@tonyclaw/llm-inspector 1.11.4 → 1.11.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- import{u as fc,a as Zh,r as v,b as dr,c as wr,g as qi,j as f,R as tt,d as hc,e as Wh}from"./index-Do7wdaYZ.js";var Ys;function K(e,t,n){function r(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);const c=s.prototype,u=Object.keys(c);for(let h=0;h<u.length;h++){const p=u[h];p in a||(a[p]=c[p].bind(a))}}const o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var l;const c=n?.Parent?new i:this;r(c,a),(l=c._zod).deferred??(l.deferred=[]);for(const u of c._zod.deferred)u();return c}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class Nn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class pc extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Ys=globalThis).__zod_globalConfig??(Ys.__zod_globalConfig={});const Gi=globalThis.__zod_globalConfig;function Mt(e){return Gi}function mc(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function hi(e,t){return typeof t=="bigint"?t.toString():t}function so(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ki(e){return e==null}function Ji(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Vh(e,t){const n=e/t,r=Math.round(n),o=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}const Xs=Symbol("evaluating");function je(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Xs)return r===void 0&&(r=Xs,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function fn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Kt(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Qs(e){return JSON.stringify(e)}function Hh(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const gc="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ir(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const qh=so(()=>{if(Gi.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function An(e){if(ir(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ir(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function xc(e){return An(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Gh=new Set(["string","number","symbol"]);function In(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Jt(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ge(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Kh(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Jh={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Yh(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=Kt(e._zod.def,{get shape(){const s={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(s[a]=n.shape[a])}return fn(this,"shape",s),s},checks:[]});return Jt(e,i)}function Xh(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=Kt(e._zod.def,{get shape(){const s={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete s[a]}return fn(this,"shape",s),s},checks:[]});return Jt(e,i)}function Qh(e,t){if(!An(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const i=e._zod.def.shape;for(const s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Kt(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return fn(this,"shape",i),i}});return Jt(e,o)}function ep(e,t){if(!An(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Kt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return fn(this,"shape",r),r}});return Jt(e,n)}function tp(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=Kt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return fn(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Jt(e,n)}function np(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=Kt(t._zod.def,{get shape(){const a=t._zod.def.shape,l={...a};if(n)for(const c in n){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(l[c]=e?new e({type:"optional",innerType:a[c]}):a[c])}else for(const c in a)l[c]=e?new e({type:"optional",innerType:a[c]}):a[c];return fn(this,"shape",l),l},checks:[]});return Jt(t,s)}function rp(e,t,n){const r=Kt(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(n)for(const s in n){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(i[s]=new e({type:"nonoptional",innerType:o[s]}))}else for(const s in o)i[s]=new e({type:"nonoptional",innerType:o[s]});return fn(this,"shape",i),i}});return Jt(t,r)}function kn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function op(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Sn(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function _r(e){return typeof e=="string"?e:e?.message}function Lt(e,t,n){const r=e.message?e.message:_r(e.inst?._zod.def?.error?.(e))??_r(t?.error?.(e))??_r(n.customError?.(e))??_r(n.localeError?.(e))??"Invalid input",{inst:o,continue:i,input:s,...a}=e;return a.path??(a.path=[]),a.message=r,t?.reportInput&&(a.input=s),a}function Yi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function sr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const yc=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,hi,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},bc=K("$ZodError",yc),vc=K("$ZodError",yc,{Parent:Error});function ip(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function sp(e,t=n=>n.message){const n={_errors:[]},r=(o,i=[])=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>r({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")r({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")r({issues:s.issues},[...i,...s.path]);else{const a=[...i,...s.path];if(a.length===0)n._errors.push(t(s));else{let l=n,c=0;for(;c<a.length;){const u=a[c];c===a.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(t(s))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}}};return r(e),n}const Xi=e=>(t,n,r,o)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Nn;if(s.issues.length){const a=new(o?.Err??e)(s.issues.map(l=>Lt(l,i,Mt())));throw gc(a,o?.callee),a}return s.value},Qi=e=>async(t,n,r,o)=>{const i=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new(o?.Err??e)(s.issues.map(l=>Lt(l,i,Mt())));throw gc(a,o?.callee),a}return s.value},ao=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new Nn;return i.issues.length?{success:!1,error:new(e??bc)(i.issues.map(s=>Lt(s,o,Mt())))}:{success:!0,data:i.value}},ap=ao(vc),lo=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Lt(s,o,Mt())))}:{success:!0,data:i.value}},lp=lo(vc),cp=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Xi(e)(t,n,o)},up=e=>(t,n,r)=>Xi(e)(t,n,r),dp=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Qi(e)(t,n,o)},fp=e=>async(t,n,r)=>Qi(e)(t,n,r),hp=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return ao(e)(t,n,o)},pp=e=>(t,n,r)=>ao(e)(t,n,r),mp=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return lo(e)(t,n,o)},gp=e=>async(t,n,r)=>lo(e)(t,n,r),xp=/^[cC][0-9a-z]{6,}$/,yp=/^[0-9a-z]+$/,bp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,vp=/^[0-9a-vA-V]{20}$/,wp=/^[A-Za-z0-9]{27}$/,_p=/^[a-zA-Z0-9_-]{21}$/,kp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Sp=/^([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})$/,ea=e=>e?new 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)$/,Cp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ep="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Np(){return new RegExp(Ep,"u")}const Tp=/^(?:(?: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])$/,jp=/^(([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}|:))$/,zp=/^((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])$/,Ap=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ip=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,wc=/^[A-Za-z0-9_-]*$/,Rp=/^https?$/,Pp=/^\+[1-9]\d{6,14}$/,_c="(?:(?:\\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])))",Op=new RegExp(`^${_c}$`);function kc(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Dp(e){return new RegExp(`^${kc(e)}$`)}function Mp(e){const t=kc({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${_c}T(?:${r})$`)}const Lp=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Fp=/^-?\d+$/,Sc=/^-?\d+(?:\.\d+)?$/,$p=/^(?:true|false)$/i,Bp=/^null$/i,Up=/^[^A-Z]*$/,Zp=/^[^a-z]*$/,rt=K("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Cc={number:"number",bigint:"bigint",object:"date"},Ec=K("$ZodCheckLessThan",(e,t)=>{rt.init(e,t);const n=Cc[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Nc=K("$ZodCheckGreaterThan",(e,t)=>{rt.init(e,t);const n=Cc[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Wp=K("$ZodCheckMultipleOf",(e,t)=>{rt.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Vh(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})}}),Vp=K("$ZodCheckNumberFormat",(e,t)=>{rt.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,i]=Jh[t.format];e._zod.onattach.push(s=>{const a=s._zod.bag;a.format=t.format,a.minimum=o,a.maximum=i,n&&(a.pattern=Fp)}),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Hp=K("$ZodCheckMaxLength",(e,t)=>{var n;rt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Ki(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const s=Yi(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),qp=K("$ZodCheckMinLength",(e,t)=>{var n;rt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Ki(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const s=Yi(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Gp=K("$ZodCheckLengthEquals",(e,t)=>{var n;rt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Ki(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,i=o.length;if(i===t.length)return;const s=Yi(o),a=i>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),co=K("$ZodCheckStringFormat",(e,t)=>{var n,r;rt.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Kp=K("$ZodCheckRegex",(e,t)=>{co.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})}}),Jp=K("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Up),co.init(e,t)}),Yp=K("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Zp),co.init(e,t)}),Xp=K("$ZodCheckIncludes",(e,t)=>{rt.init(e,t);const n=In(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Qp=K("$ZodCheckStartsWith",(e,t)=>{rt.init(e,t);const n=new RegExp(`^${In(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),em=K("$ZodCheckEndsWith",(e,t)=>{rt.init(e,t);const n=new RegExp(`.*${In(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),tm=K("$ZodCheckOverwrite",(e,t)=>{rt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class nm{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
1
+ import{u as fc,a as Zh,r as v,b as dr,c as wr,g as qi,j as f,R as tt,d as hc,e as Wh}from"./index-BLz26_QE.js";var Ys;function K(e,t,n){function r(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);const c=s.prototype,u=Object.keys(c);for(let h=0;h<u.length;h++){const p=u[h];p in a||(a[p]=c[p].bind(a))}}const o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var l;const c=n?.Parent?new i:this;r(c,a),(l=c._zod).deferred??(l.deferred=[]);for(const u of c._zod.deferred)u();return c}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class Nn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class pc extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Ys=globalThis).__zod_globalConfig??(Ys.__zod_globalConfig={});const Gi=globalThis.__zod_globalConfig;function Mt(e){return Gi}function mc(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function hi(e,t){return typeof t=="bigint"?t.toString():t}function so(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ki(e){return e==null}function Ji(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Vh(e,t){const n=e/t,r=Math.round(n),o=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}const Xs=Symbol("evaluating");function je(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Xs)return r===void 0&&(r=Xs,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function fn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Kt(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Qs(e){return JSON.stringify(e)}function Hh(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const gc="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ir(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const qh=so(()=>{if(Gi.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function In(e){if(ir(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ir(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function xc(e){return In(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Gh=new Set(["string","number","symbol"]);function An(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Jt(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ge(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Kh(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Jh={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Yh(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=Kt(e._zod.def,{get shape(){const s={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(s[a]=n.shape[a])}return fn(this,"shape",s),s},checks:[]});return Jt(e,i)}function Xh(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=Kt(e._zod.def,{get shape(){const s={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete s[a]}return fn(this,"shape",s),s},checks:[]});return Jt(e,i)}function Qh(e,t){if(!In(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const i=e._zod.def.shape;for(const s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Kt(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return fn(this,"shape",i),i}});return Jt(e,o)}function ep(e,t){if(!In(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Kt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return fn(this,"shape",r),r}});return Jt(e,n)}function tp(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=Kt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return fn(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Jt(e,n)}function np(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=Kt(t._zod.def,{get shape(){const a=t._zod.def.shape,l={...a};if(n)for(const c in n){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(l[c]=e?new e({type:"optional",innerType:a[c]}):a[c])}else for(const c in a)l[c]=e?new e({type:"optional",innerType:a[c]}):a[c];return fn(this,"shape",l),l},checks:[]});return Jt(t,s)}function rp(e,t,n){const r=Kt(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(n)for(const s in n){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(i[s]=new e({type:"nonoptional",innerType:o[s]}))}else for(const s in o)i[s]=new e({type:"nonoptional",innerType:o[s]});return fn(this,"shape",i),i}});return Jt(t,r)}function kn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function op(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Sn(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function _r(e){return typeof e=="string"?e:e?.message}function Lt(e,t,n){const r=e.message?e.message:_r(e.inst?._zod.def?.error?.(e))??_r(t?.error?.(e))??_r(n.customError?.(e))??_r(n.localeError?.(e))??"Invalid input",{inst:o,continue:i,input:s,...a}=e;return a.path??(a.path=[]),a.message=r,t?.reportInput&&(a.input=s),a}function Yi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function sr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const yc=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,hi,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},bc=K("$ZodError",yc),vc=K("$ZodError",yc,{Parent:Error});function ip(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function sp(e,t=n=>n.message){const n={_errors:[]},r=(o,i=[])=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>r({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")r({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")r({issues:s.issues},[...i,...s.path]);else{const a=[...i,...s.path];if(a.length===0)n._errors.push(t(s));else{let l=n,c=0;for(;c<a.length;){const u=a[c];c===a.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(t(s))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}}};return r(e),n}const Xi=e=>(t,n,r,o)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Nn;if(s.issues.length){const a=new(o?.Err??e)(s.issues.map(l=>Lt(l,i,Mt())));throw gc(a,o?.callee),a}return s.value},Qi=e=>async(t,n,r,o)=>{const i=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new(o?.Err??e)(s.issues.map(l=>Lt(l,i,Mt())));throw gc(a,o?.callee),a}return s.value},ao=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new Nn;return i.issues.length?{success:!1,error:new(e??bc)(i.issues.map(s=>Lt(s,o,Mt())))}:{success:!0,data:i.value}},ap=ao(vc),lo=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Lt(s,o,Mt())))}:{success:!0,data:i.value}},lp=lo(vc),cp=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Xi(e)(t,n,o)},up=e=>(t,n,r)=>Xi(e)(t,n,r),dp=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Qi(e)(t,n,o)},fp=e=>async(t,n,r)=>Qi(e)(t,n,r),hp=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return ao(e)(t,n,o)},pp=e=>(t,n,r)=>ao(e)(t,n,r),mp=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return lo(e)(t,n,o)},gp=e=>async(t,n,r)=>lo(e)(t,n,r),xp=/^[cC][0-9a-z]{6,}$/,yp=/^[0-9a-z]+$/,bp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,vp=/^[0-9a-vA-V]{20}$/,wp=/^[A-Za-z0-9]{27}$/,_p=/^[a-zA-Z0-9_-]{21}$/,kp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Sp=/^([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})$/,ea=e=>e?new 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)$/,Cp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ep="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Np(){return new RegExp(Ep,"u")}const Tp=/^(?:(?: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])$/,jp=/^(([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}|:))$/,zp=/^((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])$/,Ip=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ap=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,wc=/^[A-Za-z0-9_-]*$/,Rp=/^https?$/,Pp=/^\+[1-9]\d{6,14}$/,_c="(?:(?:\\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])))",Op=new RegExp(`^${_c}$`);function kc(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Dp(e){return new RegExp(`^${kc(e)}$`)}function Mp(e){const t=kc({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${_c}T(?:${r})$`)}const Lp=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Fp=/^-?\d+$/,Sc=/^-?\d+(?:\.\d+)?$/,$p=/^(?:true|false)$/i,Bp=/^null$/i,Up=/^[^A-Z]*$/,Zp=/^[^a-z]*$/,rt=K("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Cc={number:"number",bigint:"bigint",object:"date"},Ec=K("$ZodCheckLessThan",(e,t)=>{rt.init(e,t);const n=Cc[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Nc=K("$ZodCheckGreaterThan",(e,t)=>{rt.init(e,t);const n=Cc[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Wp=K("$ZodCheckMultipleOf",(e,t)=>{rt.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Vh(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})}}),Vp=K("$ZodCheckNumberFormat",(e,t)=>{rt.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,i]=Jh[t.format];e._zod.onattach.push(s=>{const a=s._zod.bag;a.format=t.format,a.minimum=o,a.maximum=i,n&&(a.pattern=Fp)}),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Hp=K("$ZodCheckMaxLength",(e,t)=>{var n;rt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Ki(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const s=Yi(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),qp=K("$ZodCheckMinLength",(e,t)=>{var n;rt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Ki(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const s=Yi(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Gp=K("$ZodCheckLengthEquals",(e,t)=>{var n;rt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Ki(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,i=o.length;if(i===t.length)return;const s=Yi(o),a=i>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),co=K("$ZodCheckStringFormat",(e,t)=>{var n,r;rt.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Kp=K("$ZodCheckRegex",(e,t)=>{co.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})}}),Jp=K("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Up),co.init(e,t)}),Yp=K("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Zp),co.init(e,t)}),Xp=K("$ZodCheckIncludes",(e,t)=>{rt.init(e,t);const n=An(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Qp=K("$ZodCheckStartsWith",(e,t)=>{rt.init(e,t);const n=new RegExp(`^${An(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),em=K("$ZodCheckEndsWith",(e,t)=>{rt.init(e,t);const n=new RegExp(`.*${An(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),tm=K("$ZodCheckOverwrite",(e,t)=>{rt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class nm{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
2
2
  `).filter(s=>s),o=Math.min(...r.map(s=>s.length-s.trimStart().length)),i=r.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(const s of i)this.content.push(s)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...n,o.join(`
3
- `))}}const rm={major:4,minor:4,patch:3},Me=K("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=rm;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const i of o._zod.onattach)i(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(s,a,l)=>{let c=kn(s),u;for(const h of a){if(h._zod.def.when){if(op(s)||!h._zod.def.when(s))continue}else if(c)continue;const p=s.issues.length,d=h._zod.check(s);if(d instanceof Promise&&l?.async===!1)throw new Nn;if(u||d instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await d,s.issues.length!==p&&(c||(c=kn(s,p)))});else{if(s.issues.length===p)continue;c||(c=kn(s,p))}}return u?u.then(()=>s):s},i=(s,a,l)=>{if(kn(s))return s.aborted=!0,s;const c=o(a,r,l);if(c instanceof Promise){if(l.async===!1)throw new Nn;return c.then(u=>e._zod.parse(u,l))}return e._zod.parse(c,l)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){const c=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(u=>i(u,s,a)):i(c,s,a)}const l=e._zod.parse(s,a);if(l instanceof Promise){if(a.async===!1)throw new Nn;return l.then(c=>o(c,r,a))}return o(l,r,a)}}je(e,"~standard",()=>({validate:o=>{try{const i=ap(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return lp(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),es=K("$ZodString",(e,t)=>{Me.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Lp(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Fe=K("$ZodStringFormat",(e,t)=>{co.init(e,t),es.init(e,t)}),om=K("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Sp),Fe.init(e,t)}),im=K("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ea(r))}else t.pattern??(t.pattern=ea());Fe.init(e,t)}),sm=K("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Cp),Fe.init(e,t)}),am=K("$ZodURL",(e,t)=>{Fe.init(e,t),e._zod.check=n=>{try{const r=n.value.trim();if(!t.normalize&&t.protocol?.source===Rp.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),lm=K("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Np()),Fe.init(e,t)}),cm=K("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=_p),Fe.init(e,t)}),um=K("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=xp),Fe.init(e,t)}),dm=K("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=yp),Fe.init(e,t)}),fm=K("$ZodULID",(e,t)=>{t.pattern??(t.pattern=bp),Fe.init(e,t)}),hm=K("$ZodXID",(e,t)=>{t.pattern??(t.pattern=vp),Fe.init(e,t)}),pm=K("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=wp),Fe.init(e,t)}),mm=K("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Mp(t)),Fe.init(e,t)}),gm=K("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Op),Fe.init(e,t)}),xm=K("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Dp(t)),Fe.init(e,t)}),ym=K("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=kp),Fe.init(e,t)}),bm=K("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Tp),Fe.init(e,t),e._zod.bag.format="ipv4"}),vm=K("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=jp),Fe.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),wm=K("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=zp),Fe.init(e,t)}),_m=K("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ap),Fe.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,i]=r;if(!i)throw new Error;const s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Tc(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const km=K("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ip),Fe.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Tc(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Sm(e){if(!wc.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Tc(n)}const Cm=K("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=wc),Fe.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Sm(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Em=K("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Pp),Fe.init(e,t)});function Nm(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Tm=K("$ZodJWT",(e,t)=>{Fe.init(e,t),e._zod.check=n=>{Nm(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),jc=K("$ZodNumber",(e,t)=>{Me.init(e,t),e._zod.pattern=e._zod.bag.pattern??Sc,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),jm=K("$ZodNumberFormat",(e,t)=>{Vp.init(e,t),jc.init(e,t)}),zm=K("$ZodBoolean",(e,t)=>{Me.init(e,t),e._zod.pattern=$p,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),Am=K("$ZodNull",(e,t)=>{Me.init(e,t),e._zod.pattern=Bp,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const o=n.value;return o===null||n.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),n}}),Im=K("$ZodUnknown",(e,t)=>{Me.init(e,t),e._zod.parse=n=>n}),Rm=K("$ZodNever",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function ta(e,t,n){e.issues.length&&t.issues.push(...Sn(n,e.issues)),t.value[n]=e.value}const Pm=K("$ZodArray",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let s=0;s<o.length;s++){const a=o[s],l=t.element._zod.run({value:a,issues:[]},r);l instanceof Promise?i.push(l.then(c=>ta(c,n,s))):ta(l,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function Zr(e,t,n,r,o,i){const s=n in r;if(e.issues.length){if(o&&i&&!s)return;t.issues.push(...Sn(n,e.issues))}if(!s&&!o){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?s&&(t.value[n]=void 0):t.value[n]=e.value}function zc(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=Kh(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Ac(e,t,n,r,o,i){const s=[],a=o.keySet,l=o.catchall._zod,c=l.def.type,u=l.optin==="optional",h=l.optout==="optional";for(const p in t){if(p==="__proto__"||a.has(p))continue;if(c==="never"){s.push(p);continue}const d=l.run({value:t[p],issues:[]},r);d instanceof Promise?e.push(d.then(g=>Zr(g,n,p,t,u,h))):Zr(d,n,p,t,u,h)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const Om=K("$ZodObject",(e,t)=>{if(Me.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...a};return Object.defineProperty(t,"shape",{value:l}),l}})}const r=so(()=>zc(t));je(e._zod,"propValues",()=>{const a=t.shape,l={};for(const c in a){const u=a[c]._zod;if(u.values){l[c]??(l[c]=new Set);for(const h of u.values)l[c].add(h)}}return l});const o=ir,i=t.catchall;let s;e._zod.parse=(a,l)=>{s??(s=r.value);const c=a.value;if(!o(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),a;a.value={};const u=[],h=s.shape;for(const p of s.keys){const d=h[p],g=d._zod.optin==="optional",m=d._zod.optout==="optional",y=d._zod.run({value:c[p],issues:[]},l);y instanceof Promise?u.push(y.then(x=>Zr(x,a,p,c,g,m))):Zr(y,a,p,c,g,m)}return i?Ac(u,c,a,l,r.value,e):u.length?Promise.all(u).then(()=>a):a}}),Dm=K("$ZodObjectJIT",(e,t)=>{Om.init(e,t);const n=e._zod.parse,r=so(()=>zc(t)),o=p=>{const d=new nm(["shape","payload","ctx"]),g=r.value,m=w=>{const S=Qs(w);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};d.write("const input = payload.value;");const y=Object.create(null);let x=0;for(const w of g.keys)y[w]=`key_${x++}`;d.write("const newResult = {};");for(const w of g.keys){const S=y[w],C=Qs(w),N=p[w],z=N?._zod?.optin==="optional",I=N?._zod?.optout==="optional";d.write(`const ${S} = ${m(w)};`),z&&I?d.write(`
3
+ `))}}const rm={major:4,minor:4,patch:3},Me=K("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=rm;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const i of o._zod.onattach)i(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(s,a,l)=>{let c=kn(s),u;for(const h of a){if(h._zod.def.when){if(op(s)||!h._zod.def.when(s))continue}else if(c)continue;const p=s.issues.length,d=h._zod.check(s);if(d instanceof Promise&&l?.async===!1)throw new Nn;if(u||d instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await d,s.issues.length!==p&&(c||(c=kn(s,p)))});else{if(s.issues.length===p)continue;c||(c=kn(s,p))}}return u?u.then(()=>s):s},i=(s,a,l)=>{if(kn(s))return s.aborted=!0,s;const c=o(a,r,l);if(c instanceof Promise){if(l.async===!1)throw new Nn;return c.then(u=>e._zod.parse(u,l))}return e._zod.parse(c,l)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){const c=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(u=>i(u,s,a)):i(c,s,a)}const l=e._zod.parse(s,a);if(l instanceof Promise){if(a.async===!1)throw new Nn;return l.then(c=>o(c,r,a))}return o(l,r,a)}}je(e,"~standard",()=>({validate:o=>{try{const i=ap(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return lp(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),es=K("$ZodString",(e,t)=>{Me.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Lp(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Fe=K("$ZodStringFormat",(e,t)=>{co.init(e,t),es.init(e,t)}),om=K("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Sp),Fe.init(e,t)}),im=K("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ea(r))}else t.pattern??(t.pattern=ea());Fe.init(e,t)}),sm=K("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Cp),Fe.init(e,t)}),am=K("$ZodURL",(e,t)=>{Fe.init(e,t),e._zod.check=n=>{try{const r=n.value.trim();if(!t.normalize&&t.protocol?.source===Rp.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),lm=K("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Np()),Fe.init(e,t)}),cm=K("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=_p),Fe.init(e,t)}),um=K("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=xp),Fe.init(e,t)}),dm=K("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=yp),Fe.init(e,t)}),fm=K("$ZodULID",(e,t)=>{t.pattern??(t.pattern=bp),Fe.init(e,t)}),hm=K("$ZodXID",(e,t)=>{t.pattern??(t.pattern=vp),Fe.init(e,t)}),pm=K("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=wp),Fe.init(e,t)}),mm=K("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Mp(t)),Fe.init(e,t)}),gm=K("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Op),Fe.init(e,t)}),xm=K("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Dp(t)),Fe.init(e,t)}),ym=K("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=kp),Fe.init(e,t)}),bm=K("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Tp),Fe.init(e,t),e._zod.bag.format="ipv4"}),vm=K("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=jp),Fe.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),wm=K("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=zp),Fe.init(e,t)}),_m=K("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ip),Fe.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,i]=r;if(!i)throw new Error;const s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Tc(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const km=K("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ap),Fe.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Tc(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Sm(e){if(!wc.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Tc(n)}const Cm=K("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=wc),Fe.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Sm(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Em=K("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Pp),Fe.init(e,t)});function Nm(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Tm=K("$ZodJWT",(e,t)=>{Fe.init(e,t),e._zod.check=n=>{Nm(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),jc=K("$ZodNumber",(e,t)=>{Me.init(e,t),e._zod.pattern=e._zod.bag.pattern??Sc,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),jm=K("$ZodNumberFormat",(e,t)=>{Vp.init(e,t),jc.init(e,t)}),zm=K("$ZodBoolean",(e,t)=>{Me.init(e,t),e._zod.pattern=$p,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),Im=K("$ZodNull",(e,t)=>{Me.init(e,t),e._zod.pattern=Bp,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const o=n.value;return o===null||n.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),n}}),Am=K("$ZodUnknown",(e,t)=>{Me.init(e,t),e._zod.parse=n=>n}),Rm=K("$ZodNever",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function ta(e,t,n){e.issues.length&&t.issues.push(...Sn(n,e.issues)),t.value[n]=e.value}const Pm=K("$ZodArray",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let s=0;s<o.length;s++){const a=o[s],l=t.element._zod.run({value:a,issues:[]},r);l instanceof Promise?i.push(l.then(c=>ta(c,n,s))):ta(l,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function Zr(e,t,n,r,o,i){const s=n in r;if(e.issues.length){if(o&&i&&!s)return;t.issues.push(...Sn(n,e.issues))}if(!s&&!o){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?s&&(t.value[n]=void 0):t.value[n]=e.value}function zc(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=Kh(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Ic(e,t,n,r,o,i){const s=[],a=o.keySet,l=o.catchall._zod,c=l.def.type,u=l.optin==="optional",h=l.optout==="optional";for(const p in t){if(p==="__proto__"||a.has(p))continue;if(c==="never"){s.push(p);continue}const d=l.run({value:t[p],issues:[]},r);d instanceof Promise?e.push(d.then(g=>Zr(g,n,p,t,u,h))):Zr(d,n,p,t,u,h)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const Om=K("$ZodObject",(e,t)=>{if(Me.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...a};return Object.defineProperty(t,"shape",{value:l}),l}})}const r=so(()=>zc(t));je(e._zod,"propValues",()=>{const a=t.shape,l={};for(const c in a){const u=a[c]._zod;if(u.values){l[c]??(l[c]=new Set);for(const h of u.values)l[c].add(h)}}return l});const o=ir,i=t.catchall;let s;e._zod.parse=(a,l)=>{s??(s=r.value);const c=a.value;if(!o(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),a;a.value={};const u=[],h=s.shape;for(const p of s.keys){const d=h[p],g=d._zod.optin==="optional",m=d._zod.optout==="optional",y=d._zod.run({value:c[p],issues:[]},l);y instanceof Promise?u.push(y.then(x=>Zr(x,a,p,c,g,m))):Zr(y,a,p,c,g,m)}return i?Ic(u,c,a,l,r.value,e):u.length?Promise.all(u).then(()=>a):a}}),Dm=K("$ZodObjectJIT",(e,t)=>{Om.init(e,t);const n=e._zod.parse,r=so(()=>zc(t)),o=p=>{const d=new nm(["shape","payload","ctx"]),g=r.value,m=w=>{const S=Qs(w);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};d.write("const input = payload.value;");const y=Object.create(null);let x=0;for(const w of g.keys)y[w]=`key_${x++}`;d.write("const newResult = {};");for(const w of g.keys){const S=y[w],C=Qs(w),N=p[w],z=N?._zod?.optin==="optional",A=N?._zod?.optout==="optional";d.write(`const ${S} = ${m(w)};`),z&&A?d.write(`
4
4
  if (${S}.issues.length) {
5
5
  if (${C} in input) {
6
6
  payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
@@ -59,10 +59,10 @@ import{u as fc,a as Zh,r as v,b as dr,c as wr,g as qi,j as f,R as tt,d as hc,e a
59
59
  }
60
60
  }
61
61
 
62
- `)}d.write("payload.value = newResult;"),d.write("return payload;");const b=d.compile();return(w,S)=>b(p,w,S)};let i;const s=ir,a=!Gi.jitless,c=a&&qh.value,u=t.catchall;let h;e._zod.parse=(p,d)=>{h??(h=r.value);const g=p.value;return s(g)?a&&c&&d?.async===!1&&d.jitless!==!0?(i||(i=o(t.shape)),p=i(p,d),u?Ac([],g,p,d,h,e):p):n(p,d):(p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p)}});function na(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const o=e.filter(i=>!kn(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(s=>Lt(s,r,Mt())))}),t)}const Ic=K("$ZodUnion",(e,t)=>{Me.init(e,t),je(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),je(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),je(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),je(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${r.map(o=>Ji(o.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let i=!1;const s=[];for(const a of t.options){const l=a._zod.run({value:r.value,issues:[]},o);if(l instanceof Promise)s.push(l),i=!0;else{if(l.issues.length===0)return l;s.push(l)}}return i?Promise.all(s).then(a=>na(a,r,e,o)):na(s,r,e,o)}}),Mm=K("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ic.init(e,t);const n=e._zod.parse;je(e._zod,"propValues",()=>{const o={};for(const i of t.options){const s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[a,l]of Object.entries(s)){o[a]||(o[a]=new Set);for(const c of l)o[a].add(c)}}return o});const r=so(()=>{const o=t.options,i=new Map;for(const s of o){const a=s._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const l of a){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,s)}}return i});e._zod.parse=(o,i)=>{const s=o.value;if(!ir(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;const a=r.value.get(s?.[t.discriminator]);return a?a._zod.run(o,i):t.unionFallback||i.direction==="backward"?n(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()),input:s,path:[t.discriminator],inst:e}),o)}}),Lm=K("$ZodIntersection",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,i=t.left._zod.run({value:o,issues:[]},r),s=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,c])=>ra(n,l,c)):ra(n,i,s)}});function pi(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(An(e)&&An(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o={...e,...t};for(const i of r){const s=pi(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],i=t[r],s=pi(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function ra(e,t,n){const r=new Map;let o;for(const a of t.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else e.issues.push(a);const i=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&o&&e.issues.push({...o,keys:i}),kn(e))return e;const s=pi(t.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const Fm=K("$ZodRecord",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!An(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[],s=t.keyType._zod.values;if(s){n.value={};const a=new Set;for(const c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);const u=t.keyType._zod.run({value:c,issues:[]},r);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(d=>Lt(d,r,Mt())),input:c,path:[c],inst:e});continue}const h=u.value,p=t.valueType._zod.run({value:o[c],issues:[]},r);p instanceof Promise?i.push(p.then(d=>{d.issues.length&&n.issues.push(...Sn(c,d.issues)),n.value[h]=d.value})):(p.issues.length&&n.issues.push(...Sn(c,p.issues)),n.value[h]=p.value)}let l;for(const c in o)a.has(c)||(l=l??[],l.push(c));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else{n.value={};for(const a of Reflect.ownKeys(o)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,a))continue;let l=t.keyType._zod.run({value:a,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Sc.test(a)&&l.issues.length){const h=t.keyType._zod.run({value:Number(a),issues:[]},r);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(l=h)}if(l.issues.length){t.mode==="loose"?n.value[a]=o[a]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(h=>Lt(h,r,Mt())),input:a,path:[a],inst:e});continue}const u=t.valueType._zod.run({value:o[a],issues:[]},r);u instanceof Promise?i.push(u.then(h=>{h.issues.length&&n.issues.push(...Sn(a,h.issues)),n.value[l.value]=h.value})):(u.issues.length&&n.issues.push(...Sn(a,u.issues)),n.value[l.value]=u.value)}}return i.length?Promise.all(i).then(()=>n):n}}),$m=K("$ZodEnum",(e,t)=>{Me.init(e,t);const n=mc(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>Gh.has(typeof o)).map(o=>typeof o=="string"?In(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:n,input:s,inst:e}),o}}),Bm=K("$ZodLiteral",(e,t)=>{if(Me.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?In(r):r?In(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),Um=K("$ZodTransform",(e,t)=>{Me.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new pc(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(n.value=s,n.fallback=!0,n));if(o instanceof Promise)throw new Nn;return n.value=o,n.fallback=!0,n}});function oa(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Rc=K("$ZodOptional",(e,t)=>{Me.init(e,t),e._zod.optin="optional",e._zod.optout="optional",je(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),je(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ji(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=n.value,i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>oa(s,o)):oa(i,o)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),Zm=K("$ZodExactOptional",(e,t)=>{Rc.init(e,t),je(e._zod,"values",()=>t.innerType._zod.values),je(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),Wm=K("$ZodNullable",(e,t)=>{Me.init(e,t),je(e._zod,"optin",()=>t.innerType._zod.optin),je(e._zod,"optout",()=>t.innerType._zod.optout),je(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ji(n.source)}|null)$`):void 0}),je(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Vm=K("$ZodDefault",(e,t)=>{Me.init(e,t),e._zod.optin="optional",je(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>ia(i,t)):ia(o,t)}});function ia(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Hm=K("$ZodPrefault",(e,t)=>{Me.init(e,t),e._zod.optin="optional",je(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),qm=K("$ZodNonOptional",(e,t)=>{Me.init(e,t),je(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>sa(i,e)):sa(o,e)}});function sa(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Gm=K("$ZodCatch",(e,t)=>{Me.init(e,t),e._zod.optin="optional",je(e._zod,"optout",()=>t.innerType._zod.optout),je(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>Lt(s,r,Mt()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>Lt(i,r,Mt()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),Km=K("$ZodPipe",(e,t)=>{Me.init(e,t),je(e._zod,"values",()=>t.in._zod.values),je(e._zod,"optin",()=>t.in._zod.optin),je(e._zod,"optout",()=>t.out._zod.optout),je(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(s=>kr(s,t.in,r)):kr(i,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>kr(i,t.out,r)):kr(o,t.out,r)}});function kr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const Jm=K("$ZodReadonly",(e,t)=>{Me.init(e,t),je(e._zod,"propValues",()=>t.innerType._zod.propValues),je(e._zod,"values",()=>t.innerType._zod.values),je(e._zod,"optin",()=>t.innerType?._zod?.optin),je(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(aa):aa(o)}});function aa(e){return e.value=Object.freeze(e.value),e}const Ym=K("$ZodLazy",(e,t)=>{Me.init(e,t),je(e._zod,"innerType",()=>{const n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),je(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),je(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),je(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),je(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),Xm=K("$ZodCustom",(e,t)=>{rt.init(e,t),Me.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>la(i,n,r,e));la(o,n,r,e)}});function la(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(sr(o))}}var ca;class Qm{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function eg(){return new Qm}(ca=globalThis).__zod_globalRegistry??(ca.__zod_globalRegistry=eg());const er=globalThis.__zod_globalRegistry;function tg(e,t){return new e({type:"string",...ge(t)})}function ng(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ge(t)})}function ua(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ge(t)})}function rg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ge(t)})}function og(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ge(t)})}function ig(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ge(t)})}function sg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ge(t)})}function ag(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ge(t)})}function lg(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ge(t)})}function cg(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ge(t)})}function ug(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ge(t)})}function dg(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ge(t)})}function fg(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ge(t)})}function hg(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ge(t)})}function pg(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ge(t)})}function mg(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ge(t)})}function gg(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ge(t)})}function xg(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ge(t)})}function yg(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ge(t)})}function bg(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ge(t)})}function vg(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ge(t)})}function wg(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ge(t)})}function _g(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ge(t)})}function kg(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ge(t)})}function Sg(e,t){return new e({type:"string",format:"date",check:"string_format",...ge(t)})}function Cg(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ge(t)})}function Eg(e,t){return new e({type:"string",format:"duration",check:"string_format",...ge(t)})}function Ng(e,t){return new e({type:"number",checks:[],...ge(t)})}function Tg(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ge(t)})}function jg(e,t){return new e({type:"boolean",...ge(t)})}function zg(e,t){return new e({type:"null",...ge(t)})}function Ag(e){return new e({type:"unknown"})}function Ig(e,t){return new e({type:"never",...ge(t)})}function da(e,t){return new Ec({check:"less_than",...ge(t),value:e,inclusive:!1})}function Po(e,t){return new Ec({check:"less_than",...ge(t),value:e,inclusive:!0})}function fa(e,t){return new Nc({check:"greater_than",...ge(t),value:e,inclusive:!1})}function Oo(e,t){return new Nc({check:"greater_than",...ge(t),value:e,inclusive:!0})}function ha(e,t){return new Wp({check:"multiple_of",...ge(t),value:e})}function Pc(e,t){return new Hp({check:"max_length",...ge(t),maximum:e})}function Wr(e,t){return new qp({check:"min_length",...ge(t),minimum:e})}function Oc(e,t){return new Gp({check:"length_equals",...ge(t),length:e})}function Rg(e,t){return new Kp({check:"string_format",format:"regex",...ge(t),pattern:e})}function Pg(e){return new Jp({check:"string_format",format:"lowercase",...ge(e)})}function Og(e){return new Yp({check:"string_format",format:"uppercase",...ge(e)})}function Dg(e,t){return new Xp({check:"string_format",format:"includes",...ge(t),includes:e})}function Mg(e,t){return new Qp({check:"string_format",format:"starts_with",...ge(t),prefix:e})}function Lg(e,t){return new em({check:"string_format",format:"ends_with",...ge(t),suffix:e})}function Fn(e){return new tm({check:"overwrite",tx:e})}function Fg(e){return Fn(t=>t.normalize(e))}function $g(){return Fn(e=>e.trim())}function Bg(){return Fn(e=>e.toLowerCase())}function Ug(){return Fn(e=>e.toUpperCase())}function Zg(){return Fn(e=>Hh(e))}function Wg(e,t,n){return new e({type:"array",element:t,...ge(n)})}function Vg(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ge(n)})}function Hg(e,t){const n=qg(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(sr(o,r.value,n._zod.def));else{const i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),r.issues.push(sr(i))}},e(r.value,r)),t);return n}function qg(e,t){const n=new rt({check:"custom",...ge(t)});return n._zod.check=e,n}function Dc(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??er,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function We(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);const a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{const u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,u);else{const p=s.schema,d=t.processors[o.type];if(!d)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);d(e,t,p,u)}const h=e._zod.parent;h&&(s.ref||(s.ref=h),We(h,t,u),t.seen.get(h).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),t.io==="input"&&Xe(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Mc(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const s of e.seen.entries()){const a=e.metadataRegistry.get(s[0])?.id;if(a){const l=r.get(a);if(l&&l!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,s[0])}}const o=s=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(s[0])?.id,p=e.external.uri??(g=>g);if(h)return{ref:p(h)};const d=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=d,{defId:d,ref:`${p("__shared")}#/${a}/${d}`}}if(s[1]===n)return{ref:"#"};const c=`#/${a}/`,u=s[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:c+u}},i=s=>{if(s[1].schema.$ref)return;const a=s[1],{ref:l,defId:c}=o(s);a.def={...a.schema},c&&(a.defId=c);const u=a.schema;for(const h in u)delete u[h];u.$ref=l};if(e.cycles==="throw")for(const s of e.seen.entries()){const a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
62
+ `)}d.write("payload.value = newResult;"),d.write("return payload;");const b=d.compile();return(w,S)=>b(p,w,S)};let i;const s=ir,a=!Gi.jitless,c=a&&qh.value,u=t.catchall;let h;e._zod.parse=(p,d)=>{h??(h=r.value);const g=p.value;return s(g)?a&&c&&d?.async===!1&&d.jitless!==!0?(i||(i=o(t.shape)),p=i(p,d),u?Ic([],g,p,d,h,e):p):n(p,d):(p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p)}});function na(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const o=e.filter(i=>!kn(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(s=>Lt(s,r,Mt())))}),t)}const Ac=K("$ZodUnion",(e,t)=>{Me.init(e,t),je(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),je(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),je(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),je(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${r.map(o=>Ji(o.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let i=!1;const s=[];for(const a of t.options){const l=a._zod.run({value:r.value,issues:[]},o);if(l instanceof Promise)s.push(l),i=!0;else{if(l.issues.length===0)return l;s.push(l)}}return i?Promise.all(s).then(a=>na(a,r,e,o)):na(s,r,e,o)}}),Mm=K("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ac.init(e,t);const n=e._zod.parse;je(e._zod,"propValues",()=>{const o={};for(const i of t.options){const s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[a,l]of Object.entries(s)){o[a]||(o[a]=new Set);for(const c of l)o[a].add(c)}}return o});const r=so(()=>{const o=t.options,i=new Map;for(const s of o){const a=s._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const l of a){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,s)}}return i});e._zod.parse=(o,i)=>{const s=o.value;if(!ir(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;const a=r.value.get(s?.[t.discriminator]);return a?a._zod.run(o,i):t.unionFallback||i.direction==="backward"?n(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()),input:s,path:[t.discriminator],inst:e}),o)}}),Lm=K("$ZodIntersection",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,i=t.left._zod.run({value:o,issues:[]},r),s=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,c])=>ra(n,l,c)):ra(n,i,s)}});function pi(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(In(e)&&In(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o={...e,...t};for(const i of r){const s=pi(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],i=t[r],s=pi(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function ra(e,t,n){const r=new Map;let o;for(const a of t.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else e.issues.push(a);const i=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&o&&e.issues.push({...o,keys:i}),kn(e))return e;const s=pi(t.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const Fm=K("$ZodRecord",(e,t)=>{Me.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!In(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[],s=t.keyType._zod.values;if(s){n.value={};const a=new Set;for(const c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);const u=t.keyType._zod.run({value:c,issues:[]},r);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(d=>Lt(d,r,Mt())),input:c,path:[c],inst:e});continue}const h=u.value,p=t.valueType._zod.run({value:o[c],issues:[]},r);p instanceof Promise?i.push(p.then(d=>{d.issues.length&&n.issues.push(...Sn(c,d.issues)),n.value[h]=d.value})):(p.issues.length&&n.issues.push(...Sn(c,p.issues)),n.value[h]=p.value)}let l;for(const c in o)a.has(c)||(l=l??[],l.push(c));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else{n.value={};for(const a of Reflect.ownKeys(o)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,a))continue;let l=t.keyType._zod.run({value:a,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Sc.test(a)&&l.issues.length){const h=t.keyType._zod.run({value:Number(a),issues:[]},r);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(l=h)}if(l.issues.length){t.mode==="loose"?n.value[a]=o[a]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(h=>Lt(h,r,Mt())),input:a,path:[a],inst:e});continue}const u=t.valueType._zod.run({value:o[a],issues:[]},r);u instanceof Promise?i.push(u.then(h=>{h.issues.length&&n.issues.push(...Sn(a,h.issues)),n.value[l.value]=h.value})):(u.issues.length&&n.issues.push(...Sn(a,u.issues)),n.value[l.value]=u.value)}}return i.length?Promise.all(i).then(()=>n):n}}),$m=K("$ZodEnum",(e,t)=>{Me.init(e,t);const n=mc(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>Gh.has(typeof o)).map(o=>typeof o=="string"?An(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:n,input:s,inst:e}),o}}),Bm=K("$ZodLiteral",(e,t)=>{if(Me.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?An(r):r?An(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),Um=K("$ZodTransform",(e,t)=>{Me.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new pc(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(n.value=s,n.fallback=!0,n));if(o instanceof Promise)throw new Nn;return n.value=o,n.fallback=!0,n}});function oa(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Rc=K("$ZodOptional",(e,t)=>{Me.init(e,t),e._zod.optin="optional",e._zod.optout="optional",je(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),je(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ji(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=n.value,i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>oa(s,o)):oa(i,o)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),Zm=K("$ZodExactOptional",(e,t)=>{Rc.init(e,t),je(e._zod,"values",()=>t.innerType._zod.values),je(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),Wm=K("$ZodNullable",(e,t)=>{Me.init(e,t),je(e._zod,"optin",()=>t.innerType._zod.optin),je(e._zod,"optout",()=>t.innerType._zod.optout),je(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ji(n.source)}|null)$`):void 0}),je(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Vm=K("$ZodDefault",(e,t)=>{Me.init(e,t),e._zod.optin="optional",je(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>ia(i,t)):ia(o,t)}});function ia(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Hm=K("$ZodPrefault",(e,t)=>{Me.init(e,t),e._zod.optin="optional",je(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),qm=K("$ZodNonOptional",(e,t)=>{Me.init(e,t),je(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>sa(i,e)):sa(o,e)}});function sa(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Gm=K("$ZodCatch",(e,t)=>{Me.init(e,t),e._zod.optin="optional",je(e._zod,"optout",()=>t.innerType._zod.optout),je(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>Lt(s,r,Mt()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>Lt(i,r,Mt()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),Km=K("$ZodPipe",(e,t)=>{Me.init(e,t),je(e._zod,"values",()=>t.in._zod.values),je(e._zod,"optin",()=>t.in._zod.optin),je(e._zod,"optout",()=>t.out._zod.optout),je(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(s=>kr(s,t.in,r)):kr(i,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>kr(i,t.out,r)):kr(o,t.out,r)}});function kr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const Jm=K("$ZodReadonly",(e,t)=>{Me.init(e,t),je(e._zod,"propValues",()=>t.innerType._zod.propValues),je(e._zod,"values",()=>t.innerType._zod.values),je(e._zod,"optin",()=>t.innerType?._zod?.optin),je(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(aa):aa(o)}});function aa(e){return e.value=Object.freeze(e.value),e}const Ym=K("$ZodLazy",(e,t)=>{Me.init(e,t),je(e._zod,"innerType",()=>{const n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),je(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),je(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),je(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),je(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),Xm=K("$ZodCustom",(e,t)=>{rt.init(e,t),Me.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>la(i,n,r,e));la(o,n,r,e)}});function la(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(sr(o))}}var ca;class Qm{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function eg(){return new Qm}(ca=globalThis).__zod_globalRegistry??(ca.__zod_globalRegistry=eg());const er=globalThis.__zod_globalRegistry;function tg(e,t){return new e({type:"string",...ge(t)})}function ng(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ge(t)})}function ua(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ge(t)})}function rg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ge(t)})}function og(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ge(t)})}function ig(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ge(t)})}function sg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ge(t)})}function ag(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ge(t)})}function lg(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ge(t)})}function cg(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ge(t)})}function ug(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ge(t)})}function dg(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ge(t)})}function fg(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ge(t)})}function hg(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ge(t)})}function pg(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ge(t)})}function mg(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ge(t)})}function gg(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ge(t)})}function xg(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ge(t)})}function yg(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ge(t)})}function bg(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ge(t)})}function vg(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ge(t)})}function wg(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ge(t)})}function _g(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ge(t)})}function kg(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ge(t)})}function Sg(e,t){return new e({type:"string",format:"date",check:"string_format",...ge(t)})}function Cg(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ge(t)})}function Eg(e,t){return new e({type:"string",format:"duration",check:"string_format",...ge(t)})}function Ng(e,t){return new e({type:"number",checks:[],...ge(t)})}function Tg(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ge(t)})}function jg(e,t){return new e({type:"boolean",...ge(t)})}function zg(e,t){return new e({type:"null",...ge(t)})}function Ig(e){return new e({type:"unknown"})}function Ag(e,t){return new e({type:"never",...ge(t)})}function da(e,t){return new Ec({check:"less_than",...ge(t),value:e,inclusive:!1})}function Po(e,t){return new Ec({check:"less_than",...ge(t),value:e,inclusive:!0})}function fa(e,t){return new Nc({check:"greater_than",...ge(t),value:e,inclusive:!1})}function Oo(e,t){return new Nc({check:"greater_than",...ge(t),value:e,inclusive:!0})}function ha(e,t){return new Wp({check:"multiple_of",...ge(t),value:e})}function Pc(e,t){return new Hp({check:"max_length",...ge(t),maximum:e})}function Wr(e,t){return new qp({check:"min_length",...ge(t),minimum:e})}function Oc(e,t){return new Gp({check:"length_equals",...ge(t),length:e})}function Rg(e,t){return new Kp({check:"string_format",format:"regex",...ge(t),pattern:e})}function Pg(e){return new Jp({check:"string_format",format:"lowercase",...ge(e)})}function Og(e){return new Yp({check:"string_format",format:"uppercase",...ge(e)})}function Dg(e,t){return new Xp({check:"string_format",format:"includes",...ge(t),includes:e})}function Mg(e,t){return new Qp({check:"string_format",format:"starts_with",...ge(t),prefix:e})}function Lg(e,t){return new em({check:"string_format",format:"ends_with",...ge(t),suffix:e})}function Fn(e){return new tm({check:"overwrite",tx:e})}function Fg(e){return Fn(t=>t.normalize(e))}function $g(){return Fn(e=>e.trim())}function Bg(){return Fn(e=>e.toLowerCase())}function Ug(){return Fn(e=>e.toUpperCase())}function Zg(){return Fn(e=>Hh(e))}function Wg(e,t,n){return new e({type:"array",element:t,...ge(n)})}function Vg(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ge(n)})}function Hg(e,t){const n=qg(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(sr(o,r.value,n._zod.def));else{const i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),r.issues.push(sr(i))}},e(r.value,r)),t);return n}function qg(e,t){const n=new rt({check:"custom",...ge(t)});return n._zod.check=e,n}function Dc(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??er,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function We(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);const a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{const u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,u);else{const p=s.schema,d=t.processors[o.type];if(!d)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);d(e,t,p,u)}const h=e._zod.parent;h&&(s.ref||(s.ref=h),We(h,t,u),t.seen.get(h).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),t.io==="input"&&Xe(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Mc(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const s of e.seen.entries()){const a=e.metadataRegistry.get(s[0])?.id;if(a){const l=r.get(a);if(l&&l!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,s[0])}}const o=s=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(s[0])?.id,p=e.external.uri??(g=>g);if(h)return{ref:p(h)};const d=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=d,{defId:d,ref:`${p("__shared")}#/${a}/${d}`}}if(s[1]===n)return{ref:"#"};const c=`#/${a}/`,u=s[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:c+u}},i=s=>{if(s[1].schema.$ref)return;const a=s[1],{ref:l,defId:c}=o(s);a.def={...a.schema},c&&(a.defId=c);const u=a.schema;for(const h in u)delete u[h];u.$ref=l};if(e.cycles==="throw")for(const s of e.seen.entries()){const a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
63
63
 
64
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of e.seen.entries()){const a=s[1];if(t===s[0]){i(s);continue}if(e.external){const c=e.external.registry.get(s[0])?.id;if(t!==s[0]&&c){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1&&e.reused==="ref"){i(s);continue}}}function Lc(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=a=>{const l=e.seen.get(a);if(l.ref===null)return;const c=l.def??l.schema,u={...c},h=l.ref;if(l.ref=null,h){r(h);const d=e.seen.get(h),g=d.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(g)):Object.assign(c,g),Object.assign(c,u),a._zod.parent===h)for(const y in c)y==="$ref"||y==="allOf"||y in u||delete c[y];if(g.$ref&&d.def)for(const y in c)y==="$ref"||y==="allOf"||y in d.def&&JSON.stringify(c[y])===JSON.stringify(d.def[y])&&delete c[y]}const p=a._zod.parent;if(p&&p!==h){r(p);const d=e.seen.get(p);if(d?.schema.$ref&&(c.$ref=d.schema.$ref,d.def))for(const g in c)g==="$ref"||g==="allOf"||g in d.def&&JSON.stringify(c[g])===JSON.stringify(d.def[g])&&delete c[g]}e.override({zodSchema:a,jsonSchema:c,path:l.path??[]})};for(const a of[...e.seen.entries()].reverse())r(a[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}Object.assign(o,n.def??n.schema);const i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;const s=e.external?.defs??{};for(const a of e.seen.entries()){const l=a[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Vr(t,"input",e.processors),output:Vr(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Xe(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Xe(r.element,n);if(r.type==="set")return Xe(r.valueType,n);if(r.type==="lazy")return Xe(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Xe(r.innerType,n);if(r.type==="intersection")return Xe(r.left,n)||Xe(r.right,n);if(r.type==="record"||r.type==="map")return Xe(r.keyType,n)||Xe(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Xe(r.in,n)||Xe(r.out,n);if(r.type==="object"){for(const o in r.shape)if(Xe(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(Xe(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(Xe(o,n))return!0;return!!(r.rest&&Xe(r.rest,n))}return!1}const Gg=(e,t={})=>n=>{const r=Dc({...n,processors:t});return We(e,r),Mc(r,e),Lc(r,e)},Vr=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},s=Dc({...o??{},target:i,io:t,processors:n});return We(e,s),Mc(s,e),Lc(s,e)},Kg={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Jg=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:i,maximum:s,format:a,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=Kg[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),c&&(o.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?o.pattern=u[0].source:u.length>1&&(o.allOf=[...u.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},Yg=(e,t,n,r)=>{const o=n,{minimum:i,maximum:s,format:a,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number";const h=typeof u=="number"&&u>=(i??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),d=t.target==="draft-04"||t.target==="openapi-3.0";h?d?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u:typeof i=="number"&&(o.minimum=i),p?d?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c:typeof s=="number"&&(o.maximum=s),typeof l=="number"&&(o.multipleOf=l)},Xg=(e,t,n,r)=>{n.type="boolean"},Qg=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},ex=(e,t,n,r)=>{n.not={}},tx=(e,t,n,r)=>{},nx=(e,t,n,r)=>{const o=e._zod.def,i=mc(o.entries);i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},rx=(e,t,n,r)=>{const o=e._zod.def,i=[];for(const s of o.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){const s=i[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),i.every(s=>typeof s=="boolean")&&(n.type="boolean"),i.every(s=>s===null)&&(n.type="null"),n.enum=i},ox=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},ix=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},sx=(e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=We(i.element,t,{...r,path:[...r.path,"items"]})},ax=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const c in s)o.properties[c]=We(s[c],t,{...r,path:[...r.path,"properties",c]});const a=new Set(Object.keys(s)),l=new Set([...a].filter(c=>{const u=i.shape[c]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));l.size>0&&(o.required=Array.from(l)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=We(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},lx=(e,t,n,r)=>{const o=e._zod.def,i=o.inclusive===!1,s=o.options.map((a,l)=>We(a,t,{...r,path:[...r.path,i?"oneOf":"anyOf",l]}));i?n.oneOf=s:n.anyOf=s},cx=(e,t,n,r)=>{const o=e._zod.def,i=We(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=We(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,l=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=l},ux=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object";const s=i.keyType,l=s._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){const u=We(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const h of l)o.patternProperties[h.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=We(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=We(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const c=s._zod.values;if(c){const u=[...c].filter(h=>typeof h=="string"||typeof h=="number");u.length>0&&(o.required=u)}},dx=(e,t,n,r)=>{const o=e._zod.def,i=We(o.innerType,t,r),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},fx=(e,t,n,r)=>{const o=e._zod.def;We(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},hx=(e,t,n,r)=>{const o=e._zod.def;We(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},px=(e,t,n,r)=>{const o=e._zod.def;We(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},mx=(e,t,n,r)=>{const o=e._zod.def;We(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},gx=(e,t,n,r)=>{const o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;We(s,t,r);const a=t.seen.get(e);a.ref=s},xx=(e,t,n,r)=>{const o=e._zod.def;We(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},Fc=(e,t,n,r)=>{const o=e._zod.def;We(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},yx=(e,t,n,r)=>{const o=e._zod.innerType;We(o,t,r);const i=t.seen.get(e);i.ref=o},bx=K("ZodISODateTime",(e,t)=>{mm.init(e,t),Ue.init(e,t)});function vx(e){return kg(bx,e)}const wx=K("ZodISODate",(e,t)=>{gm.init(e,t),Ue.init(e,t)});function _x(e){return Sg(wx,e)}const kx=K("ZodISOTime",(e,t)=>{xm.init(e,t),Ue.init(e,t)});function Sx(e){return Cg(kx,e)}const Cx=K("ZodISODuration",(e,t)=>{ym.init(e,t),Ue.init(e,t)});function Ex(e){return Eg(Cx,e)}const Nx=(e,t)=>{bc.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>sp(e,n)},flatten:{value:n=>ip(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,hi,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,hi,2)}},isEmpty:{get(){return e.issues.length===0}}})},pt=K("ZodError",Nx,{Parent:Error}),Tx=Xi(pt),jx=Qi(pt),zx=ao(pt),Ax=lo(pt),Ix=cp(pt),Rx=up(pt),Px=dp(pt),Ox=fp(pt),Dx=hp(pt),Mx=pp(pt),Lx=mp(pt),Fx=gp(pt),pa=new WeakMap;function fr(e,t,n){const r=Object.getPrototypeOf(e);let o=pa.get(r);if(o||(o=new Set,pa.set(r,o)),!o.has(t)){o.add(t);for(const i in n){const s=n[i];Object.defineProperty(r,i,{configurable:!0,enumerable:!1,get(){const a=s.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const Le=K("ZodType",(e,t)=>(Me.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Vr(e,"input"),output:Vr(e,"output")}}),e.toJSONSchema=Gg(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>Tx(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>zx(e,n,r),e.parseAsync=async(n,r)=>jx(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Ax(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>Ix(e,n,r),e.decode=(n,r)=>Rx(e,n,r),e.encodeAsync=async(n,r)=>Px(e,n,r),e.decodeAsync=async(n,r)=>Ox(e,n,r),e.safeEncode=(n,r)=>Dx(e,n,r),e.safeDecode=(n,r)=>Mx(e,n,r),e.safeEncodeAsync=async(n,r)=>Lx(e,n,r),e.safeDecodeAsync=async(n,r)=>Fx(e,n,r),fr(e,"ZodType",{check(...n){const r=this.def;return this.clone(Kt(r,{checks:[...r.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return Jt(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(P0(n,r))},superRefine(n,r){return this.check(O0(n,r))},overwrite(n){return this.check(Fn(n))},optional(){return ba(this)},exactOptional(){return b0(this)},nullable(){return va(this)},nullish(){return ba(va(this))},nonoptional(n){return C0(this,n)},array(){return Be(this)},or(n){return Yt([this,n])},and(n){return p0(this,n)},transform(n){return wa(this,x0(n))},default(n){return _0(this,n)},prefault(n){return S0(this,n)},catch(n){return N0(this,n)},pipe(n){return wa(this,n)},readonly(){return z0(this)},describe(n){const r=this.clone();return er.add(r,{description:n}),r},meta(...n){if(n.length===0)return er.get(this);const r=this.clone();return er.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return er.get(e)?.description},configurable:!0}),e)),$c=K("_ZodString",(e,t)=>{es.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Jg(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,fr(e,"_ZodString",{regex(...r){return this.check(Rg(...r))},includes(...r){return this.check(Dg(...r))},startsWith(...r){return this.check(Mg(...r))},endsWith(...r){return this.check(Lg(...r))},min(...r){return this.check(Wr(...r))},max(...r){return this.check(Pc(...r))},length(...r){return this.check(Oc(...r))},nonempty(...r){return this.check(Wr(1,...r))},lowercase(r){return this.check(Pg(r))},uppercase(r){return this.check(Og(r))},trim(){return this.check($g())},normalize(...r){return this.check(Fg(...r))},toLowerCase(){return this.check(Bg())},toUpperCase(){return this.check(Ug())},slugify(){return this.check(Zg())}})}),$x=K("ZodString",(e,t)=>{es.init(e,t),$c.init(e,t),e.email=n=>e.check(ng(Bx,n)),e.url=n=>e.check(ag(Ux,n)),e.jwt=n=>e.check(_g(r0,n)),e.emoji=n=>e.check(lg(Zx,n)),e.guid=n=>e.check(ua(ma,n)),e.uuid=n=>e.check(rg(Sr,n)),e.uuidv4=n=>e.check(og(Sr,n)),e.uuidv6=n=>e.check(ig(Sr,n)),e.uuidv7=n=>e.check(sg(Sr,n)),e.nanoid=n=>e.check(cg(Wx,n)),e.guid=n=>e.check(ua(ma,n)),e.cuid=n=>e.check(ug(Vx,n)),e.cuid2=n=>e.check(dg(Hx,n)),e.ulid=n=>e.check(fg(qx,n)),e.base64=n=>e.check(bg(e0,n)),e.base64url=n=>e.check(vg(t0,n)),e.xid=n=>e.check(hg(Gx,n)),e.ksuid=n=>e.check(pg(Kx,n)),e.ipv4=n=>e.check(mg(Jx,n)),e.ipv6=n=>e.check(gg(Yx,n)),e.cidrv4=n=>e.check(xg(Xx,n)),e.cidrv6=n=>e.check(yg(Qx,n)),e.e164=n=>e.check(wg(n0,n)),e.datetime=n=>e.check(vx(n)),e.date=n=>e.check(_x(n)),e.time=n=>e.check(Sx(n)),e.duration=n=>e.check(Ex(n))});function X(e){return tg($x,e)}const Ue=K("ZodStringFormat",(e,t)=>{Fe.init(e,t),$c.init(e,t)}),Bx=K("ZodEmail",(e,t)=>{sm.init(e,t),Ue.init(e,t)}),ma=K("ZodGUID",(e,t)=>{om.init(e,t),Ue.init(e,t)}),Sr=K("ZodUUID",(e,t)=>{im.init(e,t),Ue.init(e,t)}),Ux=K("ZodURL",(e,t)=>{am.init(e,t),Ue.init(e,t)}),Zx=K("ZodEmoji",(e,t)=>{lm.init(e,t),Ue.init(e,t)}),Wx=K("ZodNanoID",(e,t)=>{cm.init(e,t),Ue.init(e,t)}),Vx=K("ZodCUID",(e,t)=>{um.init(e,t),Ue.init(e,t)}),Hx=K("ZodCUID2",(e,t)=>{dm.init(e,t),Ue.init(e,t)}),qx=K("ZodULID",(e,t)=>{fm.init(e,t),Ue.init(e,t)}),Gx=K("ZodXID",(e,t)=>{hm.init(e,t),Ue.init(e,t)}),Kx=K("ZodKSUID",(e,t)=>{pm.init(e,t),Ue.init(e,t)}),Jx=K("ZodIPv4",(e,t)=>{bm.init(e,t),Ue.init(e,t)}),Yx=K("ZodIPv6",(e,t)=>{vm.init(e,t),Ue.init(e,t)}),Xx=K("ZodCIDRv4",(e,t)=>{wm.init(e,t),Ue.init(e,t)}),Qx=K("ZodCIDRv6",(e,t)=>{_m.init(e,t),Ue.init(e,t)}),e0=K("ZodBase64",(e,t)=>{km.init(e,t),Ue.init(e,t)}),t0=K("ZodBase64URL",(e,t)=>{Cm.init(e,t),Ue.init(e,t)}),n0=K("ZodE164",(e,t)=>{Em.init(e,t),Ue.init(e,t)}),r0=K("ZodJWT",(e,t)=>{Tm.init(e,t),Ue.init(e,t)}),Bc=K("ZodNumber",(e,t)=>{jc.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Yg(e,r,o),fr(e,"ZodNumber",{gt(r,o){return this.check(fa(r,o))},gte(r,o){return this.check(Oo(r,o))},min(r,o){return this.check(Oo(r,o))},lt(r,o){return this.check(da(r,o))},lte(r,o){return this.check(Po(r,o))},max(r,o){return this.check(Po(r,o))},int(r){return this.check(ga(r))},safe(r){return this.check(ga(r))},positive(r){return this.check(fa(0,r))},nonnegative(r){return this.check(Oo(0,r))},negative(r){return this.check(da(0,r))},nonpositive(r){return this.check(Po(0,r))},multipleOf(r,o){return this.check(ha(r,o))},step(r,o){return this.check(ha(r,o))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function ye(e){return Ng(Bc,e)}const o0=K("ZodNumberFormat",(e,t)=>{jm.init(e,t),Bc.init(e,t)});function ga(e){return Tg(o0,e)}const i0=K("ZodBoolean",(e,t)=>{zm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Xg(e,n,r)});function ht(e){return jg(i0,e)}const s0=K("ZodNull",(e,t)=>{Am.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Qg(e,n,r)});function mi(e){return zg(s0,e)}const a0=K("ZodUnknown",(e,t)=>{Im.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>tx()});function xa(){return Ag(a0)}const l0=K("ZodNever",(e,t)=>{Rm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ex(e,n,r)});function c0(e){return Ig(l0,e)}const u0=K("ZodArray",(e,t)=>{Pm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>sx(e,n,r,o),e.element=t.element,fr(e,"ZodArray",{min(n,r){return this.check(Wr(n,r))},nonempty(n){return this.check(Wr(1,n))},max(n,r){return this.check(Pc(n,r))},length(n,r){return this.check(Oc(n,r))},unwrap(){return this.element}})});function Be(e,t){return Wg(u0,e,t)}const d0=K("ZodObject",(e,t)=>{Dm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ax(e,n,r,o),je(e,"shape",()=>t.shape),fr(e,"ZodObject",{keyof(){return $n(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:xa()})},loose(){return this.clone({...this._zod.def,catchall:xa()})},strict(){return this.clone({...this._zod.def,catchall:c0()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return Qh(this,n)},safeExtend(n){return ep(this,n)},merge(n){return tp(this,n)},pick(n){return Yh(this,n)},omit(n){return Xh(this,n)},partial(...n){return np(Zc,this,n[0])},required(...n){return rp(Wc,this,n[0])}})});function de(e,t){const n={type:"object",shape:e??{},...ge(t)};return new d0(n)}const Uc=K("ZodUnion",(e,t)=>{Ic.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>lx(e,n,r,o),e.options=t.options});function Yt(e,t){return new Uc({type:"union",options:e,...ge(t)})}const f0=K("ZodDiscriminatedUnion",(e,t)=>{Uc.init(e,t),Mm.init(e,t)});function hn(e,t,n){return new f0({type:"union",options:t,discriminator:e,...ge(n)})}const h0=K("ZodIntersection",(e,t)=>{Lm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>cx(e,n,r,o)});function p0(e,t){return new h0({type:"intersection",left:e,right:t})}const ya=K("ZodRecord",(e,t)=>{Fm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ux(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function sn(e,t,n){return!t||!t._zod?new ya({type:"record",keyType:X(),valueType:e,...ge(t)}):new ya({type:"record",keyType:e,valueType:t,...ge(n)})}const gi=K("ZodEnum",(e,t)=>{$m.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(r,o,i)=>nx(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const i={};for(const s of r)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new gi({...t,checks:[],...ge(o),entries:i})},e.exclude=(r,o)=>{const i={...t.entries};for(const s of r)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new gi({...t,checks:[],...ge(o),entries:i})}});function $n(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new gi({type:"enum",entries:n,...ge(t)})}const m0=K("ZodLiteral",(e,t)=>{Bm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>rx(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ne(e,t){return new m0({type:"literal",values:Array.isArray(e)?e:[e],...ge(t)})}const g0=K("ZodTransform",(e,t)=>{Um.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ix(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new pc(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(sr(i,n.value,t));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),n.issues.push(sr(s))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n.fallback=!0,n)):(n.value=o,n.fallback=!0,n)}});function x0(e){return new g0({type:"transform",transform:e})}const Zc=K("ZodOptional",(e,t)=>{Rc.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Fc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function ba(e){return new Zc({type:"optional",innerType:e})}const y0=K("ZodExactOptional",(e,t)=>{Zm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Fc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function b0(e){return new y0({type:"optional",innerType:e})}const v0=K("ZodNullable",(e,t)=>{Wm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>dx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function va(e){return new v0({type:"nullable",innerType:e})}const w0=K("ZodDefault",(e,t)=>{Vm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function _0(e,t){return new w0({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():xc(t)}})}const k0=K("ZodPrefault",(e,t)=>{Hm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>px(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function S0(e,t){return new k0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():xc(t)}})}const Wc=K("ZodNonOptional",(e,t)=>{qm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function C0(e,t){return new Wc({type:"nonoptional",innerType:e,...ge(t)})}const E0=K("ZodCatch",(e,t)=>{Gm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function N0(e,t){return new E0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const T0=K("ZodPipe",(e,t)=>{Km.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gx(e,n,r,o),e.in=t.in,e.out=t.out});function wa(e,t){return new T0({type:"pipe",in:e,out:t})}const j0=K("ZodReadonly",(e,t)=>{Jm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function z0(e){return new j0({type:"readonly",innerType:e})}const A0=K("ZodLazy",(e,t)=>{Ym.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>yx(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});function I0(e){return new A0({type:"lazy",getter:e})}const R0=K("ZodCustom",(e,t)=>{Xm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ox(e,n)});function P0(e,t={}){return Vg(R0,e,t)}function O0(e,t){return Hg(e,t)}const Rn=I0(()=>Yt([X(),ye(),ht(),mi(),Be(Rn),sn(X(),Rn)])),ts=de({type:X(),ttl:X().optional(),scope:X().optional()}),ns=de({type:Ne("text"),text:X(),cache_control:ts.optional()}),Vc=de({type:Ne("thinking"),thinking:X(),signature:X().optional()}),D0=de({type:Ne("think"),thinking:X(),signature:X().optional()}),M0=de({type:Ne("base64"),media_type:X(),data:X()}),Hc=de({type:Ne("image"),source:M0}),qc=de({type:Ne("tool_use"),id:X(),name:X(),input:sn(X(),Rn)}),L0=hn("type",[ns,Hc]),F0=de({type:Ne("tool_result"),tool_use_id:X().optional(),content:Yt([X(),Be(L0)]),is_error:ht().optional()}),$0=hn("type",[ns,Vc,Hc,qc,F0]),B0=Yt([X(),Be($0)]),U0=de({role:$n(["user","assistant"]),content:B0}),Z0=de({type:Ne("text"),text:X(),cache_control:ts.optional()}),W0=de({type:X(),properties:sn(X(),sn(X(),Rn)).optional(),required:Be(X()).optional(),additionalProperties:ht().optional(),$schema:X().optional()}),V0=de({name:X(),description:X().optional(),input_schema:W0.optional(),cache_control:ts.optional()}),H0=hn("type",[de({type:Ne("enabled"),budget_tokens:ye()}),de({type:Ne("disabled")}),de({type:Ne("adaptive")})]),q0=de({model:X(),messages:Be(U0),system:Be(Z0).optional(),tools:Be(V0).optional(),max_tokens:ye().optional(),temperature:ye().optional(),stream:ht().optional(),thinking:H0.optional(),metadata:de({user_id:X().optional()}).optional()}),rs=hn("type",[ns,Vc,D0,qc]),G0=de({input_tokens:ye().nullable().optional(),output_tokens:ye().nullable().optional(),cache_creation_input_tokens:ye().nullable().optional(),cache_read_input_tokens:ye().nullable().optional()}).passthrough(),K0=de({id:X(),type:Ne("message"),model:X(),role:Ne("assistant"),content:Be(rs),stop_reason:X().nullable(),stop_sequence:X().nullable().optional(),usage:G0}).passthrough(),J0=de({type:Ne("message_start"),message:de({id:X(),type:Ne("message"),model:X(),role:Ne("assistant"),content:Be(rs),stop_reason:mi(),stop_sequence:mi(),usage:de({input_tokens:ye(),cache_creation_input_tokens:ye().optional(),cache_read_input_tokens:ye().optional()}).passthrough()})}),Y0=de({type:Ne("content_block_start"),index:ye(),content_block:rs}),X0=hn("type",[de({type:Ne("text_delta"),text:X()}),de({type:Ne("input_json_delta"),partial_json:X()}),de({type:Ne("thinking_delta"),thinking:X()}),de({type:Ne("signature_delta"),signature:X()})]),Q0=de({type:Ne("content_block_delta"),index:ye(),delta:X0}),ey=de({type:Ne("content_block_stop"),index:ye()}),ty=de({type:Ne("message_delta"),delta:de({stop_reason:X().nullable(),stop_sequence:X().nullable().optional()}),usage:de({output_tokens:ye(),input_tokens:ye().optional(),cache_creation_input_tokens:ye().optional(),cache_read_input_tokens:ye().optional()}).passthrough()}),ny=de({type:Ne("message_stop")}),ry=de({type:Ne("ping")}),oy=de({type:Ne("error"),error:de({type:X(),message:X()})});hn("type",[J0,Y0,Q0,ey,ty,ny,ry,oy]);const iy=q0,sy=K0,ay=Yt([X(),Be(hn("type",[de({type:Ne("text"),text:X()}),de({type:Ne("image_url"),image_url:de({url:X(),detail:X().optional()})})]))]),Gc=de({role:$n(["system","user","assistant","tool"]),content:ay,name:X().optional(),reasoning_content:X().optional(),thinking:X().optional(),think:X().optional()}),ly=de({name:X(),arguments:X()});Gc.extend({content:Yt([X(),Be(de({type:Ne("text"),text:X()}))]).optional(),function_call:ly.optional()});const cy=de({type:Ne("function"),function:de({name:X(),description:X().optional(),parameters:sn(X(),Rn)})});de({model:X(),messages:Be(Gc),temperature:ye().optional(),max_tokens:ye().optional(),stream:ht().optional(),tools:Be(cy).optional(),tool_choice:Yt([de({type:Ne("auto")}),de({type:Ne("none")}),de({type:Ne("function"),function:de({name:X()})})]).optional(),user:X().optional()});const Kc=de({role:$n(["assistant"]).optional(),content:X().nullable().optional(),reasoning_content:X().nullable().optional(),thinking:X().nullable().optional(),think:X().nullable().optional(),function_call:de({name:X().optional(),arguments:X().optional()}).nullable().optional(),tool_calls:Be(de({index:ye(),id:X().optional(),type:Ne("function").optional(),function:de({name:X().optional(),arguments:X().optional()})})).nullable().optional()}),uy=de({index:ye(),message:de({role:$n(["assistant"]),content:X().nullable(),reasoning_content:X().optional(),thinking:X().optional(),think:X().optional(),function_call:de({name:X(),arguments:X()}).nullable().optional()}).optional(),delta:Kc.optional(),finish_reason:X().nullable()}),dy=de({id:X(),object:Ne("chat.completion"),created:ye(),model:X(),choices:Be(uy),usage:de({prompt_tokens:ye().nullable().optional(),completion_tokens:ye().nullable().optional(),total_tokens:ye().nullable().optional()}).passthrough(),service_tier:X().nullable().optional(),system_fingerprint:X().nullable().optional()}).passthrough();de({id:X(),object:Ne("chat.completion.chunk"),created:ye(),model:X(),choices:Be(de({index:ye(),delta:Kc,finish_reason:X().nullable().optional()})),usage:de({prompt_tokens:ye().nullable().optional(),completion_tokens:ye().nullable().optional(),total_tokens:ye().nullable().optional()}).passthrough().nullable().optional()}).passthrough();function fy(e){try{const t=JSON.parse(e),n=dy.safeParse(t);return n.success?n.data:null}catch{return null}}const hy=de({index:ye(),timestamp:ye(),type:X(),data:Rn}),py=de({chunks:Be(hy),truncated:ht().optional().default(!1)}),xi=de({id:ye(),timestamp:X(),method:X(),path:X(),model:X().nullable(),sessionId:X().nullable(),rawRequestBody:X().nullable(),responseStatus:ye().nullable(),responseText:X().nullable(),inputTokens:ye().nullable(),outputTokens:ye().nullable(),cacheCreationInputTokens:ye().nullable(),cacheReadInputTokens:ye().nullable(),elapsedMs:ye().nullable(),streaming:ht(),userAgent:X().nullable(),origin:X().nullable(),rawHeaders:sn(X(),X()).optional(),headers:sn(X(),X()).optional(),apiFormat:$n(["anthropic","openai","unknown"]).default("unknown"),isTest:ht().optional().default(!1),providerName:X().nullable().optional(),clientPort:ye().nullable().optional(),clientPid:ye().nullable().optional(),clientCwd:X().nullable().optional(),clientProjectFolder:X().nullable().optional(),streamingChunks:py.optional(),streamingChunksPath:X().nullable().optional(),error:X().nullable().optional()});de({model:X()});de({model:X().optional(),metadata:de({user_id:X().optional()}).passthrough().optional()});function my(e){if(e===null)return null;try{const t=JSON.parse(e),n=iy.safeParse(t);return n.success?n.data:null}catch{return null}}const Jc=de({stripClaudeCodeBillingHeader:ht()}),yi="/api/config";async function gy(e){const t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch ${e}: ${t.status}`);const n=await t.json();return Jc.parse(n)}function xy(e,t){if(typeof e!="object"||e===null)return t;const n=e.error;return typeof n=="string"?n:t}async function yy(e){const t=await fetch(yi,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const r=await t.json().catch(()=>({}));throw new Error(xy(r,`PATCH failed with status ${t.status}`))}const n=await t.json();return Jc.parse(n)}function Yc(){const e=fc(yi,gy,{revalidateOnFocus:!1,revalidateIfStale:!1}),{mutate:t}=Zh(),n=e.data?.stripClaudeCodeBillingHeader??!1,r=async o=>{await t(yi,yy({stripClaudeCodeBillingHeader:o}),{optimisticData:{stripClaudeCodeBillingHeader:o},rollbackOnError:!0,revalidate:!1})};return{strip:n,isLoading:e.isLoading,isError:e.error!==void 0,setStrip:r}}function by(e,t,n){const r=new Array(e);return new Proxy(r,{get(o,i,s){if(typeof i=="string"){const a=i.charCodeAt(0);if(a>=48&&a<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&l<e){let c=o[l];if(!c){const u=t[l*2];c=o[l]={index:l,key:n(l),start:u,size:t[l*2+1],end:u+t[l*2+1],lane:0}}return c}}if(i==="length")return e}return Reflect.get(o,i,s)}})}function xn(e,t,n){let r=n.initialDeps??[],o,i=!0;function s(){const a=e();return(a.length!==r.length||a.some((c,u)=>r[u]!==c))&&(r=a,o=t(...a),n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(o),i=!1),o}return s.updateDeps=a=>{r=a},s}function _a(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const vy=(e,t)=>Math.abs(e-t)<1.01,wy=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}};let qn;const Do=()=>{if(qn!==void 0)return qn;if(typeof navigator>"u")return qn=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return qn=!0;const e=navigator.maxTouchPoints;return qn=navigator.platform==="MacIntel"&&e!==void 0&&e>0},ka=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},_y=e=>e,ky=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,o=new Array(r);for(let i=0;i<r;i++)o[i]=t+i;return o},Sy=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(o(ka(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l?.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(ka(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},Hr={passive:!0},Cy=typeof window>"u"?!0:"onscrollend"in window,Ey=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;const i=e.options.useScrollendEvent&&Cy;let s=0;const a=i?null:wy(o,()=>t(s,!1),e.options.isScrollingResetDelay),l=h=>()=>{s=n(r),a?.(),t(s,h)},c=l(!0),u=l(!1);return r.addEventListener("scroll",c,Hr),i&&r.addEventListener("scrollend",u,Hr),()=>{r.removeEventListener("scroll",c),i&&r.removeEventListener("scrollend",u)}},Ny=(e,t)=>Ey(e,t,n=>{const{horizontal:r,isRtl:o}=e.options;return r?n.scrollLeft*(o&&-1||1):n.scrollTop}),Ty=(e,t,n)=>{if(n.options.useCachedMeasurements){const r=n.indexFromElement(e),o=n.options.getItemKey(r);return n.itemSizeCache.get(o)??n.options.estimateSize(r)}if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const r=n.indexFromElement(e),o=n.options.getItemKey(r),i=n.itemSizeCache.get(o);if(i!==void 0)return i}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},jy=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})},zy=jy;class Ay{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,r,o;return((o=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:o.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const s=()=>{const a=i.target,l=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);for(const[c,u]of this.elementsCache)if(u===a){this.elementsCache.delete(c);break}return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(a,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{var r,o;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:_y,rangeExtractor:ky,onChange:()=>{},measureElement:Ty,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const p in n){const d=n[p];d!==void 0&&(i[p]=d)}const s=this.options;let a=null,l=null,c=!1;if(s!==void 0&&s.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const p=s.count,d=i.count,g=this.getMeasurements(),m=p>0?((r=g[0])==null?void 0:r.key)??s.getItemKey(0):null,y=p>0?((o=g[p-1])==null?void 0:o.key)??s.getItemKey(p-1):null;if(d!==p||p>0&&d>0&&(i.getItemKey(0)!==m||i.getItemKey(d-1)!==y)){c=!0;const w=p>0?this.getVirtualItemForOffset(this.getScrollOffset())??g[0]:null;w&&(a=[w.key,this.getScrollOffset()-w.start]);const S=i.followOnAppend===!0?"auto":i.followOnAppend||null;S&&d>p&&this.isAtEnd(s.scrollEndThreshold)&&(p===0||i.getItemKey(d-1)!==y)&&(l=S)}}this.options=i,c&&(this.pendingMin=0,this.itemSizeCacheVersion++);let u=!1,h=0;if(a&&this.scrollOffset!==null){const[p,d]=a,g=this.getMeasurements(),{count:m,getItemKey:y}=this.options;let x=0;for(;x<m&&y(x)!==p;)x++;if(x<m){const b=g[x];if(b){const w=b.start+d;w!==this.scrollOffset&&(h=w-this.scrollOffset,this.scrollOffset=w,u=!0)}}}(u||l)&&(this.pendingScrollAnchor=[u?a[0]:null,u?a[1]:0,l,h])},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=xn(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,s)=>{this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=s,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const i=this.scrollElement,s=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},a=()=>{this._iosTouching=!1,!(!Do()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",s,Hr),i.addEventListener("touchend",a,Hr),this.unsubs.push(()=>{i.removeEventListener("touchstart",s),i.removeEventListener("touchend",a),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const o=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,o&&this.scrollElement&&this.options.enabled){const[i,s,a,l]=o;i!==null&&!a&&(Do()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),a&&this.scrollToEnd({behavior:a})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;const o=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=o,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=xn(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(n,r,o,i,s,a,l)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a,laneAssignmentMode:l}),{key:!1}),this.getMeasurements=xn(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a,laneAssignmentMode:l},c)=>{const u=this.itemSizeCache;if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const g of this.laneAssignments.keys())g>=n&&this.laneAssignments.delete(g);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(g=>{this.itemSizeCache.set(g.key,g.size)}));const h=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),a===1){const g=this.options.gap,m=n*2;let y=this._flatMeasurements;if(!y||y.length<m){const w=new Float64Array(m);y&&h>0&&w.set(y.subarray(0,h*2)),y=w,this._flatMeasurements=y}let x;if(h===0)x=r+o;else{const w=h-1;x=y[w*2]+y[w*2+1]+g}for(let w=h;w<n;w++){const S=i(w),C=u.get(S),N=typeof C=="number"?C:this.options.estimateSize(w);y[w*2]=x,y[w*2+1]=N,x+=N+g}const b=by(n,y,i);return this.measurementsCache=b,b}const p=this.measurementsCache.slice(0,h),d=new Array(a).fill(void 0);for(let g=0;g<h;g++){const m=p[g];m&&(d[m.lane]=g)}for(let g=h;g<n;g++){const m=i(g),y=this.laneAssignments.get(g);let x,b;const w=l==="estimate"||u.has(m);if(y!==void 0&&this.options.lanes>1){x=y;const z=d[x],I=z!==void 0?p[z]:void 0;b=I?I.end+this.options.gap:r+o}else{const z=this.options.lanes===1?p[g-1]:this.getFurthestMeasurement(p,g);b=z?z.end+this.options.gap:r+o,x=z?z.lane:g%this.options.lanes,this.options.lanes>1&&w&&this.laneAssignments.set(g,x)}const S=u.get(m),C=typeof S=="number"?S:this.options.estimateSize(g),N=b+C;p[g]={index:g,start:b,size:C,end:N,key:m,lane:x},d[x]=g}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=xn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?Iy({measurements:n,outerSize:r,scrollOffset:o,lanes:i,flat:i===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=xn(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(o!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),s=Math.max(0,o-i),a=Math.min(this.options.count-1,o+i);return n>=s&&n<=a}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((s,a)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(a))});return}const r=this.indexFromElement(n),o=this.options.getItemKey(r),i=this.elementsCache.get(o);i!==n&&(i&&this.observer.unobserve(i),this.observer.observe(n),this.elementsCache.set(o,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var o,i;if(n<0||n>=this.options.count)return;let s,a,l;const c=this._flatMeasurements;if(this.options.lanes===1&&c!==null)l=this.options.getItemKey(n),a=c[n*2],s=c[n*2+1];else{const p=this.measurementsCache[n];if(!p)return;l=p.key,a=p.start,s=p.size}const u=this.itemSizeCache.get(l)??s,h=r-u;if(h!==0){const p=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,d=p?this.getTotalSize():0,g=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:l,start:a,size:s,end:a+s,lane:0},h,this):a<this.getScrollOffset()+this.scrollAdjustments&&this.scrollDirection!=="backward");(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(l,r),this.itemSizeCacheVersion++,p?this.applyScrollAdjustment(this.getTotalSize()-d):g&&this.applyScrollAdjustment(h),this.notify(!1)}},this.getVirtualItems=xn(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length===0)return;const o=this._flatMeasurements,i=this.options.lanes===1&&o!=null,s=Xc(0,r.length-1,i?a=>o[a*2]:a=>_a(r[a]).start,n);return _a(r[s])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,o=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getSize(),i=this.getScrollOffset(),s=this.measurementsCache[n];if(!s)return;if(r==="auto")if(s.end>=i+o-this.options.scrollPaddingEnd)r="end";else if(s.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const a=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,s.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:o="auto"}={})=>{const i=this.getOffsetForAlignment(n,r),s=this.now();this.scrollState={index:null,align:r,behavior:o,startedAt:s,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:o="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.getOffsetForIndex(n,r);if(!i)return;const[s,a]=i,l=this.now();this.scrollState={index:n,align:a,behavior:o,startedAt:l,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const o=this.getScrollOffset()+n,i=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:i,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1){const i=r.length-1,s=this._flatMeasurements;s!=null?o=s[i*2]+s[i*2+1]:o=((n=r[i])==null?void 0:n.end)??0}else{const i=Array(this.options.lanes).fill(null);let s=r.length-1;for(;s>=0&&i.some(a=>a===null);){const a=r[s];i[a.lane]===null&&(i[a.lane]=a.end),s--}o=Math.max(...i.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const o of r)o&&this.itemSizeCache.has(o.key)&&n.push({index:o.index,key:o.key,start:o.start,size:o.size,end:o.end,lane:o.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){t!==0&&(Do()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=t:this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=r?r[0]:this.scrollState.lastTargetOffset,i=1,s=o!==this.scrollState.lastTargetOffset;if(!s&&vy(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==o&&this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,s){const a=this.getSize()||600,l=Math.abs(o-this.getScrollOffset()),c=this.scrollState.behavior==="smooth"&&l>a;this.scrollState.lastTargetOffset=o,c||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:c?"smooth":"auto"})}this.scheduleScrollReconcile()}}const Xc=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function Iy({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:o}){const i=e.length-1,s=o?u=>o[u*2]:u=>e[u].start,a=o?u=>o[u*2]+o[u*2+1]:u=>e[u].end;if(e.length<=r)return{startIndex:0,endIndex:i};let l=Xc(0,i,s,n),c=l;if(r===1)for(;c<i&&a(c)<n+t;)c++;else if(r>1){const u=Array(r).fill(0);for(;c<i&&u.some(p=>p<n+t);){const p=e[c];u[p.lane]=p.end,c++}const h=Array(r).fill(n+t);for(;l>=0&&h.some(p=>p>=n);){const p=e[l];h[p.lane]=p.start,l--}l=Math.max(0,l-l%r),c=Math.min(i,c+(r-1-c%r))}return{startIndex:l,endIndex:c}}const Mo=typeof document<"u"?v.useLayoutEffect:v.useEffect;function Ry({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const o=v.useReducer(c=>c+1,0)[1],i=v.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=t,i.current.mode=n;const s=c=>{const u=i.current;if(!u.enabled)return;const h=c.getTotalSize();if(u.container&&h!==u.lastSize){u.lastSize=h;const x=c.options.horizontal?"width":"height";u.container.style[x]=`${h}px`}const p=!!c.options.horizontal,d=u.mode==="transform",g=p?"left":"top",m=c.options.scrollMargin,y=c.getVirtualItems();for(const x of y){const b=x.start-m,w=c.elementsCache.get(x.key);w&&u.lastPositions.get(w)!==b&&(u.lastPositions.set(w,b),d?w.style.transform=p?`translate3d(${b}px, 0, 0)`:`translate3d(0, ${b}px, 0)`:w.style[g]=`${b}px`)}},a={...r,onChange:(c,u)=>{var h;const p=i.current;let d=!0;if(p.enabled){s(c);const g=c.range,m=p.prevRange;d=!m||m.isScrolling!==c.isScrolling||m.startIndex!==g?.startIndex||m.endIndex!==g?.endIndex,d&&(p.prevRange=g?{startIndex:g.startIndex,endIndex:g.endIndex,isScrolling:c.isScrolling}:null)}d&&(e&&u?dr.flushSync(o):o()),(h=r.onChange)==null||h.call(r,c,u)}},[l]=v.useState(()=>{const c=new Ay(a);return Object.assign(c,{containerRef:u=>{const h=i.current;if(h.container=u,h.lastSize=null,u&&h.enabled){const p=c.getTotalSize();h.lastSize=p;const d=c.options.horizontal?"width":"height";u.style[d]=`${p}px`}}})});return l.setOptions(a),Mo(()=>l._didMount(),[]),Mo(()=>l._willUpdate()),Mo(()=>{s(l)}),l}function Qc(e){return Ry({observeElementRect:Sy,observeElementOffset:Ny,scrollToFn:zy,...e})}const eu=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const Py=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Oy=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const Sa=e=>{const t=Oy(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Dy={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const My=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Ly=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>v.createElement("svg",{ref:l,...Dy,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:eu("lucide",o),...!i&&!My(a)&&{"aria-hidden":"true"},...a},[...s.map(([c,u])=>v.createElement(c,u)),...Array.isArray(i)?i:[i]]));const _e=(e,t)=>{const n=v.forwardRef(({className:r,...o},i)=>v.createElement(Ly,{ref:i,iconNode:t,className:eu(`lucide-${Py(Sa(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Sa(e),n};const Fy=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],$y=_e("brain",Fy);const By=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],hr=_e("check",By);const Uy=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],zt=_e("chevron-down",Uy);const Zy=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ht=_e("chevron-right",Zy);const Wy=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Vy=_e("chevron-up",Wy);const Hy=[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]],qy=_e("chevrons-down",Hy);const Gy=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],Ky=_e("chevrons-up",Gy);const Jy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],bi=_e("circle-alert",Jy);const Yy=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Xy=_e("circle-check-big",Yy);const Qy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],eb=_e("circle-question-mark",Qy);const tb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],tu=_e("circle-stop",tb);const nb=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],os=_e("clock",nb);const rb=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],ob=_e("columns-2",rb);const ib=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],uo=_e("copy",ib);const sb=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],nu=_e("download",sb);const ab=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],lb=_e("external-link",ab);const cb=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],ru=_e("eye-off",cb);const ub=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ou=_e("eye",ub);const db=[["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:"m8 16 2-2-2-2",key:"10vzyd"}],["path",{d:"M12 18h4",key:"1wd2n7"}]],fb=_e("file-terminal",db);const hb=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],pb=_e("gauge",hb);const mb=[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]],gb=_e("git-compare-arrows",mb);const xb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],yb=_e("globe",xb);const bb=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],vb=_e("layout-grid",bb);const wb=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],_b=_e("list",wb);const kb=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],iu=_e("loader-circle",kb);const Sb=[["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"}]],Cb=_e("lock",Sb);const Eb=[["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"}]],su=_e("message-square",Eb);const Nb=[["path",{d:"M5 12h14",key:"1ays0h"}]],Tb=_e("minus",Nb);const jb=[["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"}]],zb=_e("pencil",jb);const Ab=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ca=_e("plus",Ab);const Ib=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Rb=_e("radio",Ib);const Pb=[["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"}]],au=_e("rotate-ccw",Pb);const Ob=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],lu=_e("rotate-cw",Ob);const Db=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],Mb=_e("rows-3",Db);const Lb=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Fb=_e("server",Lb);const $b=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Bb=_e("settings",$b);const Ub=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Zb=_e("terminal",Ub);const Wb=[["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"}]],Vb=_e("trash-2",Wb);const Hb=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],qb=_e("triangle-alert",Hb);const Gb=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Kb=_e("upload",Gb);const Jb=[["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"}]],Yb=_e("user",Jb);const Xb=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Qb=_e("wifi-off",Xb);const ev=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],tv=_e("wifi",ev);const nv=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],rv=_e("wrench",nv);const ov=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],iv=_e("x",ov);const sv=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],pr=_e("zap",sv);function Cr(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Lo={exports:{}};var Ea;function av(){return Ea||(Ea=1,(function(e,t){(function(n){e.exports=n()})(function(){return(function n(r,o,i){function s(c,u){if(!o[c]){if(!r[c]){var h=typeof Cr=="function"&&Cr;if(!u&&h)return h(c,!0);if(a)return a(c,!0);var p=new Error("Cannot find module '"+c+"'");throw p.code="MODULE_NOT_FOUND",p}var d=o[c]={exports:{}};r[c][0].call(d.exports,function(g){var m=r[c][1][g];return s(m||g)},d,d.exports,n,r,o,i)}return o[c].exports}for(var a=typeof Cr=="function"&&Cr,l=0;l<i.length;l++)s(i[l]);return s})({1:[function(n,r,o){var i=n("./utils"),s=n("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.encode=function(l){for(var c,u,h,p,d,g,m,y=[],x=0,b=l.length,w=b,S=i.getTypeOf(l)!=="string";x<l.length;)w=b-x,h=S?(c=l[x++],u=x<b?l[x++]:0,x<b?l[x++]:0):(c=l.charCodeAt(x++),u=x<b?l.charCodeAt(x++):0,x<b?l.charCodeAt(x++):0),p=c>>2,d=(3&c)<<4|u>>4,g=1<w?(15&u)<<2|h>>6:64,m=2<w?63&h:64,y.push(a.charAt(p)+a.charAt(d)+a.charAt(g)+a.charAt(m));return y.join("")},o.decode=function(l){var c,u,h,p,d,g,m=0,y=0,x="data:";if(l.substr(0,x.length)===x)throw new Error("Invalid base64 input, it looks like a data url.");var b,w=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&w--,l.charAt(l.length-2)===a.charAt(64)&&w--,w%1!=0)throw new Error("Invalid base64 input, bad content length.");for(b=s.uint8array?new Uint8Array(0|w):new Array(0|w);m<l.length;)c=a.indexOf(l.charAt(m++))<<2|(p=a.indexOf(l.charAt(m++)))>>4,u=(15&p)<<4|(d=a.indexOf(l.charAt(m++)))>>2,h=(3&d)<<6|(g=a.indexOf(l.charAt(m++))),b[y++]=c,d!==64&&(b[y++]=u),g!==64&&(b[y++]=h);return b}},{"./support":30,"./utils":32}],2:[function(n,r,o){var i=n("./external"),s=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function c(u,h,p,d,g){this.compressedSize=u,this.uncompressedSize=h,this.crc32=p,this.compression=d,this.compressedContent=g}c.prototype={getContentWorker:function(){var u=new s(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),h=this;return u.on("end",function(){if(this.streamInfo.data_length!==h.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new s(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,h,p){return u.pipe(new a).pipe(new l("uncompressedSize")).pipe(h.compressWorker(p)).pipe(new l("compressedSize")).withStreamInfo("compression",h)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,o){var i=n("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},o.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,o){var i=n("./utils"),s=(function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var u=0;u<8;u++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l})();r.exports=function(a,l){return a!==void 0&&a.length?i.getTypeOf(a)!=="string"?(function(c,u,h,p){var d=s,g=p+h;c^=-1;for(var m=p;m<g;m++)c=c>>>8^d[255&(c^u[m])];return-1^c})(0|l,a,a.length,0):(function(c,u,h,p){var d=s,g=p+h;c^=-1;for(var m=p;m<g;m++)c=c>>>8^d[255&(c^u.charCodeAt(m))];return-1^c})(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,o){o.base64=!1,o.binary=!1,o.dir=!1,o.createFolders=!0,o.date=null,o.compression=null,o.compressionOptions=null,o.comment=null,o.unixPermissions=null,o.dosPermissions=null},{}],6:[function(n,r,o){var i=null;i=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:i}},{lie:37}],7:[function(n,r,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=n("pako"),a=n("./utils"),l=n("./stream/GenericWorker"),c=i?"uint8array":"array";function u(h,p){l.call(this,"FlateWorker/"+h),this._pako=null,this._pakoAction=h,this._pakoOptions=p,this.meta={}}o.magic="\b\0",a.inherits(u,l),u.prototype.processChunk=function(h){this.meta=h.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,h.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var h=this;this._pako.onData=function(p){h.push({data:p,meta:h.meta})}},o.compressWorker=function(h){return new u("Deflate",h)},o.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,o){function i(d,g){var m,y="";for(m=0;m<g;m++)y+=String.fromCharCode(255&d),d>>>=8;return y}function s(d,g,m,y,x,b){var w,S,C=d.file,N=d.compression,z=b!==c.utf8encode,I=a.transformTo("string",b(C.name)),O=a.transformTo("string",c.utf8encode(C.name)),P=C.comment,L=a.transformTo("string",b(P)),T=a.transformTo("string",c.utf8encode(P)),M=O.length!==C.name.length,_=T.length!==P.length,D="",G="",Z="",te=C.dir,q=C.date,E={crc32:0,compressedSize:0,uncompressedSize:0};g&&!m||(E.crc32=d.crc32,E.compressedSize=d.compressedSize,E.uncompressedSize=d.uncompressedSize);var U=0;g&&(U|=8),z||!M&&!_||(U|=2048);var B=0,j=0;te&&(B|=16),x==="UNIX"?(j=798,B|=(function(H,ce){var ie=H;return H||(ie=ce?16893:33204),(65535&ie)<<16})(C.unixPermissions,te)):(j=20,B|=(function(H){return 63&(H||0)})(C.dosPermissions)),w=q.getUTCHours(),w<<=6,w|=q.getUTCMinutes(),w<<=5,w|=q.getUTCSeconds()/2,S=q.getUTCFullYear()-1980,S<<=4,S|=q.getUTCMonth()+1,S<<=5,S|=q.getUTCDate(),M&&(G=i(1,1)+i(u(I),4)+O,D+="up"+i(G.length,2)+G),_&&(Z=i(1,1)+i(u(L),4)+T,D+="uc"+i(Z.length,2)+Z);var Y="";return Y+=`
65
- \0`,Y+=i(U,2),Y+=N.magic,Y+=i(w,2),Y+=i(S,2),Y+=i(E.crc32,4),Y+=i(E.compressedSize,4),Y+=i(E.uncompressedSize,4),Y+=i(I.length,2),Y+=i(D.length,2),{fileRecord:h.LOCAL_FILE_HEADER+Y+I+D,dirRecord:h.CENTRAL_FILE_HEADER+i(j,2)+Y+i(L.length,2)+"\0\0\0\0"+i(B,4)+i(y,4)+I+D+L}}var a=n("../utils"),l=n("../stream/GenericWorker"),c=n("../utf8"),u=n("../crc32"),h=n("../signature");function p(d,g,m,y){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=g,this.zipPlatform=m,this.encodeFileName=y,this.streamFiles=d,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,l),p.prototype.push=function(d){var g=d.meta.percent||0,m=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(d):(this.bytesWritten+=d.data.length,l.prototype.push.call(this,{data:d.data,meta:{currentFile:this.currentFile,percent:m?(g+100*(m-y-1))/m:100}}))},p.prototype.openedSource=function(d){this.currentSourceOffset=this.bytesWritten,this.currentFile=d.file.name;var g=this.streamFiles&&!d.file.dir;if(g){var m=s(d,g,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(d){this.accumulate=!1;var g=this.streamFiles&&!d.file.dir,m=s(d,g,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),g)this.push({data:(function(y){return h.DATA_DESCRIPTOR+i(y.crc32,4)+i(y.compressedSize,4)+i(y.uncompressedSize,4)})(d),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var d=this.bytesWritten,g=0;g<this.dirRecords.length;g++)this.push({data:this.dirRecords[g],meta:{percent:100}});var m=this.bytesWritten-d,y=(function(x,b,w,S,C){var N=a.transformTo("string",C(S));return h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(x,2)+i(x,2)+i(b,4)+i(w,4)+i(N.length,2)+N})(this.dirRecords.length,m,d,this.zipComment,this.encodeFileName);this.push({data:y,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(d){this._sources.push(d);var g=this;return d.on("data",function(m){g.processChunk(m)}),d.on("end",function(){g.closedSource(g.previous.streamInfo),g._sources.length?g.prepareNextSource():g.end()}),d.on("error",function(m){g.error(m)}),this},p.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(d){var g=this._sources;if(!l.prototype.error.call(this,d))return!1;for(var m=0;m<g.length;m++)try{g[m].error(d)}catch{}return!0},p.prototype.lock=function(){l.prototype.lock.call(this);for(var d=this._sources,g=0;g<d.length;g++)d[g].lock()},r.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,o){var i=n("../compressions"),s=n("./ZipFileWorker");o.generateWorker=function(a,l,c){var u=new s(l.streamFiles,c,l.platform,l.encodeFileName),h=0;try{a.forEach(function(p,d){h++;var g=(function(b,w){var S=b||w,C=i[S];if(!C)throw new Error(S+" is not a valid compression method !");return C})(d.options.compression,l.compression),m=d.options.compressionOptions||l.compressionOptions||{},y=d.dir,x=d.date;d._compressWorker(g,m).withStreamInfo("file",{name:p,dir:y,date:x,comment:d.comment||"",unixPermissions:d.unixPermissions,dosPermissions:d.dosPermissions}).pipe(u)}),u.entriesCount=h}catch(p){u.error(p)}return u}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,o){function i(){if(!(this instanceof i))return new i;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new i;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}(i.prototype=n("./object")).loadAsync=n("./load"),i.support=n("./support"),i.defaults=n("./defaults"),i.version="3.10.1",i.loadAsync=function(s,a){return new i().loadAsync(s,a)},i.external=n("./external"),r.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,o){var i=n("./utils"),s=n("./external"),a=n("./utf8"),l=n("./zipEntries"),c=n("./stream/Crc32Probe"),u=n("./nodejsUtils");function h(p){return new s.Promise(function(d,g){var m=p.decompressed.getContentWorker().pipe(new c);m.on("error",function(y){g(y)}).on("end",function(){m.streamInfo.crc32!==p.decompressed.crc32?g(new Error("Corrupted zip : CRC32 mismatch")):d()}).resume()})}r.exports=function(p,d){var g=this;return d=i.extend(d||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),u.isNode&&u.isStream(p)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",p,!0,d.optimizedBinaryString,d.base64).then(function(m){var y=new l(d);return y.load(m),y}).then(function(m){var y=[s.Promise.resolve(m)],x=m.files;if(d.checkCRC32)for(var b=0;b<x.length;b++)y.push(h(x[b]));return s.Promise.all(y)}).then(function(m){for(var y=m.shift(),x=y.files,b=0;b<x.length;b++){var w=x[b],S=w.fileNameStr,C=i.resolve(w.fileNameStr);g.file(C,w.decompressed,{binary:!0,optimizedBinaryString:!0,date:w.date,dir:w.dir,comment:w.fileCommentStr.length?w.fileCommentStr:null,unixPermissions:w.unixPermissions,dosPermissions:w.dosPermissions,createFolders:d.createFolders}),w.dir||(g.file(C).unsafeOriginalName=S)}return y.zipComment.length&&(g.comment=y.zipComment),g})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,o){var i=n("../utils"),s=n("../stream/GenericWorker");function a(l,c){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}i.inherits(a,s),a.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(u){c.push({data:u,meta:{percent:0}})}).on("error",function(u){c.isPaused?this.generatedError=u:c.error(u)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},a.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,o){var i=n("readable-stream").Readable;function s(a,l,c){i.call(this,l),this._helper=a;var u=this;a.on("data",function(h,p){u.push(h)||u._helper.pause(),c&&c(p)}).on("error",function(h){u.emit("error",h)}).on("end",function(){u.push(null)})}n("../utils").inherits(s,i),s.prototype._read=function(){this._helper.resume()},r.exports=s},{"../utils":32,"readable-stream":16}],14:[function(n,r,o){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(i,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(i,s);if(typeof i=="number")throw new Error('The "data" argument must not be a number');return new Buffer(i,s)},allocBuffer:function(i){if(Buffer.alloc)return Buffer.alloc(i);var s=new Buffer(i);return s.fill(0),s},isBuffer:function(i){return Buffer.isBuffer(i)},isStream:function(i){return i&&typeof i.on=="function"&&typeof i.pause=="function"&&typeof i.resume=="function"}}},{}],15:[function(n,r,o){function i(C,N,z){var I,O=a.getTypeOf(N),P=a.extend(z||{},u);P.date=P.date||new Date,P.compression!==null&&(P.compression=P.compression.toUpperCase()),typeof P.unixPermissions=="string"&&(P.unixPermissions=parseInt(P.unixPermissions,8)),P.unixPermissions&&16384&P.unixPermissions&&(P.dir=!0),P.dosPermissions&&16&P.dosPermissions&&(P.dir=!0),P.dir&&(C=x(C)),P.createFolders&&(I=y(C))&&b.call(this,I,!0);var L=O==="string"&&P.binary===!1&&P.base64===!1;z&&z.binary!==void 0||(P.binary=!L),(N instanceof h&&N.uncompressedSize===0||P.dir||!N||N.length===0)&&(P.base64=!1,P.binary=!0,N="",P.compression="STORE",O="string");var T=null;T=N instanceof h||N instanceof l?N:g.isNode&&g.isStream(N)?new m(C,N):a.prepareContent(C,N,P.binary,P.optimizedBinaryString,P.base64);var M=new p(C,T,P);this.files[C]=M}var s=n("./utf8"),a=n("./utils"),l=n("./stream/GenericWorker"),c=n("./stream/StreamHelper"),u=n("./defaults"),h=n("./compressedObject"),p=n("./zipObject"),d=n("./generate"),g=n("./nodejsUtils"),m=n("./nodejs/NodejsStreamInputAdapter"),y=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var N=C.lastIndexOf("/");return 0<N?C.substring(0,N):""},x=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},b=function(C,N){return N=N!==void 0?N:u.createFolders,C=x(C),this.files[C]||i.call(this,C,null,{dir:!0,createFolders:N}),this.files[C]};function w(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var S={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var N,z,I;for(N in this.files)I=this.files[N],(z=N.slice(this.root.length,N.length))&&N.slice(0,this.root.length)===this.root&&C(z,I)},filter:function(C){var N=[];return this.forEach(function(z,I){C(z,I)&&N.push(I)}),N},file:function(C,N,z){if(arguments.length!==1)return C=this.root+C,i.call(this,C,N,z),this;if(w(C)){var I=C;return this.filter(function(P,L){return!L.dir&&I.test(P)})}var O=this.files[this.root+C];return O&&!O.dir?O:null},folder:function(C){if(!C)return this;if(w(C))return this.filter(function(O,P){return P.dir&&C.test(O)});var N=this.root+C,z=b.call(this,N),I=this.clone();return I.root=z.name,I},remove:function(C){C=this.root+C;var N=this.files[C];if(N||(C.slice(-1)!=="/"&&(C+="/"),N=this.files[C]),N&&!N.dir)delete this.files[C];else for(var z=this.filter(function(O,P){return P.name.slice(0,C.length)===C}),I=0;I<z.length;I++)delete this.files[z[I].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(C){var N,z={};try{if((z=a.extend(C||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=z.type.toLowerCase(),z.compression=z.compression.toUpperCase(),z.type==="binarystring"&&(z.type="string"),!z.type)throw new Error("No output type specified.");a.checkSupport(z.type),z.platform!=="darwin"&&z.platform!=="freebsd"&&z.platform!=="linux"&&z.platform!=="sunos"||(z.platform="UNIX"),z.platform==="win32"&&(z.platform="DOS");var I=z.comment||this.comment||"";N=d.generateWorker(this,z,I)}catch(O){(N=new l("error")).error(O)}return new c(N,z.type||"string",z.mimeType)},generateAsync:function(C,N){return this.generateInternalStream(C).accumulate(N)},generateNodeStream:function(C,N){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(N)}};r.exports=S},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,r,o){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,o){var i=n("./DataReader");function s(a){i.call(this,a);for(var l=0;l<this.data.length;l++)a[l]=255&a[l]}n("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data[this.zero+a]},s.prototype.lastIndexOfSignature=function(a){for(var l=a.charCodeAt(0),c=a.charCodeAt(1),u=a.charCodeAt(2),h=a.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===l&&this.data[p+1]===c&&this.data[p+2]===u&&this.data[p+3]===h)return p-this.zero;return-1},s.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),c=a.charCodeAt(1),u=a.charCodeAt(2),h=a.charCodeAt(3),p=this.readData(4);return l===p[0]&&c===p[1]&&u===p[2]&&h===p[3]},s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./DataReader":18}],18:[function(n,r,o){var i=n("../utils");function s(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var l,c=0;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return i.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=s},{"../utils":32}],19:[function(n,r,o){var i=n("./Uint8ArrayReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,o){var i=n("./DataReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./DataReader":18}],21:[function(n,r,o){var i=n("./ArrayReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,o){var i=n("../utils"),s=n("../support"),a=n("./ArrayReader"),l=n("./StringReader"),c=n("./NodeBufferReader"),u=n("./Uint8ArrayReader");r.exports=function(h){var p=i.getTypeOf(h);return i.checkSupport(p),p!=="string"||s.uint8array?p==="nodebuffer"?new c(h):s.uint8array?new u(i.transformTo("uint8array",h)):new a(i.transformTo("array",h)):new l(h)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,o){var i=n("./GenericWorker"),s=n("../utils");function a(l){i.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,i),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,o){var i=n("./GenericWorker"),s=n("../crc32");function a(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,i),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,o){var i=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}i.inherits(a,s),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,o){var i=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=i.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}i.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,o){function i(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l<this._listeners[s].length;l++)this._listeners[s][l].call(this,a)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var a=this;return s.on("data",function(l){a.processChunk(l)}),s.on("end",function(){a.end()}),s.on("error",function(l){a.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,a){return this.extraStreamInfo[s]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},r.exports=i},{}],29:[function(n,r,o){var i=n("../utils"),s=n("./ConvertWorker"),a=n("./GenericWorker"),l=n("../base64"),c=n("../support"),u=n("../external"),h=null;if(c.nodestream)try{h=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(g,m){return new u.Promise(function(y,x){var b=[],w=g._internalType,S=g._outputType,C=g._mimeType;g.on("data",function(N,z){b.push(N),m&&m(z)}).on("error",function(N){b=[],x(N)}).on("end",function(){try{var N=(function(z,I,O){switch(z){case"blob":return i.newBlob(i.transformTo("arraybuffer",I),O);case"base64":return l.encode(I);default:return i.transformTo(z,I)}})(S,(function(z,I){var O,P=0,L=null,T=0;for(O=0;O<I.length;O++)T+=I[O].length;switch(z){case"string":return I.join("");case"array":return Array.prototype.concat.apply([],I);case"uint8array":for(L=new Uint8Array(T),O=0;O<I.length;O++)L.set(I[O],P),P+=I[O].length;return L;case"nodebuffer":return Buffer.concat(I);default:throw new Error("concat : unsupported type '"+z+"'")}})(w,b),C);y(N)}catch(z){x(z)}b=[]}).resume()})}function d(g,m,y){var x=m;switch(m){case"blob":case"arraybuffer":x="uint8array";break;case"base64":x="string"}try{this._internalType=x,this._outputType=m,this._mimeType=y,i.checkSupport(x),this._worker=g.pipe(new s(x)),g.lock()}catch(b){this._worker=new a("error"),this._worker.error(b)}}d.prototype={accumulate:function(g){return p(this,g)},on:function(g,m){var y=this;return g==="data"?this._worker.on(g,function(x){m.call(y,x.data,x.meta)}):this._worker.on(g,function(){i.delay(m,arguments,y)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(g){if(i.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new h(this,{objectMode:this._outputType!=="nodebuffer"},g)}},r.exports=d},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof Buffer<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var i=new ArrayBuffer(0);try{o.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(i),o.blob=s.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!n("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,o){for(var i=n("./utils"),s=n("./support"),a=n("./nodejsUtils"),l=n("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;c[254]=c[254]=1;function h(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}o.utf8encode=function(d){return s.nodebuffer?a.newBufferFrom(d,"utf-8"):(function(g){var m,y,x,b,w,S=g.length,C=0;for(b=0;b<S;b++)(64512&(y=g.charCodeAt(b)))==55296&&b+1<S&&(64512&(x=g.charCodeAt(b+1)))==56320&&(y=65536+(y-55296<<10)+(x-56320),b++),C+=y<128?1:y<2048?2:y<65536?3:4;for(m=s.uint8array?new Uint8Array(C):new Array(C),b=w=0;w<C;b++)(64512&(y=g.charCodeAt(b)))==55296&&b+1<S&&(64512&(x=g.charCodeAt(b+1)))==56320&&(y=65536+(y-55296<<10)+(x-56320),b++),y<128?m[w++]=y:(y<2048?m[w++]=192|y>>>6:(y<65536?m[w++]=224|y>>>12:(m[w++]=240|y>>>18,m[w++]=128|y>>>12&63),m[w++]=128|y>>>6&63),m[w++]=128|63&y);return m})(d)},o.utf8decode=function(d){return s.nodebuffer?i.transformTo("nodebuffer",d).toString("utf-8"):(function(g){var m,y,x,b,w=g.length,S=new Array(2*w);for(m=y=0;m<w;)if((x=g[m++])<128)S[y++]=x;else if(4<(b=c[x]))S[y++]=65533,m+=b-1;else{for(x&=b===2?31:b===3?15:7;1<b&&m<w;)x=x<<6|63&g[m++],b--;1<b?S[y++]=65533:x<65536?S[y++]=x:(x-=65536,S[y++]=55296|x>>10&1023,S[y++]=56320|1023&x)}return S.length!==y&&(S.subarray?S=S.subarray(0,y):S.length=y),i.applyFromCharCode(S)})(d=i.transformTo(s.uint8array?"uint8array":"array",d))},i.inherits(h,l),h.prototype.processChunk=function(d){var g=i.transformTo(s.uint8array?"uint8array":"array",d.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var m=g;(g=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),g.set(m,this.leftOver.length)}else g=this.leftOver.concat(g);this.leftOver=null}var y=(function(b,w){var S;for((w=w||b.length)>b.length&&(w=b.length),S=w-1;0<=S&&(192&b[S])==128;)S--;return S<0||S===0?w:S+c[b[S]]>w?S:w})(g),x=g;y!==g.length&&(s.uint8array?(x=g.subarray(0,y),this.leftOver=g.subarray(y,g.length)):(x=g.slice(0,y),this.leftOver=g.slice(y,g.length))),this.push({data:o.utf8decode(x),meta:d.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=h,i.inherits(p,l),p.prototype.processChunk=function(d){this.push({data:o.utf8encode(d.data),meta:d.meta})},o.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,o){var i=n("./support"),s=n("./base64"),a=n("./nodejsUtils"),l=n("./external");function c(m){return m}function u(m,y){for(var x=0;x<m.length;++x)y[x]=255&m.charCodeAt(x);return y}n("setimmediate"),o.newBlob=function(m,y){o.checkSupport("blob");try{return new Blob([m],{type:y})}catch{try{var x=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return x.append(m),x.getBlob(y)}catch{throw new Error("Bug : can't construct the Blob.")}}};var h={stringifyByChunk:function(m,y,x){var b=[],w=0,S=m.length;if(S<=x)return String.fromCharCode.apply(null,m);for(;w<S;)y==="array"||y==="nodebuffer"?b.push(String.fromCharCode.apply(null,m.slice(w,Math.min(w+x,S)))):b.push(String.fromCharCode.apply(null,m.subarray(w,Math.min(w+x,S)))),w+=x;return b.join("")},stringifyByChar:function(m){for(var y="",x=0;x<m.length;x++)y+=String.fromCharCode(m[x]);return y},applyCanBeUsed:{uint8array:(function(){try{return i.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return i.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}})()}};function p(m){var y=65536,x=o.getTypeOf(m),b=!0;if(x==="uint8array"?b=h.applyCanBeUsed.uint8array:x==="nodebuffer"&&(b=h.applyCanBeUsed.nodebuffer),b)for(;1<y;)try{return h.stringifyByChunk(m,x,y)}catch{y=Math.floor(y/2)}return h.stringifyByChar(m)}function d(m,y){for(var x=0;x<m.length;x++)y[x]=m[x];return y}o.applyFromCharCode=p;var g={};g.string={string:c,array:function(m){return u(m,new Array(m.length))},arraybuffer:function(m){return g.string.uint8array(m).buffer},uint8array:function(m){return u(m,new Uint8Array(m.length))},nodebuffer:function(m){return u(m,a.allocBuffer(m.length))}},g.array={string:p,array:c,arraybuffer:function(m){return new Uint8Array(m).buffer},uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(m)}},g.arraybuffer={string:function(m){return p(new Uint8Array(m))},array:function(m){return d(new Uint8Array(m),new Array(m.byteLength))},arraybuffer:c,uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(new Uint8Array(m))}},g.uint8array={string:p,array:function(m){return d(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:c,nodebuffer:function(m){return a.newBufferFrom(m)}},g.nodebuffer={string:p,array:function(m){return d(m,new Array(m.length))},arraybuffer:function(m){return g.nodebuffer.uint8array(m).buffer},uint8array:function(m){return d(m,new Uint8Array(m.length))},nodebuffer:c},o.transformTo=function(m,y){if(y=y||"",!m)return y;o.checkSupport(m);var x=o.getTypeOf(y);return g[x][m](y)},o.resolve=function(m){for(var y=m.split("/"),x=[],b=0;b<y.length;b++){var w=y[b];w==="."||w===""&&b!==0&&b!==y.length-1||(w===".."?x.pop():x.push(w))}return x.join("/")},o.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":i.nodebuffer&&a.isBuffer(m)?"nodebuffer":i.uint8array&&m instanceof Uint8Array?"uint8array":i.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(m){if(!i[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(m){var y,x,b="";for(x=0;x<(m||"").length;x++)b+="\\x"+((y=m.charCodeAt(x))<16?"0":"")+y.toString(16).toUpperCase();return b},o.delay=function(m,y,x){setImmediate(function(){m.apply(x||null,y||[])})},o.inherits=function(m,y){function x(){}x.prototype=y.prototype,m.prototype=new x},o.extend=function(){var m,y,x={};for(m=0;m<arguments.length;m++)for(y in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],y)&&x[y]===void 0&&(x[y]=arguments[m][y]);return x},o.prepareContent=function(m,y,x,b,w){return l.Promise.resolve(y).then(function(S){return i.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1)&&typeof FileReader<"u"?new l.Promise(function(C,N){var z=new FileReader;z.onload=function(I){C(I.target.result)},z.onerror=function(I){N(I.target.error)},z.readAsArrayBuffer(S)}):S}).then(function(S){var C=o.getTypeOf(S);return C?(C==="arraybuffer"?S=o.transformTo("uint8array",S):C==="string"&&(w?S=s.decode(S):x&&b!==!0&&(S=(function(N){return u(N,i.uint8array?new Uint8Array(N.length):new Array(N.length))})(S))),S):l.Promise.reject(new Error("Can't read the data of '"+m+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,o){var i=n("./reader/readerFor"),s=n("./utils"),a=n("./signature"),l=n("./zipEntry"),c=n("./support");function u(h){this.files=[],this.loadOptions=h}u.prototype={checkSignature:function(h){if(!this.reader.readAndCheckSignature(h)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(p)+", expected "+s.pretty(h)+")")}},isSignature:function(h,p){var d=this.reader.index;this.reader.setIndex(h);var g=this.reader.readString(4)===p;return this.reader.setIndex(d),g},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var h=this.reader.readData(this.zipCommentLength),p=c.uint8array?"uint8array":"array",d=s.transformTo(p,h);this.zipComment=this.loadOptions.decodeFileName(d)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var h,p,d,g=this.zip64EndOfCentralSize-44;0<g;)h=this.reader.readInt(2),p=this.reader.readInt(4),d=this.reader.readData(p),this.zip64ExtensibleData[h]={id:h,length:p,value:d}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var h,p;for(h=0;h<this.files.length;h++)p=this.files[h],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var h;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(h=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(h);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var h=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(h<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(h);var p=h;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(h=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(h),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var d=this.centralDirOffset+this.centralDirSize;this.zip64&&(d+=20,d+=12+this.zip64EndOfCentralSize);var g=p-d;if(0<g)this.isSignature(p,a.CENTRAL_FILE_HEADER)||(this.reader.zero=g);else if(g<0)throw new Error("Corrupted zip: missing "+Math.abs(g)+" bytes.")},prepareReader:function(h){this.reader=i(h)},load:function(h){this.prepareReader(h),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,o){var i=n("./reader/readerFor"),s=n("./utils"),a=n("./compressedObject"),l=n("./crc32"),c=n("./utf8"),u=n("./compressions"),h=n("./support");function p(d,g){this.options=d,this.loadOptions=g}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(d){var g,m;if(d.skip(22),this.fileNameLength=d.readInt(2),m=d.readInt(2),this.fileName=d.readData(this.fileNameLength),d.skip(m),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((g=(function(y){for(var x in u)if(Object.prototype.hasOwnProperty.call(u,x)&&u[x].magic===y)return u[x];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,g,d.readData(this.compressedSize))},readCentralPart:function(d){this.versionMadeBy=d.readInt(2),d.skip(2),this.bitFlag=d.readInt(2),this.compressionMethod=d.readString(2),this.date=d.readDate(),this.crc32=d.readInt(4),this.compressedSize=d.readInt(4),this.uncompressedSize=d.readInt(4);var g=d.readInt(2);if(this.extraFieldsLength=d.readInt(2),this.fileCommentLength=d.readInt(2),this.diskNumberStart=d.readInt(2),this.internalFileAttributes=d.readInt(2),this.externalFileAttributes=d.readInt(4),this.localHeaderOffset=d.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");d.skip(g),this.readExtraFields(d),this.parseZIP64ExtraField(d),this.fileComment=d.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var d=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),d==0&&(this.dosPermissions=63&this.externalFileAttributes),d==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var d=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=d.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=d.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=d.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=d.readInt(4))}},readExtraFields:function(d){var g,m,y,x=d.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});d.index+4<x;)g=d.readInt(2),m=d.readInt(2),y=d.readData(m),this.extraFields[g]={id:g,length:m,value:y};d.setIndex(x)},handleUTF8:function(){var d=h.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var g=this.findExtraFieldUnicodePath();if(g!==null)this.fileNameStr=g;else{var m=s.transformTo(d,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var y=this.findExtraFieldUnicodeComment();if(y!==null)this.fileCommentStr=y;else{var x=s.transformTo(d,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(x)}}},findExtraFieldUnicodePath:function(){var d=this.extraFields[28789];if(d){var g=i(d.value);return g.readInt(1)!==1||l(this.fileName)!==g.readInt(4)?null:c.utf8decode(g.readData(d.length-5))}return null},findExtraFieldUnicodeComment:function(){var d=this.extraFields[25461];if(d){var g=i(d.value);return g.readInt(1)!==1||l(this.fileComment)!==g.readInt(4)?null:c.utf8decode(g.readData(d.length-5))}return null}},r.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,o){function i(g,m,y){this.name=g,this.dir=y.dir,this.date=y.date,this.comment=y.comment,this.unixPermissions=y.unixPermissions,this.dosPermissions=y.dosPermissions,this._data=m,this._dataBinary=y.binary,this.options={compression:y.compression,compressionOptions:y.compressionOptions}}var s=n("./stream/StreamHelper"),a=n("./stream/DataWorker"),l=n("./utf8"),c=n("./compressedObject"),u=n("./stream/GenericWorker");i.prototype={internalStream:function(g){var m=null,y="string";try{if(!g)throw new Error("No output type specified.");var x=(y=g.toLowerCase())==="string"||y==="text";y!=="binarystring"&&y!=="text"||(y="string"),m=this._decompressWorker();var b=!this._dataBinary;b&&!x&&(m=m.pipe(new l.Utf8EncodeWorker)),!b&&x&&(m=m.pipe(new l.Utf8DecodeWorker))}catch(w){(m=new u("error")).error(w)}return new s(m,y,"")},async:function(g,m){return this.internalStream(g).accumulate(m)},nodeStream:function(g,m){return this.internalStream(g||"nodebuffer").toNodejsStream(m)},_compressWorker:function(g,m){if(this._data instanceof c&&this._data.compression.magic===g.magic)return this._data.getCompressedWorker();var y=this._decompressWorker();return this._dataBinary||(y=y.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(y,g,m)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof u?this._data:new a(this._data)}};for(var h=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},d=0;d<h.length;d++)i.prototype[h[d]]=p;r.exports=i},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,o){(function(i){var s,a,l=i.MutationObserver||i.WebKitMutationObserver;if(l){var c=0,u=new l(g),h=i.document.createTextNode("");u.observe(h,{characterData:!0}),s=function(){h.data=c=++c%2}}else if(i.setImmediate||i.MessageChannel===void 0)s="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var m=i.document.createElement("script");m.onreadystatechange=function(){g(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},i.document.documentElement.appendChild(m)}:function(){setTimeout(g,0)};else{var p=new i.MessageChannel;p.port1.onmessage=g,s=function(){p.port2.postMessage(0)}}var d=[];function g(){var m,y;a=!0;for(var x=d.length;x;){for(y=d,d=[],m=-1;++m<x;)y[m]();x=d.length}a=!1}r.exports=function(m){d.push(m)!==1||a||s()}}).call(this,typeof wr<"u"?wr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,o){var i=n("immediate");function s(){}var a={},l=["REJECTED"],c=["FULFILLED"],u=["PENDING"];function h(x){if(typeof x!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,x!==s&&m(this,x)}function p(x,b,w){this.promise=x,typeof b=="function"&&(this.onFulfilled=b,this.callFulfilled=this.otherCallFulfilled),typeof w=="function"&&(this.onRejected=w,this.callRejected=this.otherCallRejected)}function d(x,b,w){i(function(){var S;try{S=b(w)}catch(C){return a.reject(x,C)}S===x?a.reject(x,new TypeError("Cannot resolve promise with itself")):a.resolve(x,S)})}function g(x){var b=x&&x.then;if(x&&(typeof x=="object"||typeof x=="function")&&typeof b=="function")return function(){b.apply(x,arguments)}}function m(x,b){var w=!1;function S(z){w||(w=!0,a.reject(x,z))}function C(z){w||(w=!0,a.resolve(x,z))}var N=y(function(){b(C,S)});N.status==="error"&&S(N.value)}function y(x,b){var w={};try{w.value=x(b),w.status="success"}catch(S){w.status="error",w.value=S}return w}(r.exports=h).prototype.finally=function(x){if(typeof x!="function")return this;var b=this.constructor;return this.then(function(w){return b.resolve(x()).then(function(){return w})},function(w){return b.resolve(x()).then(function(){throw w})})},h.prototype.catch=function(x){return this.then(null,x)},h.prototype.then=function(x,b){if(typeof x!="function"&&this.state===c||typeof b!="function"&&this.state===l)return this;var w=new this.constructor(s);return this.state!==u?d(w,this.state===c?x:b,this.outcome):this.queue.push(new p(w,x,b)),w},p.prototype.callFulfilled=function(x){a.resolve(this.promise,x)},p.prototype.otherCallFulfilled=function(x){d(this.promise,this.onFulfilled,x)},p.prototype.callRejected=function(x){a.reject(this.promise,x)},p.prototype.otherCallRejected=function(x){d(this.promise,this.onRejected,x)},a.resolve=function(x,b){var w=y(g,b);if(w.status==="error")return a.reject(x,w.value);var S=w.value;if(S)m(x,S);else{x.state=c,x.outcome=b;for(var C=-1,N=x.queue.length;++C<N;)x.queue[C].callFulfilled(b)}return x},a.reject=function(x,b){x.state=l,x.outcome=b;for(var w=-1,S=x.queue.length;++w<S;)x.queue[w].callRejected(b);return x},h.resolve=function(x){return x instanceof this?x:a.resolve(new this(s),x)},h.reject=function(x){var b=new this(s);return a.reject(b,x)},h.all=function(x){var b=this;if(Object.prototype.toString.call(x)!=="[object Array]")return this.reject(new TypeError("must be an array"));var w=x.length,S=!1;if(!w)return this.resolve([]);for(var C=new Array(w),N=0,z=-1,I=new this(s);++z<w;)O(x[z],z);return I;function O(P,L){b.resolve(P).then(function(T){C[L]=T,++N!==w||S||(S=!0,a.resolve(I,C))},function(T){S||(S=!0,a.reject(I,T))})}},h.race=function(x){var b=this;if(Object.prototype.toString.call(x)!=="[object Array]")return this.reject(new TypeError("must be an array"));var w=x.length,S=!1;if(!w)return this.resolve([]);for(var C=-1,N=new this(s);++C<w;)z=x[C],b.resolve(z).then(function(I){S||(S=!0,a.resolve(N,I))},function(I){S||(S=!0,a.reject(N,I))});var z;return N}},{immediate:36}],38:[function(n,r,o){var i={};(0,n("./lib/utils/common").assign)(i,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,o){var i=n("./zlib/deflate"),s=n("./utils/common"),a=n("./utils/strings"),l=n("./zlib/messages"),c=n("./zlib/zstream"),u=Object.prototype.toString,h=0,p=-1,d=0,g=8;function m(x){if(!(this instanceof m))return new m(x);this.options=s.assign({level:p,method:g,chunkSize:16384,windowBits:15,memLevel:8,strategy:d,to:""},x||{});var b=this.options;b.raw&&0<b.windowBits?b.windowBits=-b.windowBits:b.gzip&&0<b.windowBits&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var w=i.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(w!==h)throw new Error(l[w]);if(b.header&&i.deflateSetHeader(this.strm,b.header),b.dictionary){var S;if(S=typeof b.dictionary=="string"?a.string2buf(b.dictionary):u.call(b.dictionary)==="[object ArrayBuffer]"?new Uint8Array(b.dictionary):b.dictionary,(w=i.deflateSetDictionary(this.strm,S))!==h)throw new Error(l[w]);this._dict_set=!0}}function y(x,b){var w=new m(b);if(w.push(x,!0),w.err)throw w.msg||l[w.err];return w.result}m.prototype.push=function(x,b){var w,S,C=this.strm,N=this.options.chunkSize;if(this.ended)return!1;S=b===~~b?b:b===!0?4:0,typeof x=="string"?C.input=a.string2buf(x):u.call(x)==="[object ArrayBuffer]"?C.input=new Uint8Array(x):C.input=x,C.next_in=0,C.avail_in=C.input.length;do{if(C.avail_out===0&&(C.output=new s.Buf8(N),C.next_out=0,C.avail_out=N),(w=i.deflate(C,S))!==1&&w!==h)return this.onEnd(w),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(C.output,C.next_out))):this.onData(s.shrinkBuf(C.output,C.next_out)))}while((0<C.avail_in||C.avail_out===0)&&w!==1);return S===4?(w=i.deflateEnd(this.strm),this.onEnd(w),this.ended=!0,w===h):S!==2||(this.onEnd(h),!(C.avail_out=0))},m.prototype.onData=function(x){this.chunks.push(x)},m.prototype.onEnd=function(x){x===h&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=x,this.msg=this.strm.msg},o.Deflate=m,o.deflate=y,o.deflateRaw=function(x,b){return(b=b||{}).raw=!0,y(x,b)},o.gzip=function(x,b){return(b=b||{}).gzip=!0,y(x,b)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,o){var i=n("./zlib/inflate"),s=n("./utils/common"),a=n("./utils/strings"),l=n("./zlib/constants"),c=n("./zlib/messages"),u=n("./zlib/zstream"),h=n("./zlib/gzheader"),p=Object.prototype.toString;function d(m){if(!(this instanceof d))return new d(m);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},m||{});var y=this.options;y.raw&&0<=y.windowBits&&y.windowBits<16&&(y.windowBits=-y.windowBits,y.windowBits===0&&(y.windowBits=-15)),!(0<=y.windowBits&&y.windowBits<16)||m&&m.windowBits||(y.windowBits+=32),15<y.windowBits&&y.windowBits<48&&(15&y.windowBits)==0&&(y.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var x=i.inflateInit2(this.strm,y.windowBits);if(x!==l.Z_OK)throw new Error(c[x]);this.header=new h,i.inflateGetHeader(this.strm,this.header)}function g(m,y){var x=new d(y);if(x.push(m,!0),x.err)throw x.msg||c[x.err];return x.result}d.prototype.push=function(m,y){var x,b,w,S,C,N,z=this.strm,I=this.options.chunkSize,O=this.options.dictionary,P=!1;if(this.ended)return!1;b=y===~~y?y:y===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof m=="string"?z.input=a.binstring2buf(m):p.call(m)==="[object ArrayBuffer]"?z.input=new Uint8Array(m):z.input=m,z.next_in=0,z.avail_in=z.input.length;do{if(z.avail_out===0&&(z.output=new s.Buf8(I),z.next_out=0,z.avail_out=I),(x=i.inflate(z,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&O&&(N=typeof O=="string"?a.string2buf(O):p.call(O)==="[object ArrayBuffer]"?new Uint8Array(O):O,x=i.inflateSetDictionary(this.strm,N)),x===l.Z_BUF_ERROR&&P===!0&&(x=l.Z_OK,P=!1),x!==l.Z_STREAM_END&&x!==l.Z_OK)return this.onEnd(x),!(this.ended=!0);z.next_out&&(z.avail_out!==0&&x!==l.Z_STREAM_END&&(z.avail_in!==0||b!==l.Z_FINISH&&b!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(w=a.utf8border(z.output,z.next_out),S=z.next_out-w,C=a.buf2string(z.output,w),z.next_out=S,z.avail_out=I-S,S&&s.arraySet(z.output,z.output,w,S,0),this.onData(C)):this.onData(s.shrinkBuf(z.output,z.next_out)))),z.avail_in===0&&z.avail_out===0&&(P=!0)}while((0<z.avail_in||z.avail_out===0)&&x!==l.Z_STREAM_END);return x===l.Z_STREAM_END&&(b=l.Z_FINISH),b===l.Z_FINISH?(x=i.inflateEnd(this.strm),this.onEnd(x),this.ended=!0,x===l.Z_OK):b!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(z.avail_out=0))},d.prototype.onData=function(m){this.chunks.push(m)},d.prototype.onEnd=function(m){m===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg},o.Inflate=d,o.inflate=g,o.inflateRaw=function(m,y){return(y=y||{}).raw=!0,g(m,y)},o.ungzip=g},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var u=c.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(var h in u)u.hasOwnProperty(h)&&(l[h]=u[h])}}return l},o.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var s={arraySet:function(l,c,u,h,p){if(c.subarray&&l.subarray)l.set(c.subarray(u,u+h),p);else for(var d=0;d<h;d++)l[p+d]=c[u+d]},flattenChunks:function(l){var c,u,h,p,d,g;for(c=h=0,u=l.length;c<u;c++)h+=l[c].length;for(g=new Uint8Array(h),c=p=0,u=l.length;c<u;c++)d=l[c],g.set(d,p),p+=d.length;return g}},a={arraySet:function(l,c,u,h,p){for(var d=0;d<h;d++)l[p+d]=c[u+d]},flattenChunks:function(l){return[].concat.apply([],l)}};o.setTyped=function(l){l?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,s)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,a))},o.setTyped(i)},{}],42:[function(n,r,o){var i=n("./common"),s=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var l=new i.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function u(h,p){if(p<65537&&(h.subarray&&a||!h.subarray&&s))return String.fromCharCode.apply(null,i.shrinkBuf(h,p));for(var d="",g=0;g<p;g++)d+=String.fromCharCode(h[g]);return d}l[254]=l[254]=1,o.string2buf=function(h){var p,d,g,m,y,x=h.length,b=0;for(m=0;m<x;m++)(64512&(d=h.charCodeAt(m)))==55296&&m+1<x&&(64512&(g=h.charCodeAt(m+1)))==56320&&(d=65536+(d-55296<<10)+(g-56320),m++),b+=d<128?1:d<2048?2:d<65536?3:4;for(p=new i.Buf8(b),m=y=0;y<b;m++)(64512&(d=h.charCodeAt(m)))==55296&&m+1<x&&(64512&(g=h.charCodeAt(m+1)))==56320&&(d=65536+(d-55296<<10)+(g-56320),m++),d<128?p[y++]=d:(d<2048?p[y++]=192|d>>>6:(d<65536?p[y++]=224|d>>>12:(p[y++]=240|d>>>18,p[y++]=128|d>>>12&63),p[y++]=128|d>>>6&63),p[y++]=128|63&d);return p},o.buf2binstring=function(h){return u(h,h.length)},o.binstring2buf=function(h){for(var p=new i.Buf8(h.length),d=0,g=p.length;d<g;d++)p[d]=h.charCodeAt(d);return p},o.buf2string=function(h,p){var d,g,m,y,x=p||h.length,b=new Array(2*x);for(d=g=0;d<x;)if((m=h[d++])<128)b[g++]=m;else if(4<(y=l[m]))b[g++]=65533,d+=y-1;else{for(m&=y===2?31:y===3?15:7;1<y&&d<x;)m=m<<6|63&h[d++],y--;1<y?b[g++]=65533:m<65536?b[g++]=m:(m-=65536,b[g++]=55296|m>>10&1023,b[g++]=56320|1023&m)}return u(b,g)},o.utf8border=function(h,p){var d;for((p=p||h.length)>h.length&&(p=h.length),d=p-1;0<=d&&(192&h[d])==128;)d--;return d<0||d===0?p:d+l[h[d]]>p?d:p}},{"./common":41}],43:[function(n,r,o){r.exports=function(i,s,a,l){for(var c=65535&i|0,u=i>>>16&65535|0,h=0;a!==0;){for(a-=h=2e3<a?2e3:a;u=u+(c=c+s[l++]|0)|0,--h;);c%=65521,u%=65521}return c|u<<16|0}},{}],44:[function(n,r,o){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(n,r,o){var i=(function(){for(var s,a=[],l=0;l<256;l++){s=l;for(var c=0;c<8;c++)s=1&s?3988292384^s>>>1:s>>>1;a[l]=s}return a})();r.exports=function(s,a,l,c){var u=i,h=c+l;s^=-1;for(var p=c;p<h;p++)s=s>>>8^u[255&(s^a[p])];return-1^s}},{}],46:[function(n,r,o){var i,s=n("../utils/common"),a=n("./trees"),l=n("./adler32"),c=n("./crc32"),u=n("./messages"),h=0,p=4,d=0,g=-2,m=-1,y=4,x=2,b=8,w=9,S=286,C=30,N=19,z=2*S+1,I=15,O=3,P=258,L=P+O+1,T=42,M=113,_=1,D=2,G=3,Z=4;function te(k,J){return k.msg=u[J],J}function q(k){return(k<<1)-(4<k?9:0)}function E(k){for(var J=k.length;0<=--J;)k[J]=0}function U(k){var J=k.state,V=J.pending;V>k.avail_out&&(V=k.avail_out),V!==0&&(s.arraySet(k.output,J.pending_buf,J.pending_out,V,k.next_out),k.next_out+=V,J.pending_out+=V,k.total_out+=V,k.avail_out-=V,J.pending-=V,J.pending===0&&(J.pending_out=0))}function B(k,J){a._tr_flush_block(k,0<=k.block_start?k.block_start:-1,k.strstart-k.block_start,J),k.block_start=k.strstart,U(k.strm)}function j(k,J){k.pending_buf[k.pending++]=J}function Y(k,J){k.pending_buf[k.pending++]=J>>>8&255,k.pending_buf[k.pending++]=255&J}function H(k,J){var V,R,A=k.max_chain_length,F=k.strstart,Q=k.prev_length,ne=k.nice_match,W=k.strstart>k.w_size-L?k.strstart-(k.w_size-L):0,se=k.window,fe=k.w_mask,ae=k.prev,$=k.strstart+P,ee=se[F+Q-1],ue=se[F+Q];k.prev_length>=k.good_match&&(A>>=2),ne>k.lookahead&&(ne=k.lookahead);do if(se[(V=J)+Q]===ue&&se[V+Q-1]===ee&&se[V]===se[F]&&se[++V]===se[F+1]){F+=2,V++;do;while(se[++F]===se[++V]&&se[++F]===se[++V]&&se[++F]===se[++V]&&se[++F]===se[++V]&&se[++F]===se[++V]&&se[++F]===se[++V]&&se[++F]===se[++V]&&se[++F]===se[++V]&&F<$);if(R=P-($-F),F=$-P,Q<R){if(k.match_start=J,ne<=(Q=R))break;ee=se[F+Q-1],ue=se[F+Q]}}while((J=ae[J&fe])>W&&--A!=0);return Q<=k.lookahead?Q:k.lookahead}function ce(k){var J,V,R,A,F,Q,ne,W,se,fe,ae=k.w_size;do{if(A=k.window_size-k.lookahead-k.strstart,k.strstart>=ae+(ae-L)){for(s.arraySet(k.window,k.window,ae,ae,0),k.match_start-=ae,k.strstart-=ae,k.block_start-=ae,J=V=k.hash_size;R=k.head[--J],k.head[J]=ae<=R?R-ae:0,--V;);for(J=V=ae;R=k.prev[--J],k.prev[J]=ae<=R?R-ae:0,--V;);A+=ae}if(k.strm.avail_in===0)break;if(Q=k.strm,ne=k.window,W=k.strstart+k.lookahead,se=A,fe=void 0,fe=Q.avail_in,se<fe&&(fe=se),V=fe===0?0:(Q.avail_in-=fe,s.arraySet(ne,Q.input,Q.next_in,fe,W),Q.state.wrap===1?Q.adler=l(Q.adler,ne,fe,W):Q.state.wrap===2&&(Q.adler=c(Q.adler,ne,fe,W)),Q.next_in+=fe,Q.total_in+=fe,fe),k.lookahead+=V,k.lookahead+k.insert>=O)for(F=k.strstart-k.insert,k.ins_h=k.window[F],k.ins_h=(k.ins_h<<k.hash_shift^k.window[F+1])&k.hash_mask;k.insert&&(k.ins_h=(k.ins_h<<k.hash_shift^k.window[F+O-1])&k.hash_mask,k.prev[F&k.w_mask]=k.head[k.ins_h],k.head[k.ins_h]=F,F++,k.insert--,!(k.lookahead+k.insert<O)););}while(k.lookahead<L&&k.strm.avail_in!==0)}function ie(k,J){for(var V,R;;){if(k.lookahead<L){if(ce(k),k.lookahead<L&&J===h)return _;if(k.lookahead===0)break}if(V=0,k.lookahead>=O&&(k.ins_h=(k.ins_h<<k.hash_shift^k.window[k.strstart+O-1])&k.hash_mask,V=k.prev[k.strstart&k.w_mask]=k.head[k.ins_h],k.head[k.ins_h]=k.strstart),V!==0&&k.strstart-V<=k.w_size-L&&(k.match_length=H(k,V)),k.match_length>=O)if(R=a._tr_tally(k,k.strstart-k.match_start,k.match_length-O),k.lookahead-=k.match_length,k.match_length<=k.max_lazy_match&&k.lookahead>=O){for(k.match_length--;k.strstart++,k.ins_h=(k.ins_h<<k.hash_shift^k.window[k.strstart+O-1])&k.hash_mask,V=k.prev[k.strstart&k.w_mask]=k.head[k.ins_h],k.head[k.ins_h]=k.strstart,--k.match_length!=0;);k.strstart++}else k.strstart+=k.match_length,k.match_length=0,k.ins_h=k.window[k.strstart],k.ins_h=(k.ins_h<<k.hash_shift^k.window[k.strstart+1])&k.hash_mask;else R=a._tr_tally(k,0,k.window[k.strstart]),k.lookahead--,k.strstart++;if(R&&(B(k,!1),k.strm.avail_out===0))return _}return k.insert=k.strstart<O-1?k.strstart:O-1,J===p?(B(k,!0),k.strm.avail_out===0?G:Z):k.last_lit&&(B(k,!1),k.strm.avail_out===0)?_:D}function re(k,J){for(var V,R,A;;){if(k.lookahead<L){if(ce(k),k.lookahead<L&&J===h)return _;if(k.lookahead===0)break}if(V=0,k.lookahead>=O&&(k.ins_h=(k.ins_h<<k.hash_shift^k.window[k.strstart+O-1])&k.hash_mask,V=k.prev[k.strstart&k.w_mask]=k.head[k.ins_h],k.head[k.ins_h]=k.strstart),k.prev_length=k.match_length,k.prev_match=k.match_start,k.match_length=O-1,V!==0&&k.prev_length<k.max_lazy_match&&k.strstart-V<=k.w_size-L&&(k.match_length=H(k,V),k.match_length<=5&&(k.strategy===1||k.match_length===O&&4096<k.strstart-k.match_start)&&(k.match_length=O-1)),k.prev_length>=O&&k.match_length<=k.prev_length){for(A=k.strstart+k.lookahead-O,R=a._tr_tally(k,k.strstart-1-k.prev_match,k.prev_length-O),k.lookahead-=k.prev_length-1,k.prev_length-=2;++k.strstart<=A&&(k.ins_h=(k.ins_h<<k.hash_shift^k.window[k.strstart+O-1])&k.hash_mask,V=k.prev[k.strstart&k.w_mask]=k.head[k.ins_h],k.head[k.ins_h]=k.strstart),--k.prev_length!=0;);if(k.match_available=0,k.match_length=O-1,k.strstart++,R&&(B(k,!1),k.strm.avail_out===0))return _}else if(k.match_available){if((R=a._tr_tally(k,0,k.window[k.strstart-1]))&&B(k,!1),k.strstart++,k.lookahead--,k.strm.avail_out===0)return _}else k.match_available=1,k.strstart++,k.lookahead--}return k.match_available&&(R=a._tr_tally(k,0,k.window[k.strstart-1]),k.match_available=0),k.insert=k.strstart<O-1?k.strstart:O-1,J===p?(B(k,!0),k.strm.avail_out===0?G:Z):k.last_lit&&(B(k,!1),k.strm.avail_out===0)?_:D}function le(k,J,V,R,A){this.good_length=k,this.max_lazy=J,this.nice_length=V,this.max_chain=R,this.func=A}function me(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=b,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*z),this.dyn_dtree=new s.Buf16(2*(2*C+1)),this.bl_tree=new s.Buf16(2*(2*N+1)),E(this.dyn_ltree),E(this.dyn_dtree),E(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(I+1),this.heap=new s.Buf16(2*S+1),E(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*S+1),E(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function xe(k){var J;return k&&k.state?(k.total_in=k.total_out=0,k.data_type=x,(J=k.state).pending=0,J.pending_out=0,J.wrap<0&&(J.wrap=-J.wrap),J.status=J.wrap?T:M,k.adler=J.wrap===2?0:1,J.last_flush=h,a._tr_init(J),d):te(k,g)}function Te(k){var J=xe(k);return J===d&&(function(V){V.window_size=2*V.w_size,E(V.head),V.max_lazy_match=i[V.level].max_lazy,V.good_match=i[V.level].good_length,V.nice_match=i[V.level].nice_length,V.max_chain_length=i[V.level].max_chain,V.strstart=0,V.block_start=0,V.lookahead=0,V.insert=0,V.match_length=V.prev_length=O-1,V.match_available=0,V.ins_h=0})(k.state),J}function Pe(k,J,V,R,A,F){if(!k)return g;var Q=1;if(J===m&&(J=6),R<0?(Q=0,R=-R):15<R&&(Q=2,R-=16),A<1||w<A||V!==b||R<8||15<R||J<0||9<J||F<0||y<F)return te(k,g);R===8&&(R=9);var ne=new me;return(k.state=ne).strm=k,ne.wrap=Q,ne.gzhead=null,ne.w_bits=R,ne.w_size=1<<ne.w_bits,ne.w_mask=ne.w_size-1,ne.hash_bits=A+7,ne.hash_size=1<<ne.hash_bits,ne.hash_mask=ne.hash_size-1,ne.hash_shift=~~((ne.hash_bits+O-1)/O),ne.window=new s.Buf8(2*ne.w_size),ne.head=new s.Buf16(ne.hash_size),ne.prev=new s.Buf16(ne.w_size),ne.lit_bufsize=1<<A+6,ne.pending_buf_size=4*ne.lit_bufsize,ne.pending_buf=new s.Buf8(ne.pending_buf_size),ne.d_buf=1*ne.lit_bufsize,ne.l_buf=3*ne.lit_bufsize,ne.level=J,ne.strategy=F,ne.method=V,Te(k)}i=[new le(0,0,0,0,function(k,J){var V=65535;for(V>k.pending_buf_size-5&&(V=k.pending_buf_size-5);;){if(k.lookahead<=1){if(ce(k),k.lookahead===0&&J===h)return _;if(k.lookahead===0)break}k.strstart+=k.lookahead,k.lookahead=0;var R=k.block_start+V;if((k.strstart===0||k.strstart>=R)&&(k.lookahead=k.strstart-R,k.strstart=R,B(k,!1),k.strm.avail_out===0)||k.strstart-k.block_start>=k.w_size-L&&(B(k,!1),k.strm.avail_out===0))return _}return k.insert=0,J===p?(B(k,!0),k.strm.avail_out===0?G:Z):(k.strstart>k.block_start&&(B(k,!1),k.strm.avail_out),_)}),new le(4,4,8,4,ie),new le(4,5,16,8,ie),new le(4,6,32,32,ie),new le(4,4,16,16,re),new le(8,16,32,32,re),new le(8,16,128,128,re),new le(8,32,128,256,re),new le(32,128,258,1024,re),new le(32,258,258,4096,re)],o.deflateInit=function(k,J){return Pe(k,J,b,15,8,0)},o.deflateInit2=Pe,o.deflateReset=Te,o.deflateResetKeep=xe,o.deflateSetHeader=function(k,J){return k&&k.state?k.state.wrap!==2?g:(k.state.gzhead=J,d):g},o.deflate=function(k,J){var V,R,A,F;if(!k||!k.state||5<J||J<0)return k?te(k,g):g;if(R=k.state,!k.output||!k.input&&k.avail_in!==0||R.status===666&&J!==p)return te(k,k.avail_out===0?-5:g);if(R.strm=k,V=R.last_flush,R.last_flush=J,R.status===T)if(R.wrap===2)k.adler=0,j(R,31),j(R,139),j(R,8),R.gzhead?(j(R,(R.gzhead.text?1:0)+(R.gzhead.hcrc?2:0)+(R.gzhead.extra?4:0)+(R.gzhead.name?8:0)+(R.gzhead.comment?16:0)),j(R,255&R.gzhead.time),j(R,R.gzhead.time>>8&255),j(R,R.gzhead.time>>16&255),j(R,R.gzhead.time>>24&255),j(R,R.level===9?2:2<=R.strategy||R.level<2?4:0),j(R,255&R.gzhead.os),R.gzhead.extra&&R.gzhead.extra.length&&(j(R,255&R.gzhead.extra.length),j(R,R.gzhead.extra.length>>8&255)),R.gzhead.hcrc&&(k.adler=c(k.adler,R.pending_buf,R.pending,0)),R.gzindex=0,R.status=69):(j(R,0),j(R,0),j(R,0),j(R,0),j(R,0),j(R,R.level===9?2:2<=R.strategy||R.level<2?4:0),j(R,3),R.status=M);else{var Q=b+(R.w_bits-8<<4)<<8;Q|=(2<=R.strategy||R.level<2?0:R.level<6?1:R.level===6?2:3)<<6,R.strstart!==0&&(Q|=32),Q+=31-Q%31,R.status=M,Y(R,Q),R.strstart!==0&&(Y(R,k.adler>>>16),Y(R,65535&k.adler)),k.adler=1}if(R.status===69)if(R.gzhead.extra){for(A=R.pending;R.gzindex<(65535&R.gzhead.extra.length)&&(R.pending!==R.pending_buf_size||(R.gzhead.hcrc&&R.pending>A&&(k.adler=c(k.adler,R.pending_buf,R.pending-A,A)),U(k),A=R.pending,R.pending!==R.pending_buf_size));)j(R,255&R.gzhead.extra[R.gzindex]),R.gzindex++;R.gzhead.hcrc&&R.pending>A&&(k.adler=c(k.adler,R.pending_buf,R.pending-A,A)),R.gzindex===R.gzhead.extra.length&&(R.gzindex=0,R.status=73)}else R.status=73;if(R.status===73)if(R.gzhead.name){A=R.pending;do{if(R.pending===R.pending_buf_size&&(R.gzhead.hcrc&&R.pending>A&&(k.adler=c(k.adler,R.pending_buf,R.pending-A,A)),U(k),A=R.pending,R.pending===R.pending_buf_size)){F=1;break}F=R.gzindex<R.gzhead.name.length?255&R.gzhead.name.charCodeAt(R.gzindex++):0,j(R,F)}while(F!==0);R.gzhead.hcrc&&R.pending>A&&(k.adler=c(k.adler,R.pending_buf,R.pending-A,A)),F===0&&(R.gzindex=0,R.status=91)}else R.status=91;if(R.status===91)if(R.gzhead.comment){A=R.pending;do{if(R.pending===R.pending_buf_size&&(R.gzhead.hcrc&&R.pending>A&&(k.adler=c(k.adler,R.pending_buf,R.pending-A,A)),U(k),A=R.pending,R.pending===R.pending_buf_size)){F=1;break}F=R.gzindex<R.gzhead.comment.length?255&R.gzhead.comment.charCodeAt(R.gzindex++):0,j(R,F)}while(F!==0);R.gzhead.hcrc&&R.pending>A&&(k.adler=c(k.adler,R.pending_buf,R.pending-A,A)),F===0&&(R.status=103)}else R.status=103;if(R.status===103&&(R.gzhead.hcrc?(R.pending+2>R.pending_buf_size&&U(k),R.pending+2<=R.pending_buf_size&&(j(R,255&k.adler),j(R,k.adler>>8&255),k.adler=0,R.status=M)):R.status=M),R.pending!==0){if(U(k),k.avail_out===0)return R.last_flush=-1,d}else if(k.avail_in===0&&q(J)<=q(V)&&J!==p)return te(k,-5);if(R.status===666&&k.avail_in!==0)return te(k,-5);if(k.avail_in!==0||R.lookahead!==0||J!==h&&R.status!==666){var ne=R.strategy===2?(function(W,se){for(var fe;;){if(W.lookahead===0&&(ce(W),W.lookahead===0)){if(se===h)return _;break}if(W.match_length=0,fe=a._tr_tally(W,0,W.window[W.strstart]),W.lookahead--,W.strstart++,fe&&(B(W,!1),W.strm.avail_out===0))return _}return W.insert=0,se===p?(B(W,!0),W.strm.avail_out===0?G:Z):W.last_lit&&(B(W,!1),W.strm.avail_out===0)?_:D})(R,J):R.strategy===3?(function(W,se){for(var fe,ae,$,ee,ue=W.window;;){if(W.lookahead<=P){if(ce(W),W.lookahead<=P&&se===h)return _;if(W.lookahead===0)break}if(W.match_length=0,W.lookahead>=O&&0<W.strstart&&(ae=ue[$=W.strstart-1])===ue[++$]&&ae===ue[++$]&&ae===ue[++$]){ee=W.strstart+P;do;while(ae===ue[++$]&&ae===ue[++$]&&ae===ue[++$]&&ae===ue[++$]&&ae===ue[++$]&&ae===ue[++$]&&ae===ue[++$]&&ae===ue[++$]&&$<ee);W.match_length=P-(ee-$),W.match_length>W.lookahead&&(W.match_length=W.lookahead)}if(W.match_length>=O?(fe=a._tr_tally(W,1,W.match_length-O),W.lookahead-=W.match_length,W.strstart+=W.match_length,W.match_length=0):(fe=a._tr_tally(W,0,W.window[W.strstart]),W.lookahead--,W.strstart++),fe&&(B(W,!1),W.strm.avail_out===0))return _}return W.insert=0,se===p?(B(W,!0),W.strm.avail_out===0?G:Z):W.last_lit&&(B(W,!1),W.strm.avail_out===0)?_:D})(R,J):i[R.level].func(R,J);if(ne!==G&&ne!==Z||(R.status=666),ne===_||ne===G)return k.avail_out===0&&(R.last_flush=-1),d;if(ne===D&&(J===1?a._tr_align(R):J!==5&&(a._tr_stored_block(R,0,0,!1),J===3&&(E(R.head),R.lookahead===0&&(R.strstart=0,R.block_start=0,R.insert=0))),U(k),k.avail_out===0))return R.last_flush=-1,d}return J!==p?d:R.wrap<=0?1:(R.wrap===2?(j(R,255&k.adler),j(R,k.adler>>8&255),j(R,k.adler>>16&255),j(R,k.adler>>24&255),j(R,255&k.total_in),j(R,k.total_in>>8&255),j(R,k.total_in>>16&255),j(R,k.total_in>>24&255)):(Y(R,k.adler>>>16),Y(R,65535&k.adler)),U(k),0<R.wrap&&(R.wrap=-R.wrap),R.pending!==0?d:1)},o.deflateEnd=function(k){var J;return k&&k.state?(J=k.state.status)!==T&&J!==69&&J!==73&&J!==91&&J!==103&&J!==M&&J!==666?te(k,g):(k.state=null,J===M?te(k,-3):d):g},o.deflateSetDictionary=function(k,J){var V,R,A,F,Q,ne,W,se,fe=J.length;if(!k||!k.state||(F=(V=k.state).wrap)===2||F===1&&V.status!==T||V.lookahead)return g;for(F===1&&(k.adler=l(k.adler,J,fe,0)),V.wrap=0,fe>=V.w_size&&(F===0&&(E(V.head),V.strstart=0,V.block_start=0,V.insert=0),se=new s.Buf8(V.w_size),s.arraySet(se,J,fe-V.w_size,V.w_size,0),J=se,fe=V.w_size),Q=k.avail_in,ne=k.next_in,W=k.input,k.avail_in=fe,k.next_in=0,k.input=J,ce(V);V.lookahead>=O;){for(R=V.strstart,A=V.lookahead-(O-1);V.ins_h=(V.ins_h<<V.hash_shift^V.window[R+O-1])&V.hash_mask,V.prev[R&V.w_mask]=V.head[V.ins_h],V.head[V.ins_h]=R,R++,--A;);V.strstart=R,V.lookahead=O-1,ce(V)}return V.strstart+=V.lookahead,V.block_start=V.strstart,V.insert=V.lookahead,V.lookahead=0,V.match_length=V.prev_length=O-1,V.match_available=0,k.next_in=ne,k.input=W,k.avail_in=Q,V.wrap=F,d},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,o){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(n,r,o){r.exports=function(i,s){var a,l,c,u,h,p,d,g,m,y,x,b,w,S,C,N,z,I,O,P,L,T,M,_,D;a=i.state,l=i.next_in,_=i.input,c=l+(i.avail_in-5),u=i.next_out,D=i.output,h=u-(s-i.avail_out),p=u+(i.avail_out-257),d=a.dmax,g=a.wsize,m=a.whave,y=a.wnext,x=a.window,b=a.hold,w=a.bits,S=a.lencode,C=a.distcode,N=(1<<a.lenbits)-1,z=(1<<a.distbits)-1;e:do{w<15&&(b+=_[l++]<<w,w+=8,b+=_[l++]<<w,w+=8),I=S[b&N];t:for(;;){if(b>>>=O=I>>>24,w-=O,(O=I>>>16&255)===0)D[u++]=65535&I;else{if(!(16&O)){if((64&O)==0){I=S[(65535&I)+(b&(1<<O)-1)];continue t}if(32&O){a.mode=12;break e}i.msg="invalid literal/length code",a.mode=30;break e}P=65535&I,(O&=15)&&(w<O&&(b+=_[l++]<<w,w+=8),P+=b&(1<<O)-1,b>>>=O,w-=O),w<15&&(b+=_[l++]<<w,w+=8,b+=_[l++]<<w,w+=8),I=C[b&z];n:for(;;){if(b>>>=O=I>>>24,w-=O,!(16&(O=I>>>16&255))){if((64&O)==0){I=C[(65535&I)+(b&(1<<O)-1)];continue n}i.msg="invalid distance code",a.mode=30;break e}if(L=65535&I,w<(O&=15)&&(b+=_[l++]<<w,(w+=8)<O&&(b+=_[l++]<<w,w+=8)),d<(L+=b&(1<<O)-1)){i.msg="invalid distance too far back",a.mode=30;break e}if(b>>>=O,w-=O,(O=u-h)<L){if(m<(O=L-O)&&a.sane){i.msg="invalid distance too far back",a.mode=30;break e}if(M=x,(T=0)===y){if(T+=g-O,O<P){for(P-=O;D[u++]=x[T++],--O;);T=u-L,M=D}}else if(y<O){if(T+=g+y-O,(O-=y)<P){for(P-=O;D[u++]=x[T++],--O;);if(T=0,y<P){for(P-=O=y;D[u++]=x[T++],--O;);T=u-L,M=D}}}else if(T+=y-O,O<P){for(P-=O;D[u++]=x[T++],--O;);T=u-L,M=D}for(;2<P;)D[u++]=M[T++],D[u++]=M[T++],D[u++]=M[T++],P-=3;P&&(D[u++]=M[T++],1<P&&(D[u++]=M[T++]))}else{for(T=u-L;D[u++]=D[T++],D[u++]=D[T++],D[u++]=D[T++],2<(P-=3););P&&(D[u++]=D[T++],1<P&&(D[u++]=D[T++]))}break}}break}}while(l<c&&u<p);l-=P=w>>3,b&=(1<<(w-=P<<3))-1,i.next_in=l,i.next_out=u,i.avail_in=l<c?c-l+5:5-(l-c),i.avail_out=u<p?p-u+257:257-(u-p),a.hold=b,a.bits=w}},{}],49:[function(n,r,o){var i=n("../utils/common"),s=n("./adler32"),a=n("./crc32"),l=n("./inffast"),c=n("./inftrees"),u=1,h=2,p=0,d=-2,g=1,m=852,y=592;function x(T){return(T>>>24&255)+(T>>>8&65280)+((65280&T)<<8)+((255&T)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function w(T){var M;return T&&T.state?(M=T.state,T.total_in=T.total_out=M.total=0,T.msg="",M.wrap&&(T.adler=1&M.wrap),M.mode=g,M.last=0,M.havedict=0,M.dmax=32768,M.head=null,M.hold=0,M.bits=0,M.lencode=M.lendyn=new i.Buf32(m),M.distcode=M.distdyn=new i.Buf32(y),M.sane=1,M.back=-1,p):d}function S(T){var M;return T&&T.state?((M=T.state).wsize=0,M.whave=0,M.wnext=0,w(T)):d}function C(T,M){var _,D;return T&&T.state?(D=T.state,M<0?(_=0,M=-M):(_=1+(M>>4),M<48&&(M&=15)),M&&(M<8||15<M)?d:(D.window!==null&&D.wbits!==M&&(D.window=null),D.wrap=_,D.wbits=M,S(T))):d}function N(T,M){var _,D;return T?(D=new b,(T.state=D).window=null,(_=C(T,M))!==p&&(T.state=null),_):d}var z,I,O=!0;function P(T){if(O){var M;for(z=new i.Buf32(512),I=new i.Buf32(32),M=0;M<144;)T.lens[M++]=8;for(;M<256;)T.lens[M++]=9;for(;M<280;)T.lens[M++]=7;for(;M<288;)T.lens[M++]=8;for(c(u,T.lens,0,288,z,0,T.work,{bits:9}),M=0;M<32;)T.lens[M++]=5;c(h,T.lens,0,32,I,0,T.work,{bits:5}),O=!1}T.lencode=z,T.lenbits=9,T.distcode=I,T.distbits=5}function L(T,M,_,D){var G,Z=T.state;return Z.window===null&&(Z.wsize=1<<Z.wbits,Z.wnext=0,Z.whave=0,Z.window=new i.Buf8(Z.wsize)),D>=Z.wsize?(i.arraySet(Z.window,M,_-Z.wsize,Z.wsize,0),Z.wnext=0,Z.whave=Z.wsize):(D<(G=Z.wsize-Z.wnext)&&(G=D),i.arraySet(Z.window,M,_-D,G,Z.wnext),(D-=G)?(i.arraySet(Z.window,M,_-D,D,0),Z.wnext=D,Z.whave=Z.wsize):(Z.wnext+=G,Z.wnext===Z.wsize&&(Z.wnext=0),Z.whave<Z.wsize&&(Z.whave+=G))),0}o.inflateReset=S,o.inflateReset2=C,o.inflateResetKeep=w,o.inflateInit=function(T){return N(T,15)},o.inflateInit2=N,o.inflate=function(T,M){var _,D,G,Z,te,q,E,U,B,j,Y,H,ce,ie,re,le,me,xe,Te,Pe,k,J,V,R,A=0,F=new i.Buf8(4),Q=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!T||!T.state||!T.output||!T.input&&T.avail_in!==0)return d;(_=T.state).mode===12&&(_.mode=13),te=T.next_out,G=T.output,E=T.avail_out,Z=T.next_in,D=T.input,q=T.avail_in,U=_.hold,B=_.bits,j=q,Y=E,J=p;e:for(;;)switch(_.mode){case g:if(_.wrap===0){_.mode=13;break}for(;B<16;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(2&_.wrap&&U===35615){F[_.check=0]=255&U,F[1]=U>>>8&255,_.check=a(_.check,F,2,0),B=U=0,_.mode=2;break}if(_.flags=0,_.head&&(_.head.done=!1),!(1&_.wrap)||(((255&U)<<8)+(U>>8))%31){T.msg="incorrect header check",_.mode=30;break}if((15&U)!=8){T.msg="unknown compression method",_.mode=30;break}if(B-=4,k=8+(15&(U>>>=4)),_.wbits===0)_.wbits=k;else if(k>_.wbits){T.msg="invalid window size",_.mode=30;break}_.dmax=1<<k,T.adler=_.check=1,_.mode=512&U?10:12,B=U=0;break;case 2:for(;B<16;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(_.flags=U,(255&_.flags)!=8){T.msg="unknown compression method",_.mode=30;break}if(57344&_.flags){T.msg="unknown header flags set",_.mode=30;break}_.head&&(_.head.text=U>>8&1),512&_.flags&&(F[0]=255&U,F[1]=U>>>8&255,_.check=a(_.check,F,2,0)),B=U=0,_.mode=3;case 3:for(;B<32;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}_.head&&(_.head.time=U),512&_.flags&&(F[0]=255&U,F[1]=U>>>8&255,F[2]=U>>>16&255,F[3]=U>>>24&255,_.check=a(_.check,F,4,0)),B=U=0,_.mode=4;case 4:for(;B<16;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}_.head&&(_.head.xflags=255&U,_.head.os=U>>8),512&_.flags&&(F[0]=255&U,F[1]=U>>>8&255,_.check=a(_.check,F,2,0)),B=U=0,_.mode=5;case 5:if(1024&_.flags){for(;B<16;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}_.length=U,_.head&&(_.head.extra_len=U),512&_.flags&&(F[0]=255&U,F[1]=U>>>8&255,_.check=a(_.check,F,2,0)),B=U=0}else _.head&&(_.head.extra=null);_.mode=6;case 6:if(1024&_.flags&&(q<(H=_.length)&&(H=q),H&&(_.head&&(k=_.head.extra_len-_.length,_.head.extra||(_.head.extra=new Array(_.head.extra_len)),i.arraySet(_.head.extra,D,Z,H,k)),512&_.flags&&(_.check=a(_.check,D,H,Z)),q-=H,Z+=H,_.length-=H),_.length))break e;_.length=0,_.mode=7;case 7:if(2048&_.flags){if(q===0)break e;for(H=0;k=D[Z+H++],_.head&&k&&_.length<65536&&(_.head.name+=String.fromCharCode(k)),k&&H<q;);if(512&_.flags&&(_.check=a(_.check,D,H,Z)),q-=H,Z+=H,k)break e}else _.head&&(_.head.name=null);_.length=0,_.mode=8;case 8:if(4096&_.flags){if(q===0)break e;for(H=0;k=D[Z+H++],_.head&&k&&_.length<65536&&(_.head.comment+=String.fromCharCode(k)),k&&H<q;);if(512&_.flags&&(_.check=a(_.check,D,H,Z)),q-=H,Z+=H,k)break e}else _.head&&(_.head.comment=null);_.mode=9;case 9:if(512&_.flags){for(;B<16;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(U!==(65535&_.check)){T.msg="header crc mismatch",_.mode=30;break}B=U=0}_.head&&(_.head.hcrc=_.flags>>9&1,_.head.done=!0),T.adler=_.check=0,_.mode=12;break;case 10:for(;B<32;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}T.adler=_.check=x(U),B=U=0,_.mode=11;case 11:if(_.havedict===0)return T.next_out=te,T.avail_out=E,T.next_in=Z,T.avail_in=q,_.hold=U,_.bits=B,2;T.adler=_.check=1,_.mode=12;case 12:if(M===5||M===6)break e;case 13:if(_.last){U>>>=7&B,B-=7&B,_.mode=27;break}for(;B<3;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}switch(_.last=1&U,B-=1,3&(U>>>=1)){case 0:_.mode=14;break;case 1:if(P(_),_.mode=20,M!==6)break;U>>>=2,B-=2;break e;case 2:_.mode=17;break;case 3:T.msg="invalid block type",_.mode=30}U>>>=2,B-=2;break;case 14:for(U>>>=7&B,B-=7&B;B<32;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if((65535&U)!=(U>>>16^65535)){T.msg="invalid stored block lengths",_.mode=30;break}if(_.length=65535&U,B=U=0,_.mode=15,M===6)break e;case 15:_.mode=16;case 16:if(H=_.length){if(q<H&&(H=q),E<H&&(H=E),H===0)break e;i.arraySet(G,D,Z,H,te),q-=H,Z+=H,E-=H,te+=H,_.length-=H;break}_.mode=12;break;case 17:for(;B<14;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(_.nlen=257+(31&U),U>>>=5,B-=5,_.ndist=1+(31&U),U>>>=5,B-=5,_.ncode=4+(15&U),U>>>=4,B-=4,286<_.nlen||30<_.ndist){T.msg="too many length or distance symbols",_.mode=30;break}_.have=0,_.mode=18;case 18:for(;_.have<_.ncode;){for(;B<3;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}_.lens[Q[_.have++]]=7&U,U>>>=3,B-=3}for(;_.have<19;)_.lens[Q[_.have++]]=0;if(_.lencode=_.lendyn,_.lenbits=7,V={bits:_.lenbits},J=c(0,_.lens,0,19,_.lencode,0,_.work,V),_.lenbits=V.bits,J){T.msg="invalid code lengths set",_.mode=30;break}_.have=0,_.mode=19;case 19:for(;_.have<_.nlen+_.ndist;){for(;le=(A=_.lencode[U&(1<<_.lenbits)-1])>>>16&255,me=65535&A,!((re=A>>>24)<=B);){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(me<16)U>>>=re,B-=re,_.lens[_.have++]=me;else{if(me===16){for(R=re+2;B<R;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(U>>>=re,B-=re,_.have===0){T.msg="invalid bit length repeat",_.mode=30;break}k=_.lens[_.have-1],H=3+(3&U),U>>>=2,B-=2}else if(me===17){for(R=re+3;B<R;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}B-=re,k=0,H=3+(7&(U>>>=re)),U>>>=3,B-=3}else{for(R=re+7;B<R;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}B-=re,k=0,H=11+(127&(U>>>=re)),U>>>=7,B-=7}if(_.have+H>_.nlen+_.ndist){T.msg="invalid bit length repeat",_.mode=30;break}for(;H--;)_.lens[_.have++]=k}}if(_.mode===30)break;if(_.lens[256]===0){T.msg="invalid code -- missing end-of-block",_.mode=30;break}if(_.lenbits=9,V={bits:_.lenbits},J=c(u,_.lens,0,_.nlen,_.lencode,0,_.work,V),_.lenbits=V.bits,J){T.msg="invalid literal/lengths set",_.mode=30;break}if(_.distbits=6,_.distcode=_.distdyn,V={bits:_.distbits},J=c(h,_.lens,_.nlen,_.ndist,_.distcode,0,_.work,V),_.distbits=V.bits,J){T.msg="invalid distances set",_.mode=30;break}if(_.mode=20,M===6)break e;case 20:_.mode=21;case 21:if(6<=q&&258<=E){T.next_out=te,T.avail_out=E,T.next_in=Z,T.avail_in=q,_.hold=U,_.bits=B,l(T,Y),te=T.next_out,G=T.output,E=T.avail_out,Z=T.next_in,D=T.input,q=T.avail_in,U=_.hold,B=_.bits,_.mode===12&&(_.back=-1);break}for(_.back=0;le=(A=_.lencode[U&(1<<_.lenbits)-1])>>>16&255,me=65535&A,!((re=A>>>24)<=B);){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(le&&(240&le)==0){for(xe=re,Te=le,Pe=me;le=(A=_.lencode[Pe+((U&(1<<xe+Te)-1)>>xe)])>>>16&255,me=65535&A,!(xe+(re=A>>>24)<=B);){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}U>>>=xe,B-=xe,_.back+=xe}if(U>>>=re,B-=re,_.back+=re,_.length=me,le===0){_.mode=26;break}if(32&le){_.back=-1,_.mode=12;break}if(64&le){T.msg="invalid literal/length code",_.mode=30;break}_.extra=15&le,_.mode=22;case 22:if(_.extra){for(R=_.extra;B<R;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}_.length+=U&(1<<_.extra)-1,U>>>=_.extra,B-=_.extra,_.back+=_.extra}_.was=_.length,_.mode=23;case 23:for(;le=(A=_.distcode[U&(1<<_.distbits)-1])>>>16&255,me=65535&A,!((re=A>>>24)<=B);){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if((240&le)==0){for(xe=re,Te=le,Pe=me;le=(A=_.distcode[Pe+((U&(1<<xe+Te)-1)>>xe)])>>>16&255,me=65535&A,!(xe+(re=A>>>24)<=B);){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}U>>>=xe,B-=xe,_.back+=xe}if(U>>>=re,B-=re,_.back+=re,64&le){T.msg="invalid distance code",_.mode=30;break}_.offset=me,_.extra=15&le,_.mode=24;case 24:if(_.extra){for(R=_.extra;B<R;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}_.offset+=U&(1<<_.extra)-1,U>>>=_.extra,B-=_.extra,_.back+=_.extra}if(_.offset>_.dmax){T.msg="invalid distance too far back",_.mode=30;break}_.mode=25;case 25:if(E===0)break e;if(H=Y-E,_.offset>H){if((H=_.offset-H)>_.whave&&_.sane){T.msg="invalid distance too far back",_.mode=30;break}ce=H>_.wnext?(H-=_.wnext,_.wsize-H):_.wnext-H,H>_.length&&(H=_.length),ie=_.window}else ie=G,ce=te-_.offset,H=_.length;for(E<H&&(H=E),E-=H,_.length-=H;G[te++]=ie[ce++],--H;);_.length===0&&(_.mode=21);break;case 26:if(E===0)break e;G[te++]=_.length,E--,_.mode=21;break;case 27:if(_.wrap){for(;B<32;){if(q===0)break e;q--,U|=D[Z++]<<B,B+=8}if(Y-=E,T.total_out+=Y,_.total+=Y,Y&&(T.adler=_.check=_.flags?a(_.check,G,Y,te-Y):s(_.check,G,Y,te-Y)),Y=E,(_.flags?U:x(U))!==_.check){T.msg="incorrect data check",_.mode=30;break}B=U=0}_.mode=28;case 28:if(_.wrap&&_.flags){for(;B<32;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(U!==(4294967295&_.total)){T.msg="incorrect length check",_.mode=30;break}B=U=0}_.mode=29;case 29:J=1;break e;case 30:J=-3;break e;case 31:return-4;default:return d}return T.next_out=te,T.avail_out=E,T.next_in=Z,T.avail_in=q,_.hold=U,_.bits=B,(_.wsize||Y!==T.avail_out&&_.mode<30&&(_.mode<27||M!==4))&&L(T,T.output,T.next_out,Y-T.avail_out)?(_.mode=31,-4):(j-=T.avail_in,Y-=T.avail_out,T.total_in+=j,T.total_out+=Y,_.total+=Y,_.wrap&&Y&&(T.adler=_.check=_.flags?a(_.check,G,Y,T.next_out-Y):s(_.check,G,Y,T.next_out-Y)),T.data_type=_.bits+(_.last?64:0)+(_.mode===12?128:0)+(_.mode===20||_.mode===15?256:0),(j==0&&Y===0||M===4)&&J===p&&(J=-5),J)},o.inflateEnd=function(T){if(!T||!T.state)return d;var M=T.state;return M.window&&(M.window=null),T.state=null,p},o.inflateGetHeader=function(T,M){var _;return T&&T.state?(2&(_=T.state).wrap)==0?d:((_.head=M).done=!1,p):d},o.inflateSetDictionary=function(T,M){var _,D=M.length;return T&&T.state?(_=T.state).wrap!==0&&_.mode!==11?d:_.mode===11&&s(1,M,D,0)!==_.check?-3:L(T,M,D,D)?(_.mode=31,-4):(_.havedict=1,p):d},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,o){var i=n("../utils/common"),s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(u,h,p,d,g,m,y,x){var b,w,S,C,N,z,I,O,P,L=x.bits,T=0,M=0,_=0,D=0,G=0,Z=0,te=0,q=0,E=0,U=0,B=null,j=0,Y=new i.Buf16(16),H=new i.Buf16(16),ce=null,ie=0;for(T=0;T<=15;T++)Y[T]=0;for(M=0;M<d;M++)Y[h[p+M]]++;for(G=L,D=15;1<=D&&Y[D]===0;D--);if(D<G&&(G=D),D===0)return g[m++]=20971520,g[m++]=20971520,x.bits=1,0;for(_=1;_<D&&Y[_]===0;_++);for(G<_&&(G=_),T=q=1;T<=15;T++)if(q<<=1,(q-=Y[T])<0)return-1;if(0<q&&(u===0||D!==1))return-1;for(H[1]=0,T=1;T<15;T++)H[T+1]=H[T]+Y[T];for(M=0;M<d;M++)h[p+M]!==0&&(y[H[h[p+M]]++]=M);if(z=u===0?(B=ce=y,19):u===1?(B=s,j-=257,ce=a,ie-=257,256):(B=l,ce=c,-1),T=_,N=m,te=M=U=0,S=-1,C=(E=1<<(Z=G))-1,u===1&&852<E||u===2&&592<E)return 1;for(;;){for(I=T-te,P=y[M]<z?(O=0,y[M]):y[M]>z?(O=ce[ie+y[M]],B[j+y[M]]):(O=96,0),b=1<<T-te,_=w=1<<Z;g[N+(U>>te)+(w-=b)]=I<<24|O<<16|P|0,w!==0;);for(b=1<<T-1;U&b;)b>>=1;if(b!==0?(U&=b-1,U+=b):U=0,M++,--Y[T]==0){if(T===D)break;T=h[p+y[M]]}if(G<T&&(U&C)!==S){for(te===0&&(te=G),N+=_,q=1<<(Z=T-te);Z+te<D&&!((q-=Y[Z+te])<=0);)Z++,q<<=1;if(E+=1<<Z,u===1&&852<E||u===2&&592<E)return 1;g[S=U&C]=G<<24|Z<<16|N-m|0}}return U!==0&&(g[N+U]=T-te<<24|64<<16|0),x.bits=G,0}},{"../utils/common":41}],51:[function(n,r,o){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(n,r,o){var i=n("../utils/common"),s=0,a=1;function l(A){for(var F=A.length;0<=--F;)A[F]=0}var c=0,u=29,h=256,p=h+1+u,d=30,g=19,m=2*p+1,y=15,x=16,b=7,w=256,S=16,C=17,N=18,z=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],I=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],O=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],L=new Array(2*(p+2));l(L);var T=new Array(2*d);l(T);var M=new Array(512);l(M);var _=new Array(256);l(_);var D=new Array(u);l(D);var G,Z,te,q=new Array(d);function E(A,F,Q,ne,W){this.static_tree=A,this.extra_bits=F,this.extra_base=Q,this.elems=ne,this.max_length=W,this.has_stree=A&&A.length}function U(A,F){this.dyn_tree=A,this.max_code=0,this.stat_desc=F}function B(A){return A<256?M[A]:M[256+(A>>>7)]}function j(A,F){A.pending_buf[A.pending++]=255&F,A.pending_buf[A.pending++]=F>>>8&255}function Y(A,F,Q){A.bi_valid>x-Q?(A.bi_buf|=F<<A.bi_valid&65535,j(A,A.bi_buf),A.bi_buf=F>>x-A.bi_valid,A.bi_valid+=Q-x):(A.bi_buf|=F<<A.bi_valid&65535,A.bi_valid+=Q)}function H(A,F,Q){Y(A,Q[2*F],Q[2*F+1])}function ce(A,F){for(var Q=0;Q|=1&A,A>>>=1,Q<<=1,0<--F;);return Q>>>1}function ie(A,F,Q){var ne,W,se=new Array(y+1),fe=0;for(ne=1;ne<=y;ne++)se[ne]=fe=fe+Q[ne-1]<<1;for(W=0;W<=F;W++){var ae=A[2*W+1];ae!==0&&(A[2*W]=ce(se[ae]++,ae))}}function re(A){var F;for(F=0;F<p;F++)A.dyn_ltree[2*F]=0;for(F=0;F<d;F++)A.dyn_dtree[2*F]=0;for(F=0;F<g;F++)A.bl_tree[2*F]=0;A.dyn_ltree[2*w]=1,A.opt_len=A.static_len=0,A.last_lit=A.matches=0}function le(A){8<A.bi_valid?j(A,A.bi_buf):0<A.bi_valid&&(A.pending_buf[A.pending++]=A.bi_buf),A.bi_buf=0,A.bi_valid=0}function me(A,F,Q,ne){var W=2*F,se=2*Q;return A[W]<A[se]||A[W]===A[se]&&ne[F]<=ne[Q]}function xe(A,F,Q){for(var ne=A.heap[Q],W=Q<<1;W<=A.heap_len&&(W<A.heap_len&&me(F,A.heap[W+1],A.heap[W],A.depth)&&W++,!me(F,ne,A.heap[W],A.depth));)A.heap[Q]=A.heap[W],Q=W,W<<=1;A.heap[Q]=ne}function Te(A,F,Q){var ne,W,se,fe,ae=0;if(A.last_lit!==0)for(;ne=A.pending_buf[A.d_buf+2*ae]<<8|A.pending_buf[A.d_buf+2*ae+1],W=A.pending_buf[A.l_buf+ae],ae++,ne===0?H(A,W,F):(H(A,(se=_[W])+h+1,F),(fe=z[se])!==0&&Y(A,W-=D[se],fe),H(A,se=B(--ne),Q),(fe=I[se])!==0&&Y(A,ne-=q[se],fe)),ae<A.last_lit;);H(A,w,F)}function Pe(A,F){var Q,ne,W,se=F.dyn_tree,fe=F.stat_desc.static_tree,ae=F.stat_desc.has_stree,$=F.stat_desc.elems,ee=-1;for(A.heap_len=0,A.heap_max=m,Q=0;Q<$;Q++)se[2*Q]!==0?(A.heap[++A.heap_len]=ee=Q,A.depth[Q]=0):se[2*Q+1]=0;for(;A.heap_len<2;)se[2*(W=A.heap[++A.heap_len]=ee<2?++ee:0)]=1,A.depth[W]=0,A.opt_len--,ae&&(A.static_len-=fe[2*W+1]);for(F.max_code=ee,Q=A.heap_len>>1;1<=Q;Q--)xe(A,se,Q);for(W=$;Q=A.heap[1],A.heap[1]=A.heap[A.heap_len--],xe(A,se,1),ne=A.heap[1],A.heap[--A.heap_max]=Q,A.heap[--A.heap_max]=ne,se[2*W]=se[2*Q]+se[2*ne],A.depth[W]=(A.depth[Q]>=A.depth[ne]?A.depth[Q]:A.depth[ne])+1,se[2*Q+1]=se[2*ne+1]=W,A.heap[1]=W++,xe(A,se,1),2<=A.heap_len;);A.heap[--A.heap_max]=A.heap[1],(function(ue,be){var ze,Ze,it,Ae,_t,Pt,$e=be.dyn_tree,Ot=be.max_code,xt=be.stat_desc.static_tree,Bh=be.stat_desc.has_stree,Uh=be.stat_desc.extra_bits,Js=be.stat_desc.extra_base,Hn=be.stat_desc.max_length,vr=0;for(Ae=0;Ae<=y;Ae++)ue.bl_count[Ae]=0;for($e[2*ue.heap[ue.heap_max]+1]=0,ze=ue.heap_max+1;ze<m;ze++)Hn<(Ae=$e[2*$e[2*(Ze=ue.heap[ze])+1]+1]+1)&&(Ae=Hn,vr++),$e[2*Ze+1]=Ae,Ot<Ze||(ue.bl_count[Ae]++,_t=0,Js<=Ze&&(_t=Uh[Ze-Js]),Pt=$e[2*Ze],ue.opt_len+=Pt*(Ae+_t),Bh&&(ue.static_len+=Pt*(xt[2*Ze+1]+_t)));if(vr!==0){do{for(Ae=Hn-1;ue.bl_count[Ae]===0;)Ae--;ue.bl_count[Ae]--,ue.bl_count[Ae+1]+=2,ue.bl_count[Hn]--,vr-=2}while(0<vr);for(Ae=Hn;Ae!==0;Ae--)for(Ze=ue.bl_count[Ae];Ze!==0;)Ot<(it=ue.heap[--ze])||($e[2*it+1]!==Ae&&(ue.opt_len+=(Ae-$e[2*it+1])*$e[2*it],$e[2*it+1]=Ae),Ze--)}})(A,F),ie(se,ee,A.bl_count)}function k(A,F,Q){var ne,W,se=-1,fe=F[1],ae=0,$=7,ee=4;for(fe===0&&($=138,ee=3),F[2*(Q+1)+1]=65535,ne=0;ne<=Q;ne++)W=fe,fe=F[2*(ne+1)+1],++ae<$&&W===fe||(ae<ee?A.bl_tree[2*W]+=ae:W!==0?(W!==se&&A.bl_tree[2*W]++,A.bl_tree[2*S]++):ae<=10?A.bl_tree[2*C]++:A.bl_tree[2*N]++,se=W,ee=(ae=0)===fe?($=138,3):W===fe?($=6,3):($=7,4))}function J(A,F,Q){var ne,W,se=-1,fe=F[1],ae=0,$=7,ee=4;for(fe===0&&($=138,ee=3),ne=0;ne<=Q;ne++)if(W=fe,fe=F[2*(ne+1)+1],!(++ae<$&&W===fe)){if(ae<ee)for(;H(A,W,A.bl_tree),--ae!=0;);else W!==0?(W!==se&&(H(A,W,A.bl_tree),ae--),H(A,S,A.bl_tree),Y(A,ae-3,2)):ae<=10?(H(A,C,A.bl_tree),Y(A,ae-3,3)):(H(A,N,A.bl_tree),Y(A,ae-11,7));se=W,ee=(ae=0)===fe?($=138,3):W===fe?($=6,3):($=7,4)}}l(q);var V=!1;function R(A,F,Q,ne){Y(A,(c<<1)+(ne?1:0),3),(function(W,se,fe,ae){le(W),j(W,fe),j(W,~fe),i.arraySet(W.pending_buf,W.window,se,fe,W.pending),W.pending+=fe})(A,F,Q)}o._tr_init=function(A){V||((function(){var F,Q,ne,W,se,fe=new Array(y+1);for(W=ne=0;W<u-1;W++)for(D[W]=ne,F=0;F<1<<z[W];F++)_[ne++]=W;for(_[ne-1]=W,W=se=0;W<16;W++)for(q[W]=se,F=0;F<1<<I[W];F++)M[se++]=W;for(se>>=7;W<d;W++)for(q[W]=se<<7,F=0;F<1<<I[W]-7;F++)M[256+se++]=W;for(Q=0;Q<=y;Q++)fe[Q]=0;for(F=0;F<=143;)L[2*F+1]=8,F++,fe[8]++;for(;F<=255;)L[2*F+1]=9,F++,fe[9]++;for(;F<=279;)L[2*F+1]=7,F++,fe[7]++;for(;F<=287;)L[2*F+1]=8,F++,fe[8]++;for(ie(L,p+1,fe),F=0;F<d;F++)T[2*F+1]=5,T[2*F]=ce(F,5);G=new E(L,z,h+1,p,y),Z=new E(T,I,0,d,y),te=new E(new Array(0),O,0,g,b)})(),V=!0),A.l_desc=new U(A.dyn_ltree,G),A.d_desc=new U(A.dyn_dtree,Z),A.bl_desc=new U(A.bl_tree,te),A.bi_buf=0,A.bi_valid=0,re(A)},o._tr_stored_block=R,o._tr_flush_block=function(A,F,Q,ne){var W,se,fe=0;0<A.level?(A.strm.data_type===2&&(A.strm.data_type=(function(ae){var $,ee=4093624447;for($=0;$<=31;$++,ee>>>=1)if(1&ee&&ae.dyn_ltree[2*$]!==0)return s;if(ae.dyn_ltree[18]!==0||ae.dyn_ltree[20]!==0||ae.dyn_ltree[26]!==0)return a;for($=32;$<h;$++)if(ae.dyn_ltree[2*$]!==0)return a;return s})(A)),Pe(A,A.l_desc),Pe(A,A.d_desc),fe=(function(ae){var $;for(k(ae,ae.dyn_ltree,ae.l_desc.max_code),k(ae,ae.dyn_dtree,ae.d_desc.max_code),Pe(ae,ae.bl_desc),$=g-1;3<=$&&ae.bl_tree[2*P[$]+1]===0;$--);return ae.opt_len+=3*($+1)+5+5+4,$})(A),W=A.opt_len+3+7>>>3,(se=A.static_len+3+7>>>3)<=W&&(W=se)):W=se=Q+5,Q+4<=W&&F!==-1?R(A,F,Q,ne):A.strategy===4||se===W?(Y(A,2+(ne?1:0),3),Te(A,L,T)):(Y(A,4+(ne?1:0),3),(function(ae,$,ee,ue){var be;for(Y(ae,$-257,5),Y(ae,ee-1,5),Y(ae,ue-4,4),be=0;be<ue;be++)Y(ae,ae.bl_tree[2*P[be]+1],3);J(ae,ae.dyn_ltree,$-1),J(ae,ae.dyn_dtree,ee-1)})(A,A.l_desc.max_code+1,A.d_desc.max_code+1,fe+1),Te(A,A.dyn_ltree,A.dyn_dtree)),re(A),ne&&le(A)},o._tr_tally=function(A,F,Q){return A.pending_buf[A.d_buf+2*A.last_lit]=F>>>8&255,A.pending_buf[A.d_buf+2*A.last_lit+1]=255&F,A.pending_buf[A.l_buf+A.last_lit]=255&Q,A.last_lit++,F===0?A.dyn_ltree[2*Q]++:(A.matches++,F--,A.dyn_ltree[2*(_[Q]+h+1)]++,A.dyn_dtree[2*B(F)]++),A.last_lit===A.lit_bufsize-1},o._tr_align=function(A){Y(A,2,3),H(A,w,L),(function(F){F.bi_valid===16?(j(F,F.bi_buf),F.bi_buf=0,F.bi_valid=0):8<=F.bi_valid&&(F.pending_buf[F.pending++]=255&F.bi_buf,F.bi_buf>>=8,F.bi_valid-=8)})(A)}},{"../utils/common":41}],53:[function(n,r,o){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,o){(function(i){(function(s,a){if(!s.setImmediate){var l,c,u,h,p=1,d={},g=!1,m=s.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(s);y=y&&y.setTimeout?y:s,l={}.toString.call(s.process)==="[object process]"?function(S){process.nextTick(function(){b(S)})}:(function(){if(s.postMessage&&!s.importScripts){var S=!0,C=s.onmessage;return s.onmessage=function(){S=!1},s.postMessage("","*"),s.onmessage=C,S}})()?(h="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",w,!1):s.attachEvent("onmessage",w),function(S){s.postMessage(h+S,"*")}):s.MessageChannel?((u=new MessageChannel).port1.onmessage=function(S){b(S.data)},function(S){u.port2.postMessage(S)}):m&&"onreadystatechange"in m.createElement("script")?(c=m.documentElement,function(S){var C=m.createElement("script");C.onreadystatechange=function(){b(S),C.onreadystatechange=null,c.removeChild(C),C=null},c.appendChild(C)}):function(S){setTimeout(b,0,S)},y.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var C=new Array(arguments.length-1),N=0;N<C.length;N++)C[N]=arguments[N+1];var z={callback:S,args:C};return d[p]=z,l(p),p++},y.clearImmediate=x}function x(S){delete d[S]}function b(S){if(g)setTimeout(b,0,S);else{var C=d[S];if(C){g=!0;try{(function(N){var z=N.callback,I=N.args;switch(I.length){case 0:z();break;case 1:z(I[0]);break;case 2:z(I[0],I[1]);break;case 3:z(I[0],I[1],I[2]);break;default:z.apply(a,I)}})(C)}finally{x(S),g=!1}}}}function w(S){S.source===s&&typeof S.data=="string"&&S.data.indexOf(h)===0&&b(+S.data.slice(h.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof wr<"u"?wr:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Lo)),Lo.exports}var lv=av();const cv=qi(lv);async function uv(e){try{const t=await fetch(`/api/logs/${e}/chunks`);if(!t.ok)return null;const n=await t.json();return JSON.stringify(n,null,2)}catch{return null}}async function dv(e){const t=new cv;for(const s of e)s.rawRequestBody!==null&&t.file(`#${s.id}.Request.json`,s.rawRequestBody),s.responseText!==null&&t.file(`#${s.id}.Response.json`,s.responseText);const n=e.filter(s=>s.streaming);await Promise.allSettled(n.map(async s=>{const a=await uv(s.id);a!==null&&t.file(`#${s.id}.SSE.Response.json`,a)}));const r=await t.generateAsync({type:"blob"}),o=URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=`llm-inspector-export-${new Date().toISOString().slice(0,10)}.zip`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o)}const fv="1.11.4",hv={version:fv};function cu(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=cu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function uu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=cu(e))&&(r&&(r+=" "),r+=t);return r}const pv=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},mv=(e,t)=>({classGroupId:e,validator:t}),du=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),qr="-",Na=[],gv="arbitrary..",xv=e=>{const t=bv(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return yv(s);const a=s.split(qr),l=a[0]===""&&a.length>1?1:0;return fu(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=r[s],c=n[s];return l?c?pv(c,l):l:c||Na}return n[s]||Na}}},fu=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],i=n.nextPart.get(o);if(i){const c=fu(e,t+1,i);if(c)return c}const s=n.validators;if(s===null)return;const a=t===0?e.join(qr):e.slice(t).join(qr),l=s.length;for(let c=0;c<l;c++){const u=s[c];if(u.validator(a))return u.classGroupId}},yv=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?gv+r:void 0})(),bv=e=>{const{theme:t,classGroups:n}=e;return vv(n,t)},vv=(e,t)=>{const n=du();for(const r in e){const o=e[r];is(o,n,r,t)}return n},is=(e,t,n,r)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];wv(s,t,n,r)}},wv=(e,t,n,r)=>{if(typeof e=="string"){_v(e,t,n);return}if(typeof e=="function"){kv(e,t,n,r);return}Sv(e,t,n,r)},_v=(e,t,n)=>{const r=e===""?t:hu(t,e);r.classGroupId=n},kv=(e,t,n,r)=>{if(Cv(e)){is(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(mv(n,e))},Sv=(e,t,n,r)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];is(l,hu(t,a),n,r)}},hu=(e,t)=>{let n=e;const r=t.split(qr),o=r.length;for(let i=0;i<o;i++){const s=r[i];let a=n.nextPart.get(s);a||(a=du(),n.nextPart.set(s,a)),n=a}return n},Cv=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Ev=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(i,s)=>{n[i]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let s=n[i];if(s!==void 0)return s;if((s=r[i])!==void 0)return o(i,s),s},set(i,s){i in n?n[i]=s:o(i,s)}}},vi="!",Ta=":",Nv=[],ja=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Tv=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const i=[];let s=0,a=0,l=0,c;const u=o.length;for(let m=0;m<u;m++){const y=o[m];if(s===0&&a===0){if(y===Ta){i.push(o.slice(l,m)),l=m+1;continue}if(y==="/"){c=m;continue}}y==="["?s++:y==="]"?s--:y==="("?a++:y===")"&&a--}const h=i.length===0?o:o.slice(l);let p=h,d=!1;h.endsWith(vi)?(p=h.slice(0,-1),d=!0):h.startsWith(vi)&&(p=h.slice(1),d=!0);const g=c&&c>l?c-l:void 0;return ja(i,d,p,g)};if(t){const o=t+Ta,i=r;r=s=>s.startsWith(o)?i(s.slice(o.length)):ja(Nv,!1,s,void 0,!0)}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},jv=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let i=0;i<n.length;i++){const s=n[i],a=s[0]==="[",l=t.has(s);a||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(s)):o.push(s)}return o.length>0&&(o.sort(),r.push(...o)),r}},zv=e=>({cache:Ev(e.cacheSize),parseClassName:Tv(e),sortModifiers:jv(e),postfixLookupClassGroupIds:Av(e),...xv(e)}),Av=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},Iv=/\s+/,Rv=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i,postfixLookupClassGroupIds:s}=t,a=[],l=e.trim().split(Iv);let c="";for(let u=l.length-1;u>=0;u-=1){const h=l[u],{isExternal:p,modifiers:d,hasImportantModifier:g,baseClassName:m,maybePostfixModifierPosition:y}=n(h);if(p){c=h+(c.length>0?" "+c:c);continue}let x=!!y,b;if(x){const z=m.substring(0,y);b=r(z);const I=b&&s[b]?r(m):void 0;I&&I!==b&&(b=I,x=!1)}else b=r(m);if(!b){if(!x){c=h+(c.length>0?" "+c:c);continue}if(b=r(m),!b){c=h+(c.length>0?" "+c:c);continue}x=!1}const w=d.length===0?"":d.length===1?d[0]:i(d).join(":"),S=g?w+vi:w,C=S+b;if(a.indexOf(C)>-1)continue;a.push(C);const N=o(b,x);for(let z=0;z<N.length;++z){const I=N[z];a.push(S+I)}c=h+(c.length>0?" "+c:c)}return c},Pv=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=pu(n))&&(o&&(o+=" "),o+=r);return o},pu=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=pu(e[r]))&&(n&&(n+=" "),n+=t);return n},Ov=(e,...t)=>{let n,r,o,i;const s=l=>{const c=t.reduce((u,h)=>h(u),e());return n=zv(c),r=n.cache.get,o=n.cache.set,i=a,a(l)},a=l=>{const c=r(l);if(c)return c;const u=Rv(l,n);return o(l,u),u};return i=s,(...l)=>i(Pv(...l))},Dv=[],He=e=>{const t=n=>n[e]||Dv;return t.isThemeGetter=!0,t},mu=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,gu=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Mv=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Lv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,$v=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Bv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Uv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Zt=e=>Mv.test(e),Ee=e=>!!e&&!Number.isNaN(Number(e)),kt=e=>!!e&&Number.isInteger(Number(e)),Fo=e=>e.endsWith("%")&&Ee(e.slice(0,-1)),Dt=e=>Lv.test(e),xu=()=>!0,Zv=e=>Fv.test(e)&&!$v.test(e),ss=()=>!1,Wv=e=>Bv.test(e),Vv=e=>Uv.test(e),Hv=e=>!he(e)&&!pe(e),qv=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)),Gv=e=>Xt(e,vu,ss),he=e=>mu.test(e),nn=e=>Xt(e,wu,Zv),za=e=>Xt(e,n1,Ee),Kv=e=>Xt(e,ku,xu),Jv=e=>Xt(e,_u,ss),Aa=e=>Xt(e,yu,ss),Yv=e=>Xt(e,bu,Vv),Er=e=>Xt(e,Su,Wv),pe=e=>gu.test(e),Gn=e=>pn(e,wu),Xv=e=>pn(e,_u),Ia=e=>pn(e,yu),Qv=e=>pn(e,vu),e1=e=>pn(e,bu),Nr=e=>pn(e,Su,!0),t1=e=>pn(e,ku,!0),Xt=(e,t,n)=>{const r=mu.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},pn=(e,t,n=!1)=>{const r=gu.exec(e);return r?r[1]?t(r[1]):n:!1},yu=e=>e==="position"||e==="percentage",bu=e=>e==="image"||e==="url",vu=e=>e==="length"||e==="size"||e==="bg-size",wu=e=>e==="length",n1=e=>e==="number",_u=e=>e==="family-name",ku=e=>e==="number"||e==="weight",Su=e=>e==="shadow",r1=()=>{const e=He("color"),t=He("font"),n=He("text"),r=He("font-weight"),o=He("tracking"),i=He("leading"),s=He("breakpoint"),a=He("container"),l=He("spacing"),c=He("radius"),u=He("shadow"),h=He("inset-shadow"),p=He("text-shadow"),d=He("drop-shadow"),g=He("blur"),m=He("perspective"),y=He("aspect"),x=He("ease"),b=He("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...S(),pe,he],N=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],I=()=>[pe,he,l],O=()=>[Zt,"full","auto",...I()],P=()=>[kt,"none","subgrid",pe,he],L=()=>["auto",{span:["full",kt,pe,he]},kt,pe,he],T=()=>[kt,"auto",pe,he],M=()=>["auto","min","max","fr",pe,he],_=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],D=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...I()],Z=()=>[Zt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],te=()=>[Zt,"screen","full","dvw","lvw","svw","min","max","fit",...I()],q=()=>[Zt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],E=()=>[e,pe,he],U=()=>[...S(),Ia,Aa,{position:[pe,he]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],j=()=>["auto","cover","contain",Qv,Gv,{size:[pe,he]}],Y=()=>[Fo,Gn,nn],H=()=>["","none","full",c,pe,he],ce=()=>["",Ee,Gn,nn],ie=()=>["solid","dashed","dotted","double"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[Ee,Fo,Ia,Aa],me=()=>["","none",g,pe,he],xe=()=>["none",Ee,pe,he],Te=()=>["none",Ee,pe,he],Pe=()=>[Ee,pe,he],k=()=>[Zt,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Dt],breakpoint:[Dt],color:[xu],container:[Dt],"drop-shadow":[Dt],ease:["in","out","in-out"],font:[Hv],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Dt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Dt],shadow:[Dt],spacing:["px",Ee],text:[Dt],"text-shadow":[Dt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Zt,he,pe,y]}],container:["container"],"container-type":[{"@container":["","normal","size",pe,he]}],"container-named":[qv],columns:[{columns:[Ee,he,pe,a]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"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:C()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[kt,"auto",pe,he]}],basis:[{basis:[Zt,"full","auto",a,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ee,Zt,"auto","initial","none",he]}],grow:[{grow:["",Ee,pe,he]}],shrink:[{shrink:["",Ee,pe,he]}],order:[{order:[kt,"first","last","none",pe,he]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[..._(),"normal"]}],"justify-items":[{"justify-items":[...D(),"normal"]}],"justify-self":[{"justify-self":["auto",...D()]}],"align-content":[{content:["normal",..._()]}],"align-items":[{items:[...D(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...D(),{baseline:["","last"]}]}],"place-content":[{"place-content":_()}],"place-items":[{"place-items":[...D(),"baseline"]}],"place-self":[{"place-self":["auto",...D()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...te()]}],"min-inline-size":[{"min-inline":["auto",...te()]}],"max-inline-size":[{"max-inline":["none",...te()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[a,"screen",...Z()]}],"min-w":[{"min-w":[a,"screen","none",...Z()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",n,Gn,nn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,t1,Kv]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Fo,he]}],"font-family":[{font:[Xv,Jv,t]}],"font-features":[{"font-features":[he]}],"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:[o,pe,he]}],"line-clamp":[{"line-clamp":[Ee,"none",pe,za]}],leading:[{leading:[i,...I()]}],"list-image":[{"list-image":["none",pe,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ee,"from-font","auto",pe,nn]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[Ee,"auto",pe,he]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"tab-size":[{tab:[kt,pe,he]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe,he]}],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",pe,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:j()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},kt,pe,he],radial:["",pe,he],conic:[kt,pe,he]},e1,Yv]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ie(),"hidden","none"]}],"divide-style":[{divide:[...ie(),"hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-bs":[{"border-bs":E()}],"border-color-be":[{"border-be":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...ie(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ee,pe,he]}],"outline-w":[{outline:["",Ee,Gn,nn]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",u,Nr,Er]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",h,Nr,Er]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[Ee,nn]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",p,Nr,Er]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[Ee,pe,he]}],"mix-blend":[{"mix-blend":[...re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":re()}],"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":[Ee]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[pe,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"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":S()}],"mask-image-conic-pos":[{"mask-conic":[Ee]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:j()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,he]}],filter:[{filter:["","none",pe,he]}],blur:[{blur:me()}],brightness:[{brightness:[Ee,pe,he]}],contrast:[{contrast:[Ee,pe,he]}],"drop-shadow":[{"drop-shadow":["","none",d,Nr,Er]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",Ee,pe,he]}],"hue-rotate":[{"hue-rotate":[Ee,pe,he]}],invert:[{invert:["",Ee,pe,he]}],saturate:[{saturate:[Ee,pe,he]}],sepia:[{sepia:["",Ee,pe,he]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,he]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[Ee,pe,he]}],"backdrop-contrast":[{"backdrop-contrast":[Ee,pe,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ee,pe,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ee,pe,he]}],"backdrop-invert":[{"backdrop-invert":["",Ee,pe,he]}],"backdrop-opacity":[{"backdrop-opacity":[Ee,pe,he]}],"backdrop-saturate":[{"backdrop-saturate":[Ee,pe,he]}],"backdrop-sepia":[{"backdrop-sepia":["",Ee,pe,he]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pe,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ee,"initial",pe,he]}],ease:[{ease:["linear","initial",x,pe,he]}],delay:[{delay:[Ee,pe,he]}],animate:[{animate:["none",b,pe,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,pe,he]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:xe()}],"rotate-x":[{"rotate-x":xe()}],"rotate-y":[{"rotate-y":xe()}],"rotate-z":[{"rotate-z":xe()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:Pe()}],"skew-x":[{"skew-x":Pe()}],"skew-y":[{"skew-y":Pe()}],transform:[{transform:[pe,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:k()}],"translate-x":[{"translate-x":k()}],"translate-y":[{"translate-y":k()}],"translate-z":[{"translate-z":k()}],"translate-none":["translate-none"],zoom:[{zoom:[kt,pe,he]}],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"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",pe,he]}],"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":E()}],"scrollbar-track-color":[{"scrollbar-track":E()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",pe,he]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[Ee,Gn,nn,za]}],stroke:[{stroke:["none",...E()]}],"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":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},o1=Ov(r1);function Se(...e){return o1(uu(e))}function Je(e){return e>=1048576?(e/1048576).toFixed(1).replace(/\.0$/,"")+"M":e>=1024?(e/1024).toFixed(1).replace(/\.0$/,"")+"K":e.toString()}function Cu(e){return e===null?"pending":e>=200&&e<300?"success":e>=400&&e<500?"client_error":e>=500?"server_error":"pending"}const Ra=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Pa=uu,as=(e,t)=>n=>{var r;if(t?.variants==null)return Pa(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n?.[c],h=i?.[c];if(u===null)return null;const p=Ra(u)||Ra(h);return o[c][p]}),a=n&&Object.entries(n).reduce((c,u)=>{let[h,p]=u;return p===void 0||(c[h]=p),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:h,className:p,...d}=u;return Object.entries(d).every(g=>{let[m,y]=g;return Array.isArray(y)?y.includes({...i,...a}[m]):{...i,...a}[m]===y})?[...c,h,p]:c},[]);return Pa(e,s,l,n?.class,n?.className)};function Oa(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Eu(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Oa(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():Oa(e[o],null)}}}}function Re(...e){return v.useCallback(Eu(...e),e)}function Pn(e){const t=s1(e),n=v.forwardRef((r,o)=>{const{children:i,...s}=r,a=v.Children.toArray(i),l=a.find(l1);if(l){const c=l.props.children,u=a.map(h=>h===l?v.Children.count(c)>1?v.Children.only(null):v.isValidElement(c)?c.props.children:null:h);return f.jsx(t,{...s,ref:o,children:v.isValidElement(c)?v.cloneElement(c,void 0,u):null})}return f.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var i1=Pn("Slot");function s1(e){const t=v.forwardRef((n,r)=>{const{children:o,...i}=n;if(v.isValidElement(o)){const s=u1(o),a=c1(i,o.props);return o.type!==v.Fragment&&(a.ref=r?Eu(r,s):s),v.cloneElement(o,a)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Nu=Symbol("radix.slottable");function a1(e){const t=({children:n})=>f.jsx(f.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Nu,t}function l1(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Nu}function c1(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function u1(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)}var d1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ce=d1.reduce((e,t)=>{const n=Pn(`Primitive.${t}`),r=v.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function f1(e,t){e&&dr.flushSync(()=>e.dispatchEvent(t))}var Tu=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"}),h1="VisuallyHidden",ju=v.forwardRef((e,t)=>f.jsx(Ce.span,{...e,ref:t,style:{...Tu,...e.style}}));ju.displayName=h1;var p1=ju;function m1(e,t){const n=v.createContext(t),r=i=>{const{children:s,...a}=i,l=v.useMemo(()=>a,Object.values(a));return f.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=v.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Bt(e,t=[]){let n=[];function r(i,s){const a=v.createContext(s),l=n.length;n=[...n,s];const c=h=>{const{scope:p,children:d,...g}=h,m=p?.[e]?.[l]||a,y=v.useMemo(()=>g,Object.values(g));return f.jsx(m.Provider,{value:y,children:d})};c.displayName=i+"Provider";function u(h,p){const d=p?.[e]?.[l]||a,g=v.useContext(d);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>v.createContext(s));return function(a){const l=a?.[e]||i;return v.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,g1(o,...t)]}function g1(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const h=l(i)[`__scope${c}`];return{...a,...h}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function zu(e){const t=e+"CollectionProvider",[n,r]=Bt(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:y,children:x}=m,b=tt.useRef(null),w=tt.useRef(new Map).current;return f.jsx(o,{scope:y,itemMap:w,collectionRef:b,children:x})};s.displayName=t;const a=e+"CollectionSlot",l=Pn(a),c=tt.forwardRef((m,y)=>{const{scope:x,children:b}=m,w=i(a,x),S=Re(y,w.collectionRef);return f.jsx(l,{ref:S,children:b})});c.displayName=a;const u=e+"CollectionItemSlot",h="data-radix-collection-item",p=Pn(u),d=tt.forwardRef((m,y)=>{const{scope:x,children:b,...w}=m,S=tt.useRef(null),C=Re(y,S),N=i(u,x);return tt.useEffect(()=>(N.itemMap.set(S,{ref:S,...w}),()=>{N.itemMap.delete(S)})),f.jsx(p,{[h]:"",ref:C,children:b})});d.displayName=u;function g(m){const y=i(e+"CollectionConsumer",m);return tt.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((N,z)=>w.indexOf(N.ref.current)-w.indexOf(z.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:c,ItemSlot:d},g,r]}function ve(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var qe=globalThis?.document?v.useLayoutEffect:()=>{},x1=hc[" useInsertionEffect ".trim().toString()]||qe;function an({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=y1({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const u=v.useRef(e!==void 0);v.useEffect(()=>{const h=u.current;h!==a&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const c=v.useCallback(u=>{if(a){const h=b1(u)?u(e):u;h!==e&&s.current?.(h)}else i(u)},[a,e,i,s]);return[l,c]}function y1({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),o=v.useRef(n),i=v.useRef(t);return x1(()=>{i.current=t},[t]),v.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function b1(e){return typeof e=="function"}function v1(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var mt=e=>{const{present:t,children:n}=e,r=w1(t),o=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=Re(r.ref,_1(o));return typeof n=="function"||r.isPresent?v.cloneElement(o,{ref:i}):null};mt.displayName="Presence";function w1(e){const[t,n]=v.useState(),r=v.useRef(null),o=v.useRef(e),i=v.useRef("none"),s=e?"mounted":"unmounted",[a,l]=v1(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const c=Tr(r.current);i.current=a==="mounted"?c:"none"},[a]),qe(()=>{const c=r.current,u=o.current;if(u!==e){const p=i.current,d=Tr(c);e?l("MOUNT"):d==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&p!==d?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),qe(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,h=d=>{const m=Tr(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&m&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=d=>{d.target===t&&(i.current=Tr(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:v.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Tr(e){return e?.animationName||"none"}function _1(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)}var k1=hc[" useId ".trim().toString()]||(()=>{}),S1=0;function Tt(e){const[t,n]=v.useState(k1());return qe(()=>{n(r=>r??String(S1++))},[e]),e||(t?`radix-${t}`:"")}var fo="Collapsible",[C1]=Bt(fo),[E1,ls]=C1(fo),Au=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l,c]=an({prop:r,defaultProp:o??!1,onChange:s,caller:fo});return f.jsx(E1,{scope:n,disabled:i,contentId:Tt(),open:l,onOpenToggle:v.useCallback(()=>c(u=>!u),[c]),children:f.jsx(Ce.div,{"data-state":us(l),"data-disabled":i?"":void 0,...a,ref:t})})});Au.displayName=fo;var Iu="CollapsibleTrigger",Ru=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=ls(Iu,n);return f.jsx(Ce.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":us(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:ve(e.onClick,o.onOpenToggle)})});Ru.displayName=Iu;var cs="CollapsibleContent",Pu=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ls(cs,e.__scopeCollapsible);return f.jsx(mt,{present:n||o.open,children:({present:i})=>f.jsx(N1,{...r,ref:t,present:i})})});Pu.displayName=cs;var N1=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=ls(cs,n),[a,l]=v.useState(r),c=v.useRef(null),u=Re(t,c),h=v.useRef(0),p=h.current,d=v.useRef(0),g=d.current,m=s.open||a,y=v.useRef(m),x=v.useRef(void 0);return v.useEffect(()=>{const b=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(b)},[]),qe(()=>{const b=c.current;if(b){x.current=x.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const w=b.getBoundingClientRect();h.current=w.height,d.current=w.width,y.current||(b.style.transitionDuration=x.current.transitionDuration,b.style.animationName=x.current.animationName),l(r)}},[s.open,r]),f.jsx(Ce.div,{"data-state":us(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!m,...i,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:m&&o})});function us(e){return e?"open":"closed"}var T1=Au,j1=v.createContext(void 0);function ho(e){const t=v.useContext(j1);return e||t||"ltr"}function Qe(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function z1(e,t=globalThis?.document){const n=Qe(e);v.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var A1="DismissableLayer",wi="dismissableLayer.update",I1="dismissableLayer.pointerDownOutside",R1="dismissableLayer.focusOutside",Da,Ou=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),po=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=v.useContext(Ou),[u,h]=v.useState(null),p=u?.ownerDocument??globalThis?.document,[,d]=v.useState({}),g=Re(t,z=>h(z)),m=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=m.indexOf(y),b=u?m.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,S=b>=x,C=D1(z=>{const I=z.target,O=[...c.branches].some(P=>P.contains(I));!S||O||(o?.(z),s?.(z),z.defaultPrevented||a?.())},p),N=M1(z=>{const I=z.target;[...c.branches].some(P=>P.contains(I))||(i?.(z),s?.(z),z.defaultPrevented||a?.())},p);return z1(z=>{b===c.layers.size-1&&(r?.(z),!z.defaultPrevented&&a&&(z.preventDefault(),a()))},p),v.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Da=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Ma(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Da)}},[u,p,n,c]),v.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Ma())},[u,c]),v.useEffect(()=>{const z=()=>d({});return document.addEventListener(wi,z),()=>document.removeEventListener(wi,z)},[]),f.jsx(Ce.div,{...l,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:ve(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ve(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ve(e.onPointerDownCapture,C.onPointerDownCapture)})});po.displayName=A1;var P1="DismissableLayerBranch",O1=v.forwardRef((e,t)=>{const n=v.useContext(Ou),r=v.useRef(null),o=Re(t,r);return v.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),f.jsx(Ce.div,{...e,ref:o})});O1.displayName=P1;function D1(e,t=globalThis?.document){const n=Qe(e),r=v.useRef(!1),o=v.useRef(()=>{});return v.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){Du(I1,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function M1(e,t=globalThis?.document){const n=Qe(e),r=v.useRef(!1);return v.useEffect(()=>{const o=i=>{i.target&&!r.current&&Du(R1,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ma(){const e=new CustomEvent(wi);document.dispatchEvent(e)}function Du(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?f1(o,i):o.dispatchEvent(i)}var $o="focusScope.autoFocusOnMount",Bo="focusScope.autoFocusOnUnmount",La={bubbles:!1,cancelable:!0},L1="FocusScope",ds=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=v.useState(null),c=Qe(o),u=Qe(i),h=v.useRef(null),p=Re(t,m=>l(m)),d=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let m=function(w){if(d.paused||!a)return;const S=w.target;a.contains(S)?h.current=S:Vt(h.current,{select:!0})},y=function(w){if(d.paused||!a)return;const S=w.relatedTarget;S!==null&&(a.contains(S)||Vt(h.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&Vt(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const b=new MutationObserver(x);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,d.paused]),v.useEffect(()=>{if(a){$a.add(d);const m=document.activeElement;if(!a.contains(m)){const x=new CustomEvent($o,La);a.addEventListener($o,c),a.dispatchEvent(x),x.defaultPrevented||(F1(W1(Mu(a)),{select:!0}),document.activeElement===m&&Vt(a))}return()=>{a.removeEventListener($o,c),setTimeout(()=>{const x=new CustomEvent(Bo,La);a.addEventListener(Bo,u),a.dispatchEvent(x),x.defaultPrevented||Vt(m??document.body,{select:!0}),a.removeEventListener(Bo,u),$a.remove(d)},0)}}},[a,c,u,d]);const g=v.useCallback(m=>{if(!n&&!r||d.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(y&&x){const b=m.currentTarget,[w,S]=$1(b);w&&S?!m.shiftKey&&x===S?(m.preventDefault(),n&&Vt(w,{select:!0})):m.shiftKey&&x===w&&(m.preventDefault(),n&&Vt(S,{select:!0})):x===b&&m.preventDefault()}},[n,r,d.paused]);return f.jsx(Ce.div,{tabIndex:-1,...s,ref:p,onKeyDown:g})});ds.displayName=L1;function F1(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Vt(r,{select:t}),document.activeElement!==n)return}function $1(e){const t=Mu(e),n=Fa(t,e),r=Fa(t.reverse(),e);return[n,r]}function Mu(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Fa(e,t){for(const n of e)if(!B1(n,{upTo:t}))return n}function B1(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}function U1(e){return e instanceof HTMLInputElement&&"select"in e}function Vt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&U1(e)&&t&&e.select()}}var $a=Z1();function Z1(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Ba(e,t),e.unshift(t)},remove(t){e=Ba(e,t),e[0]?.resume()}}}function Ba(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function W1(e){return e.filter(t=>t.tagName!=="A")}var V1="Portal",mo=v.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=v.useState(!1);qe(()=>i(!0),[]);const s=n||o&&globalThis?.document?.body;return s?Wh.createPortal(f.jsx(Ce.div,{...r,ref:t}),s):null});mo.displayName=V1;var Uo=0;function Lu(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ua()),document.body.insertAdjacentElement("beforeend",e[1]??Ua()),Uo++,()=>{Uo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Uo--}},[])}function Ua(){const 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}var Ct=function(){return Ct=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ct.apply(this,arguments)};function Fu(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function H1(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Lr="right-scroll-bar-position",Fr="width-before-scroll-bar",q1="with-scroll-bars-hidden",G1="--removed-body-scroll-bar-size";function Zo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function K1(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var J1=typeof window<"u"?v.useLayoutEffect:v.useEffect,Za=new WeakMap;function Y1(e,t){var n=K1(null,function(r){return e.forEach(function(o){return Zo(o,r)})});return J1(function(){var r=Za.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||Zo(a,null)}),i.forEach(function(a){o.has(a)||Zo(a,s)})}Za.set(n,e)},[e]),n}function X1(e){return e}function Q1(e,t){t===void 0&&(t=X1);var n=[],r=!1,o={read:function(){if(r)throw new 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(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var u=s;s=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return o}function ew(e){e===void 0&&(e={});var t=Q1(null);return t.options=Ct({async:!0,ssr:!1},e),t}var $u=function(e){var t=e.sideCar,n=Fu(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,Ct({},n))};$u.isSideCarExport=!0;function tw(e,t){return e.useMedium(t),$u}var Bu=ew(),Wo=function(){},go=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:Wo,onWheelCapture:Wo,onTouchMoveCapture:Wo}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,h=e.shards,p=e.sideCar,d=e.noRelative,g=e.noIsolation,m=e.inert,y=e.allowPinchZoom,x=e.as,b=x===void 0?"div":x,w=e.gapMode,S=Fu(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=p,N=Y1([n,t]),z=Ct(Ct({},S),o);return v.createElement(v.Fragment,null,u&&v.createElement(C,{sideCar:Bu,removeScrollBar:c,shards:h,noRelative:d,noIsolation:g,inert:m,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:w}),s?v.cloneElement(v.Children.only(a),Ct(Ct({},z),{ref:N})):v.createElement(b,Ct({},z,{className:l,ref:N}),a))});go.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};go.classNames={fullWidth:Fr,zeroRight:Lr};var nw=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function rw(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=nw();return t&&e.setAttribute("nonce",t),e}function ow(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function iw(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sw=function(){var e=0,t=null;return{add:function(n){e==0&&(t=rw())&&(ow(t,n),iw(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},aw=function(){var e=sw();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Uu=function(){var e=aw(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},lw={left:0,top:0,right:0,gap:0},Vo=function(e){return parseInt(e||"",10)||0},cw=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Vo(n),Vo(r),Vo(o)]},uw=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return lw;var t=cw(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])}},dw=Uu(),Tn="data-scroll-locked",fw=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
64
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of e.seen.entries()){const a=s[1];if(t===s[0]){i(s);continue}if(e.external){const c=e.external.registry.get(s[0])?.id;if(t!==s[0]&&c){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1&&e.reused==="ref"){i(s);continue}}}function Lc(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=a=>{const l=e.seen.get(a);if(l.ref===null)return;const c=l.def??l.schema,u={...c},h=l.ref;if(l.ref=null,h){r(h);const d=e.seen.get(h),g=d.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(g)):Object.assign(c,g),Object.assign(c,u),a._zod.parent===h)for(const y in c)y==="$ref"||y==="allOf"||y in u||delete c[y];if(g.$ref&&d.def)for(const y in c)y==="$ref"||y==="allOf"||y in d.def&&JSON.stringify(c[y])===JSON.stringify(d.def[y])&&delete c[y]}const p=a._zod.parent;if(p&&p!==h){r(p);const d=e.seen.get(p);if(d?.schema.$ref&&(c.$ref=d.schema.$ref,d.def))for(const g in c)g==="$ref"||g==="allOf"||g in d.def&&JSON.stringify(c[g])===JSON.stringify(d.def[g])&&delete c[g]}e.override({zodSchema:a,jsonSchema:c,path:l.path??[]})};for(const a of[...e.seen.entries()].reverse())r(a[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}Object.assign(o,n.def??n.schema);const i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;const s=e.external?.defs??{};for(const a of e.seen.entries()){const l=a[1];l.def&&l.defId&&(l.def.id===l.defId&&delete l.def.id,s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Vr(t,"input",e.processors),output:Vr(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Xe(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Xe(r.element,n);if(r.type==="set")return Xe(r.valueType,n);if(r.type==="lazy")return Xe(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Xe(r.innerType,n);if(r.type==="intersection")return Xe(r.left,n)||Xe(r.right,n);if(r.type==="record"||r.type==="map")return Xe(r.keyType,n)||Xe(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Xe(r.in,n)||Xe(r.out,n);if(r.type==="object"){for(const o in r.shape)if(Xe(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(Xe(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(Xe(o,n))return!0;return!!(r.rest&&Xe(r.rest,n))}return!1}const Gg=(e,t={})=>n=>{const r=Dc({...n,processors:t});return We(e,r),Mc(r,e),Lc(r,e)},Vr=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},s=Dc({...o??{},target:i,io:t,processors:n});return We(e,s),Mc(s,e),Lc(s,e)},Kg={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Jg=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:i,maximum:s,format:a,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=Kg[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),c&&(o.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?o.pattern=u[0].source:u.length>1&&(o.allOf=[...u.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},Yg=(e,t,n,r)=>{const o=n,{minimum:i,maximum:s,format:a,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number";const h=typeof u=="number"&&u>=(i??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),d=t.target==="draft-04"||t.target==="openapi-3.0";h?d?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u:typeof i=="number"&&(o.minimum=i),p?d?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c:typeof s=="number"&&(o.maximum=s),typeof l=="number"&&(o.multipleOf=l)},Xg=(e,t,n,r)=>{n.type="boolean"},Qg=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},ex=(e,t,n,r)=>{n.not={}},tx=(e,t,n,r)=>{},nx=(e,t,n,r)=>{const o=e._zod.def,i=mc(o.entries);i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},rx=(e,t,n,r)=>{const o=e._zod.def,i=[];for(const s of o.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){const s=i[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),i.every(s=>typeof s=="boolean")&&(n.type="boolean"),i.every(s=>s===null)&&(n.type="null"),n.enum=i},ox=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},ix=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},sx=(e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=We(i.element,t,{...r,path:[...r.path,"items"]})},ax=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const c in s)o.properties[c]=We(s[c],t,{...r,path:[...r.path,"properties",c]});const a=new Set(Object.keys(s)),l=new Set([...a].filter(c=>{const u=i.shape[c]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));l.size>0&&(o.required=Array.from(l)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=We(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},lx=(e,t,n,r)=>{const o=e._zod.def,i=o.inclusive===!1,s=o.options.map((a,l)=>We(a,t,{...r,path:[...r.path,i?"oneOf":"anyOf",l]}));i?n.oneOf=s:n.anyOf=s},cx=(e,t,n,r)=>{const o=e._zod.def,i=We(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=We(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,l=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=l},ux=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object";const s=i.keyType,l=s._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){const u=We(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const h of l)o.patternProperties[h.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=We(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=We(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const c=s._zod.values;if(c){const u=[...c].filter(h=>typeof h=="string"||typeof h=="number");u.length>0&&(o.required=u)}},dx=(e,t,n,r)=>{const o=e._zod.def,i=We(o.innerType,t,r),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},fx=(e,t,n,r)=>{const o=e._zod.def;We(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},hx=(e,t,n,r)=>{const o=e._zod.def;We(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},px=(e,t,n,r)=>{const o=e._zod.def;We(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},mx=(e,t,n,r)=>{const o=e._zod.def;We(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},gx=(e,t,n,r)=>{const o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;We(s,t,r);const a=t.seen.get(e);a.ref=s},xx=(e,t,n,r)=>{const o=e._zod.def;We(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},Fc=(e,t,n,r)=>{const o=e._zod.def;We(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},yx=(e,t,n,r)=>{const o=e._zod.innerType;We(o,t,r);const i=t.seen.get(e);i.ref=o},bx=K("ZodISODateTime",(e,t)=>{mm.init(e,t),Ue.init(e,t)});function vx(e){return kg(bx,e)}const wx=K("ZodISODate",(e,t)=>{gm.init(e,t),Ue.init(e,t)});function _x(e){return Sg(wx,e)}const kx=K("ZodISOTime",(e,t)=>{xm.init(e,t),Ue.init(e,t)});function Sx(e){return Cg(kx,e)}const Cx=K("ZodISODuration",(e,t)=>{ym.init(e,t),Ue.init(e,t)});function Ex(e){return Eg(Cx,e)}const Nx=(e,t)=>{bc.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>sp(e,n)},flatten:{value:n=>ip(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,hi,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,hi,2)}},isEmpty:{get(){return e.issues.length===0}}})},pt=K("ZodError",Nx,{Parent:Error}),Tx=Xi(pt),jx=Qi(pt),zx=ao(pt),Ix=lo(pt),Ax=cp(pt),Rx=up(pt),Px=dp(pt),Ox=fp(pt),Dx=hp(pt),Mx=pp(pt),Lx=mp(pt),Fx=gp(pt),pa=new WeakMap;function fr(e,t,n){const r=Object.getPrototypeOf(e);let o=pa.get(r);if(o||(o=new Set,pa.set(r,o)),!o.has(t)){o.add(t);for(const i in n){const s=n[i];Object.defineProperty(r,i,{configurable:!0,enumerable:!1,get(){const a=s.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const Le=K("ZodType",(e,t)=>(Me.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Vr(e,"input"),output:Vr(e,"output")}}),e.toJSONSchema=Gg(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>Tx(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>zx(e,n,r),e.parseAsync=async(n,r)=>jx(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Ix(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>Ax(e,n,r),e.decode=(n,r)=>Rx(e,n,r),e.encodeAsync=async(n,r)=>Px(e,n,r),e.decodeAsync=async(n,r)=>Ox(e,n,r),e.safeEncode=(n,r)=>Dx(e,n,r),e.safeDecode=(n,r)=>Mx(e,n,r),e.safeEncodeAsync=async(n,r)=>Lx(e,n,r),e.safeDecodeAsync=async(n,r)=>Fx(e,n,r),fr(e,"ZodType",{check(...n){const r=this.def;return this.clone(Kt(r,{checks:[...r.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return Jt(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(P0(n,r))},superRefine(n,r){return this.check(O0(n,r))},overwrite(n){return this.check(Fn(n))},optional(){return ba(this)},exactOptional(){return b0(this)},nullable(){return va(this)},nullish(){return ba(va(this))},nonoptional(n){return C0(this,n)},array(){return Be(this)},or(n){return Yt([this,n])},and(n){return p0(this,n)},transform(n){return wa(this,x0(n))},default(n){return _0(this,n)},prefault(n){return S0(this,n)},catch(n){return N0(this,n)},pipe(n){return wa(this,n)},readonly(){return z0(this)},describe(n){const r=this.clone();return er.add(r,{description:n}),r},meta(...n){if(n.length===0)return er.get(this);const r=this.clone();return er.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return er.get(e)?.description},configurable:!0}),e)),$c=K("_ZodString",(e,t)=>{es.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Jg(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,fr(e,"_ZodString",{regex(...r){return this.check(Rg(...r))},includes(...r){return this.check(Dg(...r))},startsWith(...r){return this.check(Mg(...r))},endsWith(...r){return this.check(Lg(...r))},min(...r){return this.check(Wr(...r))},max(...r){return this.check(Pc(...r))},length(...r){return this.check(Oc(...r))},nonempty(...r){return this.check(Wr(1,...r))},lowercase(r){return this.check(Pg(r))},uppercase(r){return this.check(Og(r))},trim(){return this.check($g())},normalize(...r){return this.check(Fg(...r))},toLowerCase(){return this.check(Bg())},toUpperCase(){return this.check(Ug())},slugify(){return this.check(Zg())}})}),$x=K("ZodString",(e,t)=>{es.init(e,t),$c.init(e,t),e.email=n=>e.check(ng(Bx,n)),e.url=n=>e.check(ag(Ux,n)),e.jwt=n=>e.check(_g(r0,n)),e.emoji=n=>e.check(lg(Zx,n)),e.guid=n=>e.check(ua(ma,n)),e.uuid=n=>e.check(rg(Sr,n)),e.uuidv4=n=>e.check(og(Sr,n)),e.uuidv6=n=>e.check(ig(Sr,n)),e.uuidv7=n=>e.check(sg(Sr,n)),e.nanoid=n=>e.check(cg(Wx,n)),e.guid=n=>e.check(ua(ma,n)),e.cuid=n=>e.check(ug(Vx,n)),e.cuid2=n=>e.check(dg(Hx,n)),e.ulid=n=>e.check(fg(qx,n)),e.base64=n=>e.check(bg(e0,n)),e.base64url=n=>e.check(vg(t0,n)),e.xid=n=>e.check(hg(Gx,n)),e.ksuid=n=>e.check(pg(Kx,n)),e.ipv4=n=>e.check(mg(Jx,n)),e.ipv6=n=>e.check(gg(Yx,n)),e.cidrv4=n=>e.check(xg(Xx,n)),e.cidrv6=n=>e.check(yg(Qx,n)),e.e164=n=>e.check(wg(n0,n)),e.datetime=n=>e.check(vx(n)),e.date=n=>e.check(_x(n)),e.time=n=>e.check(Sx(n)),e.duration=n=>e.check(Ex(n))});function X(e){return tg($x,e)}const Ue=K("ZodStringFormat",(e,t)=>{Fe.init(e,t),$c.init(e,t)}),Bx=K("ZodEmail",(e,t)=>{sm.init(e,t),Ue.init(e,t)}),ma=K("ZodGUID",(e,t)=>{om.init(e,t),Ue.init(e,t)}),Sr=K("ZodUUID",(e,t)=>{im.init(e,t),Ue.init(e,t)}),Ux=K("ZodURL",(e,t)=>{am.init(e,t),Ue.init(e,t)}),Zx=K("ZodEmoji",(e,t)=>{lm.init(e,t),Ue.init(e,t)}),Wx=K("ZodNanoID",(e,t)=>{cm.init(e,t),Ue.init(e,t)}),Vx=K("ZodCUID",(e,t)=>{um.init(e,t),Ue.init(e,t)}),Hx=K("ZodCUID2",(e,t)=>{dm.init(e,t),Ue.init(e,t)}),qx=K("ZodULID",(e,t)=>{fm.init(e,t),Ue.init(e,t)}),Gx=K("ZodXID",(e,t)=>{hm.init(e,t),Ue.init(e,t)}),Kx=K("ZodKSUID",(e,t)=>{pm.init(e,t),Ue.init(e,t)}),Jx=K("ZodIPv4",(e,t)=>{bm.init(e,t),Ue.init(e,t)}),Yx=K("ZodIPv6",(e,t)=>{vm.init(e,t),Ue.init(e,t)}),Xx=K("ZodCIDRv4",(e,t)=>{wm.init(e,t),Ue.init(e,t)}),Qx=K("ZodCIDRv6",(e,t)=>{_m.init(e,t),Ue.init(e,t)}),e0=K("ZodBase64",(e,t)=>{km.init(e,t),Ue.init(e,t)}),t0=K("ZodBase64URL",(e,t)=>{Cm.init(e,t),Ue.init(e,t)}),n0=K("ZodE164",(e,t)=>{Em.init(e,t),Ue.init(e,t)}),r0=K("ZodJWT",(e,t)=>{Tm.init(e,t),Ue.init(e,t)}),Bc=K("ZodNumber",(e,t)=>{jc.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Yg(e,r,o),fr(e,"ZodNumber",{gt(r,o){return this.check(fa(r,o))},gte(r,o){return this.check(Oo(r,o))},min(r,o){return this.check(Oo(r,o))},lt(r,o){return this.check(da(r,o))},lte(r,o){return this.check(Po(r,o))},max(r,o){return this.check(Po(r,o))},int(r){return this.check(ga(r))},safe(r){return this.check(ga(r))},positive(r){return this.check(fa(0,r))},nonnegative(r){return this.check(Oo(0,r))},negative(r){return this.check(da(0,r))},nonpositive(r){return this.check(Po(0,r))},multipleOf(r,o){return this.check(ha(r,o))},step(r,o){return this.check(ha(r,o))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function ye(e){return Ng(Bc,e)}const o0=K("ZodNumberFormat",(e,t)=>{jm.init(e,t),Bc.init(e,t)});function ga(e){return Tg(o0,e)}const i0=K("ZodBoolean",(e,t)=>{zm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Xg(e,n,r)});function ht(e){return jg(i0,e)}const s0=K("ZodNull",(e,t)=>{Im.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Qg(e,n,r)});function mi(e){return zg(s0,e)}const a0=K("ZodUnknown",(e,t)=>{Am.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>tx()});function xa(){return Ig(a0)}const l0=K("ZodNever",(e,t)=>{Rm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ex(e,n,r)});function c0(e){return Ag(l0,e)}const u0=K("ZodArray",(e,t)=>{Pm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>sx(e,n,r,o),e.element=t.element,fr(e,"ZodArray",{min(n,r){return this.check(Wr(n,r))},nonempty(n){return this.check(Wr(1,n))},max(n,r){return this.check(Pc(n,r))},length(n,r){return this.check(Oc(n,r))},unwrap(){return this.element}})});function Be(e,t){return Wg(u0,e,t)}const d0=K("ZodObject",(e,t)=>{Dm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ax(e,n,r,o),je(e,"shape",()=>t.shape),fr(e,"ZodObject",{keyof(){return $n(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:xa()})},loose(){return this.clone({...this._zod.def,catchall:xa()})},strict(){return this.clone({...this._zod.def,catchall:c0()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return Qh(this,n)},safeExtend(n){return ep(this,n)},merge(n){return tp(this,n)},pick(n){return Yh(this,n)},omit(n){return Xh(this,n)},partial(...n){return np(Zc,this,n[0])},required(...n){return rp(Wc,this,n[0])}})});function de(e,t){const n={type:"object",shape:e??{},...ge(t)};return new d0(n)}const Uc=K("ZodUnion",(e,t)=>{Ac.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>lx(e,n,r,o),e.options=t.options});function Yt(e,t){return new Uc({type:"union",options:e,...ge(t)})}const f0=K("ZodDiscriminatedUnion",(e,t)=>{Uc.init(e,t),Mm.init(e,t)});function hn(e,t,n){return new f0({type:"union",options:t,discriminator:e,...ge(n)})}const h0=K("ZodIntersection",(e,t)=>{Lm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>cx(e,n,r,o)});function p0(e,t){return new h0({type:"intersection",left:e,right:t})}const ya=K("ZodRecord",(e,t)=>{Fm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ux(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function sn(e,t,n){return!t||!t._zod?new ya({type:"record",keyType:X(),valueType:e,...ge(t)}):new ya({type:"record",keyType:e,valueType:t,...ge(n)})}const gi=K("ZodEnum",(e,t)=>{$m.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(r,o,i)=>nx(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const i={};for(const s of r)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new gi({...t,checks:[],...ge(o),entries:i})},e.exclude=(r,o)=>{const i={...t.entries};for(const s of r)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new gi({...t,checks:[],...ge(o),entries:i})}});function $n(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new gi({type:"enum",entries:n,...ge(t)})}const m0=K("ZodLiteral",(e,t)=>{Bm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>rx(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ne(e,t){return new m0({type:"literal",values:Array.isArray(e)?e:[e],...ge(t)})}const g0=K("ZodTransform",(e,t)=>{Um.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ix(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new pc(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(sr(i,n.value,t));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),n.issues.push(sr(s))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n.fallback=!0,n)):(n.value=o,n.fallback=!0,n)}});function x0(e){return new g0({type:"transform",transform:e})}const Zc=K("ZodOptional",(e,t)=>{Rc.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Fc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function ba(e){return new Zc({type:"optional",innerType:e})}const y0=K("ZodExactOptional",(e,t)=>{Zm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Fc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function b0(e){return new y0({type:"optional",innerType:e})}const v0=K("ZodNullable",(e,t)=>{Wm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>dx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function va(e){return new v0({type:"nullable",innerType:e})}const w0=K("ZodDefault",(e,t)=>{Vm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function _0(e,t){return new w0({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():xc(t)}})}const k0=K("ZodPrefault",(e,t)=>{Hm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>px(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function S0(e,t){return new k0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():xc(t)}})}const Wc=K("ZodNonOptional",(e,t)=>{qm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function C0(e,t){return new Wc({type:"nonoptional",innerType:e,...ge(t)})}const E0=K("ZodCatch",(e,t)=>{Gm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function N0(e,t){return new E0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const T0=K("ZodPipe",(e,t)=>{Km.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gx(e,n,r,o),e.in=t.in,e.out=t.out});function wa(e,t){return new T0({type:"pipe",in:e,out:t})}const j0=K("ZodReadonly",(e,t)=>{Jm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function z0(e){return new j0({type:"readonly",innerType:e})}const I0=K("ZodLazy",(e,t)=>{Ym.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>yx(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});function A0(e){return new I0({type:"lazy",getter:e})}const R0=K("ZodCustom",(e,t)=>{Xm.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ox(e,n)});function P0(e,t={}){return Vg(R0,e,t)}function O0(e,t){return Hg(e,t)}const Rn=A0(()=>Yt([X(),ye(),ht(),mi(),Be(Rn),sn(X(),Rn)])),ts=de({type:X(),ttl:X().optional(),scope:X().optional()}),ns=de({type:Ne("text"),text:X(),cache_control:ts.optional()}),Vc=de({type:Ne("thinking"),thinking:X(),signature:X().optional()}),D0=de({type:Ne("think"),thinking:X(),signature:X().optional()}),M0=de({type:Ne("base64"),media_type:X(),data:X()}),Hc=de({type:Ne("image"),source:M0}),qc=de({type:Ne("tool_use"),id:X(),name:X(),input:sn(X(),Rn)}),L0=hn("type",[ns,Hc]),F0=de({type:Ne("tool_result"),tool_use_id:X().optional(),content:Yt([X(),Be(L0)]),is_error:ht().optional()}),$0=hn("type",[ns,Vc,Hc,qc,F0]),B0=Yt([X(),Be($0)]),U0=de({role:$n(["user","assistant"]),content:B0}),Z0=de({type:Ne("text"),text:X(),cache_control:ts.optional()}),W0=de({type:X(),properties:sn(X(),sn(X(),Rn)).optional(),required:Be(X()).optional(),additionalProperties:ht().optional(),$schema:X().optional()}),V0=de({name:X(),description:X().optional(),input_schema:W0.optional(),cache_control:ts.optional()}),H0=hn("type",[de({type:Ne("enabled"),budget_tokens:ye()}),de({type:Ne("disabled")}),de({type:Ne("adaptive")})]),q0=de({model:X(),messages:Be(U0),system:Be(Z0).optional(),tools:Be(V0).optional(),max_tokens:ye().optional(),temperature:ye().optional(),stream:ht().optional(),thinking:H0.optional(),metadata:de({user_id:X().optional()}).optional()}),rs=hn("type",[ns,Vc,D0,qc]),G0=de({input_tokens:ye().nullable().optional(),output_tokens:ye().nullable().optional(),cache_creation_input_tokens:ye().nullable().optional(),cache_read_input_tokens:ye().nullable().optional()}).passthrough(),K0=de({id:X(),type:Ne("message"),model:X(),role:Ne("assistant"),content:Be(rs),stop_reason:X().nullable(),stop_sequence:X().nullable().optional(),usage:G0}).passthrough(),J0=de({type:Ne("message_start"),message:de({id:X(),type:Ne("message"),model:X(),role:Ne("assistant"),content:Be(rs),stop_reason:mi(),stop_sequence:mi(),usage:de({input_tokens:ye(),cache_creation_input_tokens:ye().optional(),cache_read_input_tokens:ye().optional()}).passthrough()})}),Y0=de({type:Ne("content_block_start"),index:ye(),content_block:rs}),X0=hn("type",[de({type:Ne("text_delta"),text:X()}),de({type:Ne("input_json_delta"),partial_json:X()}),de({type:Ne("thinking_delta"),thinking:X()}),de({type:Ne("signature_delta"),signature:X()})]),Q0=de({type:Ne("content_block_delta"),index:ye(),delta:X0}),ey=de({type:Ne("content_block_stop"),index:ye()}),ty=de({type:Ne("message_delta"),delta:de({stop_reason:X().nullable(),stop_sequence:X().nullable().optional()}),usage:de({output_tokens:ye(),input_tokens:ye().optional(),cache_creation_input_tokens:ye().optional(),cache_read_input_tokens:ye().optional()}).passthrough()}),ny=de({type:Ne("message_stop")}),ry=de({type:Ne("ping")}),oy=de({type:Ne("error"),error:de({type:X(),message:X()})});hn("type",[J0,Y0,Q0,ey,ty,ny,ry,oy]);const iy=q0,sy=K0,ay=Yt([X(),Be(hn("type",[de({type:Ne("text"),text:X()}),de({type:Ne("image_url"),image_url:de({url:X(),detail:X().optional()})})]))]),Gc=de({role:$n(["system","user","assistant","tool"]),content:ay,name:X().optional(),reasoning_content:X().optional(),thinking:X().optional(),think:X().optional()}),ly=de({name:X(),arguments:X()});Gc.extend({content:Yt([X(),Be(de({type:Ne("text"),text:X()}))]).optional(),function_call:ly.optional()});const cy=de({type:Ne("function"),function:de({name:X(),description:X().optional(),parameters:sn(X(),Rn)})});de({model:X(),messages:Be(Gc),temperature:ye().optional(),max_tokens:ye().optional(),stream:ht().optional(),tools:Be(cy).optional(),tool_choice:Yt([de({type:Ne("auto")}),de({type:Ne("none")}),de({type:Ne("function"),function:de({name:X()})})]).optional(),user:X().optional()});const Kc=de({role:$n(["assistant"]).optional(),content:X().nullable().optional(),reasoning_content:X().nullable().optional(),thinking:X().nullable().optional(),think:X().nullable().optional(),function_call:de({name:X().optional(),arguments:X().optional()}).nullable().optional(),tool_calls:Be(de({index:ye(),id:X().optional(),type:Ne("function").optional(),function:de({name:X().optional(),arguments:X().optional()})})).nullable().optional()}),uy=de({index:ye(),message:de({role:$n(["assistant"]),content:X().nullable(),reasoning_content:X().optional(),thinking:X().optional(),think:X().optional(),function_call:de({name:X(),arguments:X()}).nullable().optional()}).optional(),delta:Kc.optional(),finish_reason:X().nullable()}),dy=de({id:X(),object:Ne("chat.completion"),created:ye(),model:X(),choices:Be(uy),usage:de({prompt_tokens:ye().nullable().optional(),completion_tokens:ye().nullable().optional(),total_tokens:ye().nullable().optional()}).passthrough(),service_tier:X().nullable().optional(),system_fingerprint:X().nullable().optional()}).passthrough();de({id:X(),object:Ne("chat.completion.chunk"),created:ye(),model:X(),choices:Be(de({index:ye(),delta:Kc,finish_reason:X().nullable().optional()})),usage:de({prompt_tokens:ye().nullable().optional(),completion_tokens:ye().nullable().optional(),total_tokens:ye().nullable().optional()}).passthrough().nullable().optional()}).passthrough();function fy(e){try{const t=JSON.parse(e),n=dy.safeParse(t);return n.success?n.data:null}catch{return null}}const hy=de({index:ye(),timestamp:ye(),type:X(),data:Rn}),py=de({chunks:Be(hy),truncated:ht().optional().default(!1)}),xi=de({id:ye(),timestamp:X(),method:X(),path:X(),model:X().nullable(),sessionId:X().nullable(),rawRequestBody:X().nullable(),responseStatus:ye().nullable(),responseText:X().nullable(),inputTokens:ye().nullable(),outputTokens:ye().nullable(),cacheCreationInputTokens:ye().nullable(),cacheReadInputTokens:ye().nullable(),elapsedMs:ye().nullable(),streaming:ht(),userAgent:X().nullable(),origin:X().nullable(),rawHeaders:sn(X(),X()).optional(),headers:sn(X(),X()).optional(),apiFormat:$n(["anthropic","openai","unknown"]).default("unknown"),isTest:ht().optional().default(!1),providerName:X().nullable().optional(),clientPort:ye().nullable().optional(),clientPid:ye().nullable().optional(),clientCwd:X().nullable().optional(),clientProjectFolder:X().nullable().optional(),streamingChunks:py.optional(),streamingChunksPath:X().nullable().optional(),error:X().nullable().optional()});de({model:X()});de({model:X().optional(),metadata:de({user_id:X().optional()}).passthrough().optional()});function my(e){if(e===null)return null;try{const t=JSON.parse(e),n=iy.safeParse(t);return n.success?n.data:null}catch{return null}}const Jc=de({stripClaudeCodeBillingHeader:ht()}),yi="/api/config";async function gy(e){const t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch ${e}: ${t.status}`);const n=await t.json();return Jc.parse(n)}function xy(e,t){if(typeof e!="object"||e===null)return t;const n=e.error;return typeof n=="string"?n:t}async function yy(e){const t=await fetch(yi,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const r=await t.json().catch(()=>({}));throw new Error(xy(r,`PATCH failed with status ${t.status}`))}const n=await t.json();return Jc.parse(n)}function Yc(){const e=fc(yi,gy,{revalidateOnFocus:!1,revalidateIfStale:!1}),{mutate:t}=Zh(),n=e.data?.stripClaudeCodeBillingHeader??!1,r=async o=>{await t(yi,yy({stripClaudeCodeBillingHeader:o}),{optimisticData:{stripClaudeCodeBillingHeader:o},rollbackOnError:!0,revalidate:!1})};return{strip:n,isLoading:e.isLoading,isError:e.error!==void 0,setStrip:r}}function by(e,t,n){const r=new Array(e);return new Proxy(r,{get(o,i,s){if(typeof i=="string"){const a=i.charCodeAt(0);if(a>=48&&a<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&l<e){let c=o[l];if(!c){const u=t[l*2];c=o[l]={index:l,key:n(l),start:u,size:t[l*2+1],end:u+t[l*2+1],lane:0}}return c}}if(i==="length")return e}return Reflect.get(o,i,s)}})}function xn(e,t,n){let r=n.initialDeps??[],o,i=!0;function s(){const a=e();return(a.length!==r.length||a.some((c,u)=>r[u]!==c))&&(r=a,o=t(...a),n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(o),i=!1),o}return s.updateDeps=a=>{r=a},s}function _a(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const vy=(e,t)=>Math.abs(e-t)<1.01,wy=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}};let qn;const Do=()=>{if(qn!==void 0)return qn;if(typeof navigator>"u")return qn=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return qn=!0;const e=navigator.maxTouchPoints;return qn=navigator.platform==="MacIntel"&&e!==void 0&&e>0},ka=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},_y=e=>e,ky=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,o=new Array(r);for(let i=0;i<r;i++)o[i]=t+i;return o},Sy=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(o(ka(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l?.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(ka(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},Hr={passive:!0},Cy=typeof window>"u"?!0:"onscrollend"in window,Ey=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;const i=e.options.useScrollendEvent&&Cy;let s=0;const a=i?null:wy(o,()=>t(s,!1),e.options.isScrollingResetDelay),l=h=>()=>{s=n(r),a?.(),t(s,h)},c=l(!0),u=l(!1);return r.addEventListener("scroll",c,Hr),i&&r.addEventListener("scrollend",u,Hr),()=>{r.removeEventListener("scroll",c),i&&r.removeEventListener("scrollend",u)}},Ny=(e,t)=>Ey(e,t,n=>{const{horizontal:r,isRtl:o}=e.options;return r?n.scrollLeft*(o&&-1||1):n.scrollTop}),Ty=(e,t,n)=>{if(n.options.useCachedMeasurements){const r=n.indexFromElement(e),o=n.options.getItemKey(r);return n.itemSizeCache.get(o)??n.options.estimateSize(r)}if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const r=n.indexFromElement(e),o=n.options.getItemKey(r),i=n.itemSizeCache.get(o);if(i!==void 0)return i}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},jy=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})},zy=jy;class Iy{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,r,o;return((o=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:o.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const s=()=>{const a=i.target,l=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);for(const[c,u]of this.elementsCache)if(u===a){this.elementsCache.delete(c);break}return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(a,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{var r,o;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:_y,rangeExtractor:ky,onChange:()=>{},measureElement:Ty,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const p in n){const d=n[p];d!==void 0&&(i[p]=d)}const s=this.options;let a=null,l=null,c=!1;if(s!==void 0&&s.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const p=s.count,d=i.count,g=this.getMeasurements(),m=p>0?((r=g[0])==null?void 0:r.key)??s.getItemKey(0):null,y=p>0?((o=g[p-1])==null?void 0:o.key)??s.getItemKey(p-1):null;if(d!==p||p>0&&d>0&&(i.getItemKey(0)!==m||i.getItemKey(d-1)!==y)){c=!0;const w=p>0?this.getVirtualItemForOffset(this.getScrollOffset())??g[0]:null;w&&(a=[w.key,this.getScrollOffset()-w.start]);const S=i.followOnAppend===!0?"auto":i.followOnAppend||null;S&&d>p&&this.isAtEnd(s.scrollEndThreshold)&&(p===0||i.getItemKey(d-1)!==y)&&(l=S)}}this.options=i,c&&(this.pendingMin=0,this.itemSizeCacheVersion++);let u=!1,h=0;if(a&&this.scrollOffset!==null){const[p,d]=a,g=this.getMeasurements(),{count:m,getItemKey:y}=this.options;let x=0;for(;x<m&&y(x)!==p;)x++;if(x<m){const b=g[x];if(b){const w=b.start+d;w!==this.scrollOffset&&(h=w-this.scrollOffset,this.scrollOffset=w,u=!0)}}}(u||l)&&(this.pendingScrollAnchor=[u?a[0]:null,u?a[1]:0,l,h])},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=xn(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,s)=>{this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=s,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const i=this.scrollElement,s=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},a=()=>{this._iosTouching=!1,!(!Do()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",s,Hr),i.addEventListener("touchend",a,Hr),this.unsubs.push(()=>{i.removeEventListener("touchstart",s),i.removeEventListener("touchend",a),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const o=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,o&&this.scrollElement&&this.options.enabled){const[i,s,a,l]=o;i!==null&&!a&&(Do()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),a&&this.scrollToEnd({behavior:a})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;const o=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=o,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=xn(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(n,r,o,i,s,a,l)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a,laneAssignmentMode:l}),{key:!1}),this.getMeasurements=xn(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a,laneAssignmentMode:l},c)=>{const u=this.itemSizeCache;if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const g of this.laneAssignments.keys())g>=n&&this.laneAssignments.delete(g);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(g=>{this.itemSizeCache.set(g.key,g.size)}));const h=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),a===1){const g=this.options.gap,m=n*2;let y=this._flatMeasurements;if(!y||y.length<m){const w=new Float64Array(m);y&&h>0&&w.set(y.subarray(0,h*2)),y=w,this._flatMeasurements=y}let x;if(h===0)x=r+o;else{const w=h-1;x=y[w*2]+y[w*2+1]+g}for(let w=h;w<n;w++){const S=i(w),C=u.get(S),N=typeof C=="number"?C:this.options.estimateSize(w);y[w*2]=x,y[w*2+1]=N,x+=N+g}const b=by(n,y,i);return this.measurementsCache=b,b}const p=this.measurementsCache.slice(0,h),d=new Array(a).fill(void 0);for(let g=0;g<h;g++){const m=p[g];m&&(d[m.lane]=g)}for(let g=h;g<n;g++){const m=i(g),y=this.laneAssignments.get(g);let x,b;const w=l==="estimate"||u.has(m);if(y!==void 0&&this.options.lanes>1){x=y;const z=d[x],A=z!==void 0?p[z]:void 0;b=A?A.end+this.options.gap:r+o}else{const z=this.options.lanes===1?p[g-1]:this.getFurthestMeasurement(p,g);b=z?z.end+this.options.gap:r+o,x=z?z.lane:g%this.options.lanes,this.options.lanes>1&&w&&this.laneAssignments.set(g,x)}const S=u.get(m),C=typeof S=="number"?S:this.options.estimateSize(g),N=b+C;p[g]={index:g,start:b,size:C,end:N,key:m,lane:x},d[x]=g}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=xn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?Ay({measurements:n,outerSize:r,scrollOffset:o,lanes:i,flat:i===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=xn(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(o!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),s=Math.max(0,o-i),a=Math.min(this.options.count-1,o+i);return n>=s&&n<=a}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((s,a)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(a))});return}const r=this.indexFromElement(n),o=this.options.getItemKey(r),i=this.elementsCache.get(o);i!==n&&(i&&this.observer.unobserve(i),this.observer.observe(n),this.elementsCache.set(o,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var o,i;if(n<0||n>=this.options.count)return;let s,a,l;const c=this._flatMeasurements;if(this.options.lanes===1&&c!==null)l=this.options.getItemKey(n),a=c[n*2],s=c[n*2+1];else{const p=this.measurementsCache[n];if(!p)return;l=p.key,a=p.start,s=p.size}const u=this.itemSizeCache.get(l)??s,h=r-u;if(h!==0){const p=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,d=p?this.getTotalSize():0,g=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:l,start:a,size:s,end:a+s,lane:0},h,this):a<this.getScrollOffset()+this.scrollAdjustments&&this.scrollDirection!=="backward");(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(l,r),this.itemSizeCacheVersion++,p?this.applyScrollAdjustment(this.getTotalSize()-d):g&&this.applyScrollAdjustment(h),this.notify(!1)}},this.getVirtualItems=xn(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length===0)return;const o=this._flatMeasurements,i=this.options.lanes===1&&o!=null,s=Xc(0,r.length-1,i?a=>o[a*2]:a=>_a(r[a]).start,n);return _a(r[s])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,o=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getSize(),i=this.getScrollOffset(),s=this.measurementsCache[n];if(!s)return;if(r==="auto")if(s.end>=i+o-this.options.scrollPaddingEnd)r="end";else if(s.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const a=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,s.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:o="auto"}={})=>{const i=this.getOffsetForAlignment(n,r),s=this.now();this.scrollState={index:null,align:r,behavior:o,startedAt:s,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:o="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.getOffsetForIndex(n,r);if(!i)return;const[s,a]=i,l=this.now();this.scrollState={index:n,align:a,behavior:o,startedAt:l,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const o=this.getScrollOffset()+n,i=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:i,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1){const i=r.length-1,s=this._flatMeasurements;s!=null?o=s[i*2]+s[i*2+1]:o=((n=r[i])==null?void 0:n.end)??0}else{const i=Array(this.options.lanes).fill(null);let s=r.length-1;for(;s>=0&&i.some(a=>a===null);){const a=r[s];i[a.lane]===null&&(i[a.lane]=a.end),s--}o=Math.max(...i.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const o of r)o&&this.itemSizeCache.has(o.key)&&n.push({index:o.index,key:o.key,start:o.start,size:o.size,end:o.end,lane:o.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){t!==0&&(Do()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=t:this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=r?r[0]:this.scrollState.lastTargetOffset,i=1,s=o!==this.scrollState.lastTargetOffset;if(!s&&vy(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==o&&this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,s){const a=this.getSize()||600,l=Math.abs(o-this.getScrollOffset()),c=this.scrollState.behavior==="smooth"&&l>a;this.scrollState.lastTargetOffset=o,c||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:c?"smooth":"auto"})}this.scheduleScrollReconcile()}}const Xc=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function Ay({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:o}){const i=e.length-1,s=o?u=>o[u*2]:u=>e[u].start,a=o?u=>o[u*2]+o[u*2+1]:u=>e[u].end;if(e.length<=r)return{startIndex:0,endIndex:i};let l=Xc(0,i,s,n),c=l;if(r===1)for(;c<i&&a(c)<n+t;)c++;else if(r>1){const u=Array(r).fill(0);for(;c<i&&u.some(p=>p<n+t);){const p=e[c];u[p.lane]=p.end,c++}const h=Array(r).fill(n+t);for(;l>=0&&h.some(p=>p>=n);){const p=e[l];h[p.lane]=p.start,l--}l=Math.max(0,l-l%r),c=Math.min(i,c+(r-1-c%r))}return{startIndex:l,endIndex:c}}const Mo=typeof document<"u"?v.useLayoutEffect:v.useEffect;function Ry({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const o=v.useReducer(c=>c+1,0)[1],i=v.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=t,i.current.mode=n;const s=c=>{const u=i.current;if(!u.enabled)return;const h=c.getTotalSize();if(u.container&&h!==u.lastSize){u.lastSize=h;const x=c.options.horizontal?"width":"height";u.container.style[x]=`${h}px`}const p=!!c.options.horizontal,d=u.mode==="transform",g=p?"left":"top",m=c.options.scrollMargin,y=c.getVirtualItems();for(const x of y){const b=x.start-m,w=c.elementsCache.get(x.key);w&&u.lastPositions.get(w)!==b&&(u.lastPositions.set(w,b),d?w.style.transform=p?`translate3d(${b}px, 0, 0)`:`translate3d(0, ${b}px, 0)`:w.style[g]=`${b}px`)}},a={...r,onChange:(c,u)=>{var h;const p=i.current;let d=!0;if(p.enabled){s(c);const g=c.range,m=p.prevRange;d=!m||m.isScrolling!==c.isScrolling||m.startIndex!==g?.startIndex||m.endIndex!==g?.endIndex,d&&(p.prevRange=g?{startIndex:g.startIndex,endIndex:g.endIndex,isScrolling:c.isScrolling}:null)}d&&(e&&u?dr.flushSync(o):o()),(h=r.onChange)==null||h.call(r,c,u)}},[l]=v.useState(()=>{const c=new Iy(a);return Object.assign(c,{containerRef:u=>{const h=i.current;if(h.container=u,h.lastSize=null,u&&h.enabled){const p=c.getTotalSize();h.lastSize=p;const d=c.options.horizontal?"width":"height";u.style[d]=`${p}px`}}})});return l.setOptions(a),Mo(()=>l._didMount(),[]),Mo(()=>l._willUpdate()),Mo(()=>{s(l)}),l}function Qc(e){return Ry({observeElementRect:Sy,observeElementOffset:Ny,scrollToFn:zy,...e})}const eu=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const Py=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Oy=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const Sa=e=>{const t=Oy(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Dy={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const My=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Ly=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>v.createElement("svg",{ref:l,...Dy,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:eu("lucide",o),...!i&&!My(a)&&{"aria-hidden":"true"},...a},[...s.map(([c,u])=>v.createElement(c,u)),...Array.isArray(i)?i:[i]]));const _e=(e,t)=>{const n=v.forwardRef(({className:r,...o},i)=>v.createElement(Ly,{ref:i,iconNode:t,className:eu(`lucide-${Py(Sa(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Sa(e),n};const Fy=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],$y=_e("brain",Fy);const By=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],hr=_e("check",By);const Uy=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],zt=_e("chevron-down",Uy);const Zy=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ht=_e("chevron-right",Zy);const Wy=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Vy=_e("chevron-up",Wy);const Hy=[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]],qy=_e("chevrons-down",Hy);const Gy=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],Ky=_e("chevrons-up",Gy);const Jy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],bi=_e("circle-alert",Jy);const Yy=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Xy=_e("circle-check-big",Yy);const Qy=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],eb=_e("circle-question-mark",Qy);const tb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],tu=_e("circle-stop",tb);const nb=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],os=_e("clock",nb);const rb=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],ob=_e("columns-2",rb);const ib=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],uo=_e("copy",ib);const sb=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],nu=_e("download",sb);const ab=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],lb=_e("external-link",ab);const cb=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],ru=_e("eye-off",cb);const ub=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ou=_e("eye",ub);const db=[["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:"m8 16 2-2-2-2",key:"10vzyd"}],["path",{d:"M12 18h4",key:"1wd2n7"}]],fb=_e("file-terminal",db);const hb=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],pb=_e("gauge",hb);const mb=[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]],gb=_e("git-compare-arrows",mb);const xb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],yb=_e("globe",xb);const bb=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],vb=_e("layout-grid",bb);const wb=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],_b=_e("list",wb);const kb=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],iu=_e("loader-circle",kb);const Sb=[["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"}]],Cb=_e("lock",Sb);const Eb=[["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"}]],su=_e("message-square",Eb);const Nb=[["path",{d:"M5 12h14",key:"1ays0h"}]],Tb=_e("minus",Nb);const jb=[["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"}]],zb=_e("pencil",jb);const Ib=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ca=_e("plus",Ib);const Ab=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Rb=_e("radio",Ab);const Pb=[["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"}]],au=_e("rotate-ccw",Pb);const Ob=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],lu=_e("rotate-cw",Ob);const Db=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],Mb=_e("rows-3",Db);const Lb=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Fb=_e("server",Lb);const $b=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Bb=_e("settings",$b);const Ub=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Zb=_e("terminal",Ub);const Wb=[["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"}]],Vb=_e("trash-2",Wb);const Hb=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],qb=_e("triangle-alert",Hb);const Gb=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Kb=_e("upload",Gb);const Jb=[["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"}]],Yb=_e("user",Jb);const Xb=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Qb=_e("wifi-off",Xb);const ev=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],tv=_e("wifi",ev);const nv=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],rv=_e("wrench",nv);const ov=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],iv=_e("x",ov);const sv=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],pr=_e("zap",sv);function Cr(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Lo={exports:{}};var Ea;function av(){return Ea||(Ea=1,(function(e,t){(function(n){e.exports=n()})(function(){return(function n(r,o,i){function s(c,u){if(!o[c]){if(!r[c]){var h=typeof Cr=="function"&&Cr;if(!u&&h)return h(c,!0);if(a)return a(c,!0);var p=new Error("Cannot find module '"+c+"'");throw p.code="MODULE_NOT_FOUND",p}var d=o[c]={exports:{}};r[c][0].call(d.exports,function(g){var m=r[c][1][g];return s(m||g)},d,d.exports,n,r,o,i)}return o[c].exports}for(var a=typeof Cr=="function"&&Cr,l=0;l<i.length;l++)s(i[l]);return s})({1:[function(n,r,o){var i=n("./utils"),s=n("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.encode=function(l){for(var c,u,h,p,d,g,m,y=[],x=0,b=l.length,w=b,S=i.getTypeOf(l)!=="string";x<l.length;)w=b-x,h=S?(c=l[x++],u=x<b?l[x++]:0,x<b?l[x++]:0):(c=l.charCodeAt(x++),u=x<b?l.charCodeAt(x++):0,x<b?l.charCodeAt(x++):0),p=c>>2,d=(3&c)<<4|u>>4,g=1<w?(15&u)<<2|h>>6:64,m=2<w?63&h:64,y.push(a.charAt(p)+a.charAt(d)+a.charAt(g)+a.charAt(m));return y.join("")},o.decode=function(l){var c,u,h,p,d,g,m=0,y=0,x="data:";if(l.substr(0,x.length)===x)throw new Error("Invalid base64 input, it looks like a data url.");var b,w=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&w--,l.charAt(l.length-2)===a.charAt(64)&&w--,w%1!=0)throw new Error("Invalid base64 input, bad content length.");for(b=s.uint8array?new Uint8Array(0|w):new Array(0|w);m<l.length;)c=a.indexOf(l.charAt(m++))<<2|(p=a.indexOf(l.charAt(m++)))>>4,u=(15&p)<<4|(d=a.indexOf(l.charAt(m++)))>>2,h=(3&d)<<6|(g=a.indexOf(l.charAt(m++))),b[y++]=c,d!==64&&(b[y++]=u),g!==64&&(b[y++]=h);return b}},{"./support":30,"./utils":32}],2:[function(n,r,o){var i=n("./external"),s=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function c(u,h,p,d,g){this.compressedSize=u,this.uncompressedSize=h,this.crc32=p,this.compression=d,this.compressedContent=g}c.prototype={getContentWorker:function(){var u=new s(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),h=this;return u.on("end",function(){if(this.streamInfo.data_length!==h.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new s(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,h,p){return u.pipe(new a).pipe(new l("uncompressedSize")).pipe(h.compressWorker(p)).pipe(new l("compressedSize")).withStreamInfo("compression",h)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,o){var i=n("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},o.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,o){var i=n("./utils"),s=(function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var u=0;u<8;u++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l})();r.exports=function(a,l){return a!==void 0&&a.length?i.getTypeOf(a)!=="string"?(function(c,u,h,p){var d=s,g=p+h;c^=-1;for(var m=p;m<g;m++)c=c>>>8^d[255&(c^u[m])];return-1^c})(0|l,a,a.length,0):(function(c,u,h,p){var d=s,g=p+h;c^=-1;for(var m=p;m<g;m++)c=c>>>8^d[255&(c^u.charCodeAt(m))];return-1^c})(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,o){o.base64=!1,o.binary=!1,o.dir=!1,o.createFolders=!0,o.date=null,o.compression=null,o.compressionOptions=null,o.comment=null,o.unixPermissions=null,o.dosPermissions=null},{}],6:[function(n,r,o){var i=null;i=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:i}},{lie:37}],7:[function(n,r,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=n("pako"),a=n("./utils"),l=n("./stream/GenericWorker"),c=i?"uint8array":"array";function u(h,p){l.call(this,"FlateWorker/"+h),this._pako=null,this._pakoAction=h,this._pakoOptions=p,this.meta={}}o.magic="\b\0",a.inherits(u,l),u.prototype.processChunk=function(h){this.meta=h.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,h.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var h=this;this._pako.onData=function(p){h.push({data:p,meta:h.meta})}},o.compressWorker=function(h){return new u("Deflate",h)},o.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,o){function i(d,g){var m,y="";for(m=0;m<g;m++)y+=String.fromCharCode(255&d),d>>>=8;return y}function s(d,g,m,y,x,b){var w,S,C=d.file,N=d.compression,z=b!==c.utf8encode,A=a.transformTo("string",b(C.name)),O=a.transformTo("string",c.utf8encode(C.name)),P=C.comment,L=a.transformTo("string",b(P)),T=a.transformTo("string",c.utf8encode(P)),M=O.length!==C.name.length,_=T.length!==P.length,D="",G="",Z="",te=C.dir,q=C.date,E={crc32:0,compressedSize:0,uncompressedSize:0};g&&!m||(E.crc32=d.crc32,E.compressedSize=d.compressedSize,E.uncompressedSize=d.uncompressedSize);var U=0;g&&(U|=8),z||!M&&!_||(U|=2048);var B=0,j=0;te&&(B|=16),x==="UNIX"?(j=798,B|=(function(H,ce){var ie=H;return H||(ie=ce?16893:33204),(65535&ie)<<16})(C.unixPermissions,te)):(j=20,B|=(function(H){return 63&(H||0)})(C.dosPermissions)),w=q.getUTCHours(),w<<=6,w|=q.getUTCMinutes(),w<<=5,w|=q.getUTCSeconds()/2,S=q.getUTCFullYear()-1980,S<<=4,S|=q.getUTCMonth()+1,S<<=5,S|=q.getUTCDate(),M&&(G=i(1,1)+i(u(A),4)+O,D+="up"+i(G.length,2)+G),_&&(Z=i(1,1)+i(u(L),4)+T,D+="uc"+i(Z.length,2)+Z);var Y="";return Y+=`
65
+ \0`,Y+=i(U,2),Y+=N.magic,Y+=i(w,2),Y+=i(S,2),Y+=i(E.crc32,4),Y+=i(E.compressedSize,4),Y+=i(E.uncompressedSize,4),Y+=i(A.length,2),Y+=i(D.length,2),{fileRecord:h.LOCAL_FILE_HEADER+Y+A+D,dirRecord:h.CENTRAL_FILE_HEADER+i(j,2)+Y+i(L.length,2)+"\0\0\0\0"+i(B,4)+i(y,4)+A+D+L}}var a=n("../utils"),l=n("../stream/GenericWorker"),c=n("../utf8"),u=n("../crc32"),h=n("../signature");function p(d,g,m,y){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=g,this.zipPlatform=m,this.encodeFileName=y,this.streamFiles=d,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,l),p.prototype.push=function(d){var g=d.meta.percent||0,m=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(d):(this.bytesWritten+=d.data.length,l.prototype.push.call(this,{data:d.data,meta:{currentFile:this.currentFile,percent:m?(g+100*(m-y-1))/m:100}}))},p.prototype.openedSource=function(d){this.currentSourceOffset=this.bytesWritten,this.currentFile=d.file.name;var g=this.streamFiles&&!d.file.dir;if(g){var m=s(d,g,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(d){this.accumulate=!1;var g=this.streamFiles&&!d.file.dir,m=s(d,g,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),g)this.push({data:(function(y){return h.DATA_DESCRIPTOR+i(y.crc32,4)+i(y.compressedSize,4)+i(y.uncompressedSize,4)})(d),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var d=this.bytesWritten,g=0;g<this.dirRecords.length;g++)this.push({data:this.dirRecords[g],meta:{percent:100}});var m=this.bytesWritten-d,y=(function(x,b,w,S,C){var N=a.transformTo("string",C(S));return h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(x,2)+i(x,2)+i(b,4)+i(w,4)+i(N.length,2)+N})(this.dirRecords.length,m,d,this.zipComment,this.encodeFileName);this.push({data:y,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(d){this._sources.push(d);var g=this;return d.on("data",function(m){g.processChunk(m)}),d.on("end",function(){g.closedSource(g.previous.streamInfo),g._sources.length?g.prepareNextSource():g.end()}),d.on("error",function(m){g.error(m)}),this},p.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(d){var g=this._sources;if(!l.prototype.error.call(this,d))return!1;for(var m=0;m<g.length;m++)try{g[m].error(d)}catch{}return!0},p.prototype.lock=function(){l.prototype.lock.call(this);for(var d=this._sources,g=0;g<d.length;g++)d[g].lock()},r.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,o){var i=n("../compressions"),s=n("./ZipFileWorker");o.generateWorker=function(a,l,c){var u=new s(l.streamFiles,c,l.platform,l.encodeFileName),h=0;try{a.forEach(function(p,d){h++;var g=(function(b,w){var S=b||w,C=i[S];if(!C)throw new Error(S+" is not a valid compression method !");return C})(d.options.compression,l.compression),m=d.options.compressionOptions||l.compressionOptions||{},y=d.dir,x=d.date;d._compressWorker(g,m).withStreamInfo("file",{name:p,dir:y,date:x,comment:d.comment||"",unixPermissions:d.unixPermissions,dosPermissions:d.dosPermissions}).pipe(u)}),u.entriesCount=h}catch(p){u.error(p)}return u}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,o){function i(){if(!(this instanceof i))return new i;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new i;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}(i.prototype=n("./object")).loadAsync=n("./load"),i.support=n("./support"),i.defaults=n("./defaults"),i.version="3.10.1",i.loadAsync=function(s,a){return new i().loadAsync(s,a)},i.external=n("./external"),r.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,o){var i=n("./utils"),s=n("./external"),a=n("./utf8"),l=n("./zipEntries"),c=n("./stream/Crc32Probe"),u=n("./nodejsUtils");function h(p){return new s.Promise(function(d,g){var m=p.decompressed.getContentWorker().pipe(new c);m.on("error",function(y){g(y)}).on("end",function(){m.streamInfo.crc32!==p.decompressed.crc32?g(new Error("Corrupted zip : CRC32 mismatch")):d()}).resume()})}r.exports=function(p,d){var g=this;return d=i.extend(d||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),u.isNode&&u.isStream(p)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",p,!0,d.optimizedBinaryString,d.base64).then(function(m){var y=new l(d);return y.load(m),y}).then(function(m){var y=[s.Promise.resolve(m)],x=m.files;if(d.checkCRC32)for(var b=0;b<x.length;b++)y.push(h(x[b]));return s.Promise.all(y)}).then(function(m){for(var y=m.shift(),x=y.files,b=0;b<x.length;b++){var w=x[b],S=w.fileNameStr,C=i.resolve(w.fileNameStr);g.file(C,w.decompressed,{binary:!0,optimizedBinaryString:!0,date:w.date,dir:w.dir,comment:w.fileCommentStr.length?w.fileCommentStr:null,unixPermissions:w.unixPermissions,dosPermissions:w.dosPermissions,createFolders:d.createFolders}),w.dir||(g.file(C).unsafeOriginalName=S)}return y.zipComment.length&&(g.comment=y.zipComment),g})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,o){var i=n("../utils"),s=n("../stream/GenericWorker");function a(l,c){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}i.inherits(a,s),a.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(u){c.push({data:u,meta:{percent:0}})}).on("error",function(u){c.isPaused?this.generatedError=u:c.error(u)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},a.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,o){var i=n("readable-stream").Readable;function s(a,l,c){i.call(this,l),this._helper=a;var u=this;a.on("data",function(h,p){u.push(h)||u._helper.pause(),c&&c(p)}).on("error",function(h){u.emit("error",h)}).on("end",function(){u.push(null)})}n("../utils").inherits(s,i),s.prototype._read=function(){this._helper.resume()},r.exports=s},{"../utils":32,"readable-stream":16}],14:[function(n,r,o){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(i,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(i,s);if(typeof i=="number")throw new Error('The "data" argument must not be a number');return new Buffer(i,s)},allocBuffer:function(i){if(Buffer.alloc)return Buffer.alloc(i);var s=new Buffer(i);return s.fill(0),s},isBuffer:function(i){return Buffer.isBuffer(i)},isStream:function(i){return i&&typeof i.on=="function"&&typeof i.pause=="function"&&typeof i.resume=="function"}}},{}],15:[function(n,r,o){function i(C,N,z){var A,O=a.getTypeOf(N),P=a.extend(z||{},u);P.date=P.date||new Date,P.compression!==null&&(P.compression=P.compression.toUpperCase()),typeof P.unixPermissions=="string"&&(P.unixPermissions=parseInt(P.unixPermissions,8)),P.unixPermissions&&16384&P.unixPermissions&&(P.dir=!0),P.dosPermissions&&16&P.dosPermissions&&(P.dir=!0),P.dir&&(C=x(C)),P.createFolders&&(A=y(C))&&b.call(this,A,!0);var L=O==="string"&&P.binary===!1&&P.base64===!1;z&&z.binary!==void 0||(P.binary=!L),(N instanceof h&&N.uncompressedSize===0||P.dir||!N||N.length===0)&&(P.base64=!1,P.binary=!0,N="",P.compression="STORE",O="string");var T=null;T=N instanceof h||N instanceof l?N:g.isNode&&g.isStream(N)?new m(C,N):a.prepareContent(C,N,P.binary,P.optimizedBinaryString,P.base64);var M=new p(C,T,P);this.files[C]=M}var s=n("./utf8"),a=n("./utils"),l=n("./stream/GenericWorker"),c=n("./stream/StreamHelper"),u=n("./defaults"),h=n("./compressedObject"),p=n("./zipObject"),d=n("./generate"),g=n("./nodejsUtils"),m=n("./nodejs/NodejsStreamInputAdapter"),y=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var N=C.lastIndexOf("/");return 0<N?C.substring(0,N):""},x=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},b=function(C,N){return N=N!==void 0?N:u.createFolders,C=x(C),this.files[C]||i.call(this,C,null,{dir:!0,createFolders:N}),this.files[C]};function w(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var S={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var N,z,A;for(N in this.files)A=this.files[N],(z=N.slice(this.root.length,N.length))&&N.slice(0,this.root.length)===this.root&&C(z,A)},filter:function(C){var N=[];return this.forEach(function(z,A){C(z,A)&&N.push(A)}),N},file:function(C,N,z){if(arguments.length!==1)return C=this.root+C,i.call(this,C,N,z),this;if(w(C)){var A=C;return this.filter(function(P,L){return!L.dir&&A.test(P)})}var O=this.files[this.root+C];return O&&!O.dir?O:null},folder:function(C){if(!C)return this;if(w(C))return this.filter(function(O,P){return P.dir&&C.test(O)});var N=this.root+C,z=b.call(this,N),A=this.clone();return A.root=z.name,A},remove:function(C){C=this.root+C;var N=this.files[C];if(N||(C.slice(-1)!=="/"&&(C+="/"),N=this.files[C]),N&&!N.dir)delete this.files[C];else for(var z=this.filter(function(O,P){return P.name.slice(0,C.length)===C}),A=0;A<z.length;A++)delete this.files[z[A].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(C){var N,z={};try{if((z=a.extend(C||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=z.type.toLowerCase(),z.compression=z.compression.toUpperCase(),z.type==="binarystring"&&(z.type="string"),!z.type)throw new Error("No output type specified.");a.checkSupport(z.type),z.platform!=="darwin"&&z.platform!=="freebsd"&&z.platform!=="linux"&&z.platform!=="sunos"||(z.platform="UNIX"),z.platform==="win32"&&(z.platform="DOS");var A=z.comment||this.comment||"";N=d.generateWorker(this,z,A)}catch(O){(N=new l("error")).error(O)}return new c(N,z.type||"string",z.mimeType)},generateAsync:function(C,N){return this.generateInternalStream(C).accumulate(N)},generateNodeStream:function(C,N){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(N)}};r.exports=S},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,r,o){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,o){var i=n("./DataReader");function s(a){i.call(this,a);for(var l=0;l<this.data.length;l++)a[l]=255&a[l]}n("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data[this.zero+a]},s.prototype.lastIndexOfSignature=function(a){for(var l=a.charCodeAt(0),c=a.charCodeAt(1),u=a.charCodeAt(2),h=a.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===l&&this.data[p+1]===c&&this.data[p+2]===u&&this.data[p+3]===h)return p-this.zero;return-1},s.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),c=a.charCodeAt(1),u=a.charCodeAt(2),h=a.charCodeAt(3),p=this.readData(4);return l===p[0]&&c===p[1]&&u===p[2]&&h===p[3]},s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./DataReader":18}],18:[function(n,r,o){var i=n("../utils");function s(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var l,c=0;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return i.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=s},{"../utils":32}],19:[function(n,r,o){var i=n("./Uint8ArrayReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,o){var i=n("./DataReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./DataReader":18}],21:[function(n,r,o){var i=n("./ArrayReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,o){var i=n("../utils"),s=n("../support"),a=n("./ArrayReader"),l=n("./StringReader"),c=n("./NodeBufferReader"),u=n("./Uint8ArrayReader");r.exports=function(h){var p=i.getTypeOf(h);return i.checkSupport(p),p!=="string"||s.uint8array?p==="nodebuffer"?new c(h):s.uint8array?new u(i.transformTo("uint8array",h)):new a(i.transformTo("array",h)):new l(h)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,o){var i=n("./GenericWorker"),s=n("../utils");function a(l){i.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,i),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,o){var i=n("./GenericWorker"),s=n("../crc32");function a(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,i),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,o){var i=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}i.inherits(a,s),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,o){var i=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=i.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}i.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,o){function i(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l<this._listeners[s].length;l++)this._listeners[s][l].call(this,a)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var a=this;return s.on("data",function(l){a.processChunk(l)}),s.on("end",function(){a.end()}),s.on("error",function(l){a.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,a){return this.extraStreamInfo[s]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},r.exports=i},{}],29:[function(n,r,o){var i=n("../utils"),s=n("./ConvertWorker"),a=n("./GenericWorker"),l=n("../base64"),c=n("../support"),u=n("../external"),h=null;if(c.nodestream)try{h=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(g,m){return new u.Promise(function(y,x){var b=[],w=g._internalType,S=g._outputType,C=g._mimeType;g.on("data",function(N,z){b.push(N),m&&m(z)}).on("error",function(N){b=[],x(N)}).on("end",function(){try{var N=(function(z,A,O){switch(z){case"blob":return i.newBlob(i.transformTo("arraybuffer",A),O);case"base64":return l.encode(A);default:return i.transformTo(z,A)}})(S,(function(z,A){var O,P=0,L=null,T=0;for(O=0;O<A.length;O++)T+=A[O].length;switch(z){case"string":return A.join("");case"array":return Array.prototype.concat.apply([],A);case"uint8array":for(L=new Uint8Array(T),O=0;O<A.length;O++)L.set(A[O],P),P+=A[O].length;return L;case"nodebuffer":return Buffer.concat(A);default:throw new Error("concat : unsupported type '"+z+"'")}})(w,b),C);y(N)}catch(z){x(z)}b=[]}).resume()})}function d(g,m,y){var x=m;switch(m){case"blob":case"arraybuffer":x="uint8array";break;case"base64":x="string"}try{this._internalType=x,this._outputType=m,this._mimeType=y,i.checkSupport(x),this._worker=g.pipe(new s(x)),g.lock()}catch(b){this._worker=new a("error"),this._worker.error(b)}}d.prototype={accumulate:function(g){return p(this,g)},on:function(g,m){var y=this;return g==="data"?this._worker.on(g,function(x){m.call(y,x.data,x.meta)}):this._worker.on(g,function(){i.delay(m,arguments,y)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(g){if(i.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new h(this,{objectMode:this._outputType!=="nodebuffer"},g)}},r.exports=d},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof Buffer<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var i=new ArrayBuffer(0);try{o.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(i),o.blob=s.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!n("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,o){for(var i=n("./utils"),s=n("./support"),a=n("./nodejsUtils"),l=n("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;c[254]=c[254]=1;function h(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}o.utf8encode=function(d){return s.nodebuffer?a.newBufferFrom(d,"utf-8"):(function(g){var m,y,x,b,w,S=g.length,C=0;for(b=0;b<S;b++)(64512&(y=g.charCodeAt(b)))==55296&&b+1<S&&(64512&(x=g.charCodeAt(b+1)))==56320&&(y=65536+(y-55296<<10)+(x-56320),b++),C+=y<128?1:y<2048?2:y<65536?3:4;for(m=s.uint8array?new Uint8Array(C):new Array(C),b=w=0;w<C;b++)(64512&(y=g.charCodeAt(b)))==55296&&b+1<S&&(64512&(x=g.charCodeAt(b+1)))==56320&&(y=65536+(y-55296<<10)+(x-56320),b++),y<128?m[w++]=y:(y<2048?m[w++]=192|y>>>6:(y<65536?m[w++]=224|y>>>12:(m[w++]=240|y>>>18,m[w++]=128|y>>>12&63),m[w++]=128|y>>>6&63),m[w++]=128|63&y);return m})(d)},o.utf8decode=function(d){return s.nodebuffer?i.transformTo("nodebuffer",d).toString("utf-8"):(function(g){var m,y,x,b,w=g.length,S=new Array(2*w);for(m=y=0;m<w;)if((x=g[m++])<128)S[y++]=x;else if(4<(b=c[x]))S[y++]=65533,m+=b-1;else{for(x&=b===2?31:b===3?15:7;1<b&&m<w;)x=x<<6|63&g[m++],b--;1<b?S[y++]=65533:x<65536?S[y++]=x:(x-=65536,S[y++]=55296|x>>10&1023,S[y++]=56320|1023&x)}return S.length!==y&&(S.subarray?S=S.subarray(0,y):S.length=y),i.applyFromCharCode(S)})(d=i.transformTo(s.uint8array?"uint8array":"array",d))},i.inherits(h,l),h.prototype.processChunk=function(d){var g=i.transformTo(s.uint8array?"uint8array":"array",d.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var m=g;(g=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),g.set(m,this.leftOver.length)}else g=this.leftOver.concat(g);this.leftOver=null}var y=(function(b,w){var S;for((w=w||b.length)>b.length&&(w=b.length),S=w-1;0<=S&&(192&b[S])==128;)S--;return S<0||S===0?w:S+c[b[S]]>w?S:w})(g),x=g;y!==g.length&&(s.uint8array?(x=g.subarray(0,y),this.leftOver=g.subarray(y,g.length)):(x=g.slice(0,y),this.leftOver=g.slice(y,g.length))),this.push({data:o.utf8decode(x),meta:d.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=h,i.inherits(p,l),p.prototype.processChunk=function(d){this.push({data:o.utf8encode(d.data),meta:d.meta})},o.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,o){var i=n("./support"),s=n("./base64"),a=n("./nodejsUtils"),l=n("./external");function c(m){return m}function u(m,y){for(var x=0;x<m.length;++x)y[x]=255&m.charCodeAt(x);return y}n("setimmediate"),o.newBlob=function(m,y){o.checkSupport("blob");try{return new Blob([m],{type:y})}catch{try{var x=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return x.append(m),x.getBlob(y)}catch{throw new Error("Bug : can't construct the Blob.")}}};var h={stringifyByChunk:function(m,y,x){var b=[],w=0,S=m.length;if(S<=x)return String.fromCharCode.apply(null,m);for(;w<S;)y==="array"||y==="nodebuffer"?b.push(String.fromCharCode.apply(null,m.slice(w,Math.min(w+x,S)))):b.push(String.fromCharCode.apply(null,m.subarray(w,Math.min(w+x,S)))),w+=x;return b.join("")},stringifyByChar:function(m){for(var y="",x=0;x<m.length;x++)y+=String.fromCharCode(m[x]);return y},applyCanBeUsed:{uint8array:(function(){try{return i.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return i.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}})()}};function p(m){var y=65536,x=o.getTypeOf(m),b=!0;if(x==="uint8array"?b=h.applyCanBeUsed.uint8array:x==="nodebuffer"&&(b=h.applyCanBeUsed.nodebuffer),b)for(;1<y;)try{return h.stringifyByChunk(m,x,y)}catch{y=Math.floor(y/2)}return h.stringifyByChar(m)}function d(m,y){for(var x=0;x<m.length;x++)y[x]=m[x];return y}o.applyFromCharCode=p;var g={};g.string={string:c,array:function(m){return u(m,new Array(m.length))},arraybuffer:function(m){return g.string.uint8array(m).buffer},uint8array:function(m){return u(m,new Uint8Array(m.length))},nodebuffer:function(m){return u(m,a.allocBuffer(m.length))}},g.array={string:p,array:c,arraybuffer:function(m){return new Uint8Array(m).buffer},uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(m)}},g.arraybuffer={string:function(m){return p(new Uint8Array(m))},array:function(m){return d(new Uint8Array(m),new Array(m.byteLength))},arraybuffer:c,uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(new Uint8Array(m))}},g.uint8array={string:p,array:function(m){return d(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:c,nodebuffer:function(m){return a.newBufferFrom(m)}},g.nodebuffer={string:p,array:function(m){return d(m,new Array(m.length))},arraybuffer:function(m){return g.nodebuffer.uint8array(m).buffer},uint8array:function(m){return d(m,new Uint8Array(m.length))},nodebuffer:c},o.transformTo=function(m,y){if(y=y||"",!m)return y;o.checkSupport(m);var x=o.getTypeOf(y);return g[x][m](y)},o.resolve=function(m){for(var y=m.split("/"),x=[],b=0;b<y.length;b++){var w=y[b];w==="."||w===""&&b!==0&&b!==y.length-1||(w===".."?x.pop():x.push(w))}return x.join("/")},o.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":i.nodebuffer&&a.isBuffer(m)?"nodebuffer":i.uint8array&&m instanceof Uint8Array?"uint8array":i.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(m){if(!i[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(m){var y,x,b="";for(x=0;x<(m||"").length;x++)b+="\\x"+((y=m.charCodeAt(x))<16?"0":"")+y.toString(16).toUpperCase();return b},o.delay=function(m,y,x){setImmediate(function(){m.apply(x||null,y||[])})},o.inherits=function(m,y){function x(){}x.prototype=y.prototype,m.prototype=new x},o.extend=function(){var m,y,x={};for(m=0;m<arguments.length;m++)for(y in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],y)&&x[y]===void 0&&(x[y]=arguments[m][y]);return x},o.prepareContent=function(m,y,x,b,w){return l.Promise.resolve(y).then(function(S){return i.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1)&&typeof FileReader<"u"?new l.Promise(function(C,N){var z=new FileReader;z.onload=function(A){C(A.target.result)},z.onerror=function(A){N(A.target.error)},z.readAsArrayBuffer(S)}):S}).then(function(S){var C=o.getTypeOf(S);return C?(C==="arraybuffer"?S=o.transformTo("uint8array",S):C==="string"&&(w?S=s.decode(S):x&&b!==!0&&(S=(function(N){return u(N,i.uint8array?new Uint8Array(N.length):new Array(N.length))})(S))),S):l.Promise.reject(new Error("Can't read the data of '"+m+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,o){var i=n("./reader/readerFor"),s=n("./utils"),a=n("./signature"),l=n("./zipEntry"),c=n("./support");function u(h){this.files=[],this.loadOptions=h}u.prototype={checkSignature:function(h){if(!this.reader.readAndCheckSignature(h)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(p)+", expected "+s.pretty(h)+")")}},isSignature:function(h,p){var d=this.reader.index;this.reader.setIndex(h);var g=this.reader.readString(4)===p;return this.reader.setIndex(d),g},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var h=this.reader.readData(this.zipCommentLength),p=c.uint8array?"uint8array":"array",d=s.transformTo(p,h);this.zipComment=this.loadOptions.decodeFileName(d)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var h,p,d,g=this.zip64EndOfCentralSize-44;0<g;)h=this.reader.readInt(2),p=this.reader.readInt(4),d=this.reader.readData(p),this.zip64ExtensibleData[h]={id:h,length:p,value:d}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var h,p;for(h=0;h<this.files.length;h++)p=this.files[h],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var h;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(h=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(h);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var h=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(h<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(h);var p=h;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(h=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(h),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var d=this.centralDirOffset+this.centralDirSize;this.zip64&&(d+=20,d+=12+this.zip64EndOfCentralSize);var g=p-d;if(0<g)this.isSignature(p,a.CENTRAL_FILE_HEADER)||(this.reader.zero=g);else if(g<0)throw new Error("Corrupted zip: missing "+Math.abs(g)+" bytes.")},prepareReader:function(h){this.reader=i(h)},load:function(h){this.prepareReader(h),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,o){var i=n("./reader/readerFor"),s=n("./utils"),a=n("./compressedObject"),l=n("./crc32"),c=n("./utf8"),u=n("./compressions"),h=n("./support");function p(d,g){this.options=d,this.loadOptions=g}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(d){var g,m;if(d.skip(22),this.fileNameLength=d.readInt(2),m=d.readInt(2),this.fileName=d.readData(this.fileNameLength),d.skip(m),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((g=(function(y){for(var x in u)if(Object.prototype.hasOwnProperty.call(u,x)&&u[x].magic===y)return u[x];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,g,d.readData(this.compressedSize))},readCentralPart:function(d){this.versionMadeBy=d.readInt(2),d.skip(2),this.bitFlag=d.readInt(2),this.compressionMethod=d.readString(2),this.date=d.readDate(),this.crc32=d.readInt(4),this.compressedSize=d.readInt(4),this.uncompressedSize=d.readInt(4);var g=d.readInt(2);if(this.extraFieldsLength=d.readInt(2),this.fileCommentLength=d.readInt(2),this.diskNumberStart=d.readInt(2),this.internalFileAttributes=d.readInt(2),this.externalFileAttributes=d.readInt(4),this.localHeaderOffset=d.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");d.skip(g),this.readExtraFields(d),this.parseZIP64ExtraField(d),this.fileComment=d.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var d=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),d==0&&(this.dosPermissions=63&this.externalFileAttributes),d==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var d=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=d.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=d.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=d.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=d.readInt(4))}},readExtraFields:function(d){var g,m,y,x=d.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});d.index+4<x;)g=d.readInt(2),m=d.readInt(2),y=d.readData(m),this.extraFields[g]={id:g,length:m,value:y};d.setIndex(x)},handleUTF8:function(){var d=h.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var g=this.findExtraFieldUnicodePath();if(g!==null)this.fileNameStr=g;else{var m=s.transformTo(d,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var y=this.findExtraFieldUnicodeComment();if(y!==null)this.fileCommentStr=y;else{var x=s.transformTo(d,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(x)}}},findExtraFieldUnicodePath:function(){var d=this.extraFields[28789];if(d){var g=i(d.value);return g.readInt(1)!==1||l(this.fileName)!==g.readInt(4)?null:c.utf8decode(g.readData(d.length-5))}return null},findExtraFieldUnicodeComment:function(){var d=this.extraFields[25461];if(d){var g=i(d.value);return g.readInt(1)!==1||l(this.fileComment)!==g.readInt(4)?null:c.utf8decode(g.readData(d.length-5))}return null}},r.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,o){function i(g,m,y){this.name=g,this.dir=y.dir,this.date=y.date,this.comment=y.comment,this.unixPermissions=y.unixPermissions,this.dosPermissions=y.dosPermissions,this._data=m,this._dataBinary=y.binary,this.options={compression:y.compression,compressionOptions:y.compressionOptions}}var s=n("./stream/StreamHelper"),a=n("./stream/DataWorker"),l=n("./utf8"),c=n("./compressedObject"),u=n("./stream/GenericWorker");i.prototype={internalStream:function(g){var m=null,y="string";try{if(!g)throw new Error("No output type specified.");var x=(y=g.toLowerCase())==="string"||y==="text";y!=="binarystring"&&y!=="text"||(y="string"),m=this._decompressWorker();var b=!this._dataBinary;b&&!x&&(m=m.pipe(new l.Utf8EncodeWorker)),!b&&x&&(m=m.pipe(new l.Utf8DecodeWorker))}catch(w){(m=new u("error")).error(w)}return new s(m,y,"")},async:function(g,m){return this.internalStream(g).accumulate(m)},nodeStream:function(g,m){return this.internalStream(g||"nodebuffer").toNodejsStream(m)},_compressWorker:function(g,m){if(this._data instanceof c&&this._data.compression.magic===g.magic)return this._data.getCompressedWorker();var y=this._decompressWorker();return this._dataBinary||(y=y.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(y,g,m)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof u?this._data:new a(this._data)}};for(var h=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},d=0;d<h.length;d++)i.prototype[h[d]]=p;r.exports=i},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,o){(function(i){var s,a,l=i.MutationObserver||i.WebKitMutationObserver;if(l){var c=0,u=new l(g),h=i.document.createTextNode("");u.observe(h,{characterData:!0}),s=function(){h.data=c=++c%2}}else if(i.setImmediate||i.MessageChannel===void 0)s="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var m=i.document.createElement("script");m.onreadystatechange=function(){g(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},i.document.documentElement.appendChild(m)}:function(){setTimeout(g,0)};else{var p=new i.MessageChannel;p.port1.onmessage=g,s=function(){p.port2.postMessage(0)}}var d=[];function g(){var m,y;a=!0;for(var x=d.length;x;){for(y=d,d=[],m=-1;++m<x;)y[m]();x=d.length}a=!1}r.exports=function(m){d.push(m)!==1||a||s()}}).call(this,typeof wr<"u"?wr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,o){var i=n("immediate");function s(){}var a={},l=["REJECTED"],c=["FULFILLED"],u=["PENDING"];function h(x){if(typeof x!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,x!==s&&m(this,x)}function p(x,b,w){this.promise=x,typeof b=="function"&&(this.onFulfilled=b,this.callFulfilled=this.otherCallFulfilled),typeof w=="function"&&(this.onRejected=w,this.callRejected=this.otherCallRejected)}function d(x,b,w){i(function(){var S;try{S=b(w)}catch(C){return a.reject(x,C)}S===x?a.reject(x,new TypeError("Cannot resolve promise with itself")):a.resolve(x,S)})}function g(x){var b=x&&x.then;if(x&&(typeof x=="object"||typeof x=="function")&&typeof b=="function")return function(){b.apply(x,arguments)}}function m(x,b){var w=!1;function S(z){w||(w=!0,a.reject(x,z))}function C(z){w||(w=!0,a.resolve(x,z))}var N=y(function(){b(C,S)});N.status==="error"&&S(N.value)}function y(x,b){var w={};try{w.value=x(b),w.status="success"}catch(S){w.status="error",w.value=S}return w}(r.exports=h).prototype.finally=function(x){if(typeof x!="function")return this;var b=this.constructor;return this.then(function(w){return b.resolve(x()).then(function(){return w})},function(w){return b.resolve(x()).then(function(){throw w})})},h.prototype.catch=function(x){return this.then(null,x)},h.prototype.then=function(x,b){if(typeof x!="function"&&this.state===c||typeof b!="function"&&this.state===l)return this;var w=new this.constructor(s);return this.state!==u?d(w,this.state===c?x:b,this.outcome):this.queue.push(new p(w,x,b)),w},p.prototype.callFulfilled=function(x){a.resolve(this.promise,x)},p.prototype.otherCallFulfilled=function(x){d(this.promise,this.onFulfilled,x)},p.prototype.callRejected=function(x){a.reject(this.promise,x)},p.prototype.otherCallRejected=function(x){d(this.promise,this.onRejected,x)},a.resolve=function(x,b){var w=y(g,b);if(w.status==="error")return a.reject(x,w.value);var S=w.value;if(S)m(x,S);else{x.state=c,x.outcome=b;for(var C=-1,N=x.queue.length;++C<N;)x.queue[C].callFulfilled(b)}return x},a.reject=function(x,b){x.state=l,x.outcome=b;for(var w=-1,S=x.queue.length;++w<S;)x.queue[w].callRejected(b);return x},h.resolve=function(x){return x instanceof this?x:a.resolve(new this(s),x)},h.reject=function(x){var b=new this(s);return a.reject(b,x)},h.all=function(x){var b=this;if(Object.prototype.toString.call(x)!=="[object Array]")return this.reject(new TypeError("must be an array"));var w=x.length,S=!1;if(!w)return this.resolve([]);for(var C=new Array(w),N=0,z=-1,A=new this(s);++z<w;)O(x[z],z);return A;function O(P,L){b.resolve(P).then(function(T){C[L]=T,++N!==w||S||(S=!0,a.resolve(A,C))},function(T){S||(S=!0,a.reject(A,T))})}},h.race=function(x){var b=this;if(Object.prototype.toString.call(x)!=="[object Array]")return this.reject(new TypeError("must be an array"));var w=x.length,S=!1;if(!w)return this.resolve([]);for(var C=-1,N=new this(s);++C<w;)z=x[C],b.resolve(z).then(function(A){S||(S=!0,a.resolve(N,A))},function(A){S||(S=!0,a.reject(N,A))});var z;return N}},{immediate:36}],38:[function(n,r,o){var i={};(0,n("./lib/utils/common").assign)(i,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,o){var i=n("./zlib/deflate"),s=n("./utils/common"),a=n("./utils/strings"),l=n("./zlib/messages"),c=n("./zlib/zstream"),u=Object.prototype.toString,h=0,p=-1,d=0,g=8;function m(x){if(!(this instanceof m))return new m(x);this.options=s.assign({level:p,method:g,chunkSize:16384,windowBits:15,memLevel:8,strategy:d,to:""},x||{});var b=this.options;b.raw&&0<b.windowBits?b.windowBits=-b.windowBits:b.gzip&&0<b.windowBits&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var w=i.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(w!==h)throw new Error(l[w]);if(b.header&&i.deflateSetHeader(this.strm,b.header),b.dictionary){var S;if(S=typeof b.dictionary=="string"?a.string2buf(b.dictionary):u.call(b.dictionary)==="[object ArrayBuffer]"?new Uint8Array(b.dictionary):b.dictionary,(w=i.deflateSetDictionary(this.strm,S))!==h)throw new Error(l[w]);this._dict_set=!0}}function y(x,b){var w=new m(b);if(w.push(x,!0),w.err)throw w.msg||l[w.err];return w.result}m.prototype.push=function(x,b){var w,S,C=this.strm,N=this.options.chunkSize;if(this.ended)return!1;S=b===~~b?b:b===!0?4:0,typeof x=="string"?C.input=a.string2buf(x):u.call(x)==="[object ArrayBuffer]"?C.input=new Uint8Array(x):C.input=x,C.next_in=0,C.avail_in=C.input.length;do{if(C.avail_out===0&&(C.output=new s.Buf8(N),C.next_out=0,C.avail_out=N),(w=i.deflate(C,S))!==1&&w!==h)return this.onEnd(w),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(C.output,C.next_out))):this.onData(s.shrinkBuf(C.output,C.next_out)))}while((0<C.avail_in||C.avail_out===0)&&w!==1);return S===4?(w=i.deflateEnd(this.strm),this.onEnd(w),this.ended=!0,w===h):S!==2||(this.onEnd(h),!(C.avail_out=0))},m.prototype.onData=function(x){this.chunks.push(x)},m.prototype.onEnd=function(x){x===h&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=x,this.msg=this.strm.msg},o.Deflate=m,o.deflate=y,o.deflateRaw=function(x,b){return(b=b||{}).raw=!0,y(x,b)},o.gzip=function(x,b){return(b=b||{}).gzip=!0,y(x,b)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,o){var i=n("./zlib/inflate"),s=n("./utils/common"),a=n("./utils/strings"),l=n("./zlib/constants"),c=n("./zlib/messages"),u=n("./zlib/zstream"),h=n("./zlib/gzheader"),p=Object.prototype.toString;function d(m){if(!(this instanceof d))return new d(m);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},m||{});var y=this.options;y.raw&&0<=y.windowBits&&y.windowBits<16&&(y.windowBits=-y.windowBits,y.windowBits===0&&(y.windowBits=-15)),!(0<=y.windowBits&&y.windowBits<16)||m&&m.windowBits||(y.windowBits+=32),15<y.windowBits&&y.windowBits<48&&(15&y.windowBits)==0&&(y.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var x=i.inflateInit2(this.strm,y.windowBits);if(x!==l.Z_OK)throw new Error(c[x]);this.header=new h,i.inflateGetHeader(this.strm,this.header)}function g(m,y){var x=new d(y);if(x.push(m,!0),x.err)throw x.msg||c[x.err];return x.result}d.prototype.push=function(m,y){var x,b,w,S,C,N,z=this.strm,A=this.options.chunkSize,O=this.options.dictionary,P=!1;if(this.ended)return!1;b=y===~~y?y:y===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof m=="string"?z.input=a.binstring2buf(m):p.call(m)==="[object ArrayBuffer]"?z.input=new Uint8Array(m):z.input=m,z.next_in=0,z.avail_in=z.input.length;do{if(z.avail_out===0&&(z.output=new s.Buf8(A),z.next_out=0,z.avail_out=A),(x=i.inflate(z,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&O&&(N=typeof O=="string"?a.string2buf(O):p.call(O)==="[object ArrayBuffer]"?new Uint8Array(O):O,x=i.inflateSetDictionary(this.strm,N)),x===l.Z_BUF_ERROR&&P===!0&&(x=l.Z_OK,P=!1),x!==l.Z_STREAM_END&&x!==l.Z_OK)return this.onEnd(x),!(this.ended=!0);z.next_out&&(z.avail_out!==0&&x!==l.Z_STREAM_END&&(z.avail_in!==0||b!==l.Z_FINISH&&b!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(w=a.utf8border(z.output,z.next_out),S=z.next_out-w,C=a.buf2string(z.output,w),z.next_out=S,z.avail_out=A-S,S&&s.arraySet(z.output,z.output,w,S,0),this.onData(C)):this.onData(s.shrinkBuf(z.output,z.next_out)))),z.avail_in===0&&z.avail_out===0&&(P=!0)}while((0<z.avail_in||z.avail_out===0)&&x!==l.Z_STREAM_END);return x===l.Z_STREAM_END&&(b=l.Z_FINISH),b===l.Z_FINISH?(x=i.inflateEnd(this.strm),this.onEnd(x),this.ended=!0,x===l.Z_OK):b!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(z.avail_out=0))},d.prototype.onData=function(m){this.chunks.push(m)},d.prototype.onEnd=function(m){m===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg},o.Inflate=d,o.inflate=g,o.inflateRaw=function(m,y){return(y=y||{}).raw=!0,g(m,y)},o.ungzip=g},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var u=c.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(var h in u)u.hasOwnProperty(h)&&(l[h]=u[h])}}return l},o.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var s={arraySet:function(l,c,u,h,p){if(c.subarray&&l.subarray)l.set(c.subarray(u,u+h),p);else for(var d=0;d<h;d++)l[p+d]=c[u+d]},flattenChunks:function(l){var c,u,h,p,d,g;for(c=h=0,u=l.length;c<u;c++)h+=l[c].length;for(g=new Uint8Array(h),c=p=0,u=l.length;c<u;c++)d=l[c],g.set(d,p),p+=d.length;return g}},a={arraySet:function(l,c,u,h,p){for(var d=0;d<h;d++)l[p+d]=c[u+d]},flattenChunks:function(l){return[].concat.apply([],l)}};o.setTyped=function(l){l?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,s)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,a))},o.setTyped(i)},{}],42:[function(n,r,o){var i=n("./common"),s=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var l=new i.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function u(h,p){if(p<65537&&(h.subarray&&a||!h.subarray&&s))return String.fromCharCode.apply(null,i.shrinkBuf(h,p));for(var d="",g=0;g<p;g++)d+=String.fromCharCode(h[g]);return d}l[254]=l[254]=1,o.string2buf=function(h){var p,d,g,m,y,x=h.length,b=0;for(m=0;m<x;m++)(64512&(d=h.charCodeAt(m)))==55296&&m+1<x&&(64512&(g=h.charCodeAt(m+1)))==56320&&(d=65536+(d-55296<<10)+(g-56320),m++),b+=d<128?1:d<2048?2:d<65536?3:4;for(p=new i.Buf8(b),m=y=0;y<b;m++)(64512&(d=h.charCodeAt(m)))==55296&&m+1<x&&(64512&(g=h.charCodeAt(m+1)))==56320&&(d=65536+(d-55296<<10)+(g-56320),m++),d<128?p[y++]=d:(d<2048?p[y++]=192|d>>>6:(d<65536?p[y++]=224|d>>>12:(p[y++]=240|d>>>18,p[y++]=128|d>>>12&63),p[y++]=128|d>>>6&63),p[y++]=128|63&d);return p},o.buf2binstring=function(h){return u(h,h.length)},o.binstring2buf=function(h){for(var p=new i.Buf8(h.length),d=0,g=p.length;d<g;d++)p[d]=h.charCodeAt(d);return p},o.buf2string=function(h,p){var d,g,m,y,x=p||h.length,b=new Array(2*x);for(d=g=0;d<x;)if((m=h[d++])<128)b[g++]=m;else if(4<(y=l[m]))b[g++]=65533,d+=y-1;else{for(m&=y===2?31:y===3?15:7;1<y&&d<x;)m=m<<6|63&h[d++],y--;1<y?b[g++]=65533:m<65536?b[g++]=m:(m-=65536,b[g++]=55296|m>>10&1023,b[g++]=56320|1023&m)}return u(b,g)},o.utf8border=function(h,p){var d;for((p=p||h.length)>h.length&&(p=h.length),d=p-1;0<=d&&(192&h[d])==128;)d--;return d<0||d===0?p:d+l[h[d]]>p?d:p}},{"./common":41}],43:[function(n,r,o){r.exports=function(i,s,a,l){for(var c=65535&i|0,u=i>>>16&65535|0,h=0;a!==0;){for(a-=h=2e3<a?2e3:a;u=u+(c=c+s[l++]|0)|0,--h;);c%=65521,u%=65521}return c|u<<16|0}},{}],44:[function(n,r,o){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(n,r,o){var i=(function(){for(var s,a=[],l=0;l<256;l++){s=l;for(var c=0;c<8;c++)s=1&s?3988292384^s>>>1:s>>>1;a[l]=s}return a})();r.exports=function(s,a,l,c){var u=i,h=c+l;s^=-1;for(var p=c;p<h;p++)s=s>>>8^u[255&(s^a[p])];return-1^s}},{}],46:[function(n,r,o){var i,s=n("../utils/common"),a=n("./trees"),l=n("./adler32"),c=n("./crc32"),u=n("./messages"),h=0,p=4,d=0,g=-2,m=-1,y=4,x=2,b=8,w=9,S=286,C=30,N=19,z=2*S+1,A=15,O=3,P=258,L=P+O+1,T=42,M=113,_=1,D=2,G=3,Z=4;function te(k,J){return k.msg=u[J],J}function q(k){return(k<<1)-(4<k?9:0)}function E(k){for(var J=k.length;0<=--J;)k[J]=0}function U(k){var J=k.state,V=J.pending;V>k.avail_out&&(V=k.avail_out),V!==0&&(s.arraySet(k.output,J.pending_buf,J.pending_out,V,k.next_out),k.next_out+=V,J.pending_out+=V,k.total_out+=V,k.avail_out-=V,J.pending-=V,J.pending===0&&(J.pending_out=0))}function B(k,J){a._tr_flush_block(k,0<=k.block_start?k.block_start:-1,k.strstart-k.block_start,J),k.block_start=k.strstart,U(k.strm)}function j(k,J){k.pending_buf[k.pending++]=J}function Y(k,J){k.pending_buf[k.pending++]=J>>>8&255,k.pending_buf[k.pending++]=255&J}function H(k,J){var V,R,I=k.max_chain_length,F=k.strstart,Q=k.prev_length,ne=k.nice_match,W=k.strstart>k.w_size-L?k.strstart-(k.w_size-L):0,se=k.window,fe=k.w_mask,ae=k.prev,$=k.strstart+P,ee=se[F+Q-1],ue=se[F+Q];k.prev_length>=k.good_match&&(I>>=2),ne>k.lookahead&&(ne=k.lookahead);do if(se[(V=J)+Q]===ue&&se[V+Q-1]===ee&&se[V]===se[F]&&se[++V]===se[F+1]){F+=2,V++;do;while(se[++F]===se[++V]&&se[++F]===se[++V]&&se[++F]===se[++V]&&se[++F]===se[++V]&&se[++F]===se[++V]&&se[++F]===se[++V]&&se[++F]===se[++V]&&se[++F]===se[++V]&&F<$);if(R=P-($-F),F=$-P,Q<R){if(k.match_start=J,ne<=(Q=R))break;ee=se[F+Q-1],ue=se[F+Q]}}while((J=ae[J&fe])>W&&--I!=0);return Q<=k.lookahead?Q:k.lookahead}function ce(k){var J,V,R,I,F,Q,ne,W,se,fe,ae=k.w_size;do{if(I=k.window_size-k.lookahead-k.strstart,k.strstart>=ae+(ae-L)){for(s.arraySet(k.window,k.window,ae,ae,0),k.match_start-=ae,k.strstart-=ae,k.block_start-=ae,J=V=k.hash_size;R=k.head[--J],k.head[J]=ae<=R?R-ae:0,--V;);for(J=V=ae;R=k.prev[--J],k.prev[J]=ae<=R?R-ae:0,--V;);I+=ae}if(k.strm.avail_in===0)break;if(Q=k.strm,ne=k.window,W=k.strstart+k.lookahead,se=I,fe=void 0,fe=Q.avail_in,se<fe&&(fe=se),V=fe===0?0:(Q.avail_in-=fe,s.arraySet(ne,Q.input,Q.next_in,fe,W),Q.state.wrap===1?Q.adler=l(Q.adler,ne,fe,W):Q.state.wrap===2&&(Q.adler=c(Q.adler,ne,fe,W)),Q.next_in+=fe,Q.total_in+=fe,fe),k.lookahead+=V,k.lookahead+k.insert>=O)for(F=k.strstart-k.insert,k.ins_h=k.window[F],k.ins_h=(k.ins_h<<k.hash_shift^k.window[F+1])&k.hash_mask;k.insert&&(k.ins_h=(k.ins_h<<k.hash_shift^k.window[F+O-1])&k.hash_mask,k.prev[F&k.w_mask]=k.head[k.ins_h],k.head[k.ins_h]=F,F++,k.insert--,!(k.lookahead+k.insert<O)););}while(k.lookahead<L&&k.strm.avail_in!==0)}function ie(k,J){for(var V,R;;){if(k.lookahead<L){if(ce(k),k.lookahead<L&&J===h)return _;if(k.lookahead===0)break}if(V=0,k.lookahead>=O&&(k.ins_h=(k.ins_h<<k.hash_shift^k.window[k.strstart+O-1])&k.hash_mask,V=k.prev[k.strstart&k.w_mask]=k.head[k.ins_h],k.head[k.ins_h]=k.strstart),V!==0&&k.strstart-V<=k.w_size-L&&(k.match_length=H(k,V)),k.match_length>=O)if(R=a._tr_tally(k,k.strstart-k.match_start,k.match_length-O),k.lookahead-=k.match_length,k.match_length<=k.max_lazy_match&&k.lookahead>=O){for(k.match_length--;k.strstart++,k.ins_h=(k.ins_h<<k.hash_shift^k.window[k.strstart+O-1])&k.hash_mask,V=k.prev[k.strstart&k.w_mask]=k.head[k.ins_h],k.head[k.ins_h]=k.strstart,--k.match_length!=0;);k.strstart++}else k.strstart+=k.match_length,k.match_length=0,k.ins_h=k.window[k.strstart],k.ins_h=(k.ins_h<<k.hash_shift^k.window[k.strstart+1])&k.hash_mask;else R=a._tr_tally(k,0,k.window[k.strstart]),k.lookahead--,k.strstart++;if(R&&(B(k,!1),k.strm.avail_out===0))return _}return k.insert=k.strstart<O-1?k.strstart:O-1,J===p?(B(k,!0),k.strm.avail_out===0?G:Z):k.last_lit&&(B(k,!1),k.strm.avail_out===0)?_:D}function re(k,J){for(var V,R,I;;){if(k.lookahead<L){if(ce(k),k.lookahead<L&&J===h)return _;if(k.lookahead===0)break}if(V=0,k.lookahead>=O&&(k.ins_h=(k.ins_h<<k.hash_shift^k.window[k.strstart+O-1])&k.hash_mask,V=k.prev[k.strstart&k.w_mask]=k.head[k.ins_h],k.head[k.ins_h]=k.strstart),k.prev_length=k.match_length,k.prev_match=k.match_start,k.match_length=O-1,V!==0&&k.prev_length<k.max_lazy_match&&k.strstart-V<=k.w_size-L&&(k.match_length=H(k,V),k.match_length<=5&&(k.strategy===1||k.match_length===O&&4096<k.strstart-k.match_start)&&(k.match_length=O-1)),k.prev_length>=O&&k.match_length<=k.prev_length){for(I=k.strstart+k.lookahead-O,R=a._tr_tally(k,k.strstart-1-k.prev_match,k.prev_length-O),k.lookahead-=k.prev_length-1,k.prev_length-=2;++k.strstart<=I&&(k.ins_h=(k.ins_h<<k.hash_shift^k.window[k.strstart+O-1])&k.hash_mask,V=k.prev[k.strstart&k.w_mask]=k.head[k.ins_h],k.head[k.ins_h]=k.strstart),--k.prev_length!=0;);if(k.match_available=0,k.match_length=O-1,k.strstart++,R&&(B(k,!1),k.strm.avail_out===0))return _}else if(k.match_available){if((R=a._tr_tally(k,0,k.window[k.strstart-1]))&&B(k,!1),k.strstart++,k.lookahead--,k.strm.avail_out===0)return _}else k.match_available=1,k.strstart++,k.lookahead--}return k.match_available&&(R=a._tr_tally(k,0,k.window[k.strstart-1]),k.match_available=0),k.insert=k.strstart<O-1?k.strstart:O-1,J===p?(B(k,!0),k.strm.avail_out===0?G:Z):k.last_lit&&(B(k,!1),k.strm.avail_out===0)?_:D}function le(k,J,V,R,I){this.good_length=k,this.max_lazy=J,this.nice_length=V,this.max_chain=R,this.func=I}function me(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=b,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*z),this.dyn_dtree=new s.Buf16(2*(2*C+1)),this.bl_tree=new s.Buf16(2*(2*N+1)),E(this.dyn_ltree),E(this.dyn_dtree),E(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(A+1),this.heap=new s.Buf16(2*S+1),E(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*S+1),E(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function xe(k){var J;return k&&k.state?(k.total_in=k.total_out=0,k.data_type=x,(J=k.state).pending=0,J.pending_out=0,J.wrap<0&&(J.wrap=-J.wrap),J.status=J.wrap?T:M,k.adler=J.wrap===2?0:1,J.last_flush=h,a._tr_init(J),d):te(k,g)}function Te(k){var J=xe(k);return J===d&&(function(V){V.window_size=2*V.w_size,E(V.head),V.max_lazy_match=i[V.level].max_lazy,V.good_match=i[V.level].good_length,V.nice_match=i[V.level].nice_length,V.max_chain_length=i[V.level].max_chain,V.strstart=0,V.block_start=0,V.lookahead=0,V.insert=0,V.match_length=V.prev_length=O-1,V.match_available=0,V.ins_h=0})(k.state),J}function Pe(k,J,V,R,I,F){if(!k)return g;var Q=1;if(J===m&&(J=6),R<0?(Q=0,R=-R):15<R&&(Q=2,R-=16),I<1||w<I||V!==b||R<8||15<R||J<0||9<J||F<0||y<F)return te(k,g);R===8&&(R=9);var ne=new me;return(k.state=ne).strm=k,ne.wrap=Q,ne.gzhead=null,ne.w_bits=R,ne.w_size=1<<ne.w_bits,ne.w_mask=ne.w_size-1,ne.hash_bits=I+7,ne.hash_size=1<<ne.hash_bits,ne.hash_mask=ne.hash_size-1,ne.hash_shift=~~((ne.hash_bits+O-1)/O),ne.window=new s.Buf8(2*ne.w_size),ne.head=new s.Buf16(ne.hash_size),ne.prev=new s.Buf16(ne.w_size),ne.lit_bufsize=1<<I+6,ne.pending_buf_size=4*ne.lit_bufsize,ne.pending_buf=new s.Buf8(ne.pending_buf_size),ne.d_buf=1*ne.lit_bufsize,ne.l_buf=3*ne.lit_bufsize,ne.level=J,ne.strategy=F,ne.method=V,Te(k)}i=[new le(0,0,0,0,function(k,J){var V=65535;for(V>k.pending_buf_size-5&&(V=k.pending_buf_size-5);;){if(k.lookahead<=1){if(ce(k),k.lookahead===0&&J===h)return _;if(k.lookahead===0)break}k.strstart+=k.lookahead,k.lookahead=0;var R=k.block_start+V;if((k.strstart===0||k.strstart>=R)&&(k.lookahead=k.strstart-R,k.strstart=R,B(k,!1),k.strm.avail_out===0)||k.strstart-k.block_start>=k.w_size-L&&(B(k,!1),k.strm.avail_out===0))return _}return k.insert=0,J===p?(B(k,!0),k.strm.avail_out===0?G:Z):(k.strstart>k.block_start&&(B(k,!1),k.strm.avail_out),_)}),new le(4,4,8,4,ie),new le(4,5,16,8,ie),new le(4,6,32,32,ie),new le(4,4,16,16,re),new le(8,16,32,32,re),new le(8,16,128,128,re),new le(8,32,128,256,re),new le(32,128,258,1024,re),new le(32,258,258,4096,re)],o.deflateInit=function(k,J){return Pe(k,J,b,15,8,0)},o.deflateInit2=Pe,o.deflateReset=Te,o.deflateResetKeep=xe,o.deflateSetHeader=function(k,J){return k&&k.state?k.state.wrap!==2?g:(k.state.gzhead=J,d):g},o.deflate=function(k,J){var V,R,I,F;if(!k||!k.state||5<J||J<0)return k?te(k,g):g;if(R=k.state,!k.output||!k.input&&k.avail_in!==0||R.status===666&&J!==p)return te(k,k.avail_out===0?-5:g);if(R.strm=k,V=R.last_flush,R.last_flush=J,R.status===T)if(R.wrap===2)k.adler=0,j(R,31),j(R,139),j(R,8),R.gzhead?(j(R,(R.gzhead.text?1:0)+(R.gzhead.hcrc?2:0)+(R.gzhead.extra?4:0)+(R.gzhead.name?8:0)+(R.gzhead.comment?16:0)),j(R,255&R.gzhead.time),j(R,R.gzhead.time>>8&255),j(R,R.gzhead.time>>16&255),j(R,R.gzhead.time>>24&255),j(R,R.level===9?2:2<=R.strategy||R.level<2?4:0),j(R,255&R.gzhead.os),R.gzhead.extra&&R.gzhead.extra.length&&(j(R,255&R.gzhead.extra.length),j(R,R.gzhead.extra.length>>8&255)),R.gzhead.hcrc&&(k.adler=c(k.adler,R.pending_buf,R.pending,0)),R.gzindex=0,R.status=69):(j(R,0),j(R,0),j(R,0),j(R,0),j(R,0),j(R,R.level===9?2:2<=R.strategy||R.level<2?4:0),j(R,3),R.status=M);else{var Q=b+(R.w_bits-8<<4)<<8;Q|=(2<=R.strategy||R.level<2?0:R.level<6?1:R.level===6?2:3)<<6,R.strstart!==0&&(Q|=32),Q+=31-Q%31,R.status=M,Y(R,Q),R.strstart!==0&&(Y(R,k.adler>>>16),Y(R,65535&k.adler)),k.adler=1}if(R.status===69)if(R.gzhead.extra){for(I=R.pending;R.gzindex<(65535&R.gzhead.extra.length)&&(R.pending!==R.pending_buf_size||(R.gzhead.hcrc&&R.pending>I&&(k.adler=c(k.adler,R.pending_buf,R.pending-I,I)),U(k),I=R.pending,R.pending!==R.pending_buf_size));)j(R,255&R.gzhead.extra[R.gzindex]),R.gzindex++;R.gzhead.hcrc&&R.pending>I&&(k.adler=c(k.adler,R.pending_buf,R.pending-I,I)),R.gzindex===R.gzhead.extra.length&&(R.gzindex=0,R.status=73)}else R.status=73;if(R.status===73)if(R.gzhead.name){I=R.pending;do{if(R.pending===R.pending_buf_size&&(R.gzhead.hcrc&&R.pending>I&&(k.adler=c(k.adler,R.pending_buf,R.pending-I,I)),U(k),I=R.pending,R.pending===R.pending_buf_size)){F=1;break}F=R.gzindex<R.gzhead.name.length?255&R.gzhead.name.charCodeAt(R.gzindex++):0,j(R,F)}while(F!==0);R.gzhead.hcrc&&R.pending>I&&(k.adler=c(k.adler,R.pending_buf,R.pending-I,I)),F===0&&(R.gzindex=0,R.status=91)}else R.status=91;if(R.status===91)if(R.gzhead.comment){I=R.pending;do{if(R.pending===R.pending_buf_size&&(R.gzhead.hcrc&&R.pending>I&&(k.adler=c(k.adler,R.pending_buf,R.pending-I,I)),U(k),I=R.pending,R.pending===R.pending_buf_size)){F=1;break}F=R.gzindex<R.gzhead.comment.length?255&R.gzhead.comment.charCodeAt(R.gzindex++):0,j(R,F)}while(F!==0);R.gzhead.hcrc&&R.pending>I&&(k.adler=c(k.adler,R.pending_buf,R.pending-I,I)),F===0&&(R.status=103)}else R.status=103;if(R.status===103&&(R.gzhead.hcrc?(R.pending+2>R.pending_buf_size&&U(k),R.pending+2<=R.pending_buf_size&&(j(R,255&k.adler),j(R,k.adler>>8&255),k.adler=0,R.status=M)):R.status=M),R.pending!==0){if(U(k),k.avail_out===0)return R.last_flush=-1,d}else if(k.avail_in===0&&q(J)<=q(V)&&J!==p)return te(k,-5);if(R.status===666&&k.avail_in!==0)return te(k,-5);if(k.avail_in!==0||R.lookahead!==0||J!==h&&R.status!==666){var ne=R.strategy===2?(function(W,se){for(var fe;;){if(W.lookahead===0&&(ce(W),W.lookahead===0)){if(se===h)return _;break}if(W.match_length=0,fe=a._tr_tally(W,0,W.window[W.strstart]),W.lookahead--,W.strstart++,fe&&(B(W,!1),W.strm.avail_out===0))return _}return W.insert=0,se===p?(B(W,!0),W.strm.avail_out===0?G:Z):W.last_lit&&(B(W,!1),W.strm.avail_out===0)?_:D})(R,J):R.strategy===3?(function(W,se){for(var fe,ae,$,ee,ue=W.window;;){if(W.lookahead<=P){if(ce(W),W.lookahead<=P&&se===h)return _;if(W.lookahead===0)break}if(W.match_length=0,W.lookahead>=O&&0<W.strstart&&(ae=ue[$=W.strstart-1])===ue[++$]&&ae===ue[++$]&&ae===ue[++$]){ee=W.strstart+P;do;while(ae===ue[++$]&&ae===ue[++$]&&ae===ue[++$]&&ae===ue[++$]&&ae===ue[++$]&&ae===ue[++$]&&ae===ue[++$]&&ae===ue[++$]&&$<ee);W.match_length=P-(ee-$),W.match_length>W.lookahead&&(W.match_length=W.lookahead)}if(W.match_length>=O?(fe=a._tr_tally(W,1,W.match_length-O),W.lookahead-=W.match_length,W.strstart+=W.match_length,W.match_length=0):(fe=a._tr_tally(W,0,W.window[W.strstart]),W.lookahead--,W.strstart++),fe&&(B(W,!1),W.strm.avail_out===0))return _}return W.insert=0,se===p?(B(W,!0),W.strm.avail_out===0?G:Z):W.last_lit&&(B(W,!1),W.strm.avail_out===0)?_:D})(R,J):i[R.level].func(R,J);if(ne!==G&&ne!==Z||(R.status=666),ne===_||ne===G)return k.avail_out===0&&(R.last_flush=-1),d;if(ne===D&&(J===1?a._tr_align(R):J!==5&&(a._tr_stored_block(R,0,0,!1),J===3&&(E(R.head),R.lookahead===0&&(R.strstart=0,R.block_start=0,R.insert=0))),U(k),k.avail_out===0))return R.last_flush=-1,d}return J!==p?d:R.wrap<=0?1:(R.wrap===2?(j(R,255&k.adler),j(R,k.adler>>8&255),j(R,k.adler>>16&255),j(R,k.adler>>24&255),j(R,255&k.total_in),j(R,k.total_in>>8&255),j(R,k.total_in>>16&255),j(R,k.total_in>>24&255)):(Y(R,k.adler>>>16),Y(R,65535&k.adler)),U(k),0<R.wrap&&(R.wrap=-R.wrap),R.pending!==0?d:1)},o.deflateEnd=function(k){var J;return k&&k.state?(J=k.state.status)!==T&&J!==69&&J!==73&&J!==91&&J!==103&&J!==M&&J!==666?te(k,g):(k.state=null,J===M?te(k,-3):d):g},o.deflateSetDictionary=function(k,J){var V,R,I,F,Q,ne,W,se,fe=J.length;if(!k||!k.state||(F=(V=k.state).wrap)===2||F===1&&V.status!==T||V.lookahead)return g;for(F===1&&(k.adler=l(k.adler,J,fe,0)),V.wrap=0,fe>=V.w_size&&(F===0&&(E(V.head),V.strstart=0,V.block_start=0,V.insert=0),se=new s.Buf8(V.w_size),s.arraySet(se,J,fe-V.w_size,V.w_size,0),J=se,fe=V.w_size),Q=k.avail_in,ne=k.next_in,W=k.input,k.avail_in=fe,k.next_in=0,k.input=J,ce(V);V.lookahead>=O;){for(R=V.strstart,I=V.lookahead-(O-1);V.ins_h=(V.ins_h<<V.hash_shift^V.window[R+O-1])&V.hash_mask,V.prev[R&V.w_mask]=V.head[V.ins_h],V.head[V.ins_h]=R,R++,--I;);V.strstart=R,V.lookahead=O-1,ce(V)}return V.strstart+=V.lookahead,V.block_start=V.strstart,V.insert=V.lookahead,V.lookahead=0,V.match_length=V.prev_length=O-1,V.match_available=0,k.next_in=ne,k.input=W,k.avail_in=Q,V.wrap=F,d},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,o){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(n,r,o){r.exports=function(i,s){var a,l,c,u,h,p,d,g,m,y,x,b,w,S,C,N,z,A,O,P,L,T,M,_,D;a=i.state,l=i.next_in,_=i.input,c=l+(i.avail_in-5),u=i.next_out,D=i.output,h=u-(s-i.avail_out),p=u+(i.avail_out-257),d=a.dmax,g=a.wsize,m=a.whave,y=a.wnext,x=a.window,b=a.hold,w=a.bits,S=a.lencode,C=a.distcode,N=(1<<a.lenbits)-1,z=(1<<a.distbits)-1;e:do{w<15&&(b+=_[l++]<<w,w+=8,b+=_[l++]<<w,w+=8),A=S[b&N];t:for(;;){if(b>>>=O=A>>>24,w-=O,(O=A>>>16&255)===0)D[u++]=65535&A;else{if(!(16&O)){if((64&O)==0){A=S[(65535&A)+(b&(1<<O)-1)];continue t}if(32&O){a.mode=12;break e}i.msg="invalid literal/length code",a.mode=30;break e}P=65535&A,(O&=15)&&(w<O&&(b+=_[l++]<<w,w+=8),P+=b&(1<<O)-1,b>>>=O,w-=O),w<15&&(b+=_[l++]<<w,w+=8,b+=_[l++]<<w,w+=8),A=C[b&z];n:for(;;){if(b>>>=O=A>>>24,w-=O,!(16&(O=A>>>16&255))){if((64&O)==0){A=C[(65535&A)+(b&(1<<O)-1)];continue n}i.msg="invalid distance code",a.mode=30;break e}if(L=65535&A,w<(O&=15)&&(b+=_[l++]<<w,(w+=8)<O&&(b+=_[l++]<<w,w+=8)),d<(L+=b&(1<<O)-1)){i.msg="invalid distance too far back",a.mode=30;break e}if(b>>>=O,w-=O,(O=u-h)<L){if(m<(O=L-O)&&a.sane){i.msg="invalid distance too far back",a.mode=30;break e}if(M=x,(T=0)===y){if(T+=g-O,O<P){for(P-=O;D[u++]=x[T++],--O;);T=u-L,M=D}}else if(y<O){if(T+=g+y-O,(O-=y)<P){for(P-=O;D[u++]=x[T++],--O;);if(T=0,y<P){for(P-=O=y;D[u++]=x[T++],--O;);T=u-L,M=D}}}else if(T+=y-O,O<P){for(P-=O;D[u++]=x[T++],--O;);T=u-L,M=D}for(;2<P;)D[u++]=M[T++],D[u++]=M[T++],D[u++]=M[T++],P-=3;P&&(D[u++]=M[T++],1<P&&(D[u++]=M[T++]))}else{for(T=u-L;D[u++]=D[T++],D[u++]=D[T++],D[u++]=D[T++],2<(P-=3););P&&(D[u++]=D[T++],1<P&&(D[u++]=D[T++]))}break}}break}}while(l<c&&u<p);l-=P=w>>3,b&=(1<<(w-=P<<3))-1,i.next_in=l,i.next_out=u,i.avail_in=l<c?c-l+5:5-(l-c),i.avail_out=u<p?p-u+257:257-(u-p),a.hold=b,a.bits=w}},{}],49:[function(n,r,o){var i=n("../utils/common"),s=n("./adler32"),a=n("./crc32"),l=n("./inffast"),c=n("./inftrees"),u=1,h=2,p=0,d=-2,g=1,m=852,y=592;function x(T){return(T>>>24&255)+(T>>>8&65280)+((65280&T)<<8)+((255&T)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function w(T){var M;return T&&T.state?(M=T.state,T.total_in=T.total_out=M.total=0,T.msg="",M.wrap&&(T.adler=1&M.wrap),M.mode=g,M.last=0,M.havedict=0,M.dmax=32768,M.head=null,M.hold=0,M.bits=0,M.lencode=M.lendyn=new i.Buf32(m),M.distcode=M.distdyn=new i.Buf32(y),M.sane=1,M.back=-1,p):d}function S(T){var M;return T&&T.state?((M=T.state).wsize=0,M.whave=0,M.wnext=0,w(T)):d}function C(T,M){var _,D;return T&&T.state?(D=T.state,M<0?(_=0,M=-M):(_=1+(M>>4),M<48&&(M&=15)),M&&(M<8||15<M)?d:(D.window!==null&&D.wbits!==M&&(D.window=null),D.wrap=_,D.wbits=M,S(T))):d}function N(T,M){var _,D;return T?(D=new b,(T.state=D).window=null,(_=C(T,M))!==p&&(T.state=null),_):d}var z,A,O=!0;function P(T){if(O){var M;for(z=new i.Buf32(512),A=new i.Buf32(32),M=0;M<144;)T.lens[M++]=8;for(;M<256;)T.lens[M++]=9;for(;M<280;)T.lens[M++]=7;for(;M<288;)T.lens[M++]=8;for(c(u,T.lens,0,288,z,0,T.work,{bits:9}),M=0;M<32;)T.lens[M++]=5;c(h,T.lens,0,32,A,0,T.work,{bits:5}),O=!1}T.lencode=z,T.lenbits=9,T.distcode=A,T.distbits=5}function L(T,M,_,D){var G,Z=T.state;return Z.window===null&&(Z.wsize=1<<Z.wbits,Z.wnext=0,Z.whave=0,Z.window=new i.Buf8(Z.wsize)),D>=Z.wsize?(i.arraySet(Z.window,M,_-Z.wsize,Z.wsize,0),Z.wnext=0,Z.whave=Z.wsize):(D<(G=Z.wsize-Z.wnext)&&(G=D),i.arraySet(Z.window,M,_-D,G,Z.wnext),(D-=G)?(i.arraySet(Z.window,M,_-D,D,0),Z.wnext=D,Z.whave=Z.wsize):(Z.wnext+=G,Z.wnext===Z.wsize&&(Z.wnext=0),Z.whave<Z.wsize&&(Z.whave+=G))),0}o.inflateReset=S,o.inflateReset2=C,o.inflateResetKeep=w,o.inflateInit=function(T){return N(T,15)},o.inflateInit2=N,o.inflate=function(T,M){var _,D,G,Z,te,q,E,U,B,j,Y,H,ce,ie,re,le,me,xe,Te,Pe,k,J,V,R,I=0,F=new i.Buf8(4),Q=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!T||!T.state||!T.output||!T.input&&T.avail_in!==0)return d;(_=T.state).mode===12&&(_.mode=13),te=T.next_out,G=T.output,E=T.avail_out,Z=T.next_in,D=T.input,q=T.avail_in,U=_.hold,B=_.bits,j=q,Y=E,J=p;e:for(;;)switch(_.mode){case g:if(_.wrap===0){_.mode=13;break}for(;B<16;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(2&_.wrap&&U===35615){F[_.check=0]=255&U,F[1]=U>>>8&255,_.check=a(_.check,F,2,0),B=U=0,_.mode=2;break}if(_.flags=0,_.head&&(_.head.done=!1),!(1&_.wrap)||(((255&U)<<8)+(U>>8))%31){T.msg="incorrect header check",_.mode=30;break}if((15&U)!=8){T.msg="unknown compression method",_.mode=30;break}if(B-=4,k=8+(15&(U>>>=4)),_.wbits===0)_.wbits=k;else if(k>_.wbits){T.msg="invalid window size",_.mode=30;break}_.dmax=1<<k,T.adler=_.check=1,_.mode=512&U?10:12,B=U=0;break;case 2:for(;B<16;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(_.flags=U,(255&_.flags)!=8){T.msg="unknown compression method",_.mode=30;break}if(57344&_.flags){T.msg="unknown header flags set",_.mode=30;break}_.head&&(_.head.text=U>>8&1),512&_.flags&&(F[0]=255&U,F[1]=U>>>8&255,_.check=a(_.check,F,2,0)),B=U=0,_.mode=3;case 3:for(;B<32;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}_.head&&(_.head.time=U),512&_.flags&&(F[0]=255&U,F[1]=U>>>8&255,F[2]=U>>>16&255,F[3]=U>>>24&255,_.check=a(_.check,F,4,0)),B=U=0,_.mode=4;case 4:for(;B<16;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}_.head&&(_.head.xflags=255&U,_.head.os=U>>8),512&_.flags&&(F[0]=255&U,F[1]=U>>>8&255,_.check=a(_.check,F,2,0)),B=U=0,_.mode=5;case 5:if(1024&_.flags){for(;B<16;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}_.length=U,_.head&&(_.head.extra_len=U),512&_.flags&&(F[0]=255&U,F[1]=U>>>8&255,_.check=a(_.check,F,2,0)),B=U=0}else _.head&&(_.head.extra=null);_.mode=6;case 6:if(1024&_.flags&&(q<(H=_.length)&&(H=q),H&&(_.head&&(k=_.head.extra_len-_.length,_.head.extra||(_.head.extra=new Array(_.head.extra_len)),i.arraySet(_.head.extra,D,Z,H,k)),512&_.flags&&(_.check=a(_.check,D,H,Z)),q-=H,Z+=H,_.length-=H),_.length))break e;_.length=0,_.mode=7;case 7:if(2048&_.flags){if(q===0)break e;for(H=0;k=D[Z+H++],_.head&&k&&_.length<65536&&(_.head.name+=String.fromCharCode(k)),k&&H<q;);if(512&_.flags&&(_.check=a(_.check,D,H,Z)),q-=H,Z+=H,k)break e}else _.head&&(_.head.name=null);_.length=0,_.mode=8;case 8:if(4096&_.flags){if(q===0)break e;for(H=0;k=D[Z+H++],_.head&&k&&_.length<65536&&(_.head.comment+=String.fromCharCode(k)),k&&H<q;);if(512&_.flags&&(_.check=a(_.check,D,H,Z)),q-=H,Z+=H,k)break e}else _.head&&(_.head.comment=null);_.mode=9;case 9:if(512&_.flags){for(;B<16;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(U!==(65535&_.check)){T.msg="header crc mismatch",_.mode=30;break}B=U=0}_.head&&(_.head.hcrc=_.flags>>9&1,_.head.done=!0),T.adler=_.check=0,_.mode=12;break;case 10:for(;B<32;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}T.adler=_.check=x(U),B=U=0,_.mode=11;case 11:if(_.havedict===0)return T.next_out=te,T.avail_out=E,T.next_in=Z,T.avail_in=q,_.hold=U,_.bits=B,2;T.adler=_.check=1,_.mode=12;case 12:if(M===5||M===6)break e;case 13:if(_.last){U>>>=7&B,B-=7&B,_.mode=27;break}for(;B<3;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}switch(_.last=1&U,B-=1,3&(U>>>=1)){case 0:_.mode=14;break;case 1:if(P(_),_.mode=20,M!==6)break;U>>>=2,B-=2;break e;case 2:_.mode=17;break;case 3:T.msg="invalid block type",_.mode=30}U>>>=2,B-=2;break;case 14:for(U>>>=7&B,B-=7&B;B<32;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if((65535&U)!=(U>>>16^65535)){T.msg="invalid stored block lengths",_.mode=30;break}if(_.length=65535&U,B=U=0,_.mode=15,M===6)break e;case 15:_.mode=16;case 16:if(H=_.length){if(q<H&&(H=q),E<H&&(H=E),H===0)break e;i.arraySet(G,D,Z,H,te),q-=H,Z+=H,E-=H,te+=H,_.length-=H;break}_.mode=12;break;case 17:for(;B<14;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(_.nlen=257+(31&U),U>>>=5,B-=5,_.ndist=1+(31&U),U>>>=5,B-=5,_.ncode=4+(15&U),U>>>=4,B-=4,286<_.nlen||30<_.ndist){T.msg="too many length or distance symbols",_.mode=30;break}_.have=0,_.mode=18;case 18:for(;_.have<_.ncode;){for(;B<3;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}_.lens[Q[_.have++]]=7&U,U>>>=3,B-=3}for(;_.have<19;)_.lens[Q[_.have++]]=0;if(_.lencode=_.lendyn,_.lenbits=7,V={bits:_.lenbits},J=c(0,_.lens,0,19,_.lencode,0,_.work,V),_.lenbits=V.bits,J){T.msg="invalid code lengths set",_.mode=30;break}_.have=0,_.mode=19;case 19:for(;_.have<_.nlen+_.ndist;){for(;le=(I=_.lencode[U&(1<<_.lenbits)-1])>>>16&255,me=65535&I,!((re=I>>>24)<=B);){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(me<16)U>>>=re,B-=re,_.lens[_.have++]=me;else{if(me===16){for(R=re+2;B<R;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(U>>>=re,B-=re,_.have===0){T.msg="invalid bit length repeat",_.mode=30;break}k=_.lens[_.have-1],H=3+(3&U),U>>>=2,B-=2}else if(me===17){for(R=re+3;B<R;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}B-=re,k=0,H=3+(7&(U>>>=re)),U>>>=3,B-=3}else{for(R=re+7;B<R;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}B-=re,k=0,H=11+(127&(U>>>=re)),U>>>=7,B-=7}if(_.have+H>_.nlen+_.ndist){T.msg="invalid bit length repeat",_.mode=30;break}for(;H--;)_.lens[_.have++]=k}}if(_.mode===30)break;if(_.lens[256]===0){T.msg="invalid code -- missing end-of-block",_.mode=30;break}if(_.lenbits=9,V={bits:_.lenbits},J=c(u,_.lens,0,_.nlen,_.lencode,0,_.work,V),_.lenbits=V.bits,J){T.msg="invalid literal/lengths set",_.mode=30;break}if(_.distbits=6,_.distcode=_.distdyn,V={bits:_.distbits},J=c(h,_.lens,_.nlen,_.ndist,_.distcode,0,_.work,V),_.distbits=V.bits,J){T.msg="invalid distances set",_.mode=30;break}if(_.mode=20,M===6)break e;case 20:_.mode=21;case 21:if(6<=q&&258<=E){T.next_out=te,T.avail_out=E,T.next_in=Z,T.avail_in=q,_.hold=U,_.bits=B,l(T,Y),te=T.next_out,G=T.output,E=T.avail_out,Z=T.next_in,D=T.input,q=T.avail_in,U=_.hold,B=_.bits,_.mode===12&&(_.back=-1);break}for(_.back=0;le=(I=_.lencode[U&(1<<_.lenbits)-1])>>>16&255,me=65535&I,!((re=I>>>24)<=B);){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(le&&(240&le)==0){for(xe=re,Te=le,Pe=me;le=(I=_.lencode[Pe+((U&(1<<xe+Te)-1)>>xe)])>>>16&255,me=65535&I,!(xe+(re=I>>>24)<=B);){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}U>>>=xe,B-=xe,_.back+=xe}if(U>>>=re,B-=re,_.back+=re,_.length=me,le===0){_.mode=26;break}if(32&le){_.back=-1,_.mode=12;break}if(64&le){T.msg="invalid literal/length code",_.mode=30;break}_.extra=15&le,_.mode=22;case 22:if(_.extra){for(R=_.extra;B<R;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}_.length+=U&(1<<_.extra)-1,U>>>=_.extra,B-=_.extra,_.back+=_.extra}_.was=_.length,_.mode=23;case 23:for(;le=(I=_.distcode[U&(1<<_.distbits)-1])>>>16&255,me=65535&I,!((re=I>>>24)<=B);){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if((240&le)==0){for(xe=re,Te=le,Pe=me;le=(I=_.distcode[Pe+((U&(1<<xe+Te)-1)>>xe)])>>>16&255,me=65535&I,!(xe+(re=I>>>24)<=B);){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}U>>>=xe,B-=xe,_.back+=xe}if(U>>>=re,B-=re,_.back+=re,64&le){T.msg="invalid distance code",_.mode=30;break}_.offset=me,_.extra=15&le,_.mode=24;case 24:if(_.extra){for(R=_.extra;B<R;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}_.offset+=U&(1<<_.extra)-1,U>>>=_.extra,B-=_.extra,_.back+=_.extra}if(_.offset>_.dmax){T.msg="invalid distance too far back",_.mode=30;break}_.mode=25;case 25:if(E===0)break e;if(H=Y-E,_.offset>H){if((H=_.offset-H)>_.whave&&_.sane){T.msg="invalid distance too far back",_.mode=30;break}ce=H>_.wnext?(H-=_.wnext,_.wsize-H):_.wnext-H,H>_.length&&(H=_.length),ie=_.window}else ie=G,ce=te-_.offset,H=_.length;for(E<H&&(H=E),E-=H,_.length-=H;G[te++]=ie[ce++],--H;);_.length===0&&(_.mode=21);break;case 26:if(E===0)break e;G[te++]=_.length,E--,_.mode=21;break;case 27:if(_.wrap){for(;B<32;){if(q===0)break e;q--,U|=D[Z++]<<B,B+=8}if(Y-=E,T.total_out+=Y,_.total+=Y,Y&&(T.adler=_.check=_.flags?a(_.check,G,Y,te-Y):s(_.check,G,Y,te-Y)),Y=E,(_.flags?U:x(U))!==_.check){T.msg="incorrect data check",_.mode=30;break}B=U=0}_.mode=28;case 28:if(_.wrap&&_.flags){for(;B<32;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(U!==(4294967295&_.total)){T.msg="incorrect length check",_.mode=30;break}B=U=0}_.mode=29;case 29:J=1;break e;case 30:J=-3;break e;case 31:return-4;default:return d}return T.next_out=te,T.avail_out=E,T.next_in=Z,T.avail_in=q,_.hold=U,_.bits=B,(_.wsize||Y!==T.avail_out&&_.mode<30&&(_.mode<27||M!==4))&&L(T,T.output,T.next_out,Y-T.avail_out)?(_.mode=31,-4):(j-=T.avail_in,Y-=T.avail_out,T.total_in+=j,T.total_out+=Y,_.total+=Y,_.wrap&&Y&&(T.adler=_.check=_.flags?a(_.check,G,Y,T.next_out-Y):s(_.check,G,Y,T.next_out-Y)),T.data_type=_.bits+(_.last?64:0)+(_.mode===12?128:0)+(_.mode===20||_.mode===15?256:0),(j==0&&Y===0||M===4)&&J===p&&(J=-5),J)},o.inflateEnd=function(T){if(!T||!T.state)return d;var M=T.state;return M.window&&(M.window=null),T.state=null,p},o.inflateGetHeader=function(T,M){var _;return T&&T.state?(2&(_=T.state).wrap)==0?d:((_.head=M).done=!1,p):d},o.inflateSetDictionary=function(T,M){var _,D=M.length;return T&&T.state?(_=T.state).wrap!==0&&_.mode!==11?d:_.mode===11&&s(1,M,D,0)!==_.check?-3:L(T,M,D,D)?(_.mode=31,-4):(_.havedict=1,p):d},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,o){var i=n("../utils/common"),s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(u,h,p,d,g,m,y,x){var b,w,S,C,N,z,A,O,P,L=x.bits,T=0,M=0,_=0,D=0,G=0,Z=0,te=0,q=0,E=0,U=0,B=null,j=0,Y=new i.Buf16(16),H=new i.Buf16(16),ce=null,ie=0;for(T=0;T<=15;T++)Y[T]=0;for(M=0;M<d;M++)Y[h[p+M]]++;for(G=L,D=15;1<=D&&Y[D]===0;D--);if(D<G&&(G=D),D===0)return g[m++]=20971520,g[m++]=20971520,x.bits=1,0;for(_=1;_<D&&Y[_]===0;_++);for(G<_&&(G=_),T=q=1;T<=15;T++)if(q<<=1,(q-=Y[T])<0)return-1;if(0<q&&(u===0||D!==1))return-1;for(H[1]=0,T=1;T<15;T++)H[T+1]=H[T]+Y[T];for(M=0;M<d;M++)h[p+M]!==0&&(y[H[h[p+M]]++]=M);if(z=u===0?(B=ce=y,19):u===1?(B=s,j-=257,ce=a,ie-=257,256):(B=l,ce=c,-1),T=_,N=m,te=M=U=0,S=-1,C=(E=1<<(Z=G))-1,u===1&&852<E||u===2&&592<E)return 1;for(;;){for(A=T-te,P=y[M]<z?(O=0,y[M]):y[M]>z?(O=ce[ie+y[M]],B[j+y[M]]):(O=96,0),b=1<<T-te,_=w=1<<Z;g[N+(U>>te)+(w-=b)]=A<<24|O<<16|P|0,w!==0;);for(b=1<<T-1;U&b;)b>>=1;if(b!==0?(U&=b-1,U+=b):U=0,M++,--Y[T]==0){if(T===D)break;T=h[p+y[M]]}if(G<T&&(U&C)!==S){for(te===0&&(te=G),N+=_,q=1<<(Z=T-te);Z+te<D&&!((q-=Y[Z+te])<=0);)Z++,q<<=1;if(E+=1<<Z,u===1&&852<E||u===2&&592<E)return 1;g[S=U&C]=G<<24|Z<<16|N-m|0}}return U!==0&&(g[N+U]=T-te<<24|64<<16|0),x.bits=G,0}},{"../utils/common":41}],51:[function(n,r,o){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(n,r,o){var i=n("../utils/common"),s=0,a=1;function l(I){for(var F=I.length;0<=--F;)I[F]=0}var c=0,u=29,h=256,p=h+1+u,d=30,g=19,m=2*p+1,y=15,x=16,b=7,w=256,S=16,C=17,N=18,z=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],A=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],O=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],L=new Array(2*(p+2));l(L);var T=new Array(2*d);l(T);var M=new Array(512);l(M);var _=new Array(256);l(_);var D=new Array(u);l(D);var G,Z,te,q=new Array(d);function E(I,F,Q,ne,W){this.static_tree=I,this.extra_bits=F,this.extra_base=Q,this.elems=ne,this.max_length=W,this.has_stree=I&&I.length}function U(I,F){this.dyn_tree=I,this.max_code=0,this.stat_desc=F}function B(I){return I<256?M[I]:M[256+(I>>>7)]}function j(I,F){I.pending_buf[I.pending++]=255&F,I.pending_buf[I.pending++]=F>>>8&255}function Y(I,F,Q){I.bi_valid>x-Q?(I.bi_buf|=F<<I.bi_valid&65535,j(I,I.bi_buf),I.bi_buf=F>>x-I.bi_valid,I.bi_valid+=Q-x):(I.bi_buf|=F<<I.bi_valid&65535,I.bi_valid+=Q)}function H(I,F,Q){Y(I,Q[2*F],Q[2*F+1])}function ce(I,F){for(var Q=0;Q|=1&I,I>>>=1,Q<<=1,0<--F;);return Q>>>1}function ie(I,F,Q){var ne,W,se=new Array(y+1),fe=0;for(ne=1;ne<=y;ne++)se[ne]=fe=fe+Q[ne-1]<<1;for(W=0;W<=F;W++){var ae=I[2*W+1];ae!==0&&(I[2*W]=ce(se[ae]++,ae))}}function re(I){var F;for(F=0;F<p;F++)I.dyn_ltree[2*F]=0;for(F=0;F<d;F++)I.dyn_dtree[2*F]=0;for(F=0;F<g;F++)I.bl_tree[2*F]=0;I.dyn_ltree[2*w]=1,I.opt_len=I.static_len=0,I.last_lit=I.matches=0}function le(I){8<I.bi_valid?j(I,I.bi_buf):0<I.bi_valid&&(I.pending_buf[I.pending++]=I.bi_buf),I.bi_buf=0,I.bi_valid=0}function me(I,F,Q,ne){var W=2*F,se=2*Q;return I[W]<I[se]||I[W]===I[se]&&ne[F]<=ne[Q]}function xe(I,F,Q){for(var ne=I.heap[Q],W=Q<<1;W<=I.heap_len&&(W<I.heap_len&&me(F,I.heap[W+1],I.heap[W],I.depth)&&W++,!me(F,ne,I.heap[W],I.depth));)I.heap[Q]=I.heap[W],Q=W,W<<=1;I.heap[Q]=ne}function Te(I,F,Q){var ne,W,se,fe,ae=0;if(I.last_lit!==0)for(;ne=I.pending_buf[I.d_buf+2*ae]<<8|I.pending_buf[I.d_buf+2*ae+1],W=I.pending_buf[I.l_buf+ae],ae++,ne===0?H(I,W,F):(H(I,(se=_[W])+h+1,F),(fe=z[se])!==0&&Y(I,W-=D[se],fe),H(I,se=B(--ne),Q),(fe=A[se])!==0&&Y(I,ne-=q[se],fe)),ae<I.last_lit;);H(I,w,F)}function Pe(I,F){var Q,ne,W,se=F.dyn_tree,fe=F.stat_desc.static_tree,ae=F.stat_desc.has_stree,$=F.stat_desc.elems,ee=-1;for(I.heap_len=0,I.heap_max=m,Q=0;Q<$;Q++)se[2*Q]!==0?(I.heap[++I.heap_len]=ee=Q,I.depth[Q]=0):se[2*Q+1]=0;for(;I.heap_len<2;)se[2*(W=I.heap[++I.heap_len]=ee<2?++ee:0)]=1,I.depth[W]=0,I.opt_len--,ae&&(I.static_len-=fe[2*W+1]);for(F.max_code=ee,Q=I.heap_len>>1;1<=Q;Q--)xe(I,se,Q);for(W=$;Q=I.heap[1],I.heap[1]=I.heap[I.heap_len--],xe(I,se,1),ne=I.heap[1],I.heap[--I.heap_max]=Q,I.heap[--I.heap_max]=ne,se[2*W]=se[2*Q]+se[2*ne],I.depth[W]=(I.depth[Q]>=I.depth[ne]?I.depth[Q]:I.depth[ne])+1,se[2*Q+1]=se[2*ne+1]=W,I.heap[1]=W++,xe(I,se,1),2<=I.heap_len;);I.heap[--I.heap_max]=I.heap[1],(function(ue,be){var ze,Ze,it,Ie,_t,Pt,$e=be.dyn_tree,Ot=be.max_code,xt=be.stat_desc.static_tree,Bh=be.stat_desc.has_stree,Uh=be.stat_desc.extra_bits,Js=be.stat_desc.extra_base,Hn=be.stat_desc.max_length,vr=0;for(Ie=0;Ie<=y;Ie++)ue.bl_count[Ie]=0;for($e[2*ue.heap[ue.heap_max]+1]=0,ze=ue.heap_max+1;ze<m;ze++)Hn<(Ie=$e[2*$e[2*(Ze=ue.heap[ze])+1]+1]+1)&&(Ie=Hn,vr++),$e[2*Ze+1]=Ie,Ot<Ze||(ue.bl_count[Ie]++,_t=0,Js<=Ze&&(_t=Uh[Ze-Js]),Pt=$e[2*Ze],ue.opt_len+=Pt*(Ie+_t),Bh&&(ue.static_len+=Pt*(xt[2*Ze+1]+_t)));if(vr!==0){do{for(Ie=Hn-1;ue.bl_count[Ie]===0;)Ie--;ue.bl_count[Ie]--,ue.bl_count[Ie+1]+=2,ue.bl_count[Hn]--,vr-=2}while(0<vr);for(Ie=Hn;Ie!==0;Ie--)for(Ze=ue.bl_count[Ie];Ze!==0;)Ot<(it=ue.heap[--ze])||($e[2*it+1]!==Ie&&(ue.opt_len+=(Ie-$e[2*it+1])*$e[2*it],$e[2*it+1]=Ie),Ze--)}})(I,F),ie(se,ee,I.bl_count)}function k(I,F,Q){var ne,W,se=-1,fe=F[1],ae=0,$=7,ee=4;for(fe===0&&($=138,ee=3),F[2*(Q+1)+1]=65535,ne=0;ne<=Q;ne++)W=fe,fe=F[2*(ne+1)+1],++ae<$&&W===fe||(ae<ee?I.bl_tree[2*W]+=ae:W!==0?(W!==se&&I.bl_tree[2*W]++,I.bl_tree[2*S]++):ae<=10?I.bl_tree[2*C]++:I.bl_tree[2*N]++,se=W,ee=(ae=0)===fe?($=138,3):W===fe?($=6,3):($=7,4))}function J(I,F,Q){var ne,W,se=-1,fe=F[1],ae=0,$=7,ee=4;for(fe===0&&($=138,ee=3),ne=0;ne<=Q;ne++)if(W=fe,fe=F[2*(ne+1)+1],!(++ae<$&&W===fe)){if(ae<ee)for(;H(I,W,I.bl_tree),--ae!=0;);else W!==0?(W!==se&&(H(I,W,I.bl_tree),ae--),H(I,S,I.bl_tree),Y(I,ae-3,2)):ae<=10?(H(I,C,I.bl_tree),Y(I,ae-3,3)):(H(I,N,I.bl_tree),Y(I,ae-11,7));se=W,ee=(ae=0)===fe?($=138,3):W===fe?($=6,3):($=7,4)}}l(q);var V=!1;function R(I,F,Q,ne){Y(I,(c<<1)+(ne?1:0),3),(function(W,se,fe,ae){le(W),j(W,fe),j(W,~fe),i.arraySet(W.pending_buf,W.window,se,fe,W.pending),W.pending+=fe})(I,F,Q)}o._tr_init=function(I){V||((function(){var F,Q,ne,W,se,fe=new Array(y+1);for(W=ne=0;W<u-1;W++)for(D[W]=ne,F=0;F<1<<z[W];F++)_[ne++]=W;for(_[ne-1]=W,W=se=0;W<16;W++)for(q[W]=se,F=0;F<1<<A[W];F++)M[se++]=W;for(se>>=7;W<d;W++)for(q[W]=se<<7,F=0;F<1<<A[W]-7;F++)M[256+se++]=W;for(Q=0;Q<=y;Q++)fe[Q]=0;for(F=0;F<=143;)L[2*F+1]=8,F++,fe[8]++;for(;F<=255;)L[2*F+1]=9,F++,fe[9]++;for(;F<=279;)L[2*F+1]=7,F++,fe[7]++;for(;F<=287;)L[2*F+1]=8,F++,fe[8]++;for(ie(L,p+1,fe),F=0;F<d;F++)T[2*F+1]=5,T[2*F]=ce(F,5);G=new E(L,z,h+1,p,y),Z=new E(T,A,0,d,y),te=new E(new Array(0),O,0,g,b)})(),V=!0),I.l_desc=new U(I.dyn_ltree,G),I.d_desc=new U(I.dyn_dtree,Z),I.bl_desc=new U(I.bl_tree,te),I.bi_buf=0,I.bi_valid=0,re(I)},o._tr_stored_block=R,o._tr_flush_block=function(I,F,Q,ne){var W,se,fe=0;0<I.level?(I.strm.data_type===2&&(I.strm.data_type=(function(ae){var $,ee=4093624447;for($=0;$<=31;$++,ee>>>=1)if(1&ee&&ae.dyn_ltree[2*$]!==0)return s;if(ae.dyn_ltree[18]!==0||ae.dyn_ltree[20]!==0||ae.dyn_ltree[26]!==0)return a;for($=32;$<h;$++)if(ae.dyn_ltree[2*$]!==0)return a;return s})(I)),Pe(I,I.l_desc),Pe(I,I.d_desc),fe=(function(ae){var $;for(k(ae,ae.dyn_ltree,ae.l_desc.max_code),k(ae,ae.dyn_dtree,ae.d_desc.max_code),Pe(ae,ae.bl_desc),$=g-1;3<=$&&ae.bl_tree[2*P[$]+1]===0;$--);return ae.opt_len+=3*($+1)+5+5+4,$})(I),W=I.opt_len+3+7>>>3,(se=I.static_len+3+7>>>3)<=W&&(W=se)):W=se=Q+5,Q+4<=W&&F!==-1?R(I,F,Q,ne):I.strategy===4||se===W?(Y(I,2+(ne?1:0),3),Te(I,L,T)):(Y(I,4+(ne?1:0),3),(function(ae,$,ee,ue){var be;for(Y(ae,$-257,5),Y(ae,ee-1,5),Y(ae,ue-4,4),be=0;be<ue;be++)Y(ae,ae.bl_tree[2*P[be]+1],3);J(ae,ae.dyn_ltree,$-1),J(ae,ae.dyn_dtree,ee-1)})(I,I.l_desc.max_code+1,I.d_desc.max_code+1,fe+1),Te(I,I.dyn_ltree,I.dyn_dtree)),re(I),ne&&le(I)},o._tr_tally=function(I,F,Q){return I.pending_buf[I.d_buf+2*I.last_lit]=F>>>8&255,I.pending_buf[I.d_buf+2*I.last_lit+1]=255&F,I.pending_buf[I.l_buf+I.last_lit]=255&Q,I.last_lit++,F===0?I.dyn_ltree[2*Q]++:(I.matches++,F--,I.dyn_ltree[2*(_[Q]+h+1)]++,I.dyn_dtree[2*B(F)]++),I.last_lit===I.lit_bufsize-1},o._tr_align=function(I){Y(I,2,3),H(I,w,L),(function(F){F.bi_valid===16?(j(F,F.bi_buf),F.bi_buf=0,F.bi_valid=0):8<=F.bi_valid&&(F.pending_buf[F.pending++]=255&F.bi_buf,F.bi_buf>>=8,F.bi_valid-=8)})(I)}},{"../utils/common":41}],53:[function(n,r,o){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,o){(function(i){(function(s,a){if(!s.setImmediate){var l,c,u,h,p=1,d={},g=!1,m=s.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(s);y=y&&y.setTimeout?y:s,l={}.toString.call(s.process)==="[object process]"?function(S){process.nextTick(function(){b(S)})}:(function(){if(s.postMessage&&!s.importScripts){var S=!0,C=s.onmessage;return s.onmessage=function(){S=!1},s.postMessage("","*"),s.onmessage=C,S}})()?(h="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",w,!1):s.attachEvent("onmessage",w),function(S){s.postMessage(h+S,"*")}):s.MessageChannel?((u=new MessageChannel).port1.onmessage=function(S){b(S.data)},function(S){u.port2.postMessage(S)}):m&&"onreadystatechange"in m.createElement("script")?(c=m.documentElement,function(S){var C=m.createElement("script");C.onreadystatechange=function(){b(S),C.onreadystatechange=null,c.removeChild(C),C=null},c.appendChild(C)}):function(S){setTimeout(b,0,S)},y.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var C=new Array(arguments.length-1),N=0;N<C.length;N++)C[N]=arguments[N+1];var z={callback:S,args:C};return d[p]=z,l(p),p++},y.clearImmediate=x}function x(S){delete d[S]}function b(S){if(g)setTimeout(b,0,S);else{var C=d[S];if(C){g=!0;try{(function(N){var z=N.callback,A=N.args;switch(A.length){case 0:z();break;case 1:z(A[0]);break;case 2:z(A[0],A[1]);break;case 3:z(A[0],A[1],A[2]);break;default:z.apply(a,A)}})(C)}finally{x(S),g=!1}}}}function w(S){S.source===s&&typeof S.data=="string"&&S.data.indexOf(h)===0&&b(+S.data.slice(h.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof wr<"u"?wr:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Lo)),Lo.exports}var lv=av();const cv=qi(lv);async function uv(e){try{const t=await fetch(`/api/logs/${e}/chunks`);if(!t.ok)return null;const n=await t.json();return JSON.stringify(n,null,2)}catch{return null}}async function dv(e){const t=new cv;for(const s of e)s.rawRequestBody!==null&&t.file(`#${s.id}.Request.json`,s.rawRequestBody),s.responseText!==null&&t.file(`#${s.id}.Response.json`,s.responseText);const n=e.filter(s=>s.streaming);await Promise.allSettled(n.map(async s=>{const a=await uv(s.id);a!==null&&t.file(`#${s.id}.SSE.Response.json`,a)}));const r=await t.generateAsync({type:"blob"}),o=URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=`llm-inspector-export-${new Date().toISOString().slice(0,10)}.zip`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o)}const fv="1.11.6",hv={version:fv};function cu(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=cu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function uu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=cu(e))&&(r&&(r+=" "),r+=t);return r}const pv=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},mv=(e,t)=>({classGroupId:e,validator:t}),du=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),qr="-",Na=[],gv="arbitrary..",xv=e=>{const t=bv(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return yv(s);const a=s.split(qr),l=a[0]===""&&a.length>1?1:0;return fu(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=r[s],c=n[s];return l?c?pv(c,l):l:c||Na}return n[s]||Na}}},fu=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],i=n.nextPart.get(o);if(i){const c=fu(e,t+1,i);if(c)return c}const s=n.validators;if(s===null)return;const a=t===0?e.join(qr):e.slice(t).join(qr),l=s.length;for(let c=0;c<l;c++){const u=s[c];if(u.validator(a))return u.classGroupId}},yv=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?gv+r:void 0})(),bv=e=>{const{theme:t,classGroups:n}=e;return vv(n,t)},vv=(e,t)=>{const n=du();for(const r in e){const o=e[r];is(o,n,r,t)}return n},is=(e,t,n,r)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];wv(s,t,n,r)}},wv=(e,t,n,r)=>{if(typeof e=="string"){_v(e,t,n);return}if(typeof e=="function"){kv(e,t,n,r);return}Sv(e,t,n,r)},_v=(e,t,n)=>{const r=e===""?t:hu(t,e);r.classGroupId=n},kv=(e,t,n,r)=>{if(Cv(e)){is(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(mv(n,e))},Sv=(e,t,n,r)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];is(l,hu(t,a),n,r)}},hu=(e,t)=>{let n=e;const r=t.split(qr),o=r.length;for(let i=0;i<o;i++){const s=r[i];let a=n.nextPart.get(s);a||(a=du(),n.nextPart.set(s,a)),n=a}return n},Cv=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Ev=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(i,s)=>{n[i]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let s=n[i];if(s!==void 0)return s;if((s=r[i])!==void 0)return o(i,s),s},set(i,s){i in n?n[i]=s:o(i,s)}}},vi="!",Ta=":",Nv=[],ja=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Tv=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const i=[];let s=0,a=0,l=0,c;const u=o.length;for(let m=0;m<u;m++){const y=o[m];if(s===0&&a===0){if(y===Ta){i.push(o.slice(l,m)),l=m+1;continue}if(y==="/"){c=m;continue}}y==="["?s++:y==="]"?s--:y==="("?a++:y===")"&&a--}const h=i.length===0?o:o.slice(l);let p=h,d=!1;h.endsWith(vi)?(p=h.slice(0,-1),d=!0):h.startsWith(vi)&&(p=h.slice(1),d=!0);const g=c&&c>l?c-l:void 0;return ja(i,d,p,g)};if(t){const o=t+Ta,i=r;r=s=>s.startsWith(o)?i(s.slice(o.length)):ja(Nv,!1,s,void 0,!0)}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},jv=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let i=0;i<n.length;i++){const s=n[i],a=s[0]==="[",l=t.has(s);a||l?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(s)):o.push(s)}return o.length>0&&(o.sort(),r.push(...o)),r}},zv=e=>({cache:Ev(e.cacheSize),parseClassName:Tv(e),sortModifiers:jv(e),postfixLookupClassGroupIds:Iv(e),...xv(e)}),Iv=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},Av=/\s+/,Rv=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i,postfixLookupClassGroupIds:s}=t,a=[],l=e.trim().split(Av);let c="";for(let u=l.length-1;u>=0;u-=1){const h=l[u],{isExternal:p,modifiers:d,hasImportantModifier:g,baseClassName:m,maybePostfixModifierPosition:y}=n(h);if(p){c=h+(c.length>0?" "+c:c);continue}let x=!!y,b;if(x){const z=m.substring(0,y);b=r(z);const A=b&&s[b]?r(m):void 0;A&&A!==b&&(b=A,x=!1)}else b=r(m);if(!b){if(!x){c=h+(c.length>0?" "+c:c);continue}if(b=r(m),!b){c=h+(c.length>0?" "+c:c);continue}x=!1}const w=d.length===0?"":d.length===1?d[0]:i(d).join(":"),S=g?w+vi:w,C=S+b;if(a.indexOf(C)>-1)continue;a.push(C);const N=o(b,x);for(let z=0;z<N.length;++z){const A=N[z];a.push(S+A)}c=h+(c.length>0?" "+c:c)}return c},Pv=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=pu(n))&&(o&&(o+=" "),o+=r);return o},pu=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=pu(e[r]))&&(n&&(n+=" "),n+=t);return n},Ov=(e,...t)=>{let n,r,o,i;const s=l=>{const c=t.reduce((u,h)=>h(u),e());return n=zv(c),r=n.cache.get,o=n.cache.set,i=a,a(l)},a=l=>{const c=r(l);if(c)return c;const u=Rv(l,n);return o(l,u),u};return i=s,(...l)=>i(Pv(...l))},Dv=[],He=e=>{const t=n=>n[e]||Dv;return t.isThemeGetter=!0,t},mu=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,gu=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Mv=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Lv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,$v=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Bv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Uv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Zt=e=>Mv.test(e),Ee=e=>!!e&&!Number.isNaN(Number(e)),kt=e=>!!e&&Number.isInteger(Number(e)),Fo=e=>e.endsWith("%")&&Ee(e.slice(0,-1)),Dt=e=>Lv.test(e),xu=()=>!0,Zv=e=>Fv.test(e)&&!$v.test(e),ss=()=>!1,Wv=e=>Bv.test(e),Vv=e=>Uv.test(e),Hv=e=>!he(e)&&!pe(e),qv=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)),Gv=e=>Xt(e,vu,ss),he=e=>mu.test(e),nn=e=>Xt(e,wu,Zv),za=e=>Xt(e,n1,Ee),Kv=e=>Xt(e,ku,xu),Jv=e=>Xt(e,_u,ss),Ia=e=>Xt(e,yu,ss),Yv=e=>Xt(e,bu,Vv),Er=e=>Xt(e,Su,Wv),pe=e=>gu.test(e),Gn=e=>pn(e,wu),Xv=e=>pn(e,_u),Aa=e=>pn(e,yu),Qv=e=>pn(e,vu),e1=e=>pn(e,bu),Nr=e=>pn(e,Su,!0),t1=e=>pn(e,ku,!0),Xt=(e,t,n)=>{const r=mu.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},pn=(e,t,n=!1)=>{const r=gu.exec(e);return r?r[1]?t(r[1]):n:!1},yu=e=>e==="position"||e==="percentage",bu=e=>e==="image"||e==="url",vu=e=>e==="length"||e==="size"||e==="bg-size",wu=e=>e==="length",n1=e=>e==="number",_u=e=>e==="family-name",ku=e=>e==="number"||e==="weight",Su=e=>e==="shadow",r1=()=>{const e=He("color"),t=He("font"),n=He("text"),r=He("font-weight"),o=He("tracking"),i=He("leading"),s=He("breakpoint"),a=He("container"),l=He("spacing"),c=He("radius"),u=He("shadow"),h=He("inset-shadow"),p=He("text-shadow"),d=He("drop-shadow"),g=He("blur"),m=He("perspective"),y=He("aspect"),x=He("ease"),b=He("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...S(),pe,he],N=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],A=()=>[pe,he,l],O=()=>[Zt,"full","auto",...A()],P=()=>[kt,"none","subgrid",pe,he],L=()=>["auto",{span:["full",kt,pe,he]},kt,pe,he],T=()=>[kt,"auto",pe,he],M=()=>["auto","min","max","fr",pe,he],_=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],D=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...A()],Z=()=>[Zt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],te=()=>[Zt,"screen","full","dvw","lvw","svw","min","max","fit",...A()],q=()=>[Zt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],E=()=>[e,pe,he],U=()=>[...S(),Aa,Ia,{position:[pe,he]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],j=()=>["auto","cover","contain",Qv,Gv,{size:[pe,he]}],Y=()=>[Fo,Gn,nn],H=()=>["","none","full",c,pe,he],ce=()=>["",Ee,Gn,nn],ie=()=>["solid","dashed","dotted","double"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[Ee,Fo,Aa,Ia],me=()=>["","none",g,pe,he],xe=()=>["none",Ee,pe,he],Te=()=>["none",Ee,pe,he],Pe=()=>[Ee,pe,he],k=()=>[Zt,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Dt],breakpoint:[Dt],color:[xu],container:[Dt],"drop-shadow":[Dt],ease:["in","out","in-out"],font:[Hv],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Dt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Dt],shadow:[Dt],spacing:["px",Ee],text:[Dt],"text-shadow":[Dt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Zt,he,pe,y]}],container:["container"],"container-type":[{"@container":["","normal","size",pe,he]}],"container-named":[qv],columns:[{columns:[Ee,he,pe,a]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"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:C()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[kt,"auto",pe,he]}],basis:[{basis:[Zt,"full","auto",a,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ee,Zt,"auto","initial","none",he]}],grow:[{grow:["",Ee,pe,he]}],shrink:[{shrink:["",Ee,pe,he]}],order:[{order:[kt,"first","last","none",pe,he]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[..._(),"normal"]}],"justify-items":[{"justify-items":[...D(),"normal"]}],"justify-self":[{"justify-self":["auto",...D()]}],"align-content":[{content:["normal",..._()]}],"align-items":[{items:[...D(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...D(),{baseline:["","last"]}]}],"place-content":[{"place-content":_()}],"place-items":[{"place-items":[...D(),"baseline"]}],"place-self":[{"place-self":["auto",...D()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...te()]}],"min-inline-size":[{"min-inline":["auto",...te()]}],"max-inline-size":[{"max-inline":["none",...te()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[a,"screen",...Z()]}],"min-w":[{"min-w":[a,"screen","none",...Z()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",n,Gn,nn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,t1,Kv]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Fo,he]}],"font-family":[{font:[Xv,Jv,t]}],"font-features":[{"font-features":[he]}],"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:[o,pe,he]}],"line-clamp":[{"line-clamp":[Ee,"none",pe,za]}],leading:[{leading:[i,...A()]}],"list-image":[{"list-image":["none",pe,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ee,"from-font","auto",pe,nn]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[Ee,"auto",pe,he]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"tab-size":[{tab:[kt,pe,he]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe,he]}],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",pe,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:j()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},kt,pe,he],radial:["",pe,he],conic:[kt,pe,he]},e1,Yv]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ie(),"hidden","none"]}],"divide-style":[{divide:[...ie(),"hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-bs":[{"border-bs":E()}],"border-color-be":[{"border-be":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...ie(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ee,pe,he]}],"outline-w":[{outline:["",Ee,Gn,nn]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",u,Nr,Er]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",h,Nr,Er]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[Ee,nn]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",p,Nr,Er]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[Ee,pe,he]}],"mix-blend":[{"mix-blend":[...re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":re()}],"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":[Ee]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[pe,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"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":S()}],"mask-image-conic-pos":[{"mask-conic":[Ee]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:j()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,he]}],filter:[{filter:["","none",pe,he]}],blur:[{blur:me()}],brightness:[{brightness:[Ee,pe,he]}],contrast:[{contrast:[Ee,pe,he]}],"drop-shadow":[{"drop-shadow":["","none",d,Nr,Er]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",Ee,pe,he]}],"hue-rotate":[{"hue-rotate":[Ee,pe,he]}],invert:[{invert:["",Ee,pe,he]}],saturate:[{saturate:[Ee,pe,he]}],sepia:[{sepia:["",Ee,pe,he]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,he]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[Ee,pe,he]}],"backdrop-contrast":[{"backdrop-contrast":[Ee,pe,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ee,pe,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ee,pe,he]}],"backdrop-invert":[{"backdrop-invert":["",Ee,pe,he]}],"backdrop-opacity":[{"backdrop-opacity":[Ee,pe,he]}],"backdrop-saturate":[{"backdrop-saturate":[Ee,pe,he]}],"backdrop-sepia":[{"backdrop-sepia":["",Ee,pe,he]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pe,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ee,"initial",pe,he]}],ease:[{ease:["linear","initial",x,pe,he]}],delay:[{delay:[Ee,pe,he]}],animate:[{animate:["none",b,pe,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,pe,he]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:xe()}],"rotate-x":[{"rotate-x":xe()}],"rotate-y":[{"rotate-y":xe()}],"rotate-z":[{"rotate-z":xe()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:Pe()}],"skew-x":[{"skew-x":Pe()}],"skew-y":[{"skew-y":Pe()}],transform:[{transform:[pe,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:k()}],"translate-x":[{"translate-x":k()}],"translate-y":[{"translate-y":k()}],"translate-z":[{"translate-z":k()}],"translate-none":["translate-none"],zoom:[{zoom:[kt,pe,he]}],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"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",pe,he]}],"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":E()}],"scrollbar-track-color":[{"scrollbar-track":E()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",pe,he]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[Ee,Gn,nn,za]}],stroke:[{stroke:["none",...E()]}],"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":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},o1=Ov(r1);function Se(...e){return o1(uu(e))}function Je(e){return e>=1048576?(e/1048576).toFixed(1).replace(/\.0$/,"")+"M":e>=1024?(e/1024).toFixed(1).replace(/\.0$/,"")+"K":e.toString()}function Cu(e){return e===null?"pending":e>=200&&e<300?"success":e>=400&&e<500?"client_error":e>=500?"server_error":"pending"}const Ra=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Pa=uu,as=(e,t)=>n=>{var r;if(t?.variants==null)return Pa(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n?.[c],h=i?.[c];if(u===null)return null;const p=Ra(u)||Ra(h);return o[c][p]}),a=n&&Object.entries(n).reduce((c,u)=>{let[h,p]=u;return p===void 0||(c[h]=p),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:h,className:p,...d}=u;return Object.entries(d).every(g=>{let[m,y]=g;return Array.isArray(y)?y.includes({...i,...a}[m]):{...i,...a}[m]===y})?[...c,h,p]:c},[]);return Pa(e,s,l,n?.class,n?.className)};function Oa(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Eu(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Oa(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():Oa(e[o],null)}}}}function Re(...e){return v.useCallback(Eu(...e),e)}function Pn(e){const t=s1(e),n=v.forwardRef((r,o)=>{const{children:i,...s}=r,a=v.Children.toArray(i),l=a.find(l1);if(l){const c=l.props.children,u=a.map(h=>h===l?v.Children.count(c)>1?v.Children.only(null):v.isValidElement(c)?c.props.children:null:h);return f.jsx(t,{...s,ref:o,children:v.isValidElement(c)?v.cloneElement(c,void 0,u):null})}return f.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var i1=Pn("Slot");function s1(e){const t=v.forwardRef((n,r)=>{const{children:o,...i}=n;if(v.isValidElement(o)){const s=u1(o),a=c1(i,o.props);return o.type!==v.Fragment&&(a.ref=r?Eu(r,s):s),v.cloneElement(o,a)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Nu=Symbol("radix.slottable");function a1(e){const t=({children:n})=>f.jsx(f.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Nu,t}function l1(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Nu}function c1(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function u1(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)}var d1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ce=d1.reduce((e,t)=>{const n=Pn(`Primitive.${t}`),r=v.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function f1(e,t){e&&dr.flushSync(()=>e.dispatchEvent(t))}var Tu=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"}),h1="VisuallyHidden",ju=v.forwardRef((e,t)=>f.jsx(Ce.span,{...e,ref:t,style:{...Tu,...e.style}}));ju.displayName=h1;var p1=ju;function m1(e,t){const n=v.createContext(t),r=i=>{const{children:s,...a}=i,l=v.useMemo(()=>a,Object.values(a));return f.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=v.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Bt(e,t=[]){let n=[];function r(i,s){const a=v.createContext(s),l=n.length;n=[...n,s];const c=h=>{const{scope:p,children:d,...g}=h,m=p?.[e]?.[l]||a,y=v.useMemo(()=>g,Object.values(g));return f.jsx(m.Provider,{value:y,children:d})};c.displayName=i+"Provider";function u(h,p){const d=p?.[e]?.[l]||a,g=v.useContext(d);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>v.createContext(s));return function(a){const l=a?.[e]||i;return v.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,g1(o,...t)]}function g1(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const h=l(i)[`__scope${c}`];return{...a,...h}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function zu(e){const t=e+"CollectionProvider",[n,r]=Bt(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:y,children:x}=m,b=tt.useRef(null),w=tt.useRef(new Map).current;return f.jsx(o,{scope:y,itemMap:w,collectionRef:b,children:x})};s.displayName=t;const a=e+"CollectionSlot",l=Pn(a),c=tt.forwardRef((m,y)=>{const{scope:x,children:b}=m,w=i(a,x),S=Re(y,w.collectionRef);return f.jsx(l,{ref:S,children:b})});c.displayName=a;const u=e+"CollectionItemSlot",h="data-radix-collection-item",p=Pn(u),d=tt.forwardRef((m,y)=>{const{scope:x,children:b,...w}=m,S=tt.useRef(null),C=Re(y,S),N=i(u,x);return tt.useEffect(()=>(N.itemMap.set(S,{ref:S,...w}),()=>{N.itemMap.delete(S)})),f.jsx(p,{[h]:"",ref:C,children:b})});d.displayName=u;function g(m){const y=i(e+"CollectionConsumer",m);return tt.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((N,z)=>w.indexOf(N.ref.current)-w.indexOf(z.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:c,ItemSlot:d},g,r]}function ve(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var qe=globalThis?.document?v.useLayoutEffect:()=>{},x1=hc[" useInsertionEffect ".trim().toString()]||qe;function an({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=y1({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const u=v.useRef(e!==void 0);v.useEffect(()=>{const h=u.current;h!==a&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const c=v.useCallback(u=>{if(a){const h=b1(u)?u(e):u;h!==e&&s.current?.(h)}else i(u)},[a,e,i,s]);return[l,c]}function y1({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),o=v.useRef(n),i=v.useRef(t);return x1(()=>{i.current=t},[t]),v.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function b1(e){return typeof e=="function"}function v1(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var mt=e=>{const{present:t,children:n}=e,r=w1(t),o=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=Re(r.ref,_1(o));return typeof n=="function"||r.isPresent?v.cloneElement(o,{ref:i}):null};mt.displayName="Presence";function w1(e){const[t,n]=v.useState(),r=v.useRef(null),o=v.useRef(e),i=v.useRef("none"),s=e?"mounted":"unmounted",[a,l]=v1(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const c=Tr(r.current);i.current=a==="mounted"?c:"none"},[a]),qe(()=>{const c=r.current,u=o.current;if(u!==e){const p=i.current,d=Tr(c);e?l("MOUNT"):d==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&p!==d?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),qe(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,h=d=>{const m=Tr(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&m&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=d=>{d.target===t&&(i.current=Tr(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:v.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Tr(e){return e?.animationName||"none"}function _1(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)}var k1=hc[" useId ".trim().toString()]||(()=>{}),S1=0;function Tt(e){const[t,n]=v.useState(k1());return qe(()=>{n(r=>r??String(S1++))},[e]),e||(t?`radix-${t}`:"")}var fo="Collapsible",[C1]=Bt(fo),[E1,ls]=C1(fo),Iu=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l,c]=an({prop:r,defaultProp:o??!1,onChange:s,caller:fo});return f.jsx(E1,{scope:n,disabled:i,contentId:Tt(),open:l,onOpenToggle:v.useCallback(()=>c(u=>!u),[c]),children:f.jsx(Ce.div,{"data-state":us(l),"data-disabled":i?"":void 0,...a,ref:t})})});Iu.displayName=fo;var Au="CollapsibleTrigger",Ru=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=ls(Au,n);return f.jsx(Ce.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":us(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:ve(e.onClick,o.onOpenToggle)})});Ru.displayName=Au;var cs="CollapsibleContent",Pu=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ls(cs,e.__scopeCollapsible);return f.jsx(mt,{present:n||o.open,children:({present:i})=>f.jsx(N1,{...r,ref:t,present:i})})});Pu.displayName=cs;var N1=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=ls(cs,n),[a,l]=v.useState(r),c=v.useRef(null),u=Re(t,c),h=v.useRef(0),p=h.current,d=v.useRef(0),g=d.current,m=s.open||a,y=v.useRef(m),x=v.useRef(void 0);return v.useEffect(()=>{const b=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(b)},[]),qe(()=>{const b=c.current;if(b){x.current=x.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const w=b.getBoundingClientRect();h.current=w.height,d.current=w.width,y.current||(b.style.transitionDuration=x.current.transitionDuration,b.style.animationName=x.current.animationName),l(r)}},[s.open,r]),f.jsx(Ce.div,{"data-state":us(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!m,...i,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:m&&o})});function us(e){return e?"open":"closed"}var T1=Iu,j1=v.createContext(void 0);function ho(e){const t=v.useContext(j1);return e||t||"ltr"}function Qe(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function z1(e,t=globalThis?.document){const n=Qe(e);v.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var I1="DismissableLayer",wi="dismissableLayer.update",A1="dismissableLayer.pointerDownOutside",R1="dismissableLayer.focusOutside",Da,Ou=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),po=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=v.useContext(Ou),[u,h]=v.useState(null),p=u?.ownerDocument??globalThis?.document,[,d]=v.useState({}),g=Re(t,z=>h(z)),m=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=m.indexOf(y),b=u?m.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,S=b>=x,C=D1(z=>{const A=z.target,O=[...c.branches].some(P=>P.contains(A));!S||O||(o?.(z),s?.(z),z.defaultPrevented||a?.())},p),N=M1(z=>{const A=z.target;[...c.branches].some(P=>P.contains(A))||(i?.(z),s?.(z),z.defaultPrevented||a?.())},p);return z1(z=>{b===c.layers.size-1&&(r?.(z),!z.defaultPrevented&&a&&(z.preventDefault(),a()))},p),v.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Da=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Ma(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Da)}},[u,p,n,c]),v.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Ma())},[u,c]),v.useEffect(()=>{const z=()=>d({});return document.addEventListener(wi,z),()=>document.removeEventListener(wi,z)},[]),f.jsx(Ce.div,{...l,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:ve(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ve(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ve(e.onPointerDownCapture,C.onPointerDownCapture)})});po.displayName=I1;var P1="DismissableLayerBranch",O1=v.forwardRef((e,t)=>{const n=v.useContext(Ou),r=v.useRef(null),o=Re(t,r);return v.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),f.jsx(Ce.div,{...e,ref:o})});O1.displayName=P1;function D1(e,t=globalThis?.document){const n=Qe(e),r=v.useRef(!1),o=v.useRef(()=>{});return v.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){Du(A1,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function M1(e,t=globalThis?.document){const n=Qe(e),r=v.useRef(!1);return v.useEffect(()=>{const o=i=>{i.target&&!r.current&&Du(R1,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ma(){const e=new CustomEvent(wi);document.dispatchEvent(e)}function Du(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?f1(o,i):o.dispatchEvent(i)}var $o="focusScope.autoFocusOnMount",Bo="focusScope.autoFocusOnUnmount",La={bubbles:!1,cancelable:!0},L1="FocusScope",ds=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=v.useState(null),c=Qe(o),u=Qe(i),h=v.useRef(null),p=Re(t,m=>l(m)),d=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let m=function(w){if(d.paused||!a)return;const S=w.target;a.contains(S)?h.current=S:Vt(h.current,{select:!0})},y=function(w){if(d.paused||!a)return;const S=w.relatedTarget;S!==null&&(a.contains(S)||Vt(h.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&Vt(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const b=new MutationObserver(x);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,d.paused]),v.useEffect(()=>{if(a){$a.add(d);const m=document.activeElement;if(!a.contains(m)){const x=new CustomEvent($o,La);a.addEventListener($o,c),a.dispatchEvent(x),x.defaultPrevented||(F1(W1(Mu(a)),{select:!0}),document.activeElement===m&&Vt(a))}return()=>{a.removeEventListener($o,c),setTimeout(()=>{const x=new CustomEvent(Bo,La);a.addEventListener(Bo,u),a.dispatchEvent(x),x.defaultPrevented||Vt(m??document.body,{select:!0}),a.removeEventListener(Bo,u),$a.remove(d)},0)}}},[a,c,u,d]);const g=v.useCallback(m=>{if(!n&&!r||d.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(y&&x){const b=m.currentTarget,[w,S]=$1(b);w&&S?!m.shiftKey&&x===S?(m.preventDefault(),n&&Vt(w,{select:!0})):m.shiftKey&&x===w&&(m.preventDefault(),n&&Vt(S,{select:!0})):x===b&&m.preventDefault()}},[n,r,d.paused]);return f.jsx(Ce.div,{tabIndex:-1,...s,ref:p,onKeyDown:g})});ds.displayName=L1;function F1(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Vt(r,{select:t}),document.activeElement!==n)return}function $1(e){const t=Mu(e),n=Fa(t,e),r=Fa(t.reverse(),e);return[n,r]}function Mu(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Fa(e,t){for(const n of e)if(!B1(n,{upTo:t}))return n}function B1(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}function U1(e){return e instanceof HTMLInputElement&&"select"in e}function Vt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&U1(e)&&t&&e.select()}}var $a=Z1();function Z1(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Ba(e,t),e.unshift(t)},remove(t){e=Ba(e,t),e[0]?.resume()}}}function Ba(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function W1(e){return e.filter(t=>t.tagName!=="A")}var V1="Portal",mo=v.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=v.useState(!1);qe(()=>i(!0),[]);const s=n||o&&globalThis?.document?.body;return s?Wh.createPortal(f.jsx(Ce.div,{...r,ref:t}),s):null});mo.displayName=V1;var Uo=0;function Lu(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ua()),document.body.insertAdjacentElement("beforeend",e[1]??Ua()),Uo++,()=>{Uo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Uo--}},[])}function Ua(){const 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}var Ct=function(){return Ct=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ct.apply(this,arguments)};function Fu(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function H1(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Lr="right-scroll-bar-position",Fr="width-before-scroll-bar",q1="with-scroll-bars-hidden",G1="--removed-body-scroll-bar-size";function Zo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function K1(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var J1=typeof window<"u"?v.useLayoutEffect:v.useEffect,Za=new WeakMap;function Y1(e,t){var n=K1(null,function(r){return e.forEach(function(o){return Zo(o,r)})});return J1(function(){var r=Za.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||Zo(a,null)}),i.forEach(function(a){o.has(a)||Zo(a,s)})}Za.set(n,e)},[e]),n}function X1(e){return e}function Q1(e,t){t===void 0&&(t=X1);var n=[],r=!1,o={read:function(){if(r)throw new 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(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var u=s;s=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return o}function ew(e){e===void 0&&(e={});var t=Q1(null);return t.options=Ct({async:!0,ssr:!1},e),t}var $u=function(e){var t=e.sideCar,n=Fu(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,Ct({},n))};$u.isSideCarExport=!0;function tw(e,t){return e.useMedium(t),$u}var Bu=ew(),Wo=function(){},go=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:Wo,onWheelCapture:Wo,onTouchMoveCapture:Wo}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,h=e.shards,p=e.sideCar,d=e.noRelative,g=e.noIsolation,m=e.inert,y=e.allowPinchZoom,x=e.as,b=x===void 0?"div":x,w=e.gapMode,S=Fu(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=p,N=Y1([n,t]),z=Ct(Ct({},S),o);return v.createElement(v.Fragment,null,u&&v.createElement(C,{sideCar:Bu,removeScrollBar:c,shards:h,noRelative:d,noIsolation:g,inert:m,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:w}),s?v.cloneElement(v.Children.only(a),Ct(Ct({},z),{ref:N})):v.createElement(b,Ct({},z,{className:l,ref:N}),a))});go.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};go.classNames={fullWidth:Fr,zeroRight:Lr};var nw=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function rw(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=nw();return t&&e.setAttribute("nonce",t),e}function ow(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function iw(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sw=function(){var e=0,t=null;return{add:function(n){e==0&&(t=rw())&&(ow(t,n),iw(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},aw=function(){var e=sw();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Uu=function(){var e=aw(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},lw={left:0,top:0,right:0,gap:0},Vo=function(e){return parseInt(e||"",10)||0},cw=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Vo(n),Vo(r),Vo(o)]},uw=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return lw;var t=cw(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])}},dw=Uu(),Tn="data-scroll-locked",fw=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
66
66
  .`.concat(q1,` {
67
67
  overflow: hidden `).concat(r,`;
68
68
  padding-right: `).concat(a,"px ").concat(r,`;
@@ -102,29 +102,29 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
102
102
  `)},Wa=function(){var e=parseInt(document.body.getAttribute(Tn)||"0",10);return isFinite(e)?e:0},hw=function(){v.useEffect(function(){return document.body.setAttribute(Tn,(Wa()+1).toString()),function(){var e=Wa()-1;e<=0?document.body.removeAttribute(Tn):document.body.setAttribute(Tn,e.toString())}},[])},pw=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;hw();var i=v.useMemo(function(){return uw(o)},[o]);return v.createElement(dw,{styles:fw(i,!t,o,n?"":"!important")})},_i=!1;if(typeof window<"u")try{var jr=Object.defineProperty({},"passive",{get:function(){return _i=!0,!0}});window.addEventListener("test",jr,jr),window.removeEventListener("test",jr,jr)}catch{_i=!1}var yn=_i?{passive:!1}:!1,mw=function(e){return e.tagName==="TEXTAREA"},Zu=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!mw(e)&&n[t]==="visible")},gw=function(e){return Zu(e,"overflowY")},xw=function(e){return Zu(e,"overflowX")},Va=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Wu(e,r);if(o){var i=Vu(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},yw=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},bw=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Wu=function(e,t){return e==="v"?gw(t):xw(t)},Vu=function(e,t){return e==="v"?yw(t):bw(t)},vw=function(e,t){return e==="h"&&t==="rtl"?-1:1},ww=function(e,t,n,r,o){var i=vw(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,h=0,p=0;do{if(!a)break;var d=Vu(e,a),g=d[0],m=d[1],y=d[2],x=m-y-i*g;(g||x)&&Wu(e,a)&&(h+=x,p+=g);var b=a.parentNode;a=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(h)<1||!u&&Math.abs(p)<1)&&(c=!0),c},zr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ha=function(e){return[e.deltaX,e.deltaY]},qa=function(e){return e&&"current"in e?e.current:e},_w=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kw=function(e){return`
103
103
  .block-interactivity-`.concat(e,` {pointer-events: none;}
104
104
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
105
- `)},Sw=0,bn=[];function Cw(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),o=v.useState(Sw++)[0],i=v.useState(Uu)[0],s=v.useRef(e);v.useEffect(function(){s.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=H1([e.lockRef.current],(e.shards||[]).map(qa),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=v.useCallback(function(m,y){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var x=zr(m),b=n.current,w="deltaX"in m?m.deltaX:b[0]-x[0],S="deltaY"in m?m.deltaY:b[1]-x[1],C,N=m.target,z=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in m&&z==="h"&&N.type==="range")return!1;var I=window.getSelection(),O=I&&I.anchorNode,P=O?O===N||O.contains(N):!1;if(P)return!1;var L=Va(z,N);if(!L)return!0;if(L?C=z:(C=z==="v"?"h":"v",L=Va(z,N)),!L)return!1;if(!r.current&&"changedTouches"in m&&(w||S)&&(r.current=C),!C)return!0;var T=r.current||C;return ww(T,y,m,T==="h"?w:S)},[]),l=v.useCallback(function(m){var y=m;if(!(!bn.length||bn[bn.length-1]!==i)){var x="deltaY"in y?Ha(y):zr(y),b=t.current.filter(function(C){return C.name===y.type&&(C.target===y.target||y.target===C.shadowParent)&&_w(C.delta,x)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var w=(s.current.shards||[]).map(qa).filter(Boolean).filter(function(C){return C.contains(y.target)}),S=w.length>0?a(y,w[0]):!s.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),c=v.useCallback(function(m,y,x,b){var w={name:m,delta:y,target:x,should:b,shadowParent:Ew(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),u=v.useCallback(function(m){n.current=zr(m),r.current=void 0},[]),h=v.useCallback(function(m){c(m.type,Ha(m),m.target,a(m,e.lockRef.current))},[]),p=v.useCallback(function(m){c(m.type,zr(m),m.target,a(m,e.lockRef.current))},[]);v.useEffect(function(){return bn.push(i),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",l,yn),document.addEventListener("touchmove",l,yn),document.addEventListener("touchstart",u,yn),function(){bn=bn.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,yn),document.removeEventListener("touchmove",l,yn),document.removeEventListener("touchstart",u,yn)}},[]);var d=e.removeScrollBar,g=e.inert;return v.createElement(v.Fragment,null,g?v.createElement(i,{styles:kw(o)}):null,d?v.createElement(pw,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ew(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Nw=tw(Bu,Cw);var fs=v.forwardRef(function(e,t){return v.createElement(go,Ct({},e,{ref:t,sideCar:Nw}))});fs.classNames=go.classNames;var Tw=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},vn=new WeakMap,Ar=new WeakMap,Ir={},Ho=0,Hu=function(e){return e&&(e.host||Hu(e.parentNode))},jw=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Hu(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},zw=function(e,t,n,r){var o=jw(t,Array.isArray(e)?e:[e]);Ir[n]||(Ir[n]=new WeakMap);var i=Ir[n],s=[],a=new Set,l=new Set(o),c=function(h){!h||a.has(h)||(a.add(h),c(h.parentNode))};o.forEach(c);var u=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(p){if(a.has(p))u(p);else try{var d=p.getAttribute(r),g=d!==null&&d!=="false",m=(vn.get(p)||0)+1,y=(i.get(p)||0)+1;vn.set(p,m),i.set(p,y),s.push(p),m===1&&g&&Ar.set(p,!0),y===1&&p.setAttribute(n,"true"),g||p.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return u(t),a.clear(),Ho++,function(){s.forEach(function(h){var p=vn.get(h)-1,d=i.get(h)-1;vn.set(h,p),i.set(h,d),p||(Ar.has(h)||h.removeAttribute(r),Ar.delete(h)),d||h.removeAttribute(n)}),Ho--,Ho||(vn=new WeakMap,vn=new WeakMap,Ar=new WeakMap,Ir={})}},qu=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Tw(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),zw(r,o,n,"aria-hidden")):function(){return null}},xo="Dialog",[Gu]=Bt(xo),[Aw,wt]=Gu(xo),Ku=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=v.useRef(null),l=v.useRef(null),[c,u]=an({prop:r,defaultProp:o??!1,onChange:i,caller:xo});return f.jsx(Aw,{scope:t,triggerRef:a,contentRef:l,contentId:Tt(),titleId:Tt(),descriptionId:Tt(),open:c,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(h=>!h),[u]),modal:s,children:n})};Ku.displayName=xo;var Ju="DialogTrigger",Yu=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(Ju,n),i=Re(t,o.triggerRef);return f.jsx(Ce.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ms(o.open),...r,ref:i,onClick:ve(e.onClick,o.onOpenToggle)})});Yu.displayName=Ju;var hs="DialogPortal",[Iw,Xu]=Gu(hs,{forceMount:void 0}),Qu=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=wt(hs,t);return f.jsx(Iw,{scope:t,forceMount:n,children:v.Children.map(r,s=>f.jsx(mt,{present:n||i.open,children:f.jsx(mo,{asChild:!0,container:o,children:s})}))})};Qu.displayName=hs;var Gr="DialogOverlay",ed=v.forwardRef((e,t)=>{const n=Xu(Gr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=wt(Gr,e.__scopeDialog);return i.modal?f.jsx(mt,{present:r||i.open,children:f.jsx(Pw,{...o,ref:t})}):null});ed.displayName=Gr;var Rw=Pn("DialogOverlay.RemoveScroll"),Pw=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(Gr,n);return f.jsx(fs,{as:Rw,allowPinchZoom:!0,shards:[o.contentRef],children:f.jsx(Ce.div,{"data-state":ms(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ln="DialogContent",td=v.forwardRef((e,t)=>{const n=Xu(ln,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=wt(ln,e.__scopeDialog);return f.jsx(mt,{present:r||i.open,children:i.modal?f.jsx(Ow,{...o,ref:t}):f.jsx(Dw,{...o,ref:t})})});td.displayName=ln;var Ow=v.forwardRef((e,t)=>{const n=wt(ln,e.__scopeDialog),r=v.useRef(null),o=Re(t,n.contentRef,r);return v.useEffect(()=>{const i=r.current;if(i)return qu(i)},[]),f.jsx(nd,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ve(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ve(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:ve(e.onFocusOutside,i=>i.preventDefault())})}),Dw=v.forwardRef((e,t)=>{const n=wt(ln,e.__scopeDialog),r=v.useRef(!1),o=v.useRef(!1);return f.jsx(nd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;n.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),nd=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=wt(ln,n),l=v.useRef(null),c=Re(t,l);return Lu(),f.jsxs(f.Fragment,{children:[f.jsx(ds,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:f.jsx(po,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ms(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(Lw,{titleId:a.titleId}),f.jsx($w,{contentRef:l,descriptionId:a.descriptionId})]})]})}),ps="DialogTitle",rd=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(ps,n);return f.jsx(Ce.h2,{id:o.titleId,...r,ref:t})});rd.displayName=ps;var od="DialogDescription",Mw=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(od,n);return f.jsx(Ce.p,{id:o.descriptionId,...r,ref:t})});Mw.displayName=od;var id="DialogClose",sd=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(id,n);return f.jsx(Ce.button,{type:"button",...r,ref:t,onClick:ve(e.onClick,()=>o.onOpenChange(!1))})});sd.displayName=id;function ms(e){return e?"open":"closed"}var ad="DialogTitleWarning",[cT,ld]=m1(ad,{contentName:ln,titleName:ps,docsSlug:"dialog"}),Lw=({titleId:e})=>{const t=ld(ad),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
105
+ `)},Sw=0,bn=[];function Cw(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),o=v.useState(Sw++)[0],i=v.useState(Uu)[0],s=v.useRef(e);v.useEffect(function(){s.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=H1([e.lockRef.current],(e.shards||[]).map(qa),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=v.useCallback(function(m,y){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var x=zr(m),b=n.current,w="deltaX"in m?m.deltaX:b[0]-x[0],S="deltaY"in m?m.deltaY:b[1]-x[1],C,N=m.target,z=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in m&&z==="h"&&N.type==="range")return!1;var A=window.getSelection(),O=A&&A.anchorNode,P=O?O===N||O.contains(N):!1;if(P)return!1;var L=Va(z,N);if(!L)return!0;if(L?C=z:(C=z==="v"?"h":"v",L=Va(z,N)),!L)return!1;if(!r.current&&"changedTouches"in m&&(w||S)&&(r.current=C),!C)return!0;var T=r.current||C;return ww(T,y,m,T==="h"?w:S)},[]),l=v.useCallback(function(m){var y=m;if(!(!bn.length||bn[bn.length-1]!==i)){var x="deltaY"in y?Ha(y):zr(y),b=t.current.filter(function(C){return C.name===y.type&&(C.target===y.target||y.target===C.shadowParent)&&_w(C.delta,x)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var w=(s.current.shards||[]).map(qa).filter(Boolean).filter(function(C){return C.contains(y.target)}),S=w.length>0?a(y,w[0]):!s.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),c=v.useCallback(function(m,y,x,b){var w={name:m,delta:y,target:x,should:b,shadowParent:Ew(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),u=v.useCallback(function(m){n.current=zr(m),r.current=void 0},[]),h=v.useCallback(function(m){c(m.type,Ha(m),m.target,a(m,e.lockRef.current))},[]),p=v.useCallback(function(m){c(m.type,zr(m),m.target,a(m,e.lockRef.current))},[]);v.useEffect(function(){return bn.push(i),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",l,yn),document.addEventListener("touchmove",l,yn),document.addEventListener("touchstart",u,yn),function(){bn=bn.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,yn),document.removeEventListener("touchmove",l,yn),document.removeEventListener("touchstart",u,yn)}},[]);var d=e.removeScrollBar,g=e.inert;return v.createElement(v.Fragment,null,g?v.createElement(i,{styles:kw(o)}):null,d?v.createElement(pw,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ew(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Nw=tw(Bu,Cw);var fs=v.forwardRef(function(e,t){return v.createElement(go,Ct({},e,{ref:t,sideCar:Nw}))});fs.classNames=go.classNames;var Tw=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},vn=new WeakMap,Ir=new WeakMap,Ar={},Ho=0,Hu=function(e){return e&&(e.host||Hu(e.parentNode))},jw=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Hu(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},zw=function(e,t,n,r){var o=jw(t,Array.isArray(e)?e:[e]);Ar[n]||(Ar[n]=new WeakMap);var i=Ar[n],s=[],a=new Set,l=new Set(o),c=function(h){!h||a.has(h)||(a.add(h),c(h.parentNode))};o.forEach(c);var u=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(p){if(a.has(p))u(p);else try{var d=p.getAttribute(r),g=d!==null&&d!=="false",m=(vn.get(p)||0)+1,y=(i.get(p)||0)+1;vn.set(p,m),i.set(p,y),s.push(p),m===1&&g&&Ir.set(p,!0),y===1&&p.setAttribute(n,"true"),g||p.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return u(t),a.clear(),Ho++,function(){s.forEach(function(h){var p=vn.get(h)-1,d=i.get(h)-1;vn.set(h,p),i.set(h,d),p||(Ir.has(h)||h.removeAttribute(r),Ir.delete(h)),d||h.removeAttribute(n)}),Ho--,Ho||(vn=new WeakMap,vn=new WeakMap,Ir=new WeakMap,Ar={})}},qu=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Tw(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),zw(r,o,n,"aria-hidden")):function(){return null}},xo="Dialog",[Gu]=Bt(xo),[Iw,wt]=Gu(xo),Ku=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=v.useRef(null),l=v.useRef(null),[c,u]=an({prop:r,defaultProp:o??!1,onChange:i,caller:xo});return f.jsx(Iw,{scope:t,triggerRef:a,contentRef:l,contentId:Tt(),titleId:Tt(),descriptionId:Tt(),open:c,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(h=>!h),[u]),modal:s,children:n})};Ku.displayName=xo;var Ju="DialogTrigger",Yu=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(Ju,n),i=Re(t,o.triggerRef);return f.jsx(Ce.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ms(o.open),...r,ref:i,onClick:ve(e.onClick,o.onOpenToggle)})});Yu.displayName=Ju;var hs="DialogPortal",[Aw,Xu]=Gu(hs,{forceMount:void 0}),Qu=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=wt(hs,t);return f.jsx(Aw,{scope:t,forceMount:n,children:v.Children.map(r,s=>f.jsx(mt,{present:n||i.open,children:f.jsx(mo,{asChild:!0,container:o,children:s})}))})};Qu.displayName=hs;var Gr="DialogOverlay",ed=v.forwardRef((e,t)=>{const n=Xu(Gr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=wt(Gr,e.__scopeDialog);return i.modal?f.jsx(mt,{present:r||i.open,children:f.jsx(Pw,{...o,ref:t})}):null});ed.displayName=Gr;var Rw=Pn("DialogOverlay.RemoveScroll"),Pw=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(Gr,n);return f.jsx(fs,{as:Rw,allowPinchZoom:!0,shards:[o.contentRef],children:f.jsx(Ce.div,{"data-state":ms(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ln="DialogContent",td=v.forwardRef((e,t)=>{const n=Xu(ln,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=wt(ln,e.__scopeDialog);return f.jsx(mt,{present:r||i.open,children:i.modal?f.jsx(Ow,{...o,ref:t}):f.jsx(Dw,{...o,ref:t})})});td.displayName=ln;var Ow=v.forwardRef((e,t)=>{const n=wt(ln,e.__scopeDialog),r=v.useRef(null),o=Re(t,n.contentRef,r);return v.useEffect(()=>{const i=r.current;if(i)return qu(i)},[]),f.jsx(nd,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ve(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ve(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:ve(e.onFocusOutside,i=>i.preventDefault())})}),Dw=v.forwardRef((e,t)=>{const n=wt(ln,e.__scopeDialog),r=v.useRef(!1),o=v.useRef(!1);return f.jsx(nd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;n.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),nd=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=wt(ln,n),l=v.useRef(null),c=Re(t,l);return Lu(),f.jsxs(f.Fragment,{children:[f.jsx(ds,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:f.jsx(po,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ms(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(Lw,{titleId:a.titleId}),f.jsx($w,{contentRef:l,descriptionId:a.descriptionId})]})]})}),ps="DialogTitle",rd=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(ps,n);return f.jsx(Ce.h2,{id:o.titleId,...r,ref:t})});rd.displayName=ps;var od="DialogDescription",Mw=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(od,n);return f.jsx(Ce.p,{id:o.descriptionId,...r,ref:t})});Mw.displayName=od;var id="DialogClose",sd=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(id,n);return f.jsx(Ce.button,{type:"button",...r,ref:t,onClick:ve(e.onClick,()=>o.onOpenChange(!1))})});sd.displayName=id;function ms(e){return e?"open":"closed"}var ad="DialogTitleWarning",[cT,ld]=m1(ad,{contentName:ln,titleName:ps,docsSlug:"dialog"}),Lw=({titleId:e})=>{const t=ld(ad),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
106
106
 
107
107
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
108
108
 
109
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Fw="DialogDescriptionWarning",$w=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ld(Fw).contentName}}.`;return v.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Bw=Ku,Uw=Yu,Zw=Qu,Ww=ed,Vw=td,Hw=rd,qw=sd;function Gw(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Kw(e){const[t,n]=v.useState(void 0);return qe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const Jw=["top","right","bottom","left"],qt=Math.min,at=Math.max,Kr=Math.round,Rr=Math.floor,jt=e=>({x:e,y:e}),Yw={left:"right",right:"left",bottom:"top",top:"bottom"};function ki(e,t,n){return at(e,qt(t,n))}function Ft(e,t){return typeof e=="function"?e(t):e}function $t(e){return e.split("-")[0]}function Bn(e){return e.split("-")[1]}function gs(e){return e==="x"?"y":"x"}function xs(e){return e==="y"?"height":"width"}function Nt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ys(e){return gs(Nt(e))}function Xw(e,t,n){n===void 0&&(n=!1);const r=Bn(e),o=ys(e),i=xs(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Jr(s)),[s,Jr(s)]}function Qw(e){const t=Jr(e);return[Si(e),t,Si(t)]}function Si(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ga=["left","right"],Ka=["right","left"],e2=["top","bottom"],t2=["bottom","top"];function n2(e,t,n){switch(e){case"top":case"bottom":return n?t?Ka:Ga:t?Ga:Ka;case"left":case"right":return t?e2:t2;default:return[]}}function r2(e,t,n,r){const o=Bn(e);let i=n2($t(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Si)))),i}function Jr(e){const t=$t(e);return Yw[t]+e.slice(t.length)}function o2(e){return{top:0,right:0,bottom:0,left:0,...e}}function cd(e){return typeof e!="number"?o2(e):{top:e,right:e,bottom:e,left:e}}function Yr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Ja(e,t,n){let{reference:r,floating:o}=e;const i=Nt(t),s=ys(t),a=xs(s),l=$t(t),c=i==="y",u=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let d;switch(l){case"top":d={x:u,y:r.y-o.height};break;case"bottom":d={x:u,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:h};break;case"left":d={x:r.x-o.width,y:h};break;default:d={x:r.x,y:r.y}}switch(Bn(t)){case"start":d[s]-=p*(n&&c?-1:1);break;case"end":d[s]+=p*(n&&c?-1:1);break}return d}async function i2(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:p=!1,padding:d=0}=Ft(t,e),g=cd(d),y=a[p?h==="floating"?"reference":"floating":h],x=Yr(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=h==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Yr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:l}):b);return{top:(x.top-C.top+g.top)/S.y,bottom:(C.bottom-x.bottom+g.bottom)/S.y,left:(x.left-C.left+g.left)/S.x,right:(C.right-x.right+g.right)/S.x}}const s2=50,a2=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:i2},l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:h}=Ja(c,r,l),p=r,d=0;const g={};for(let m=0;m<i.length;m++){const y=i[m];if(!y)continue;const{name:x,fn:b}=y,{x:w,y:S,data:C,reset:N}=await b({x:u,y:h,initialPlacement:r,placement:p,strategy:o,middlewareData:g,rects:c,platform:a,elements:{reference:e,floating:t}});u=w??u,h=S??h,g[x]={...g[x],...C},N&&d<s2&&(d++,typeof N=="object"&&(N.placement&&(p=N.placement),N.rects&&(c=N.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:u,y:h}=Ja(c,p,l)),m=-1)}return{x:u,y:h,placement:p,strategy:o,middlewareData:g}},l2=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Ft(e,t)||{};if(c==null)return{};const h=cd(u),p={x:n,y:r},d=ys(o),g=xs(d),m=await s.getDimensions(c),y=d==="y",x=y?"top":"left",b=y?"bottom":"right",w=y?"clientHeight":"clientWidth",S=i.reference[g]+i.reference[d]-p[d]-i.floating[g],C=p[d]-i.reference[d],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let z=N?N[w]:0;(!z||!await(s.isElement==null?void 0:s.isElement(N)))&&(z=a.floating[w]||i.floating[g]);const I=S/2-C/2,O=z/2-m[g]/2-1,P=qt(h[x],O),L=qt(h[b],O),T=P,M=z-m[g]-L,_=z/2-m[g]/2+I,D=ki(T,_,M),G=!l.arrow&&Bn(o)!=null&&_!==D&&i.reference[g]/2-(_<T?P:L)-m[g]/2<0,Z=G?_<T?_-T:_-M:0;return{[d]:p[d]+Z,data:{[d]:D,centerOffset:_-D-Z,...G&&{alignmentOffset:Z}},reset:G}}}),c2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...y}=Ft(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=$t(o),b=Nt(a),w=$t(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=p||(w||!m?[Jr(a)]:Qw(a)),N=g!=="none";!p&&N&&C.push(...r2(a,m,g,S));const z=[a,...C],I=await l.detectOverflow(t,y),O=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&O.push(I[x]),h){const _=Xw(o,s,S);O.push(I[_[0]],I[_[1]])}if(P=[...P,{placement:o,overflows:O}],!O.every(_=>_<=0)){var L,T;const _=(((L=i.flip)==null?void 0:L.index)||0)+1,D=z[_];if(D&&(!(h==="alignment"?b!==Nt(D):!1)||P.every(te=>Nt(te.placement)===b?te.overflows[0]>0:!0)))return{data:{index:_,overflows:P},reset:{placement:D}};let G=(T=P.filter(Z=>Z.overflows[0]<=0).sort((Z,te)=>Z.overflows[1]-te.overflows[1])[0])==null?void 0:T.placement;if(!G)switch(d){case"bestFit":{var M;const Z=(M=P.filter(te=>{if(N){const q=Nt(te.placement);return q===b||q==="y"}return!0}).map(te=>[te.placement,te.overflows.filter(q=>q>0).reduce((q,E)=>q+E,0)]).sort((te,q)=>te[1]-q[1])[0])==null?void 0:M[0];Z&&(G=Z);break}case"initialPlacement":G=a;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function Ya(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xa(e){return Jw.some(t=>e[t]>=0)}const u2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=Ft(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=Ya(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Xa(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=Ya(s,n.floating);return{data:{escapedOffsets:a,escaped:Xa(a)}}}default:return{}}}}},ud=new Set(["left","top"]);async function d2(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=$t(n),a=Bn(n),l=Nt(n)==="y",c=ud.has(s)?-1:1,u=i&&l?-1:1,h=Ft(t,e);let{mainAxis:p,crossAxis:d,alignmentAxis:g}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof g=="number"&&(d=a==="end"?g*-1:g),l?{x:d*u,y:p*c}:{x:p*c,y:d*u}}const f2=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await d2(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},h2=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:x=>{let{x:b,y:w}=x;return{x:b,y:w}}},...c}=Ft(e,t),u={x:n,y:r},h=await i.detectOverflow(t,c),p=Nt($t(o)),d=gs(p);let g=u[d],m=u[p];if(s){const x=d==="y"?"top":"left",b=d==="y"?"bottom":"right",w=g+h[x],S=g-h[b];g=ki(w,g,S)}if(a){const x=p==="y"?"top":"left",b=p==="y"?"bottom":"right",w=m+h[x],S=m-h[b];m=ki(w,m,S)}const y=l.fn({...t,[d]:g,[p]:m});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[d]:s,[p]:a}}}}}},p2=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Ft(e,t),u={x:n,y:r},h=Nt(o),p=gs(h);let d=u[p],g=u[h];const m=Ft(a,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const w=p==="y"?"height":"width",S=i.reference[p]-i.floating[w]+y.mainAxis,C=i.reference[p]+i.reference[w]-y.mainAxis;d<S?d=S:d>C&&(d=C)}if(c){var x,b;const w=p==="y"?"width":"height",S=ud.has($t(o)),C=i.reference[h]-i.floating[w]+(S&&((x=s.offset)==null?void 0:x[h])||0)+(S?0:y.crossAxis),N=i.reference[h]+i.reference[w]+(S?0:((b=s.offset)==null?void 0:b[h])||0)-(S?y.crossAxis:0);g<C?g=C:g>N&&(g=N)}return{[p]:d,[h]:g}}}},m2=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Ft(e,t),u=await s.detectOverflow(t,c),h=$t(o),p=Bn(o),d=Nt(o)==="y",{width:g,height:m}=i.floating;let y,x;h==="top"||h==="bottom"?(y=h,x=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(x=h,y=p==="end"?"top":"bottom");const b=m-u.top-u.bottom,w=g-u.left-u.right,S=qt(m-u[y],b),C=qt(g-u[x],w),N=!t.middlewareData.shift;let z=S,I=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(z=b),N&&!p){const P=at(u.left,0),L=at(u.right,0),T=at(u.top,0),M=at(u.bottom,0);d?I=g-2*(P!==0||L!==0?P+L:at(u.left,u.right)):z=m-2*(T!==0||M!==0?T+M:at(u.top,u.bottom))}await l({...t,availableWidth:I,availableHeight:z});const O=await s.getDimensions(a.floating);return g!==O.width||m!==O.height?{reset:{rects:!0}}:{}}}};function yo(){return typeof window<"u"}function Un(e){return dd(e)?(e.nodeName||"").toLowerCase():"#document"}function ut(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function It(e){var t;return(t=(dd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dd(e){return yo()?e instanceof Node||e instanceof ut(e).Node:!1}function bt(e){return yo()?e instanceof Element||e instanceof ut(e).Element:!1}function Ut(e){return yo()?e instanceof HTMLElement||e instanceof ut(e).HTMLElement:!1}function Qa(e){return!yo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ut(e).ShadowRoot}function mr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=vt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function g2(e){return/^(table|td|th)$/.test(Un(e))}function bo(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const x2=/transform|translate|scale|rotate|perspective|filter/,y2=/paint|layout|strict|content/,rn=e=>!!e&&e!=="none";let qo;function bs(e){const t=bt(e)?vt(e):e;return rn(t.transform)||rn(t.translate)||rn(t.scale)||rn(t.rotate)||rn(t.perspective)||!vs()&&(rn(t.backdropFilter)||rn(t.filter))||x2.test(t.willChange||"")||y2.test(t.contain||"")}function b2(e){let t=Gt(e);for(;Ut(t)&&!On(t);){if(bs(t))return t;if(bo(t))return null;t=Gt(t)}return null}function vs(){return qo==null&&(qo=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),qo}function On(e){return/^(html|body|#document)$/.test(Un(e))}function vt(e){return ut(e).getComputedStyle(e)}function vo(e){return bt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Gt(e){if(Un(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Qa(e)&&e.host||It(e);return Qa(t)?t.host:t}function fd(e){const t=Gt(e);return On(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ut(t)&&mr(t)?t:fd(t)}function ar(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=fd(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ut(o);if(i){const a=Ci(s);return t.concat(s,s.visualViewport||[],mr(o)?o:[],a&&n?ar(a):[])}else return t.concat(o,ar(o,[],n))}function Ci(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function hd(e){const t=vt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ut(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Kr(n)!==i||Kr(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function ws(e){return bt(e)?e:e.contextElement}function jn(e){const t=ws(e);if(!Ut(t))return jt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=hd(t);let s=(i?Kr(n.width):n.width)/r,a=(i?Kr(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const v2=jt(0);function pd(e){const t=ut(e);return!vs()||!t.visualViewport?v2:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function w2(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ut(e)?!1:t}function cn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=ws(e);let s=jt(1);t&&(r?bt(r)&&(s=jn(r)):s=jn(e));const a=w2(i,n,r)?pd(i):jt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,h=o.height/s.y;if(i){const p=ut(i),d=r&&bt(r)?ut(r):r;let g=p,m=Ci(g);for(;m&&r&&d!==g;){const y=jn(m),x=m.getBoundingClientRect(),b=vt(m),w=x.left+(m.clientLeft+parseFloat(b.paddingLeft))*y.x,S=x.top+(m.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,h*=y.y,l+=w,c+=S,g=ut(m),m=Ci(g)}}return Yr({width:u,height:h,x:l,y:c})}function wo(e,t){const n=vo(e).scrollLeft;return t?t.left+n:cn(It(e)).left+n}function md(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-wo(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function _2(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=It(r),a=t?bo(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=jt(1);const u=jt(0),h=Ut(r);if((h||!h&&!i)&&((Un(r)!=="body"||mr(s))&&(l=vo(r)),h)){const d=cn(r);c=jn(r),u.x=d.x+r.clientLeft,u.y=d.y+r.clientTop}const p=s&&!h&&!i?md(s,l):jt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}}function k2(e){return Array.from(e.getClientRects())}function S2(e){const t=It(e),n=vo(e),r=e.ownerDocument.body,o=at(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=at(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+wo(e);const a=-n.scrollTop;return vt(r).direction==="rtl"&&(s+=at(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const el=25;function C2(e,t){const n=ut(e),r=It(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=vs();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=wo(r);if(c<=0){const u=r.ownerDocument,h=u.body,p=getComputedStyle(h),d=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(r.clientWidth-h.clientWidth-d);g<=el&&(i-=g)}else c<=el&&(i+=c);return{width:i,height:s,x:a,y:l}}function E2(e,t){const n=cn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ut(e)?jn(e):jt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function tl(e,t,n){let r;if(t==="viewport")r=C2(e,n);else if(t==="document")r=S2(It(e));else if(bt(t))r=E2(t,n);else{const o=pd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Yr(r)}function gd(e,t){const n=Gt(e);return n===t||!bt(n)||On(n)?!1:vt(n).position==="fixed"||gd(n,t)}function N2(e,t){const n=t.get(e);if(n)return n;let r=ar(e,[],!1).filter(a=>bt(a)&&Un(a)!=="body"),o=null;const i=vt(e).position==="fixed";let s=i?Gt(e):e;for(;bt(s)&&!On(s);){const a=vt(s),l=bs(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||mr(s)&&!l&&gd(e,s))?r=r.filter(u=>u!==s):o=a,s=Gt(s)}return t.set(e,r),r}function T2(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?bo(t)?[]:N2(t,this._c):[].concat(n),r],a=tl(t,s[0],o);let l=a.top,c=a.right,u=a.bottom,h=a.left;for(let p=1;p<s.length;p++){const d=tl(t,s[p],o);l=at(d.top,l),c=qt(d.right,c),u=qt(d.bottom,u),h=at(d.left,h)}return{width:c-h,height:u-l,x:h,y:l}}function j2(e){const{width:t,height:n}=hd(e);return{width:t,height:n}}function z2(e,t,n){const r=Ut(t),o=It(t),i=n==="fixed",s=cn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=jt(0);function c(){l.x=wo(o)}if(r||!r&&!i)if((Un(t)!=="body"||mr(o))&&(a=vo(t)),r){const d=cn(t,!0,i,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?md(o,a):jt(0),h=s.left+a.scrollLeft-l.x-u.x,p=s.top+a.scrollTop-l.y-u.y;return{x:h,y:p,width:s.width,height:s.height}}function Go(e){return vt(e).position==="static"}function nl(e,t){if(!Ut(e)||vt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return It(e)===n&&(n=n.ownerDocument.body),n}function xd(e,t){const n=ut(e);if(bo(e))return n;if(!Ut(e)){let o=Gt(e);for(;o&&!On(o);){if(bt(o)&&!Go(o))return o;o=Gt(o)}return n}let r=nl(e,t);for(;r&&g2(r)&&Go(r);)r=nl(r,t);return r&&On(r)&&Go(r)&&!bs(r)?n:r||b2(e)||n}const A2=async function(e){const t=this.getOffsetParent||xd,n=this.getDimensions,r=await n(e.floating);return{reference:z2(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function I2(e){return vt(e).direction==="rtl"}const R2={convertOffsetParentRelativeRectToViewportRelativeRect:_2,getDocumentElement:It,getClippingRect:T2,getOffsetParent:xd,getElementRects:A2,getClientRects:k2,getDimensions:j2,getScale:jn,isElement:bt,isRTL:I2};function yd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function P2(e,t){let n=null,r;const o=It(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:h,width:p,height:d}=c;if(a||t(),!p||!d)return;const g=Rr(h),m=Rr(o.clientWidth-(u+p)),y=Rr(o.clientHeight-(h+d)),x=Rr(u),w={rootMargin:-g+"px "+-m+"px "+-y+"px "+-x+"px",threshold:at(0,qt(1,l))||1};let S=!0;function C(N){const z=N[0].intersectionRatio;if(z!==l){if(!S)return s();z?s(!1,z):r=setTimeout(()=>{s(!1,1e-7)},1e3)}z===1&&!yd(c,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return s(!0),i}function O2(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=ws(e),u=o||i?[...c?ar(c):[],...t?ar(t):[]]:[];u.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const h=c&&a?P2(c,n):null;let p=-1,d=null;s&&(d=new ResizeObserver(x=>{let[b]=x;b&&b.target===c&&d&&t&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(t)})),n()}),c&&!l&&d.observe(c),t&&d.observe(t));let g,m=l?cn(e):null;l&&y();function y(){const x=cn(e);m&&!yd(m,x)&&n(),m=x,g=requestAnimationFrame(y)}return n(),()=>{var x;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),h?.(),(x=d)==null||x.disconnect(),d=null,l&&cancelAnimationFrame(g)}}const D2=f2,M2=h2,L2=c2,F2=m2,$2=u2,rl=l2,B2=p2,U2=(e,t,n)=>{const r=new Map,o={platform:R2,...n},i={...o.platform,_c:r};return a2(e,t,{...o,platform:i})};var Z2=typeof document<"u",W2=function(){},$r=Z2?v.useLayoutEffect:W2;function Xr(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,o;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(!Xr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Xr(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function bd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ol(e,t){const n=bd(e);return Math.round(t*n)/n}function Ko(e){const t=v.useRef(e);return $r(()=>{t.current=e}),t}function V2(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,h]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=v.useState(r);Xr(p,r)||d(r);const[g,m]=v.useState(null),[y,x]=v.useState(null),b=v.useCallback(te=>{te!==N.current&&(N.current=te,m(te))},[]),w=v.useCallback(te=>{te!==z.current&&(z.current=te,x(te))},[]),S=i||g,C=s||y,N=v.useRef(null),z=v.useRef(null),I=v.useRef(u),O=l!=null,P=Ko(l),L=Ko(o),T=Ko(c),M=v.useCallback(()=>{if(!N.current||!z.current)return;const te={placement:t,strategy:n,middleware:p};L.current&&(te.platform=L.current),U2(N.current,z.current,te).then(q=>{const E={...q,isPositioned:T.current!==!1};_.current&&!Xr(I.current,E)&&(I.current=E,dr.flushSync(()=>{h(E)}))})},[p,t,n,L,T]);$r(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,h(te=>({...te,isPositioned:!1})))},[c]);const _=v.useRef(!1);$r(()=>(_.current=!0,()=>{_.current=!1}),[]),$r(()=>{if(S&&(N.current=S),C&&(z.current=C),S&&C){if(P.current)return P.current(S,C,M);M()}},[S,C,M,P,O]);const D=v.useMemo(()=>({reference:N,floating:z,setReference:b,setFloating:w}),[b,w]),G=v.useMemo(()=>({reference:S,floating:C}),[S,C]),Z=v.useMemo(()=>{const te={position:n,left:0,top:0};if(!G.floating)return te;const q=ol(G.floating,u.x),E=ol(G.floating,u.y);return a?{...te,transform:"translate("+q+"px, "+E+"px)",...bd(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:E}},[n,a,G.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:M,refs:D,elements:G,floatingStyles:Z}),[u,M,D,G,Z])}const H2=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?rl({element:r.current,padding:o}).fn(n):{}:r?rl({element:r,padding:o}).fn(n):{}}}},q2=(e,t)=>{const n=D2(e);return{name:n.name,fn:n.fn,options:[e,t]}},G2=(e,t)=>{const n=M2(e);return{name:n.name,fn:n.fn,options:[e,t]}},K2=(e,t)=>({fn:B2(e).fn,options:[e,t]}),J2=(e,t)=>{const n=L2(e);return{name:n.name,fn:n.fn,options:[e,t]}},Y2=(e,t)=>{const n=F2(e);return{name:n.name,fn:n.fn,options:[e,t]}},X2=(e,t)=>{const n=$2(e);return{name:n.name,fn:n.fn,options:[e,t]}},Q2=(e,t)=>{const n=H2(e);return{name:n.name,fn:n.fn,options:[e,t]}};var e_="Arrow",vd=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return f.jsx(Ce.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});vd.displayName=e_;var t_=vd,_s="Popper",[wd,_o]=Bt(_s),[n_,_d]=wd(_s),kd=e=>{const{__scopePopper:t,children:n}=e,[r,o]=v.useState(null);return f.jsx(n_,{scope:t,anchor:r,onAnchorChange:o,children:n})};kd.displayName=_s;var Sd="PopperAnchor",Cd=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=_d(Sd,n),s=v.useRef(null),a=Re(t,s),l=v.useRef(null);return v.useEffect(()=>{const c=l.current;l.current=r?.current||s.current,c!==l.current&&i.onAnchorChange(l.current)}),r?null:f.jsx(Ce.div,{...o,ref:a})});Cd.displayName=Sd;var ks="PopperContent",[r_,o_]=wd(ks),Ed=v.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:d="optimized",onPlaced:g,...m}=e,y=_d(ks,n),[x,b]=v.useState(null),w=Re(t,ie=>b(ie)),[S,C]=v.useState(null),N=Kw(S),z=N?.width??0,I=N?.height??0,O=r+(i!=="center"?"-"+i:""),P=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},L=Array.isArray(c)?c:[c],T=L.length>0,M={padding:P,boundary:L.filter(s_),altBoundary:T},{refs:_,floatingStyles:D,placement:G,isPositioned:Z,middlewareData:te}=V2({strategy:"fixed",placement:O,whileElementsMounted:(...ie)=>O2(...ie,{animationFrame:d==="always"}),elements:{reference:y.anchor},middleware:[q2({mainAxis:o+I,alignmentAxis:s}),l&&G2({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?K2():void 0,...M}),l&&J2({...M}),Y2({...M,apply:({elements:ie,rects:re,availableWidth:le,availableHeight:me})=>{const{width:xe,height:Te}=re.reference,Pe=ie.floating.style;Pe.setProperty("--radix-popper-available-width",`${le}px`),Pe.setProperty("--radix-popper-available-height",`${me}px`),Pe.setProperty("--radix-popper-anchor-width",`${xe}px`),Pe.setProperty("--radix-popper-anchor-height",`${Te}px`)}}),S&&Q2({element:S,padding:a}),a_({arrowWidth:z,arrowHeight:I}),p&&X2({strategy:"referenceHidden",...M})]}),[q,E]=jd(G),U=Qe(g);qe(()=>{Z&&U?.()},[Z,U]);const B=te.arrow?.x,j=te.arrow?.y,Y=te.arrow?.centerOffset!==0,[H,ce]=v.useState();return qe(()=>{x&&ce(window.getComputedStyle(x).zIndex)},[x]),f.jsx("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:Z?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(" "),...te.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(r_,{scope:n,placedSide:q,onArrowChange:C,arrowX:B,arrowY:j,shouldHideArrow:Y,children:f.jsx(Ce.div,{"data-side":q,"data-align":E,...m,ref:w,style:{...m.style,animation:Z?void 0:"none"}})})})});Ed.displayName=ks;var Nd="PopperArrow",i_={top:"bottom",right:"left",bottom:"top",left:"right"},Td=v.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=o_(Nd,r),s=i_[i.placedSide];return f.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:f.jsx(t_,{...o,ref:n,style:{...o.style,display:"block"}})})});Td.displayName=Nd;function s_(e){return e!==null}var a_=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=jd(n),h={start:"0%",center:"50%",end:"100%"}[u],p=(o.arrow?.x??0)+a/2,d=(o.arrow?.y??0)+l/2;let g="",m="";return c==="bottom"?(g=s?h:`${p}px`,m=`${-l}px`):c==="top"?(g=s?h:`${p}px`,m=`${r.floating.height+l}px`):c==="right"?(g=`${-l}px`,m=s?h:`${d}px`):c==="left"&&(g=`${r.floating.width+l}px`,m=s?h:`${d}px`),{data:{x:g,y:m}}}});function jd(e){const[t,n="center"]=e.split("-");return[t,n]}var zd=kd,Ad=Cd,Id=Ed,Rd=Td,Jo="rovingFocusGroup.onEntryFocus",l_={bubbles:!1,cancelable:!0},gr="RovingFocusGroup",[Ei,Pd,c_]=zu(gr),[u_,Od]=Bt(gr,[c_]),[d_,f_]=u_(gr),Dd=v.forwardRef((e,t)=>f.jsx(Ei.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Ei.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(h_,{...e,ref:t})})}));Dd.displayName=gr;var h_=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...h}=e,p=v.useRef(null),d=Re(t,p),g=ho(i),[m,y]=an({prop:s,defaultProp:a??null,onChange:l,caller:gr}),[x,b]=v.useState(!1),w=Qe(c),S=Pd(n),C=v.useRef(!1),[N,z]=v.useState(0);return v.useEffect(()=>{const I=p.current;if(I)return I.addEventListener(Jo,w),()=>I.removeEventListener(Jo,w)},[w]),f.jsx(d_,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:m,onItemFocus:v.useCallback(I=>y(I),[y]),onItemShiftTab:v.useCallback(()=>b(!0),[]),onFocusableItemAdd:v.useCallback(()=>z(I=>I+1),[]),onFocusableItemRemove:v.useCallback(()=>z(I=>I-1),[]),children:f.jsx(Ce.div,{tabIndex:x||N===0?-1:0,"data-orientation":r,...h,ref:d,style:{outline:"none",...e.style},onMouseDown:ve(e.onMouseDown,()=>{C.current=!0}),onFocus:ve(e.onFocus,I=>{const O=!C.current;if(I.target===I.currentTarget&&O&&!x){const P=new CustomEvent(Jo,l_);if(I.currentTarget.dispatchEvent(P),!P.defaultPrevented){const L=S().filter(G=>G.focusable),T=L.find(G=>G.active),M=L.find(G=>G.id===m),D=[T,M,...L].filter(Boolean).map(G=>G.ref.current);Fd(D,u)}}C.current=!1}),onBlur:ve(e.onBlur,()=>b(!1))})})}),Md="RovingFocusGroupItem",Ld=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:s,...a}=e,l=Tt(),c=i||l,u=f_(Md,n),h=u.currentTabStopId===c,p=Pd(n),{onFocusableItemAdd:d,onFocusableItemRemove:g,currentTabStopId:m}=u;return v.useEffect(()=>{if(r)return d(),()=>g()},[r,d,g]),f.jsx(Ei.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:f.jsx(Ce.span,{tabIndex:h?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:ve(e.onMouseDown,y=>{r?u.onItemFocus(c):y.preventDefault()}),onFocus:ve(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:ve(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const x=g_(y,u.orientation,u.dir);if(x!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=p().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const S=w.indexOf(y.currentTarget);w=u.loop?x_(w,S+1):w.slice(S+1)}setTimeout(()=>Fd(w))}}),children:typeof s=="function"?s({isCurrentTabStop:h,hasTabStop:m!=null}):s})})});Ld.displayName=Md;var p_={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function m_(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function g_(e,t,n){const r=m_(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return p_[r]}function Fd(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function x_(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var y_=Dd,b_=Ld;function Ni(e,[t,n]){return Math.min(n,Math.max(t,e))}function v_(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Ss="ScrollArea",[$d]=Bt(Ss),[w_,gt]=$d(Ss),Bd=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=v.useState(null),[c,u]=v.useState(null),[h,p]=v.useState(null),[d,g]=v.useState(null),[m,y]=v.useState(null),[x,b]=v.useState(0),[w,S]=v.useState(0),[C,N]=v.useState(!1),[z,I]=v.useState(!1),O=Re(t,L=>l(L)),P=ho(o);return f.jsx(w_,{scope:n,type:r,dir:P,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:h,onContentChange:p,scrollbarX:d,onScrollbarXChange:g,scrollbarXEnabled:C,onScrollbarXEnabledChange:N,scrollbarY:m,onScrollbarYChange:y,scrollbarYEnabled:z,onScrollbarYEnabledChange:I,onCornerWidthChange:b,onCornerHeightChange:S,children:f.jsx(Ce.div,{dir:P,...s,ref:O,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});Bd.displayName=Ss;var Ud="ScrollAreaViewport",Zd=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,s=gt(Ud,n),a=v.useRef(null),l=Re(t,a,s.onViewportChange);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),f.jsx(Ce.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:f.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Zd.displayName=Ud;var Rt="ScrollAreaScrollbar",Wd=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=gt(Rt,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return v.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?f.jsx(__,{...r,ref:t,forceMount:n}):o.type==="scroll"?f.jsx(k_,{...r,ref:t,forceMount:n}):o.type==="auto"?f.jsx(Vd,{...r,ref:t,forceMount:n}):o.type==="always"?f.jsx(Cs,{...r,ref:t}):null});Wd.displayName=Rt;var __=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=gt(Rt,e.__scopeScrollArea),[i,s]=v.useState(!1);return v.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),f.jsx(mt,{present:n||i,children:f.jsx(Vd,{"data-state":i?"visible":"hidden",...r,ref:t})})}),k_=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=gt(Rt,e.__scopeScrollArea),i=e.orientation==="horizontal",s=So(()=>l("SCROLL_END"),100),[a,l]=v_("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return v.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),v.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let h=c[u];const p=()=>{const d=c[u];h!==d&&(l("SCROLL"),s()),h=d};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[o.viewport,i,l,s]),f.jsx(mt,{present:n||a!=="hidden",children:f.jsx(Cs,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ve(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ve(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Vd=v.forwardRef((e,t)=>{const n=gt(Rt,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=v.useState(!1),a=e.orientation==="horizontal",l=So(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return Dn(n.viewport,l),Dn(n.content,l),f.jsx(mt,{present:r||i,children:f.jsx(Cs,{"data-state":i?"visible":"hidden",...o,ref:t})})}),Cs=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=gt(Rt,e.__scopeScrollArea),i=v.useRef(null),s=v.useRef(0),[a,l]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=Jd(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function h(p,d){return j_(p,s.current,a,d)}return n==="horizontal"?f.jsx(S_,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,d=il(p,a,o.dir);i.current.style.transform=`translate3d(${d}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=h(p,o.dir))}}):n==="vertical"?f.jsx(C_,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,d=il(p,a);i.current.style.transform=`translate3d(0, ${d}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=h(p))}}):null}),S_=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=gt(Rt,e.__scopeScrollArea),[s,a]=v.useState(),l=v.useRef(null),c=Re(t,l,i.onScrollbarXChange);return v.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),f.jsx(qd,{"data-orientation":"horizontal",...o,ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ko(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,h)=>{if(i.viewport){const p=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),Xd(p,h)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:eo(s.paddingLeft),paddingEnd:eo(s.paddingRight)}})}})}),C_=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=gt(Rt,e.__scopeScrollArea),[s,a]=v.useState(),l=v.useRef(null),c=Re(t,l,i.onScrollbarYChange);return v.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),f.jsx(qd,{"data-orientation":"vertical",...o,ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ko(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,h)=>{if(i.viewport){const p=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),Xd(p,h)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:eo(s.paddingTop),paddingEnd:eo(s.paddingBottom)}})}})}),[E_,Hd]=$d(Rt),qd=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:h,...p}=e,d=gt(Rt,n),[g,m]=v.useState(null),y=Re(t,O=>m(O)),x=v.useRef(null),b=v.useRef(""),w=d.viewport,S=r.content-r.viewport,C=Qe(u),N=Qe(l),z=So(h,10);function I(O){if(x.current){const P=O.clientX-x.current.left,L=O.clientY-x.current.top;c({x:P,y:L})}}return v.useEffect(()=>{const O=P=>{const L=P.target;g?.contains(L)&&C(P,S)};return document.addEventListener("wheel",O,{passive:!1}),()=>document.removeEventListener("wheel",O,{passive:!1})},[w,g,S,C]),v.useEffect(N,[r,N]),Dn(g,z),Dn(d.content,z),f.jsx(E_,{scope:n,scrollbar:g,hasThumb:o,onThumbChange:Qe(i),onThumbPointerUp:Qe(s),onThumbPositionChange:N,onThumbPointerDown:Qe(a),children:f.jsx(Ce.div,{...p,ref:y,style:{position:"absolute",...p.style},onPointerDown:ve(e.onPointerDown,O=>{O.button===0&&(O.target.setPointerCapture(O.pointerId),x.current=g.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",d.viewport&&(d.viewport.style.scrollBehavior="auto"),I(O))}),onPointerMove:ve(e.onPointerMove,I),onPointerUp:ve(e.onPointerUp,O=>{const P=O.target;P.hasPointerCapture(O.pointerId)&&P.releasePointerCapture(O.pointerId),document.body.style.webkitUserSelect=b.current,d.viewport&&(d.viewport.style.scrollBehavior=""),x.current=null})})})}),Qr="ScrollAreaThumb",Gd=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Hd(Qr,e.__scopeScrollArea);return f.jsx(mt,{present:n||o.hasThumb,children:f.jsx(N_,{ref:t,...r})})}),N_=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=gt(Qr,n),s=Hd(Qr,n),{onThumbPositionChange:a}=s,l=Re(t,h=>s.onThumbChange(h)),c=v.useRef(void 0),u=So(()=>{c.current&&(c.current(),c.current=void 0)},100);return v.useEffect(()=>{const h=i.viewport;if(h){const p=()=>{if(u(),!c.current){const d=z_(h,a);c.current=d,a()}};return a(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[i.viewport,u,a]),f.jsx(Ce.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ve(e.onPointerDownCapture,h=>{const d=h.target.getBoundingClientRect(),g=h.clientX-d.left,m=h.clientY-d.top;s.onThumbPointerDown({x:g,y:m})}),onPointerUp:ve(e.onPointerUp,s.onThumbPointerUp)})});Gd.displayName=Qr;var Es="ScrollAreaCorner",Kd=v.forwardRef((e,t)=>{const n=gt(Es,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?f.jsx(T_,{...e,ref:t}):null});Kd.displayName=Es;var T_=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=gt(Es,n),[i,s]=v.useState(0),[a,l]=v.useState(0),c=!!(i&&a);return Dn(o.scrollbarX,()=>{const u=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(u),l(u)}),Dn(o.scrollbarY,()=>{const u=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(u),s(u)}),c?f.jsx(Ce.div,{...r,ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function eo(e){return e?parseInt(e,10):0}function Jd(e,t){const n=e/t;return isNaN(n)?0:n}function ko(e){const t=Jd(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function j_(e,t,n,r="ltr"){const o=ko(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,h=r==="ltr"?[0,u]:[u*-1,0];return Yd([l,c],h)(e)}function il(e,t,n="ltr"){const r=ko(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=Ni(e,l);return Yd([0,s],[0,a])(c)}function Yd(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Xd(e,t){return e>0&&e<t}var z_=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&t(),n=i,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)};function So(e,t){const n=Qe(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Dn(e,t){const n=Qe(t);qe(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var A_=Bd,I_=Zd,R_=Kd,P_=[" ","Enter","ArrowUp","ArrowDown"],O_=[" ","Enter"],un="Select",[Co,Eo,D_]=zu(un),[Zn]=Bt(un,[D_,_o]),No=_o(),[M_,Qt]=Zn(un),[L_,F_]=Zn(un),Qd=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:h,disabled:p,required:d,form:g}=e,m=No(t),[y,x]=v.useState(null),[b,w]=v.useState(null),[S,C]=v.useState(!1),N=ho(c),[z,I]=an({prop:r,defaultProp:o??!1,onChange:i,caller:un}),[O,P]=an({prop:s,defaultProp:a,onChange:l,caller:un}),L=v.useRef(null),T=y?g||!!y.closest("form"):!0,[M,_]=v.useState(new Set),D=Array.from(M).map(G=>G.props.value).join(";");return f.jsx(zd,{...m,children:f.jsxs(M_,{required:d,scope:t,trigger:y,onTriggerChange:x,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Tt(),value:O,onValueChange:P,open:z,onOpenChange:I,dir:N,triggerPointerDownPosRef:L,disabled:p,children:[f.jsx(Co.Provider,{scope:t,children:f.jsx(L_,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(G=>{_(Z=>new Set(Z).add(G))},[]),onNativeOptionRemove:v.useCallback(G=>{_(Z=>{const te=new Set(Z);return te.delete(G),te})},[]),children:n})}),T?f.jsxs(_f,{"aria-hidden":!0,required:d,tabIndex:-1,name:u,autoComplete:h,value:O,onChange:G=>P(G.target.value),disabled:p,form:g,children:[O===void 0?f.jsx("option",{value:""}):null,Array.from(M)]},D):null]})})};Qd.displayName=un;var ef="SelectTrigger",tf=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=No(n),s=Qt(ef,n),a=s.disabled||r,l=Re(t,s.onTriggerChange),c=Eo(n),u=v.useRef("touch"),[h,p,d]=Sf(m=>{const y=c().filter(w=>!w.disabled),x=y.find(w=>w.value===s.value),b=Cf(y,m,x);b!==void 0&&s.onValueChange(b.value)}),g=m=>{a||(s.onOpenChange(!0),d()),m&&(s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return f.jsx(Ad,{asChild:!0,...i,children:f.jsx(Ce.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":kf(s.value)?"":void 0,...o,ref:l,onClick:ve(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&g(m)}),onPointerDown:ve(o.onPointerDown,m=>{u.current=m.pointerType;const y=m.target;y.hasPointerCapture(m.pointerId)&&y.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(g(m),m.preventDefault())}),onKeyDown:ve(o.onKeyDown,m=>{const y=h.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(y&&m.key===" ")&&P_.includes(m.key)&&(g(),m.preventDefault())})})})});tf.displayName=ef;var nf="SelectValue",rf=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Qt(nf,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,h=Re(t,l.onValueNodeChange);return qe(()=>{c(u)},[c,u]),f.jsx(Ce.span,{...a,ref:h,style:{pointerEvents:"none"},children:kf(l.value)?f.jsx(f.Fragment,{children:s}):i})});rf.displayName=nf;var $_="SelectIcon",of=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return f.jsx(Ce.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});of.displayName=$_;var B_="SelectPortal",sf=e=>f.jsx(mo,{asChild:!0,...e});sf.displayName=B_;var dn="SelectContent",af=v.forwardRef((e,t)=>{const n=Qt(dn,e.__scopeSelect),[r,o]=v.useState();if(qe(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?dr.createPortal(f.jsx(lf,{scope:e.__scopeSelect,children:f.jsx(Co.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),i):null}return f.jsx(cf,{...e,ref:t})});af.displayName=dn;var yt=10,[lf,en]=Zn(dn),U_="SelectContentImpl",Z_=Pn("SelectContent.RemoveScroll"),cf=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:d,sticky:g,hideWhenDetached:m,avoidCollisions:y,...x}=e,b=Qt(dn,n),[w,S]=v.useState(null),[C,N]=v.useState(null),z=Re(t,ie=>S(ie)),[I,O]=v.useState(null),[P,L]=v.useState(null),T=Eo(n),[M,_]=v.useState(!1),D=v.useRef(!1);v.useEffect(()=>{if(w)return qu(w)},[w]),Lu();const G=v.useCallback(ie=>{const[re,...le]=T().map(Te=>Te.ref.current),[me]=le.slice(-1),xe=document.activeElement;for(const Te of ie)if(Te===xe||(Te?.scrollIntoView({block:"nearest"}),Te===re&&C&&(C.scrollTop=0),Te===me&&C&&(C.scrollTop=C.scrollHeight),Te?.focus(),document.activeElement!==xe))return},[T,C]),Z=v.useCallback(()=>G([I,w]),[G,I,w]);v.useEffect(()=>{M&&Z()},[M,Z]);const{onOpenChange:te,triggerPointerDownPosRef:q}=b;v.useEffect(()=>{if(w){let ie={x:0,y:0};const re=me=>{ie={x:Math.abs(Math.round(me.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(me.pageY)-(q.current?.y??0))}},le=me=>{ie.x<=10&&ie.y<=10?me.preventDefault():w.contains(me.target)||te(!1),document.removeEventListener("pointermove",re),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",le,{capture:!0})}}},[w,te,q]),v.useEffect(()=>{const ie=()=>te(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[te]);const[E,U]=Sf(ie=>{const re=T().filter(xe=>!xe.disabled),le=re.find(xe=>xe.ref.current===document.activeElement),me=Cf(re,ie,le);me&&setTimeout(()=>me.ref.current.focus())}),B=v.useCallback((ie,re,le)=>{const me=!D.current&&!le;(b.value!==void 0&&b.value===re||me)&&(O(ie),me&&(D.current=!0))},[b.value]),j=v.useCallback(()=>w?.focus(),[w]),Y=v.useCallback((ie,re,le)=>{const me=!D.current&&!le;(b.value!==void 0&&b.value===re||me)&&L(ie)},[b.value]),H=r==="popper"?Ti:uf,ce=H===Ti?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:d,sticky:g,hideWhenDetached:m,avoidCollisions:y}:{};return f.jsx(lf,{scope:n,content:w,viewport:C,onViewportChange:N,itemRefCallback:B,selectedItem:I,onItemLeave:j,itemTextRefCallback:Y,focusSelectedItem:Z,selectedItemText:P,position:r,isPositioned:M,searchRef:E,children:f.jsx(fs,{as:Z_,allowPinchZoom:!0,children:f.jsx(ds,{asChild:!0,trapped:b.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:ve(o,ie=>{b.trigger?.focus({preventScroll:!0}),ie.preventDefault()}),children:f.jsx(po,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:f.jsx(H,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:ie=>ie.preventDefault(),...x,...ce,onPlaced:()=>_(!0),ref:z,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:ve(x.onKeyDown,ie=>{const re=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!re&&ie.key.length===1&&U(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let me=T().filter(xe=>!xe.disabled).map(xe=>xe.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(me=me.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const xe=ie.target,Te=me.indexOf(xe);me=me.slice(Te+1)}setTimeout(()=>G(me)),ie.preventDefault()}})})})})})})});cf.displayName=U_;var W_="SelectItemAlignedPosition",uf=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Qt(dn,n),s=en(dn,n),[a,l]=v.useState(null),[c,u]=v.useState(null),h=Re(t,z=>u(z)),p=Eo(n),d=v.useRef(!1),g=v.useRef(!0),{viewport:m,selectedItem:y,selectedItemText:x,focusSelectedItem:b}=s,w=v.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&m&&y&&x){const z=i.trigger.getBoundingClientRect(),I=c.getBoundingClientRect(),O=i.valueNode.getBoundingClientRect(),P=x.getBoundingClientRect();if(i.dir!=="rtl"){const xe=P.left-I.left,Te=O.left-xe,Pe=z.left-Te,k=z.width+Pe,J=Math.max(k,I.width),V=window.innerWidth-yt,R=Ni(Te,[yt,Math.max(yt,V-J)]);a.style.minWidth=k+"px",a.style.left=R+"px"}else{const xe=I.right-P.right,Te=window.innerWidth-O.right-xe,Pe=window.innerWidth-z.right-Te,k=z.width+Pe,J=Math.max(k,I.width),V=window.innerWidth-yt,R=Ni(Te,[yt,Math.max(yt,V-J)]);a.style.minWidth=k+"px",a.style.right=R+"px"}const L=p(),T=window.innerHeight-yt*2,M=m.scrollHeight,_=window.getComputedStyle(c),D=parseInt(_.borderTopWidth,10),G=parseInt(_.paddingTop,10),Z=parseInt(_.borderBottomWidth,10),te=parseInt(_.paddingBottom,10),q=D+G+M+te+Z,E=Math.min(y.offsetHeight*5,q),U=window.getComputedStyle(m),B=parseInt(U.paddingTop,10),j=parseInt(U.paddingBottom,10),Y=z.top+z.height/2-yt,H=T-Y,ce=y.offsetHeight/2,ie=y.offsetTop+ce,re=D+G+ie,le=q-re;if(re<=Y){const xe=L.length>0&&y===L[L.length-1].ref.current;a.style.bottom="0px";const Te=c.clientHeight-m.offsetTop-m.offsetHeight,Pe=Math.max(H,ce+(xe?j:0)+Te+Z),k=re+Pe;a.style.height=k+"px"}else{const xe=L.length>0&&y===L[0].ref.current;a.style.top="0px";const Pe=Math.max(Y,D+m.offsetTop+(xe?B:0)+ce)+le;a.style.height=Pe+"px",m.scrollTop=re-Y+m.offsetTop}a.style.margin=`${yt}px 0`,a.style.minHeight=E+"px",a.style.maxHeight=T+"px",r?.(),requestAnimationFrame(()=>d.current=!0)}},[p,i.trigger,i.valueNode,a,c,m,y,x,i.dir,r]);qe(()=>w(),[w]);const[S,C]=v.useState();qe(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const N=v.useCallback(z=>{z&&g.current===!0&&(w(),b?.(),g.current=!1)},[w,b]);return f.jsx(H_,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:d,onScrollButtonChange:N,children:f.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:f.jsx(Ce.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});uf.displayName=W_;var V_="SelectPopperPosition",Ti=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=yt,...i}=e,s=No(n);return f.jsx(Id,{...s,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Ti.displayName=V_;var[H_,Ns]=Zn(dn,{}),ji="SelectViewport",df=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=en(ji,n),s=Ns(ji,n),a=Re(t,i.onViewportChange),l=v.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),f.jsx(Co.Slot,{scope:n,children:f.jsx(Ce.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ve(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:p}=s;if(p?.current&&h){const d=Math.abs(l.current-u.scrollTop);if(d>0){const g=window.innerHeight-yt*2,m=parseFloat(h.style.minHeight),y=parseFloat(h.style.height),x=Math.max(m,y);if(x<g){const b=x+d,w=Math.min(g,b),S=b-w;h.style.height=w+"px",h.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,h.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});df.displayName=ji;var ff="SelectGroup",[q_,G_]=Zn(ff),K_=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Tt();return f.jsx(q_,{scope:n,id:o,children:f.jsx(Ce.div,{role:"group","aria-labelledby":o,...r,ref:t})})});K_.displayName=ff;var hf="SelectLabel",J_=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=G_(hf,n);return f.jsx(Ce.div,{id:o.id,...r,ref:t})});J_.displayName=hf;var to="SelectItem",[Y_,pf]=Zn(to),mf=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Qt(to,n),l=en(to,n),c=a.value===r,[u,h]=v.useState(i??""),[p,d]=v.useState(!1),g=Re(t,b=>l.itemRefCallback?.(b,r,o)),m=Tt(),y=v.useRef("touch"),x=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return f.jsx(Y_,{scope:n,value:r,disabled:o,textId:m,isSelected:c,onItemTextChange:v.useCallback(b=>{h(w=>w||(b?.textContent??"").trim())},[]),children:f.jsx(Co.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:f.jsx(Ce.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:g,onFocus:ve(s.onFocus,()=>d(!0)),onBlur:ve(s.onBlur,()=>d(!1)),onClick:ve(s.onClick,()=>{y.current!=="mouse"&&x()}),onPointerUp:ve(s.onPointerUp,()=>{y.current==="mouse"&&x()}),onPointerDown:ve(s.onPointerDown,b=>{y.current=b.pointerType}),onPointerMove:ve(s.onPointerMove,b=>{y.current=b.pointerType,o?l.onItemLeave?.():y.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ve(s.onPointerLeave,b=>{b.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:ve(s.onKeyDown,b=>{l.searchRef?.current!==""&&b.key===" "||(O_.includes(b.key)&&x(),b.key===" "&&b.preventDefault())})})})})});mf.displayName=to;var tr="SelectItemText",gf=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Qt(tr,n),a=en(tr,n),l=pf(tr,n),c=F_(tr,n),[u,h]=v.useState(null),p=Re(t,x=>h(x),l.onItemTextChange,x=>a.itemTextRefCallback?.(x,l.value,l.disabled)),d=u?.textContent,g=v.useMemo(()=>f.jsx("option",{value:l.value,disabled:l.disabled,children:d},l.value),[l.disabled,l.value,d]),{onNativeOptionAdd:m,onNativeOptionRemove:y}=c;return qe(()=>(m(g),()=>y(g)),[m,y,g]),f.jsxs(f.Fragment,{children:[f.jsx(Ce.span,{id:l.textId,...i,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?dr.createPortal(i.children,s.valueNode):null]})});gf.displayName=tr;var xf="SelectItemIndicator",yf=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return pf(xf,n).isSelected?f.jsx(Ce.span,{"aria-hidden":!0,...r,ref:t}):null});yf.displayName=xf;var zi="SelectScrollUpButton",bf=v.forwardRef((e,t)=>{const n=en(zi,e.__scopeSelect),r=Ns(zi,e.__scopeSelect),[o,i]=v.useState(!1),s=Re(t,r.onScrollButtonChange);return qe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?f.jsx(wf,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});bf.displayName=zi;var Ai="SelectScrollDownButton",vf=v.forwardRef((e,t)=>{const n=en(Ai,e.__scopeSelect),r=Ns(Ai,e.__scopeSelect),[o,i]=v.useState(!1),s=Re(t,r.onScrollButtonChange);return qe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?f.jsx(wf,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});vf.displayName=Ai;var wf=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=en("SelectScrollButton",n),s=v.useRef(null),a=Eo(n),l=v.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return v.useEffect(()=>()=>l(),[l]),qe(()=>{a().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),f.jsx(Ce.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ve(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:ve(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:ve(o.onPointerLeave,()=>{l()})})}),X_="SelectSeparator",Q_=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(Ce.div,{"aria-hidden":!0,...r,ref:t})});Q_.displayName=X_;var Ii="SelectArrow",ek=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=No(n),i=Qt(Ii,n),s=en(Ii,n);return i.open&&s.position==="popper"?f.jsx(Rd,{...o,...r,ref:t}):null});ek.displayName=Ii;var tk="SelectBubbleInput",_f=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=v.useRef(null),i=Re(r,o),s=Gw(t);return v.useEffect(()=>{const a=o.current;if(!a)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&u){const h=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(h)}},[s,t]),f.jsx(Ce.select,{...n,style:{...Tu,...n.style},ref:i,defaultValue:t})});_f.displayName=tk;function kf(e){return e===""||e===void 0}function Sf(e){const t=Qe(e),n=v.useRef(""),r=v.useRef(0),o=v.useCallback(s=>{const a=n.current+s;t(a),(function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))})(a)},[t]),i=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Cf(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=nk(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function nk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var rk=Qd,ok=tf,ik=rf,sk=of,ak=sf,lk=af,ck=df,uk=mf,dk=gf,fk=yf,hk=bf,pk=vf,mk="Separator",sl="horizontal",gk=["horizontal","vertical"],Ef=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=sl,...o}=e,i=xk(r)?r:sl,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return f.jsx(Ce.div,{"data-orientation":i,...a,...o,ref:t})});Ef.displayName=mk;function xk(e){return gk.includes(e)}var yk=Ef,To="Tabs",[bk]=Bt(To,[Od]),Nf=Od(),[vk,Ts]=bk(To),Tf=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=ho(a),[h,p]=an({prop:r,onChange:o,defaultProp:i??"",caller:To});return f.jsx(vk,{scope:n,baseId:Tt(),value:h,onValueChange:p,orientation:s,dir:u,activationMode:l,children:f.jsx(Ce.div,{dir:u,"data-orientation":s,...c,ref:t})})});Tf.displayName=To;var jf="TabsList",zf=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Ts(jf,n),s=Nf(n);return f.jsx(y_,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:f.jsx(Ce.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});zf.displayName=jf;var Af="TabsTrigger",If=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=Ts(Af,n),a=Nf(n),l=Of(s.baseId,r),c=Df(s.baseId,r),u=r===s.value;return f.jsx(b_,{asChild:!0,...a,focusable:!o,active:u,children:f.jsx(Ce.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:ve(e.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:ve(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:ve(e.onFocus,()=>{const h=s.activationMode!=="manual";!u&&!o&&h&&s.onValueChange(r)})})})});If.displayName=Af;var Rf="TabsContent",Pf=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=Ts(Rf,n),l=Of(a.baseId,r),c=Df(a.baseId,r),u=r===a.value,h=v.useRef(u);return v.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),f.jsx(mt,{present:o||u,children:({present:p})=>f.jsx(Ce.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:p&&i})})});Pf.displayName=Rf;function Of(e,t){return`${e}-trigger-${t}`}function Df(e,t){return`${e}-content-${t}`}var wk=Tf,_k=zf,kk=If,Sk=Pf,[jo]=Bt("Tooltip",[_o]),zo=_o(),Mf="TooltipProvider",Ck=700,Ri="tooltip.open",[Ek,js]=jo(Mf),Lf=e=>{const{__scopeTooltip:t,delayDuration:n=Ck,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=v.useRef(!0),a=v.useRef(!1),l=v.useRef(0);return v.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),f.jsx(Ek,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:v.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:i})};Lf.displayName=Mf;var lr="Tooltip",[Nk,xr]=jo(lr),Ff=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=js(lr,e.__scopeTooltip),c=zo(t),[u,h]=v.useState(null),p=Tt(),d=v.useRef(0),g=s??l.disableHoverableContent,m=a??l.delayDuration,y=v.useRef(!1),[x,b]=an({prop:r,defaultProp:o??!1,onChange:z=>{z?(l.onOpen(),document.dispatchEvent(new CustomEvent(Ri))):l.onClose(),i?.(z)},caller:lr}),w=v.useMemo(()=>x?y.current?"delayed-open":"instant-open":"closed",[x]),S=v.useCallback(()=>{window.clearTimeout(d.current),d.current=0,y.current=!1,b(!0)},[b]),C=v.useCallback(()=>{window.clearTimeout(d.current),d.current=0,b(!1)},[b]),N=v.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>{y.current=!0,b(!0),d.current=0},m)},[m,b]);return v.useEffect(()=>()=>{d.current&&(window.clearTimeout(d.current),d.current=0)},[]),f.jsx(zd,{...c,children:f.jsx(Nk,{scope:t,contentId:p,open:x,stateAttribute:w,trigger:u,onTriggerChange:h,onTriggerEnter:v.useCallback(()=>{l.isOpenDelayedRef.current?N():S()},[l.isOpenDelayedRef,N,S]),onTriggerLeave:v.useCallback(()=>{g?C():(window.clearTimeout(d.current),d.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})};Ff.displayName=lr;var Pi="TooltipTrigger",$f=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=xr(Pi,n),i=js(Pi,n),s=zo(n),a=v.useRef(null),l=Re(t,a,o.onTriggerChange),c=v.useRef(!1),u=v.useRef(!1),h=v.useCallback(()=>c.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),f.jsx(Ad,{asChild:!0,...s,children:f.jsx(Ce.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:ve(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:ve(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:ve(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:ve(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:ve(e.onBlur,o.onClose),onClick:ve(e.onClick,o.onClose)})})});$f.displayName=Pi;var zs="TooltipPortal",[Tk,jk]=jo(zs,{forceMount:void 0}),Bf=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=xr(zs,t);return f.jsx(Tk,{scope:t,forceMount:n,children:f.jsx(mt,{present:n||i.open,children:f.jsx(mo,{asChild:!0,container:o,children:r})})})};Bf.displayName=zs;var Mn="TooltipContent",Uf=v.forwardRef((e,t)=>{const n=jk(Mn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=xr(Mn,e.__scopeTooltip);return f.jsx(mt,{present:r||s.open,children:s.disableHoverableContent?f.jsx(Zf,{side:o,...i,ref:t}):f.jsx(zk,{side:o,...i,ref:t})})}),zk=v.forwardRef((e,t)=>{const n=xr(Mn,e.__scopeTooltip),r=js(Mn,e.__scopeTooltip),o=v.useRef(null),i=Re(t,o),[s,a]=v.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:h}=r,p=v.useCallback(()=>{a(null),h(!1)},[h]),d=v.useCallback((g,m)=>{const y=g.currentTarget,x={x:g.clientX,y:g.clientY},b=Pk(x,y.getBoundingClientRect()),w=Ok(x,b),S=Dk(m.getBoundingClientRect()),C=Lk([...w,...S]);a(C),h(!0)},[h]);return v.useEffect(()=>()=>p(),[p]),v.useEffect(()=>{if(l&&u){const g=y=>d(y,u),m=y=>d(y,l);return l.addEventListener("pointerleave",g),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",g),u.removeEventListener("pointerleave",m)}}},[l,u,d,p]),v.useEffect(()=>{if(s){const g=m=>{const y=m.target,x={x:m.clientX,y:m.clientY},b=l?.contains(y)||u?.contains(y),w=!Mk(x,s);b?p():w&&(p(),c())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,u,s,c,p]),f.jsx(Zf,{...e,ref:i})}),[Ak,Ik]=jo(lr,{isInside:!1}),Rk=a1("TooltipContent"),Zf=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=xr(Mn,n),c=zo(n),{onClose:u}=l;return v.useEffect(()=>(document.addEventListener(Ri,u),()=>document.removeEventListener(Ri,u)),[u]),v.useEffect(()=>{if(l.trigger){const h=p=>{p.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,u]),f.jsx(po,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:u,children:f.jsxs(Id,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.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:[f.jsx(Rk,{children:r}),f.jsx(Ak,{scope:n,isInside:!0,children:f.jsx(p1,{id:l.contentId,role:"tooltip",children:o||r})})]})})});Uf.displayName=Mn;var Wf="TooltipArrow",Vf=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=zo(n);return Ik(Wf,n).isInside?null:f.jsx(Rd,{...o,...r,ref:t})});Vf.displayName=Wf;function Pk(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ok(e,t,n=5){const 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});break}return r}function Dk(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Mk(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],l=t[s],c=a.x,u=a.y,h=l.x,p=l.y;u>r!=p>r&&n<(h-c)*(r-u)/(p-u)+c&&(o=!o)}return o}function Lk(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Fk(t)}function Fk(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}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)}var $k=Lf,Bk=Ff,Uk=$f,Zk=Bf,Wk=Uf,Vk=Vf;const Hk=as("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function lt({className:e,variant:t="default",asChild:n=!1,...r}){const o=n?i1:"span";return f.jsx(o,{"data-slot":"badge","data-variant":t,className:Se(Hk({variant:t}),e),...r})}const qk={anthropic:"Anthropic",openai:"OpenAI",unknown:"Unknown"};function al(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Gk({conversationId:e,startTime:t,endTime:n,totalCalls:r,totalInputTokens:o,totalOutputTokens:i,apiFormat:s,expanded:a,onToggle:l,hideApiFormat:c=!1}){return f.jsxs("div",{role:"button",tabIndex:0,className:Se("flex items-center gap-3 px-3 py-2 cursor-pointer transition-colors","hover:bg-muted/50","select-none","border border-border rounded-lg mb-2 bg-muted/30"),onClick:l,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),l())},children:[a?f.jsx(zt,{className:"size-4 text-muted-foreground shrink-0"}):f.jsx(Ht,{className:"size-4 text-muted-foreground shrink-0"}),f.jsx("span",{className:"text-purple-400/90 font-mono text-xs font-semibold shrink-0",title:e,children:e.length>24?e.slice(0,12)+"…"+e.slice(-12):e}),!c&&f.jsx(lt,{variant:"outline",className:Se("text-[10px] px-1.5 py-0 h-5 font-mono shrink-0",s==="openai"&&"border-blue-500/40 text-blue-400",s==="anthropic"&&"border-orange-500/40 text-orange-400",s==="unknown"&&"border-muted text-muted-foreground"),children:qk[s]}),f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[f.jsx(os,{className:"size-3"}),f.jsxs("span",{className:"font-mono tabular-nums",children:[al(t)," - ",al(n)]})]}),f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[f.jsx(su,{className:"size-3"}),f.jsxs("span",{className:"font-mono tabular-nums",children:[r," call",r!==1?"s":""]})]}),f.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[f.jsx(pr,{className:"size-3 text-muted-foreground"}),f.jsxs("span",{className:"font-mono tabular-nums",children:[f.jsx("span",{className:"text-blue-400",children:Je(o)})," / ",f.jsx("span",{className:"text-amber-400",children:Je(i)})]})]}),f.jsx("span",{className:"flex-1 min-w-0"})]})}function Kk(e){const t=e.find(n=>n.apiFormat!=="unknown");return t!==void 0?t.apiFormat:e[0]?.apiFormat??"unknown"}function Jk(e){let t=!1,n=!1;for(const r of e)if(r.apiFormat==="anthropic"?t=!0:r.apiFormat==="openai"&&(n=!0),t&&n)return!0;return!1}function Yk(e){if(e.sessionId!==null&&e.sessionId!=="")return e.sessionId;const t=e.clientPid!==null?`PID:${e.clientPid}`:"unknown",n=e.clientProjectFolder!==null?e.clientProjectFolder:"no-folder";return`${t}|${n}`}function Xk(e){const t=new Map;for(const r of e){const o=Yk(r),i=t.get(o);i!==void 0?i.push(r):t.set(o,[r])}const n=[];for(const[r,o]of t){const i=[...o].sort((s,a)=>s.timestamp.localeCompare(a.timestamp));n.push({id:r,conversationId:r,logs:i})}return n.sort((r,o)=>(r.logs[0]?.timestamp??"").localeCompare(o.logs[0]?.timestamp??"")),n}const Qk="x-anthropic-billing-header:";function eS(e){return e.trimStart().toLowerCase().startsWith(Qk)}function ll(e,t){return Object.getOwnPropertyDescriptor(e,t)?.value}function tS(e){return typeof e!="object"||e===null||Array.isArray(e)?!1:Object.prototype.hasOwnProperty.call(e,"system")}function nS(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;const t=ll(e,"type"),n=ll(e,"text");return typeof t!="string"||t!=="text"||typeof n!="string"?!1:eS(n)}function rS(e){let t;try{t=JSON.parse(e)}catch{return{body:e,removed:0}}if(!tS(t))return{body:e,removed:0};const n=t.system;if(!Array.isArray(n)||n.length===0)return{body:e,removed:0};const r=[];let o=0;for(const i of n){if(nS(i)){o+=1;continue}r.push(i)}return o===0?{body:e,removed:0}:(r.length===0?delete t.system:t.system=r,{body:JSON.stringify(t),removed:o})}const oS=as("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function ft({className:e,variant:t,size:n,...r}){return f.jsx("button",{"data-slot":"button",className:Se(oS({variant:t,size:n,className:e})),...r})}function iS(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const sS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,aS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lS={};function cl(e,t){return(lS.jsx?aS:sS).test(e)}const cS=/[ \t\n\f\r]/g;function uS(e){return typeof e=="object"?e.type==="text"?ul(e.value):!1:ul(e)}function ul(e){return e.replace(cS,"")===""}class yr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}yr.prototype.normal={};yr.prototype.property={};yr.prototype.space=void 0;function Hf(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new yr(n,r,t)}function Oi(e){return e.toLowerCase()}class ot{constructor(t,n){this.attribute=n,this.property=t}}ot.prototype.attribute="";ot.prototype.booleanish=!1;ot.prototype.boolean=!1;ot.prototype.commaOrSpaceSeparated=!1;ot.prototype.commaSeparated=!1;ot.prototype.defined=!1;ot.prototype.mustUseProperty=!1;ot.prototype.number=!1;ot.prototype.overloadedBoolean=!1;ot.prototype.property="";ot.prototype.spaceSeparated=!1;ot.prototype.space=void 0;let dS=0;const ke=mn(),Ve=mn(),Di=mn(),oe=mn(),Oe=mn(),on=mn(),st=mn();function mn(){return 2**++dS}const Mi=Object.freeze(Object.defineProperty({__proto__:null,boolean:ke,booleanish:Ve,commaOrSpaceSeparated:st,commaSeparated:on,number:oe,overloadedBoolean:Di,spaceSeparated:Oe},Symbol.toStringTag,{value:"Module"})),Yo=Object.keys(Mi);class As extends ot{constructor(t,n,r,o){let i=-1;if(super(t,n),dl(this,"space",o),typeof r=="number")for(;++i<Yo.length;){const s=Yo[i];dl(this,Yo[i],(r&Mi[s])===Mi[s])}}}As.prototype.defined=!0;function dl(e,t,n){n&&(e[t]=n)}function Wn(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new As(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Oi(r)]=r,n[Oi(i.attribute)]=r}return new yr(t,n,e.space)}const qf=Wn({properties:{ariaActiveDescendant:null,ariaAtomic:Ve,ariaAutoComplete:null,ariaBusy:Ve,ariaChecked:Ve,ariaColCount:oe,ariaColIndex:oe,ariaColSpan:oe,ariaControls:Oe,ariaCurrent:null,ariaDescribedBy:Oe,ariaDetails:null,ariaDisabled:Ve,ariaDropEffect:Oe,ariaErrorMessage:null,ariaExpanded:Ve,ariaFlowTo:Oe,ariaGrabbed:Ve,ariaHasPopup:null,ariaHidden:Ve,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Oe,ariaLevel:oe,ariaLive:null,ariaModal:Ve,ariaMultiLine:Ve,ariaMultiSelectable:Ve,ariaOrientation:null,ariaOwns:Oe,ariaPlaceholder:null,ariaPosInSet:oe,ariaPressed:Ve,ariaReadOnly:Ve,ariaRelevant:null,ariaRequired:Ve,ariaRoleDescription:Oe,ariaRowCount:oe,ariaRowIndex:oe,ariaRowSpan:oe,ariaSelected:Ve,ariaSetSize:oe,ariaSort:null,ariaValueMax:oe,ariaValueMin:oe,ariaValueNow:oe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Gf(e,t){return t in e?e[t]:t}function Kf(e,t){return Gf(e,t.toLowerCase())}const fS=Wn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:on,acceptCharset:Oe,accessKey:Oe,action:null,allow:null,allowFullScreen:ke,allowPaymentRequest:ke,allowUserMedia:ke,alpha:ke,alt:null,as:null,async:ke,autoCapitalize:null,autoComplete:Oe,autoFocus:ke,autoPlay:ke,blocking:Oe,capture:null,charSet:null,checked:ke,cite:null,className:Oe,closedBy:null,colorSpace:null,cols:oe,colSpan:oe,command:null,commandFor:null,content:null,contentEditable:Ve,controls:ke,controlsList:Oe,coords:oe|on,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ke,defer:ke,dir:null,dirName:null,disabled:ke,download:Di,draggable:Ve,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ke,formTarget:null,headers:Oe,height:oe,hidden:Di,high:oe,href:null,hrefLang:null,htmlFor:Oe,httpEquiv:Oe,id:null,imageSizes:null,imageSrcSet:null,inert:ke,inputMode:null,integrity:null,is:null,isMap:ke,itemId:null,itemProp:Oe,itemRef:Oe,itemScope:ke,itemType:Oe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ke,low:oe,manifest:null,max:null,maxLength:oe,media:null,method:null,min:null,minLength:oe,multiple:ke,muted:ke,name:null,nonce:null,noModule:ke,noValidate:ke,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ke,optimum:oe,pattern:null,ping:Oe,placeholder:null,playsInline:ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ke,referrerPolicy:null,rel:Oe,required:ke,reversed:ke,rows:oe,rowSpan:oe,sandbox:Oe,scope:null,scoped:ke,seamless:ke,selected:ke,shadowRootClonable:ke,shadowRootCustomElementRegistry:ke,shadowRootDelegatesFocus:ke,shadowRootMode:null,shadowRootSerializable:ke,shape:null,size:oe,sizes:null,slot:null,span:oe,spellCheck:Ve,src:null,srcDoc:null,srcLang:null,srcSet:null,start:oe,step:null,style:null,tabIndex:oe,target:null,title:null,translate:null,type:null,typeMustMatch:ke,useMap:null,value:Ve,width:oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Oe,axis:null,background:null,bgColor:null,border:oe,borderColor:null,bottomMargin:oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ke,declare:ke,event:null,face:null,frame:null,frameBorder:null,hSpace:oe,leftMargin:oe,link:null,longDesc:null,lowSrc:null,marginHeight:oe,marginWidth:oe,noResize:ke,noHref:ke,noShade:ke,noWrap:ke,object:null,profile:null,prompt:null,rev:null,rightMargin:oe,rules:null,scheme:null,scrolling:Ve,standby:null,summary:null,text:null,topMargin:oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:oe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ke,disablePictureInPicture:ke,disableRemotePlayback:ke,exportParts:on,part:Oe,prefix:null,property:null,results:oe,security:null,unselectable:null},space:"html",transform:Kf}),hS=Wn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:st,accentHeight:oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:oe,amplitude:oe,arabicForm:null,ascent:oe,attributeName:null,attributeType:null,azimuth:oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:oe,by:null,calcMode:null,capHeight:oe,className:Oe,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:oe,diffuseConstant:oe,direction:null,display:null,dur:null,divisor:oe,dominantBaseline:null,download:ke,dx:null,dy:null,edgeMode:null,editable:null,elevation:oe,enableBackground:null,end:null,event:null,exponent:oe,externalResourcesRequired:null,fill:null,fillOpacity:oe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:on,g2:on,glyphName:on,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:oe,horizOriginX:oe,horizOriginY:oe,id:null,ideographic:oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:oe,k:oe,k1:oe,k2:oe,k3:oe,k4:oe,kernelMatrix:st,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:oe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:oe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:oe,overlineThickness:oe,paintOrder:null,panose1:null,path:null,pathLength:oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Oe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:oe,pointsAtY:oe,pointsAtZ:oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:st,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:st,rev:st,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:st,requiredFeatures:st,requiredFonts:st,requiredFormats:st,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:oe,specularExponent:oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:oe,strikethroughThickness:oe,string:null,stroke:null,strokeDashArray:st,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:oe,strokeOpacity:oe,strokeWidth:null,style:null,surfaceScale:oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:st,tabIndex:oe,tableValues:null,target:null,targetX:oe,targetY:oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:st,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:oe,underlineThickness:oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:oe,values:null,vAlphabetic:oe,vMathematical:oe,vectorEffect:null,vHanging:oe,vIdeographic:oe,version:null,vertAdvY:oe,vertOriginX:oe,vertOriginY:oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Gf}),Jf=Wn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Yf=Wn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Kf}),Xf=Wn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),pS={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},mS=/[A-Z]/g,fl=/-[a-z]/g,gS=/^data[-\w.:]+$/i;function xS(e,t){const n=Oi(t);let r=t,o=ot;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&gS.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(fl,bS);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!fl.test(i)){let s=i.replace(mS,yS);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=As}return new o(r,t)}function yS(e){return"-"+e.toLowerCase()}function bS(e){return e.charAt(1).toUpperCase()}const vS=Hf([qf,fS,Jf,Yf,Xf],"html"),Is=Hf([qf,hS,Jf,Yf,Xf],"svg");function wS(e){return e.join(" ").trim()}var wn={},Xo,hl;function _S(){if(hl)return Xo;hl=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
110
- `,c="/",u="*",h="",p="comment",d="declaration";function g(y,x){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];x=x||{};var b=1,w=1;function S(_){var D=_.match(t);D&&(b+=D.length);var G=_.lastIndexOf(l);w=~G?_.length-G:w+_.length}function C(){var _={line:b,column:w};return function(D){return D.position=new N(_),O(),D}}function N(_){this.start=_,this.end={line:b,column:w},this.source=x.source}N.prototype.content=y;function z(_){var D=new Error(x.source+":"+b+":"+w+": "+_);if(D.reason=_,D.filename=x.source,D.line=b,D.column=w,D.source=y,!x.silent)throw D}function I(_){var D=_.exec(y);if(D){var G=D[0];return S(G),y=y.slice(G.length),D}}function O(){I(n)}function P(_){var D;for(_=_||[];D=L();)D!==!1&&_.push(D);return _}function L(){var _=C();if(!(c!=y.charAt(0)||u!=y.charAt(1))){for(var D=2;h!=y.charAt(D)&&(u!=y.charAt(D)||c!=y.charAt(D+1));)++D;if(D+=2,h===y.charAt(D-1))return z("End of comment missing");var G=y.slice(2,D-2);return w+=2,S(G),y=y.slice(D),w+=2,_({type:p,comment:G})}}function T(){var _=C(),D=I(r);if(D){if(L(),!I(o))return z("property missing ':'");var G=I(i),Z=_({type:d,property:m(D[0].replace(e,h)),value:G?m(G[0].replace(e,h)):h});return I(s),Z}}function M(){var _=[];P(_);for(var D;D=T();)D!==!1&&(_.push(D),P(_));return _}return O(),M()}function m(y){return y?y.replace(a,h):h}return Xo=g,Xo}var pl;function kS(){if(pl)return wn;pl=1;var e=wn&&wn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wn,"__esModule",{value:!0}),wn.default=n;const t=e(_S());function n(r,o){let i=null;if(!r||typeof r!="string")return i;const s=(0,t.default)(r),a=typeof o=="function";return s.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:u}=l;a?o(c,u,l):u&&(i=i||{},i[c]=u)}),i}return wn}var Kn={},ml;function SS(){if(ml)return Kn;ml=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(c){return!c||n.test(c)||e.test(c)},s=function(c,u){return u.toUpperCase()},a=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),i(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(o,a):c=c.replace(r,a),c.replace(t,s))};return Kn.camelCase=l,Kn}var Jn,gl;function CS(){if(gl)return Jn;gl=1;var e=Jn&&Jn.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(kS()),n=SS();function r(o,i){var s={};return!o||typeof o!="string"||(0,t.default)(o,function(a,l){a&&l&&(s[(0,n.camelCase)(a,i)]=l)}),s}return r.default=r,Jn=r,Jn}var ES=CS();const NS=qi(ES),Qf=eh("end"),Rs=eh("start");function eh(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function TS(e){const t=Rs(e),n=Qf(e);if(t&&n)return{start:t,end:n}}function nr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?xl(e.position):"start"in e||"end"in e?xl(e):"line"in e||"column"in e?Li(e):""}function Li(e){return yl(e&&e.line)+":"+yl(e&&e.column)}function xl(e){return Li(e&&e.start)+"-"+Li(e&&e.end)}function yl(e){return e&&typeof e=="number"?e:1}class Ye extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(s=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=a?a.line:void 0,this.name=nr(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ye.prototype.file="";Ye.prototype.name="";Ye.prototype.reason="";Ye.prototype.message="";Ye.prototype.stack="";Ye.prototype.column=void 0;Ye.prototype.line=void 0;Ye.prototype.ancestors=void 0;Ye.prototype.cause=void 0;Ye.prototype.fatal=void 0;Ye.prototype.place=void 0;Ye.prototype.ruleId=void 0;Ye.prototype.source=void 0;const Ps={}.hasOwnProperty,jS=new Map,zS=/[A-Z]/g,AS=new Set(["table","tbody","thead","tfoot","tr"]),IS=new Set(["td","th"]),th="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function RS(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=BS(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=$S(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Is:vS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=nh(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function nh(e,t,n){if(t.type==="element")return PS(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return OS(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return MS(e,t,n);if(t.type==="mdxjsEsm")return DS(e,t);if(t.type==="root")return LS(e,t,n);if(t.type==="text")return FS(e,t)}function PS(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Is,e.schema=o),e.ancestors.push(t);const i=oh(e,t.tagName,!1),s=US(e,t);let a=Ds(e,t);return AS.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!uS(l):!0})),rh(e,s,i,t),Os(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function OS(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}cr(e,t.position)}function DS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cr(e,t.position)}function MS(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=Is,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:oh(e,t.name,!0),s=ZS(e,t),a=Ds(e,t);return rh(e,s,i,t),Os(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function LS(e,t,n){const r={};return Os(r,Ds(e,t)),e.create(t,e.Fragment,r,n)}function FS(e,t){return t.value}function rh(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Os(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function $S(e,t,n){return r;function r(o,i,s,a){const c=Array.isArray(s.children)?n:t;return a?c(i,s,a):c(i,s)}}function BS(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=Rs(r);return t(o,i,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function US(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&Ps.call(t.properties,o)){const i=WS(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&IS.has(t.tagName)?r=a:n[s]=a}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function ZS(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const s=i.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else cr(e,t.position);else{const o=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else cr(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function Ds(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:jS;for(;++r<t.children.length;){const i=t.children[r];let s;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=o.get(l)||0;s=l+"-"+c,o.set(l,c+1)}}const a=nh(e,i,s);a!==void 0&&n.push(a)}return n}function WS(e,t,n){const r=xS(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?iS(n):wS(n)),r.property==="style"){let o=typeof n=="object"?n:VS(e,String(n));return e.stylePropertyNameCase==="css"&&(o=HS(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?pS[r.property]||r.property:r.attribute,n]}}function VS(e,t){try{return NS(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Ye("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=th+"#cannot-parse-style-attribute",o}}function oh(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,s;for(;++i<o.length;){const a=cl(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=s}else r=cl(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return Ps.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);cr(e)}function cr(e,t){const n=new Ye("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=th+"#cannot-handle-mdx-estrees-without-createevaluater",n}function HS(e){const t={};let n;for(n in e)Ps.call(e,n)&&(t[qS(n)]=e[n]);return t}function qS(e){let t=e.replace(zS,GS);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function GS(e){return"-"+e.toLowerCase()}const Qo={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},KS={};function JS(e,t){const n=KS,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ih(e,r,o)}function ih(e,t,n){if(YS(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return bl(e.children,t,n)}return Array.isArray(e)?bl(e,t,n):""}function bl(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=ih(e[o],t,n);return r.join("")}function YS(e){return!!(e&&typeof e=="object")}const vl=document.createElement("i");function Ms(e){const t="&"+e+";";vl.innerHTML=t;const n=vl.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function At(e,t,n,r){const o=e.length;let i=0,s;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function dt(e,t){return e.length>0?(At(e,e.length,0,t),e):t}const wl={}.hasOwnProperty;function XS(e){const t={};let n=-1;for(;++n<e.length;)QS(t,e[n]);return t}function QS(e,t){let n;for(n in t){const o=(wl.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){wl.call(o,s)||(o[s]=[]);const a=i[s];eC(o[s],Array.isArray(a)?a:a?[a]:[])}}}function eC(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);At(e,0,0,r)}function sh(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function zn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Et=tn(/[A-Za-z]/),ct=tn(/[\dA-Za-z]/),tC=tn(/[#-'*+\--9=?A-Z^-~]/);function Fi(e){return e!==null&&(e<32||e===127)}const $i=tn(/\d/),nC=tn(/[\dA-Fa-f]/),rC=tn(/[!-/:-@[-`{-~]/);function we(e){return e!==null&&e<-2}function nt(e){return e!==null&&(e<0||e===32)}function Ie(e){return e===-2||e===-1||e===32}const oC=tn(new RegExp("\\p{P}|\\p{S}","u")),iC=tn(/\s/);function tn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Vn(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&ct(e.charCodeAt(n+1))&&ct(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(s=String.fromCharCode(i,a),o=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+o+1,s=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function De(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return Ie(l)?(e.enter(n),a(l)):t(l)}function a(l){return Ie(l)&&i++<o?(e.consume(l),a):(e.exit(n),t(l))}}const sC={tokenize:aC};function aC(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),De(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),i(a)}function i(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return we(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}const lC={tokenize:cC},_l={tokenize:uC};function cC(e){const t=this,n=[];let r=0,o,i,s;return a;function a(w){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&b();const S=t.events.length;let C=S,N;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){N=t.events[C][1].end;break}x(r);let z=S;for(;z<t.events.length;)t.events[z][1].end={...N},z++;return At(t.events,C+1,0,t.events.slice(S)),t.events.length=z,c(w)}return a(w)}function c(w){if(r===n.length){if(!o)return p(w);if(o.currentConstruct&&o.currentConstruct.concrete)return g(w);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(_l,u,h)(w)}function u(w){return o&&b(),x(r),p(w)}function h(w){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(w)}function p(w){return t.containerState={},e.attempt(_l,d,g)(w)}function d(w){return r++,n.push([t.currentConstruct,t.containerState]),p(w)}function g(w){if(w===null){o&&b(),x(0),e.consume(w);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),m(w)}function m(w){if(w===null){y(e.exit("chunkFlow"),!0),x(0),e.consume(w);return}return we(w)?(e.consume(w),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(w),m)}function y(w,S){const C=t.sliceStream(w);if(S&&C.push(null),w.previous=i,i&&(i.next=w),i=w,o.defineSkip(w.start),o.write(C),t.parser.lazy[w.start.line]){let N=o.events.length;for(;N--;)if(o.events[N][1].start.offset<s&&(!o.events[N][1].end||o.events[N][1].end.offset>s))return;const z=t.events.length;let I=z,O,P;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(O){P=t.events[I][1].end;break}O=!0}for(x(r),N=z;N<t.events.length;)t.events[N][1].end={...P},N++;At(t.events,I+1,0,t.events.slice(z)),t.events.length=N}}function x(w){let S=n.length;for(;S-- >w;){const C=n[S];t.containerState=C[1],C[0].exit.call(t,e)}n.length=w}function b(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function uC(e,t,n){return De(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function kl(e){if(e===null||nt(e)||iC(e))return 1;if(oC(e))return 2}function Ls(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const Bi={name:"attention",resolveAll:dC,tokenize:fC};function dC(e,t){let n=-1,r,o,i,s,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},p={...e[n][1].start};Sl(h,-l),Sl(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=dt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=dt(c,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=dt(c,Ls(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=dt(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=dt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,At(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function fC(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=kl(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const c=e.exit("attentionSequence"),u=kl(l),h=!u||u===2&&o||n.includes(l),p=!o||o===2&&u||n.includes(r);return c._open=!!(i===42?h:h&&(o||!p)),c._close=!!(i===42?p:p&&(u||!h)),t(l)}}function Sl(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const hC={name:"autolink",tokenize:pC};function pC(e,t,n){let r=0;return o;function o(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(d){return Et(d)?(e.consume(d),s):d===64?n(d):c(d)}function s(d){return d===43||d===45||d===46||ct(d)?(r=1,a(d)):c(d)}function a(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||ct(d))&&r++<32?(e.consume(d),a):(r=0,c(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||Fi(d)?n(d):(e.consume(d),l)}function c(d){return d===64?(e.consume(d),u):tC(d)?(e.consume(d),c):n(d)}function u(d){return ct(d)?h(d):n(d)}function h(d){return d===46?(e.consume(d),r=0,u):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):p(d)}function p(d){if((d===45||ct(d))&&r++<63){const g=d===45?p:h;return e.consume(d),g}return n(d)}}const Ao={partial:!0,tokenize:mC};function mC(e,t,n){return r;function r(i){return Ie(i)?De(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||we(i)?t(i):n(i)}}const ah={continuation:{tokenize:xC},exit:yC,name:"blockQuote",tokenize:gC};function gC(e,t,n){const r=this;return o;function o(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return n(s)}function i(s){return Ie(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function xC(e,t,n){const r=this;return o;function o(s){return Ie(s)?De(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(ah,t,n)(s)}}function yC(e){e.exit("blockQuote")}const lh={name:"characterEscape",tokenize:bC};function bC(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return rC(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const ch={name:"characterReference",tokenize:vC};function vC(e,t,n){const r=this;let o=0,i,s;return a;function a(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),l}function l(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,s=ct,u(h))}function c(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=nC,u):(e.enter("characterReferenceValue"),i=7,s=$i,u(h))}function u(h){if(h===59&&o){const p=e.exit("characterReferenceValue");return s===ct&&!Ms(r.sliceSerialize(p))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(h)&&o++<i?(e.consume(h),u):n(h)}}const Cl={partial:!0,tokenize:_C},El={concrete:!0,name:"codeFenced",tokenize:wC};function wC(e,t,n){const r=this,o={partial:!0,tokenize:C};let i=0,s=0,a;return l;function l(N){return c(N)}function c(N){const z=r.events[r.events.length-1];return i=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,a=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(N)}function u(N){return N===a?(s++,e.consume(N),u):s<3?n(N):(e.exit("codeFencedFenceSequence"),Ie(N)?De(e,h,"whitespace")(N):h(N))}function h(N){return N===null||we(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(Cl,m,S)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(N))}function p(N){return N===null||we(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(N)):Ie(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),De(e,d,"whitespace")(N)):N===96&&N===a?n(N):(e.consume(N),p)}function d(N){return N===null||we(N)?h(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(N))}function g(N){return N===null||we(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(N)):N===96&&N===a?n(N):(e.consume(N),g)}function m(N){return e.attempt(o,S,y)(N)}function y(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),x}function x(N){return i>0&&Ie(N)?De(e,b,"linePrefix",i+1)(N):b(N)}function b(N){return N===null||we(N)?e.check(Cl,m,S)(N):(e.enter("codeFlowValue"),w(N))}function w(N){return N===null||we(N)?(e.exit("codeFlowValue"),b(N)):(e.consume(N),w)}function S(N){return e.exit("codeFenced"),t(N)}function C(N,z,I){let O=0;return P;function P(D){return N.enter("lineEnding"),N.consume(D),N.exit("lineEnding"),L}function L(D){return N.enter("codeFencedFence"),Ie(D)?De(N,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):T(D)}function T(D){return D===a?(N.enter("codeFencedFenceSequence"),M(D)):I(D)}function M(D){return D===a?(O++,N.consume(D),M):O>=s?(N.exit("codeFencedFenceSequence"),Ie(D)?De(N,_,"whitespace")(D):_(D)):I(D)}function _(D){return D===null||we(D)?(N.exit("codeFencedFence"),z(D)):I(D)}}}function _C(e,t,n){const r=this;return o;function o(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ei={name:"codeIndented",tokenize:SC},kC={partial:!0,tokenize:CC};function SC(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),De(e,i,"linePrefix",5)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):we(c)?e.attempt(kC,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||we(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function CC(e,t,n){const r=this;return o;function o(s){return r.parser.lazy[r.now().line]?n(s):we(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):De(e,i,"linePrefix",5)(s)}function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):we(s)?o(s):n(s)}}const EC={name:"codeText",previous:TC,resolve:NC,tokenize:jC};function NC(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function TC(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function jC(e,t,n){let r=0,o,i;return s;function s(h){return e.enter("codeText"),e.enter("codeTextSequence"),a(h)}function a(h){return h===96?(e.consume(h),r++,a):(e.exit("codeTextSequence"),l(h))}function l(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),l):h===96?(i=e.enter("codeTextSequence"),o=0,u(h)):we(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||we(h)?(e.exit("codeTextData"),l(h)):(e.consume(h),c)}function u(h){return h===96?(e.consume(h),o++,u):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(i.type="codeTextData",c(h))}}class zC{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const o=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&Yn(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Yn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Yn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Yn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Yn(this.left,n.reverse())}}}function Yn(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function uh(e){const t={};let n=-1,r,o,i,s,a,l,c;const u=new zC(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,AC(u,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,o=void 0;i--;)if(s=u.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(o&&(u.get(o)[1].type="lineEndingBlank"),s[1].type="lineEnding",o=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;o&&(r[1].end={...u.get(o)[1].start},a=u.slice(o,n),a.unshift(r),u.splice(o,n-o+1,a))}}return At(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function AC(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],c={};let u,h,p=-1,d=n,g=0,m=0;const y=[m];for(;d;){for(;e.get(++o)[1]!==d;);i.push(o),d._tokenizer||(u=r.sliceStream(d),d.next||u.push(null),h&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=d,d=d.next}for(d=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(m=p+1,y.push(m),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):y.pop(),p=y.length;p--;){const x=a.slice(y[p],y[p+1]),b=i.pop();l.push([b,b+x.length-1]),e.splice(b,2,x)}for(l.reverse(),p=-1;++p<l.length;)c[g+l[p][0]]=g+l[p][1],g+=l[p][1]-l[p][0]-1;return c}const IC={resolve:PC,tokenize:OC},RC={partial:!0,tokenize:DC};function PC(e){return uh(e),e}function OC(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(a)}function o(a){return a===null?i(a):we(a)?e.check(RC,s,i)(a):(e.consume(a),o)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function DC(e,t,n){const r=this;return o;function o(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),De(e,i,"linePrefix")}function i(s){if(s===null||we(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function dh(e,t,n,r,o,i,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return h;function h(x){return x===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(x),e.exit(i),p):x===null||x===32||x===41||Fi(x)?n(x):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(x))}function p(x){return x===62?(e.enter(i),e.consume(x),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(x))}function d(x){return x===62?(e.exit("chunkString"),e.exit(a),p(x)):x===null||x===60||we(x)?n(x):(e.consume(x),x===92?g:d)}function g(x){return x===60||x===62||x===92?(e.consume(x),d):d(x)}function m(x){return!u&&(x===null||x===41||nt(x))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(x)):u<c&&x===40?(e.consume(x),u++,m):x===41?(e.consume(x),u--,m):x===null||x===32||x===40||Fi(x)?n(x):(e.consume(x),x===92?y:m)}function y(x){return x===40||x===41||x===92?(e.consume(x),m):m(x)}}function fh(e,t,n,r,o,i){const s=this;let a=0,l;return c;function c(d){return e.enter(r),e.enter(o),e.consume(d),e.exit(o),e.enter(i),u}function u(d){return a>999||d===null||d===91||d===93&&!l||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):we(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),h(d))}function h(d){return d===null||d===91||d===93||we(d)||a++>999?(e.exit("chunkString"),u(d)):(e.consume(d),l||(l=!Ie(d)),d===92?p:h)}function p(d){return d===91||d===92||d===93?(e.consume(d),a++,h):h(d)}}function hh(e,t,n,r,o,i){let s;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(o),e.consume(p),e.exit(o),s=p===40?41:p,l):n(p)}function l(p){return p===s?(e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):(e.enter(i),c(p))}function c(p){return p===s?(e.exit(i),l(s)):p===null?n(p):we(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),De(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===s||p===null||we(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?h:u)}function h(p){return p===s||p===92?(e.consume(p),u):u(p)}}function rr(e,t){let n;return r;function r(o){return we(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Ie(o)?De(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const MC={name:"definition",tokenize:FC},LC={partial:!0,tokenize:$C};function FC(e,t,n){const r=this;let o;return i;function i(d){return e.enter("definition"),s(d)}function s(d){return fh.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return o=zn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return nt(d)?rr(e,c)(d):c(d)}function c(d){return dh(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function u(d){return e.attempt(LC,h,h)(d)}function h(d){return Ie(d)?De(e,p,"whitespace")(d):p(d)}function p(d){return d===null||we(d)?(e.exit("definition"),r.parser.defined.push(o),t(d)):n(d)}}function $C(e,t,n){return r;function r(a){return nt(a)?rr(e,o)(a):n(a)}function o(a){return hh(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return Ie(a)?De(e,s,"whitespace")(a):s(a)}function s(a){return a===null||we(a)?t(a):n(a)}}const BC={name:"hardBreakEscape",tokenize:UC};function UC(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return we(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const ZC={name:"headingAtx",resolve:WC,tokenize:VC};function WC(e,t){let n=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},At(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function VC(e,t,n){let r=0;return o;function o(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||nt(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||we(u)?(e.exit("atxHeading"),t(u)):Ie(u)?De(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||nt(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const HC=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Nl=["pre","script","style","textarea"],qC={concrete:!0,name:"htmlFlow",resolveTo:JC,tokenize:YC},GC={partial:!0,tokenize:QC},KC={partial:!0,tokenize:XC};function JC(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function YC(e,t,n){const r=this;let o,i,s,a,l;return c;function c(j){return u(j)}function u(j){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(j),h}function h(j){return j===33?(e.consume(j),p):j===47?(e.consume(j),i=!0,m):j===63?(e.consume(j),o=3,r.interrupt?t:E):Et(j)?(e.consume(j),s=String.fromCharCode(j),y):n(j)}function p(j){return j===45?(e.consume(j),o=2,d):j===91?(e.consume(j),o=5,a=0,g):Et(j)?(e.consume(j),o=4,r.interrupt?t:E):n(j)}function d(j){return j===45?(e.consume(j),r.interrupt?t:E):n(j)}function g(j){const Y="CDATA[";return j===Y.charCodeAt(a++)?(e.consume(j),a===Y.length?r.interrupt?t:T:g):n(j)}function m(j){return Et(j)?(e.consume(j),s=String.fromCharCode(j),y):n(j)}function y(j){if(j===null||j===47||j===62||nt(j)){const Y=j===47,H=s.toLowerCase();return!Y&&!i&&Nl.includes(H)?(o=1,r.interrupt?t(j):T(j)):HC.includes(s.toLowerCase())?(o=6,Y?(e.consume(j),x):r.interrupt?t(j):T(j)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(j):i?b(j):w(j))}return j===45||ct(j)?(e.consume(j),s+=String.fromCharCode(j),y):n(j)}function x(j){return j===62?(e.consume(j),r.interrupt?t:T):n(j)}function b(j){return Ie(j)?(e.consume(j),b):P(j)}function w(j){return j===47?(e.consume(j),P):j===58||j===95||Et(j)?(e.consume(j),S):Ie(j)?(e.consume(j),w):P(j)}function S(j){return j===45||j===46||j===58||j===95||ct(j)?(e.consume(j),S):C(j)}function C(j){return j===61?(e.consume(j),N):Ie(j)?(e.consume(j),C):w(j)}function N(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),l=j,z):Ie(j)?(e.consume(j),N):I(j)}function z(j){return j===l?(e.consume(j),l=null,O):j===null||we(j)?n(j):(e.consume(j),z)}function I(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||nt(j)?C(j):(e.consume(j),I)}function O(j){return j===47||j===62||Ie(j)?w(j):n(j)}function P(j){return j===62?(e.consume(j),L):n(j)}function L(j){return j===null||we(j)?T(j):Ie(j)?(e.consume(j),L):n(j)}function T(j){return j===45&&o===2?(e.consume(j),G):j===60&&o===1?(e.consume(j),Z):j===62&&o===4?(e.consume(j),U):j===63&&o===3?(e.consume(j),E):j===93&&o===5?(e.consume(j),q):we(j)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(GC,B,M)(j)):j===null||we(j)?(e.exit("htmlFlowData"),M(j)):(e.consume(j),T)}function M(j){return e.check(KC,_,B)(j)}function _(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),D}function D(j){return j===null||we(j)?M(j):(e.enter("htmlFlowData"),T(j))}function G(j){return j===45?(e.consume(j),E):T(j)}function Z(j){return j===47?(e.consume(j),s="",te):T(j)}function te(j){if(j===62){const Y=s.toLowerCase();return Nl.includes(Y)?(e.consume(j),U):T(j)}return Et(j)&&s.length<8?(e.consume(j),s+=String.fromCharCode(j),te):T(j)}function q(j){return j===93?(e.consume(j),E):T(j)}function E(j){return j===62?(e.consume(j),U):j===45&&o===2?(e.consume(j),E):T(j)}function U(j){return j===null||we(j)?(e.exit("htmlFlowData"),B(j)):(e.consume(j),U)}function B(j){return e.exit("htmlFlow"),t(j)}}function XC(e,t,n){const r=this;return o;function o(s){return we(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function QC(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Ao,t,n)}}const eE={name:"htmlText",tokenize:tE};function tE(e,t,n){const r=this;let o,i,s;return a;function a(E){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(E),l}function l(E){return E===33?(e.consume(E),c):E===47?(e.consume(E),C):E===63?(e.consume(E),w):Et(E)?(e.consume(E),I):n(E)}function c(E){return E===45?(e.consume(E),u):E===91?(e.consume(E),i=0,g):Et(E)?(e.consume(E),b):n(E)}function u(E){return E===45?(e.consume(E),d):n(E)}function h(E){return E===null?n(E):E===45?(e.consume(E),p):we(E)?(s=h,Z(E)):(e.consume(E),h)}function p(E){return E===45?(e.consume(E),d):h(E)}function d(E){return E===62?G(E):E===45?p(E):h(E)}function g(E){const U="CDATA[";return E===U.charCodeAt(i++)?(e.consume(E),i===U.length?m:g):n(E)}function m(E){return E===null?n(E):E===93?(e.consume(E),y):we(E)?(s=m,Z(E)):(e.consume(E),m)}function y(E){return E===93?(e.consume(E),x):m(E)}function x(E){return E===62?G(E):E===93?(e.consume(E),x):m(E)}function b(E){return E===null||E===62?G(E):we(E)?(s=b,Z(E)):(e.consume(E),b)}function w(E){return E===null?n(E):E===63?(e.consume(E),S):we(E)?(s=w,Z(E)):(e.consume(E),w)}function S(E){return E===62?G(E):w(E)}function C(E){return Et(E)?(e.consume(E),N):n(E)}function N(E){return E===45||ct(E)?(e.consume(E),N):z(E)}function z(E){return we(E)?(s=z,Z(E)):Ie(E)?(e.consume(E),z):G(E)}function I(E){return E===45||ct(E)?(e.consume(E),I):E===47||E===62||nt(E)?O(E):n(E)}function O(E){return E===47?(e.consume(E),G):E===58||E===95||Et(E)?(e.consume(E),P):we(E)?(s=O,Z(E)):Ie(E)?(e.consume(E),O):G(E)}function P(E){return E===45||E===46||E===58||E===95||ct(E)?(e.consume(E),P):L(E)}function L(E){return E===61?(e.consume(E),T):we(E)?(s=L,Z(E)):Ie(E)?(e.consume(E),L):O(E)}function T(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),o=E,M):we(E)?(s=T,Z(E)):Ie(E)?(e.consume(E),T):(e.consume(E),_)}function M(E){return E===o?(e.consume(E),o=void 0,D):E===null?n(E):we(E)?(s=M,Z(E)):(e.consume(E),M)}function _(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||nt(E)?O(E):(e.consume(E),_)}function D(E){return E===47||E===62||nt(E)?O(E):n(E)}function G(E){return E===62?(e.consume(E),e.exit("htmlTextData"),e.exit("htmlText"),t):n(E)}function Z(E){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),te}function te(E){return Ie(E)?De(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):q(E)}function q(E){return e.enter("htmlTextData"),s(E)}}const Fs={name:"labelEnd",resolveAll:iE,resolveTo:sE,tokenize:aE},nE={tokenize:lE},rE={tokenize:cE},oE={tokenize:uE};function iE(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&At(e,0,e.length,n),e}function sE(e,t){let n=e.length,r=0,o,i,s,a;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=dt(a,e.slice(i+1,i+r+3)),a=dt(a,[["enter",u,t]]),a=dt(a,Ls(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=dt(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=dt(a,e.slice(s+1)),a=dt(a,[["exit",l,t]]),At(e,i,e.length,a),e}function aE(e,t,n){const r=this;let o=r.events.length,i,s;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return a;function a(p){return i?i._inactive?h(p):(s=r.parser.defined.includes(zn(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(nE,u,s?u:h)(p):p===91?e.attempt(rE,u,s?c:h)(p):s?u(p):h(p)}function c(p){return e.attempt(oE,u,h)(p)}function u(p){return t(p)}function h(p){return i._balanced=!0,n(p)}}function lE(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),o}function o(h){return nt(h)?rr(e,i)(h):i(h)}function i(h){return h===41?u(h):dh(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return nt(h)?rr(e,l)(h):u(h)}function a(h){return n(h)}function l(h){return h===34||h===39||h===40?hh(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):u(h)}function c(h){return nt(h)?rr(e,u)(h):u(h)}function u(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function cE(e,t,n){const r=this;return o;function o(a){return fh.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(zn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function uE(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const dE={name:"labelStartImage",resolveAll:Fs.resolveAll,tokenize:fE};function fE(e,t,n){const r=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const hE={name:"labelStartLink",resolveAll:Fs.resolveAll,tokenize:pE};function pE(e,t,n){const r=this;return o;function o(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const ti={name:"lineEnding",tokenize:mE};function mE(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),De(e,t,"linePrefix")}}const Br={name:"thematicBreak",tokenize:gE};function gE(e,t,n){let r=0,o;return i;function i(c){return e.enter("thematicBreak"),s(c)}function s(c){return o=c,a(c)}function a(c){return c===o?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||we(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===o?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Ie(c)?De(e,a,"whitespace")(c):a(c))}}const et={continuation:{tokenize:vE},exit:_E,name:"list",tokenize:bE},xE={partial:!0,tokenize:kE},yE={partial:!0,tokenize:wE};function bE(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,s=0;return a;function a(d){const g=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:$i(d)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(Br,n,c)(d):c(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return $i(d)&&++s<10?(e.consume(d),l):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),c(d)):n(d)}function c(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(Ao,r.interrupt?n:u,e.attempt(xE,p,h))}function u(d){return r.containerState.initialBlankLine=!0,i++,p(d)}function h(d){return Ie(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),p):n(d)}function p(d){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function vE(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ao,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,De(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!Ie(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(yE,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,De(e,e.attempt(et,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function wE(e,t,n){const r=this;return De(e,o,"listItemIndent",r.containerState.size+1);function o(i){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(i):n(i)}}function _E(e){e.exit(this.containerState.type)}function kE(e,t,n){const r=this;return De(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const s=r.events[r.events.length-1];return!Ie(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const Tl={name:"setextUnderline",resolveTo:SE,tokenize:CE};function SE(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function CE(e,t,n){const r=this;let o;return i;function i(c){let u=r.events.length,h;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){h=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),o=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===o?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Ie(c)?De(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||we(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const EE={tokenize:NE};function NE(e){const t=this,n=e.attempt(Ao,r,e.attempt(this.parser.constructs.flowInitial,o,De(e,e.attempt(this.parser.constructs.flow,o,e.attempt(IC,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const TE={resolveAll:mh()},jE=ph("string"),zE=ph("text");function ph(e){return{resolveAll:mh(e==="text"?AE:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,s,a);return s;function s(u){return c(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const h=o[u];let p=-1;if(h)for(;++p<h.length;){const d=h[p];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function mh(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function AE(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let i=o.length,s=-1,a=0,l;for(;i--;){const c=o[i];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:r.start._bufferIndex+s,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const IE={42:et,43:et,45:et,48:et,49:et,50:et,51:et,52:et,53:et,54:et,55:et,56:et,57:et,62:ah},RE={91:MC},PE={[-2]:ei,[-1]:ei,32:ei},OE={35:ZC,42:Br,45:[Tl,Br],60:qC,61:Tl,95:Br,96:El,126:El},DE={38:ch,92:lh},ME={[-5]:ti,[-4]:ti,[-3]:ti,33:dE,38:ch,42:Bi,60:[hC,eE],91:hE,92:[BC,lh],93:Fs,95:Bi,96:EC},LE={null:[Bi,TE]},FE={null:[42,95]},$E={null:[]},BE=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:FE,contentInitial:RE,disable:$E,document:IE,flow:OE,flowInitial:PE,insideSpan:LE,string:DE,text:ME},Symbol.toStringTag,{value:"Module"}));function UE(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let s=[],a=[];const l={attempt:z(C),check:z(N),consume:b,enter:w,exit:S,interrupt:z(N,{interrupt:!0})},c={code:null,containerState:{},defineSkip:m,events:[],now:g,parser:e,previous:null,sliceSerialize:p,sliceStream:d,write:h};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function h(L){return s=dt(s,L),y(),s[s.length-1]!==null?[]:(I(t,0),c.events=Ls(i,c.events,c),c.events)}function p(L,T){return WE(d(L),T)}function d(L){return ZE(s,L)}function g(){const{_bufferIndex:L,_index:T,line:M,column:_,offset:D}=r;return{_bufferIndex:L,_index:T,line:M,column:_,offset:D}}function m(L){o[L.line]=L.column,P()}function y(){let L;for(;r._index<s.length;){const T=s[r._index];if(typeof T=="string")for(L=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===L&&r._bufferIndex<T.length;)x(T.charCodeAt(r._bufferIndex));else x(T)}}function x(L){u=u(L)}function b(L){we(L)?(r.line++,r.column=1,r.offset+=L===-3?2:1,P()):L!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=L}function w(L,T){const M=T||{};return M.type=L,M.start=g(),c.events.push(["enter",M,c]),a.push(M),M}function S(L){const T=a.pop();return T.end=g(),c.events.push(["exit",T,c]),T}function C(L,T){I(L,T.from)}function N(L,T){T.restore()}function z(L,T){return M;function M(_,D,G){let Z,te,q,E;return Array.isArray(_)?B(_):"tokenize"in _?B([_]):U(_);function U(ce){return ie;function ie(re){const le=re!==null&&ce[re],me=re!==null&&ce.null,xe=[...Array.isArray(le)?le:le?[le]:[],...Array.isArray(me)?me:me?[me]:[]];return B(xe)(re)}}function B(ce){return Z=ce,te=0,ce.length===0?G:j(ce[te])}function j(ce){return ie;function ie(re){return E=O(),q=ce,ce.partial||(c.currentConstruct=ce),ce.name&&c.parser.constructs.disable.null.includes(ce.name)?H():ce.tokenize.call(T?Object.assign(Object.create(c),T):c,l,Y,H)(re)}}function Y(ce){return L(q,E),D}function H(ce){return E.restore(),++te<Z.length?j(Z[te]):G}}}function I(L,T){L.resolveAll&&!i.includes(L)&&i.push(L),L.resolve&&At(c.events,T,c.events.length-T,L.resolve(c.events.slice(T),c)),L.resolveTo&&(c.events=L.resolveTo(c.events,c))}function O(){const L=g(),T=c.previous,M=c.currentConstruct,_=c.events.length,D=Array.from(a);return{from:_,restore:G};function G(){r=L,c.previous=T,c.currentConstruct=M,c.events.length=_,a=D,P()}}function P(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function ZE(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let s;if(n===o)s=[e[n].slice(r,i)];else{if(s=e.slice(n,o),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}i>0&&s.push(e[o].slice(0,i))}return s}function WE(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
109
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Fw="DialogDescriptionWarning",$w=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ld(Fw).contentName}}.`;return v.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Bw=Ku,Uw=Yu,Zw=Qu,Ww=ed,Vw=td,Hw=rd,qw=sd;function Gw(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Kw(e){const[t,n]=v.useState(void 0);return qe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const Jw=["top","right","bottom","left"],qt=Math.min,at=Math.max,Kr=Math.round,Rr=Math.floor,jt=e=>({x:e,y:e}),Yw={left:"right",right:"left",bottom:"top",top:"bottom"};function ki(e,t,n){return at(e,qt(t,n))}function Ft(e,t){return typeof e=="function"?e(t):e}function $t(e){return e.split("-")[0]}function Bn(e){return e.split("-")[1]}function gs(e){return e==="x"?"y":"x"}function xs(e){return e==="y"?"height":"width"}function Nt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ys(e){return gs(Nt(e))}function Xw(e,t,n){n===void 0&&(n=!1);const r=Bn(e),o=ys(e),i=xs(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Jr(s)),[s,Jr(s)]}function Qw(e){const t=Jr(e);return[Si(e),t,Si(t)]}function Si(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ga=["left","right"],Ka=["right","left"],e2=["top","bottom"],t2=["bottom","top"];function n2(e,t,n){switch(e){case"top":case"bottom":return n?t?Ka:Ga:t?Ga:Ka;case"left":case"right":return t?e2:t2;default:return[]}}function r2(e,t,n,r){const o=Bn(e);let i=n2($t(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Si)))),i}function Jr(e){const t=$t(e);return Yw[t]+e.slice(t.length)}function o2(e){return{top:0,right:0,bottom:0,left:0,...e}}function cd(e){return typeof e!="number"?o2(e):{top:e,right:e,bottom:e,left:e}}function Yr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Ja(e,t,n){let{reference:r,floating:o}=e;const i=Nt(t),s=ys(t),a=xs(s),l=$t(t),c=i==="y",u=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let d;switch(l){case"top":d={x:u,y:r.y-o.height};break;case"bottom":d={x:u,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:h};break;case"left":d={x:r.x-o.width,y:h};break;default:d={x:r.x,y:r.y}}switch(Bn(t)){case"start":d[s]-=p*(n&&c?-1:1);break;case"end":d[s]+=p*(n&&c?-1:1);break}return d}async function i2(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:p=!1,padding:d=0}=Ft(t,e),g=cd(d),y=a[p?h==="floating"?"reference":"floating":h],x=Yr(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=h==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Yr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:l}):b);return{top:(x.top-C.top+g.top)/S.y,bottom:(C.bottom-x.bottom+g.bottom)/S.y,left:(x.left-C.left+g.left)/S.x,right:(C.right-x.right+g.right)/S.x}}const s2=50,a2=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:i2},l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:h}=Ja(c,r,l),p=r,d=0;const g={};for(let m=0;m<i.length;m++){const y=i[m];if(!y)continue;const{name:x,fn:b}=y,{x:w,y:S,data:C,reset:N}=await b({x:u,y:h,initialPlacement:r,placement:p,strategy:o,middlewareData:g,rects:c,platform:a,elements:{reference:e,floating:t}});u=w??u,h=S??h,g[x]={...g[x],...C},N&&d<s2&&(d++,typeof N=="object"&&(N.placement&&(p=N.placement),N.rects&&(c=N.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:u,y:h}=Ja(c,p,l)),m=-1)}return{x:u,y:h,placement:p,strategy:o,middlewareData:g}},l2=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Ft(e,t)||{};if(c==null)return{};const h=cd(u),p={x:n,y:r},d=ys(o),g=xs(d),m=await s.getDimensions(c),y=d==="y",x=y?"top":"left",b=y?"bottom":"right",w=y?"clientHeight":"clientWidth",S=i.reference[g]+i.reference[d]-p[d]-i.floating[g],C=p[d]-i.reference[d],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let z=N?N[w]:0;(!z||!await(s.isElement==null?void 0:s.isElement(N)))&&(z=a.floating[w]||i.floating[g]);const A=S/2-C/2,O=z/2-m[g]/2-1,P=qt(h[x],O),L=qt(h[b],O),T=P,M=z-m[g]-L,_=z/2-m[g]/2+A,D=ki(T,_,M),G=!l.arrow&&Bn(o)!=null&&_!==D&&i.reference[g]/2-(_<T?P:L)-m[g]/2<0,Z=G?_<T?_-T:_-M:0;return{[d]:p[d]+Z,data:{[d]:D,centerOffset:_-D-Z,...G&&{alignmentOffset:Z}},reset:G}}}),c2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...y}=Ft(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=$t(o),b=Nt(a),w=$t(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=p||(w||!m?[Jr(a)]:Qw(a)),N=g!=="none";!p&&N&&C.push(...r2(a,m,g,S));const z=[a,...C],A=await l.detectOverflow(t,y),O=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&O.push(A[x]),h){const _=Xw(o,s,S);O.push(A[_[0]],A[_[1]])}if(P=[...P,{placement:o,overflows:O}],!O.every(_=>_<=0)){var L,T;const _=(((L=i.flip)==null?void 0:L.index)||0)+1,D=z[_];if(D&&(!(h==="alignment"?b!==Nt(D):!1)||P.every(te=>Nt(te.placement)===b?te.overflows[0]>0:!0)))return{data:{index:_,overflows:P},reset:{placement:D}};let G=(T=P.filter(Z=>Z.overflows[0]<=0).sort((Z,te)=>Z.overflows[1]-te.overflows[1])[0])==null?void 0:T.placement;if(!G)switch(d){case"bestFit":{var M;const Z=(M=P.filter(te=>{if(N){const q=Nt(te.placement);return q===b||q==="y"}return!0}).map(te=>[te.placement,te.overflows.filter(q=>q>0).reduce((q,E)=>q+E,0)]).sort((te,q)=>te[1]-q[1])[0])==null?void 0:M[0];Z&&(G=Z);break}case"initialPlacement":G=a;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function Ya(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xa(e){return Jw.some(t=>e[t]>=0)}const u2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=Ft(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=Ya(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Xa(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=Ya(s,n.floating);return{data:{escapedOffsets:a,escaped:Xa(a)}}}default:return{}}}}},ud=new Set(["left","top"]);async function d2(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=$t(n),a=Bn(n),l=Nt(n)==="y",c=ud.has(s)?-1:1,u=i&&l?-1:1,h=Ft(t,e);let{mainAxis:p,crossAxis:d,alignmentAxis:g}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof g=="number"&&(d=a==="end"?g*-1:g),l?{x:d*u,y:p*c}:{x:p*c,y:d*u}}const f2=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await d2(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},h2=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:x=>{let{x:b,y:w}=x;return{x:b,y:w}}},...c}=Ft(e,t),u={x:n,y:r},h=await i.detectOverflow(t,c),p=Nt($t(o)),d=gs(p);let g=u[d],m=u[p];if(s){const x=d==="y"?"top":"left",b=d==="y"?"bottom":"right",w=g+h[x],S=g-h[b];g=ki(w,g,S)}if(a){const x=p==="y"?"top":"left",b=p==="y"?"bottom":"right",w=m+h[x],S=m-h[b];m=ki(w,m,S)}const y=l.fn({...t,[d]:g,[p]:m});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[d]:s,[p]:a}}}}}},p2=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Ft(e,t),u={x:n,y:r},h=Nt(o),p=gs(h);let d=u[p],g=u[h];const m=Ft(a,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const w=p==="y"?"height":"width",S=i.reference[p]-i.floating[w]+y.mainAxis,C=i.reference[p]+i.reference[w]-y.mainAxis;d<S?d=S:d>C&&(d=C)}if(c){var x,b;const w=p==="y"?"width":"height",S=ud.has($t(o)),C=i.reference[h]-i.floating[w]+(S&&((x=s.offset)==null?void 0:x[h])||0)+(S?0:y.crossAxis),N=i.reference[h]+i.reference[w]+(S?0:((b=s.offset)==null?void 0:b[h])||0)-(S?y.crossAxis:0);g<C?g=C:g>N&&(g=N)}return{[p]:d,[h]:g}}}},m2=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Ft(e,t),u=await s.detectOverflow(t,c),h=$t(o),p=Bn(o),d=Nt(o)==="y",{width:g,height:m}=i.floating;let y,x;h==="top"||h==="bottom"?(y=h,x=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(x=h,y=p==="end"?"top":"bottom");const b=m-u.top-u.bottom,w=g-u.left-u.right,S=qt(m-u[y],b),C=qt(g-u[x],w),N=!t.middlewareData.shift;let z=S,A=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(z=b),N&&!p){const P=at(u.left,0),L=at(u.right,0),T=at(u.top,0),M=at(u.bottom,0);d?A=g-2*(P!==0||L!==0?P+L:at(u.left,u.right)):z=m-2*(T!==0||M!==0?T+M:at(u.top,u.bottom))}await l({...t,availableWidth:A,availableHeight:z});const O=await s.getDimensions(a.floating);return g!==O.width||m!==O.height?{reset:{rects:!0}}:{}}}};function yo(){return typeof window<"u"}function Un(e){return dd(e)?(e.nodeName||"").toLowerCase():"#document"}function ut(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function At(e){var t;return(t=(dd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dd(e){return yo()?e instanceof Node||e instanceof ut(e).Node:!1}function bt(e){return yo()?e instanceof Element||e instanceof ut(e).Element:!1}function Ut(e){return yo()?e instanceof HTMLElement||e instanceof ut(e).HTMLElement:!1}function Qa(e){return!yo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ut(e).ShadowRoot}function mr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=vt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function g2(e){return/^(table|td|th)$/.test(Un(e))}function bo(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const x2=/transform|translate|scale|rotate|perspective|filter/,y2=/paint|layout|strict|content/,rn=e=>!!e&&e!=="none";let qo;function bs(e){const t=bt(e)?vt(e):e;return rn(t.transform)||rn(t.translate)||rn(t.scale)||rn(t.rotate)||rn(t.perspective)||!vs()&&(rn(t.backdropFilter)||rn(t.filter))||x2.test(t.willChange||"")||y2.test(t.contain||"")}function b2(e){let t=Gt(e);for(;Ut(t)&&!On(t);){if(bs(t))return t;if(bo(t))return null;t=Gt(t)}return null}function vs(){return qo==null&&(qo=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),qo}function On(e){return/^(html|body|#document)$/.test(Un(e))}function vt(e){return ut(e).getComputedStyle(e)}function vo(e){return bt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Gt(e){if(Un(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Qa(e)&&e.host||At(e);return Qa(t)?t.host:t}function fd(e){const t=Gt(e);return On(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ut(t)&&mr(t)?t:fd(t)}function ar(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=fd(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ut(o);if(i){const a=Ci(s);return t.concat(s,s.visualViewport||[],mr(o)?o:[],a&&n?ar(a):[])}else return t.concat(o,ar(o,[],n))}function Ci(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function hd(e){const t=vt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ut(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Kr(n)!==i||Kr(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function ws(e){return bt(e)?e:e.contextElement}function jn(e){const t=ws(e);if(!Ut(t))return jt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=hd(t);let s=(i?Kr(n.width):n.width)/r,a=(i?Kr(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const v2=jt(0);function pd(e){const t=ut(e);return!vs()||!t.visualViewport?v2:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function w2(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ut(e)?!1:t}function cn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=ws(e);let s=jt(1);t&&(r?bt(r)&&(s=jn(r)):s=jn(e));const a=w2(i,n,r)?pd(i):jt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,h=o.height/s.y;if(i){const p=ut(i),d=r&&bt(r)?ut(r):r;let g=p,m=Ci(g);for(;m&&r&&d!==g;){const y=jn(m),x=m.getBoundingClientRect(),b=vt(m),w=x.left+(m.clientLeft+parseFloat(b.paddingLeft))*y.x,S=x.top+(m.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,h*=y.y,l+=w,c+=S,g=ut(m),m=Ci(g)}}return Yr({width:u,height:h,x:l,y:c})}function wo(e,t){const n=vo(e).scrollLeft;return t?t.left+n:cn(At(e)).left+n}function md(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-wo(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function _2(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=At(r),a=t?bo(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=jt(1);const u=jt(0),h=Ut(r);if((h||!h&&!i)&&((Un(r)!=="body"||mr(s))&&(l=vo(r)),h)){const d=cn(r);c=jn(r),u.x=d.x+r.clientLeft,u.y=d.y+r.clientTop}const p=s&&!h&&!i?md(s,l):jt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}}function k2(e){return Array.from(e.getClientRects())}function S2(e){const t=At(e),n=vo(e),r=e.ownerDocument.body,o=at(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=at(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+wo(e);const a=-n.scrollTop;return vt(r).direction==="rtl"&&(s+=at(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const el=25;function C2(e,t){const n=ut(e),r=At(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=vs();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=wo(r);if(c<=0){const u=r.ownerDocument,h=u.body,p=getComputedStyle(h),d=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(r.clientWidth-h.clientWidth-d);g<=el&&(i-=g)}else c<=el&&(i+=c);return{width:i,height:s,x:a,y:l}}function E2(e,t){const n=cn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ut(e)?jn(e):jt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function tl(e,t,n){let r;if(t==="viewport")r=C2(e,n);else if(t==="document")r=S2(At(e));else if(bt(t))r=E2(t,n);else{const o=pd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Yr(r)}function gd(e,t){const n=Gt(e);return n===t||!bt(n)||On(n)?!1:vt(n).position==="fixed"||gd(n,t)}function N2(e,t){const n=t.get(e);if(n)return n;let r=ar(e,[],!1).filter(a=>bt(a)&&Un(a)!=="body"),o=null;const i=vt(e).position==="fixed";let s=i?Gt(e):e;for(;bt(s)&&!On(s);){const a=vt(s),l=bs(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||mr(s)&&!l&&gd(e,s))?r=r.filter(u=>u!==s):o=a,s=Gt(s)}return t.set(e,r),r}function T2(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?bo(t)?[]:N2(t,this._c):[].concat(n),r],a=tl(t,s[0],o);let l=a.top,c=a.right,u=a.bottom,h=a.left;for(let p=1;p<s.length;p++){const d=tl(t,s[p],o);l=at(d.top,l),c=qt(d.right,c),u=qt(d.bottom,u),h=at(d.left,h)}return{width:c-h,height:u-l,x:h,y:l}}function j2(e){const{width:t,height:n}=hd(e);return{width:t,height:n}}function z2(e,t,n){const r=Ut(t),o=At(t),i=n==="fixed",s=cn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=jt(0);function c(){l.x=wo(o)}if(r||!r&&!i)if((Un(t)!=="body"||mr(o))&&(a=vo(t)),r){const d=cn(t,!0,i,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?md(o,a):jt(0),h=s.left+a.scrollLeft-l.x-u.x,p=s.top+a.scrollTop-l.y-u.y;return{x:h,y:p,width:s.width,height:s.height}}function Go(e){return vt(e).position==="static"}function nl(e,t){if(!Ut(e)||vt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return At(e)===n&&(n=n.ownerDocument.body),n}function xd(e,t){const n=ut(e);if(bo(e))return n;if(!Ut(e)){let o=Gt(e);for(;o&&!On(o);){if(bt(o)&&!Go(o))return o;o=Gt(o)}return n}let r=nl(e,t);for(;r&&g2(r)&&Go(r);)r=nl(r,t);return r&&On(r)&&Go(r)&&!bs(r)?n:r||b2(e)||n}const I2=async function(e){const t=this.getOffsetParent||xd,n=this.getDimensions,r=await n(e.floating);return{reference:z2(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function A2(e){return vt(e).direction==="rtl"}const R2={convertOffsetParentRelativeRectToViewportRelativeRect:_2,getDocumentElement:At,getClippingRect:T2,getOffsetParent:xd,getElementRects:I2,getClientRects:k2,getDimensions:j2,getScale:jn,isElement:bt,isRTL:A2};function yd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function P2(e,t){let n=null,r;const o=At(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:h,width:p,height:d}=c;if(a||t(),!p||!d)return;const g=Rr(h),m=Rr(o.clientWidth-(u+p)),y=Rr(o.clientHeight-(h+d)),x=Rr(u),w={rootMargin:-g+"px "+-m+"px "+-y+"px "+-x+"px",threshold:at(0,qt(1,l))||1};let S=!0;function C(N){const z=N[0].intersectionRatio;if(z!==l){if(!S)return s();z?s(!1,z):r=setTimeout(()=>{s(!1,1e-7)},1e3)}z===1&&!yd(c,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return s(!0),i}function O2(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=ws(e),u=o||i?[...c?ar(c):[],...t?ar(t):[]]:[];u.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const h=c&&a?P2(c,n):null;let p=-1,d=null;s&&(d=new ResizeObserver(x=>{let[b]=x;b&&b.target===c&&d&&t&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(t)})),n()}),c&&!l&&d.observe(c),t&&d.observe(t));let g,m=l?cn(e):null;l&&y();function y(){const x=cn(e);m&&!yd(m,x)&&n(),m=x,g=requestAnimationFrame(y)}return n(),()=>{var x;u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),h?.(),(x=d)==null||x.disconnect(),d=null,l&&cancelAnimationFrame(g)}}const D2=f2,M2=h2,L2=c2,F2=m2,$2=u2,rl=l2,B2=p2,U2=(e,t,n)=>{const r=new Map,o={platform:R2,...n},i={...o.platform,_c:r};return a2(e,t,{...o,platform:i})};var Z2=typeof document<"u",W2=function(){},$r=Z2?v.useLayoutEffect:W2;function Xr(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,o;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(!Xr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Xr(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function bd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ol(e,t){const n=bd(e);return Math.round(t*n)/n}function Ko(e){const t=v.useRef(e);return $r(()=>{t.current=e}),t}function V2(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,h]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,d]=v.useState(r);Xr(p,r)||d(r);const[g,m]=v.useState(null),[y,x]=v.useState(null),b=v.useCallback(te=>{te!==N.current&&(N.current=te,m(te))},[]),w=v.useCallback(te=>{te!==z.current&&(z.current=te,x(te))},[]),S=i||g,C=s||y,N=v.useRef(null),z=v.useRef(null),A=v.useRef(u),O=l!=null,P=Ko(l),L=Ko(o),T=Ko(c),M=v.useCallback(()=>{if(!N.current||!z.current)return;const te={placement:t,strategy:n,middleware:p};L.current&&(te.platform=L.current),U2(N.current,z.current,te).then(q=>{const E={...q,isPositioned:T.current!==!1};_.current&&!Xr(A.current,E)&&(A.current=E,dr.flushSync(()=>{h(E)}))})},[p,t,n,L,T]);$r(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,h(te=>({...te,isPositioned:!1})))},[c]);const _=v.useRef(!1);$r(()=>(_.current=!0,()=>{_.current=!1}),[]),$r(()=>{if(S&&(N.current=S),C&&(z.current=C),S&&C){if(P.current)return P.current(S,C,M);M()}},[S,C,M,P,O]);const D=v.useMemo(()=>({reference:N,floating:z,setReference:b,setFloating:w}),[b,w]),G=v.useMemo(()=>({reference:S,floating:C}),[S,C]),Z=v.useMemo(()=>{const te={position:n,left:0,top:0};if(!G.floating)return te;const q=ol(G.floating,u.x),E=ol(G.floating,u.y);return a?{...te,transform:"translate("+q+"px, "+E+"px)",...bd(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:E}},[n,a,G.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:M,refs:D,elements:G,floatingStyles:Z}),[u,M,D,G,Z])}const H2=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?rl({element:r.current,padding:o}).fn(n):{}:r?rl({element:r,padding:o}).fn(n):{}}}},q2=(e,t)=>{const n=D2(e);return{name:n.name,fn:n.fn,options:[e,t]}},G2=(e,t)=>{const n=M2(e);return{name:n.name,fn:n.fn,options:[e,t]}},K2=(e,t)=>({fn:B2(e).fn,options:[e,t]}),J2=(e,t)=>{const n=L2(e);return{name:n.name,fn:n.fn,options:[e,t]}},Y2=(e,t)=>{const n=F2(e);return{name:n.name,fn:n.fn,options:[e,t]}},X2=(e,t)=>{const n=$2(e);return{name:n.name,fn:n.fn,options:[e,t]}},Q2=(e,t)=>{const n=H2(e);return{name:n.name,fn:n.fn,options:[e,t]}};var e_="Arrow",vd=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return f.jsx(Ce.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});vd.displayName=e_;var t_=vd,_s="Popper",[wd,_o]=Bt(_s),[n_,_d]=wd(_s),kd=e=>{const{__scopePopper:t,children:n}=e,[r,o]=v.useState(null);return f.jsx(n_,{scope:t,anchor:r,onAnchorChange:o,children:n})};kd.displayName=_s;var Sd="PopperAnchor",Cd=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=_d(Sd,n),s=v.useRef(null),a=Re(t,s),l=v.useRef(null);return v.useEffect(()=>{const c=l.current;l.current=r?.current||s.current,c!==l.current&&i.onAnchorChange(l.current)}),r?null:f.jsx(Ce.div,{...o,ref:a})});Cd.displayName=Sd;var ks="PopperContent",[r_,o_]=wd(ks),Ed=v.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:d="optimized",onPlaced:g,...m}=e,y=_d(ks,n),[x,b]=v.useState(null),w=Re(t,ie=>b(ie)),[S,C]=v.useState(null),N=Kw(S),z=N?.width??0,A=N?.height??0,O=r+(i!=="center"?"-"+i:""),P=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},L=Array.isArray(c)?c:[c],T=L.length>0,M={padding:P,boundary:L.filter(s_),altBoundary:T},{refs:_,floatingStyles:D,placement:G,isPositioned:Z,middlewareData:te}=V2({strategy:"fixed",placement:O,whileElementsMounted:(...ie)=>O2(...ie,{animationFrame:d==="always"}),elements:{reference:y.anchor},middleware:[q2({mainAxis:o+A,alignmentAxis:s}),l&&G2({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?K2():void 0,...M}),l&&J2({...M}),Y2({...M,apply:({elements:ie,rects:re,availableWidth:le,availableHeight:me})=>{const{width:xe,height:Te}=re.reference,Pe=ie.floating.style;Pe.setProperty("--radix-popper-available-width",`${le}px`),Pe.setProperty("--radix-popper-available-height",`${me}px`),Pe.setProperty("--radix-popper-anchor-width",`${xe}px`),Pe.setProperty("--radix-popper-anchor-height",`${Te}px`)}}),S&&Q2({element:S,padding:a}),a_({arrowWidth:z,arrowHeight:A}),p&&X2({strategy:"referenceHidden",...M})]}),[q,E]=jd(G),U=Qe(g);qe(()=>{Z&&U?.()},[Z,U]);const B=te.arrow?.x,j=te.arrow?.y,Y=te.arrow?.centerOffset!==0,[H,ce]=v.useState();return qe(()=>{x&&ce(window.getComputedStyle(x).zIndex)},[x]),f.jsx("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:Z?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[te.transformOrigin?.x,te.transformOrigin?.y].join(" "),...te.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(r_,{scope:n,placedSide:q,onArrowChange:C,arrowX:B,arrowY:j,shouldHideArrow:Y,children:f.jsx(Ce.div,{"data-side":q,"data-align":E,...m,ref:w,style:{...m.style,animation:Z?void 0:"none"}})})})});Ed.displayName=ks;var Nd="PopperArrow",i_={top:"bottom",right:"left",bottom:"top",left:"right"},Td=v.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=o_(Nd,r),s=i_[i.placedSide];return f.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:f.jsx(t_,{...o,ref:n,style:{...o.style,display:"block"}})})});Td.displayName=Nd;function s_(e){return e!==null}var a_=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=jd(n),h={start:"0%",center:"50%",end:"100%"}[u],p=(o.arrow?.x??0)+a/2,d=(o.arrow?.y??0)+l/2;let g="",m="";return c==="bottom"?(g=s?h:`${p}px`,m=`${-l}px`):c==="top"?(g=s?h:`${p}px`,m=`${r.floating.height+l}px`):c==="right"?(g=`${-l}px`,m=s?h:`${d}px`):c==="left"&&(g=`${r.floating.width+l}px`,m=s?h:`${d}px`),{data:{x:g,y:m}}}});function jd(e){const[t,n="center"]=e.split("-");return[t,n]}var zd=kd,Id=Cd,Ad=Ed,Rd=Td,Jo="rovingFocusGroup.onEntryFocus",l_={bubbles:!1,cancelable:!0},gr="RovingFocusGroup",[Ei,Pd,c_]=zu(gr),[u_,Od]=Bt(gr,[c_]),[d_,f_]=u_(gr),Dd=v.forwardRef((e,t)=>f.jsx(Ei.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Ei.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(h_,{...e,ref:t})})}));Dd.displayName=gr;var h_=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...h}=e,p=v.useRef(null),d=Re(t,p),g=ho(i),[m,y]=an({prop:s,defaultProp:a??null,onChange:l,caller:gr}),[x,b]=v.useState(!1),w=Qe(c),S=Pd(n),C=v.useRef(!1),[N,z]=v.useState(0);return v.useEffect(()=>{const A=p.current;if(A)return A.addEventListener(Jo,w),()=>A.removeEventListener(Jo,w)},[w]),f.jsx(d_,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:m,onItemFocus:v.useCallback(A=>y(A),[y]),onItemShiftTab:v.useCallback(()=>b(!0),[]),onFocusableItemAdd:v.useCallback(()=>z(A=>A+1),[]),onFocusableItemRemove:v.useCallback(()=>z(A=>A-1),[]),children:f.jsx(Ce.div,{tabIndex:x||N===0?-1:0,"data-orientation":r,...h,ref:d,style:{outline:"none",...e.style},onMouseDown:ve(e.onMouseDown,()=>{C.current=!0}),onFocus:ve(e.onFocus,A=>{const O=!C.current;if(A.target===A.currentTarget&&O&&!x){const P=new CustomEvent(Jo,l_);if(A.currentTarget.dispatchEvent(P),!P.defaultPrevented){const L=S().filter(G=>G.focusable),T=L.find(G=>G.active),M=L.find(G=>G.id===m),D=[T,M,...L].filter(Boolean).map(G=>G.ref.current);Fd(D,u)}}C.current=!1}),onBlur:ve(e.onBlur,()=>b(!1))})})}),Md="RovingFocusGroupItem",Ld=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:s,...a}=e,l=Tt(),c=i||l,u=f_(Md,n),h=u.currentTabStopId===c,p=Pd(n),{onFocusableItemAdd:d,onFocusableItemRemove:g,currentTabStopId:m}=u;return v.useEffect(()=>{if(r)return d(),()=>g()},[r,d,g]),f.jsx(Ei.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:f.jsx(Ce.span,{tabIndex:h?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:ve(e.onMouseDown,y=>{r?u.onItemFocus(c):y.preventDefault()}),onFocus:ve(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:ve(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const x=g_(y,u.orientation,u.dir);if(x!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=p().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const S=w.indexOf(y.currentTarget);w=u.loop?x_(w,S+1):w.slice(S+1)}setTimeout(()=>Fd(w))}}),children:typeof s=="function"?s({isCurrentTabStop:h,hasTabStop:m!=null}):s})})});Ld.displayName=Md;var p_={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function m_(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function g_(e,t,n){const r=m_(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return p_[r]}function Fd(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function x_(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var y_=Dd,b_=Ld;function Ni(e,[t,n]){return Math.min(n,Math.max(t,e))}function v_(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Ss="ScrollArea",[$d]=Bt(Ss),[w_,gt]=$d(Ss),Bd=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=v.useState(null),[c,u]=v.useState(null),[h,p]=v.useState(null),[d,g]=v.useState(null),[m,y]=v.useState(null),[x,b]=v.useState(0),[w,S]=v.useState(0),[C,N]=v.useState(!1),[z,A]=v.useState(!1),O=Re(t,L=>l(L)),P=ho(o);return f.jsx(w_,{scope:n,type:r,dir:P,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:h,onContentChange:p,scrollbarX:d,onScrollbarXChange:g,scrollbarXEnabled:C,onScrollbarXEnabledChange:N,scrollbarY:m,onScrollbarYChange:y,scrollbarYEnabled:z,onScrollbarYEnabledChange:A,onCornerWidthChange:b,onCornerHeightChange:S,children:f.jsx(Ce.div,{dir:P,...s,ref:O,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});Bd.displayName=Ss;var Ud="ScrollAreaViewport",Zd=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,s=gt(Ud,n),a=v.useRef(null),l=Re(t,a,s.onViewportChange);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),f.jsx(Ce.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:f.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Zd.displayName=Ud;var Rt="ScrollAreaScrollbar",Wd=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=gt(Rt,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return v.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?f.jsx(__,{...r,ref:t,forceMount:n}):o.type==="scroll"?f.jsx(k_,{...r,ref:t,forceMount:n}):o.type==="auto"?f.jsx(Vd,{...r,ref:t,forceMount:n}):o.type==="always"?f.jsx(Cs,{...r,ref:t}):null});Wd.displayName=Rt;var __=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=gt(Rt,e.__scopeScrollArea),[i,s]=v.useState(!1);return v.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),f.jsx(mt,{present:n||i,children:f.jsx(Vd,{"data-state":i?"visible":"hidden",...r,ref:t})})}),k_=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=gt(Rt,e.__scopeScrollArea),i=e.orientation==="horizontal",s=So(()=>l("SCROLL_END"),100),[a,l]=v_("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return v.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),v.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let h=c[u];const p=()=>{const d=c[u];h!==d&&(l("SCROLL"),s()),h=d};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[o.viewport,i,l,s]),f.jsx(mt,{present:n||a!=="hidden",children:f.jsx(Cs,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ve(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ve(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Vd=v.forwardRef((e,t)=>{const n=gt(Rt,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=v.useState(!1),a=e.orientation==="horizontal",l=So(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return Dn(n.viewport,l),Dn(n.content,l),f.jsx(mt,{present:r||i,children:f.jsx(Cs,{"data-state":i?"visible":"hidden",...o,ref:t})})}),Cs=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=gt(Rt,e.__scopeScrollArea),i=v.useRef(null),s=v.useRef(0),[a,l]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=Jd(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function h(p,d){return j_(p,s.current,a,d)}return n==="horizontal"?f.jsx(S_,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,d=il(p,a,o.dir);i.current.style.transform=`translate3d(${d}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=h(p,o.dir))}}):n==="vertical"?f.jsx(C_,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,d=il(p,a);i.current.style.transform=`translate3d(0, ${d}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=h(p))}}):null}),S_=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=gt(Rt,e.__scopeScrollArea),[s,a]=v.useState(),l=v.useRef(null),c=Re(t,l,i.onScrollbarXChange);return v.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),f.jsx(qd,{"data-orientation":"horizontal",...o,ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ko(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,h)=>{if(i.viewport){const p=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),Xd(p,h)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:eo(s.paddingLeft),paddingEnd:eo(s.paddingRight)}})}})}),C_=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=gt(Rt,e.__scopeScrollArea),[s,a]=v.useState(),l=v.useRef(null),c=Re(t,l,i.onScrollbarYChange);return v.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),f.jsx(qd,{"data-orientation":"vertical",...o,ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ko(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,h)=>{if(i.viewport){const p=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),Xd(p,h)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:eo(s.paddingTop),paddingEnd:eo(s.paddingBottom)}})}})}),[E_,Hd]=$d(Rt),qd=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:h,...p}=e,d=gt(Rt,n),[g,m]=v.useState(null),y=Re(t,O=>m(O)),x=v.useRef(null),b=v.useRef(""),w=d.viewport,S=r.content-r.viewport,C=Qe(u),N=Qe(l),z=So(h,10);function A(O){if(x.current){const P=O.clientX-x.current.left,L=O.clientY-x.current.top;c({x:P,y:L})}}return v.useEffect(()=>{const O=P=>{const L=P.target;g?.contains(L)&&C(P,S)};return document.addEventListener("wheel",O,{passive:!1}),()=>document.removeEventListener("wheel",O,{passive:!1})},[w,g,S,C]),v.useEffect(N,[r,N]),Dn(g,z),Dn(d.content,z),f.jsx(E_,{scope:n,scrollbar:g,hasThumb:o,onThumbChange:Qe(i),onThumbPointerUp:Qe(s),onThumbPositionChange:N,onThumbPointerDown:Qe(a),children:f.jsx(Ce.div,{...p,ref:y,style:{position:"absolute",...p.style},onPointerDown:ve(e.onPointerDown,O=>{O.button===0&&(O.target.setPointerCapture(O.pointerId),x.current=g.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",d.viewport&&(d.viewport.style.scrollBehavior="auto"),A(O))}),onPointerMove:ve(e.onPointerMove,A),onPointerUp:ve(e.onPointerUp,O=>{const P=O.target;P.hasPointerCapture(O.pointerId)&&P.releasePointerCapture(O.pointerId),document.body.style.webkitUserSelect=b.current,d.viewport&&(d.viewport.style.scrollBehavior=""),x.current=null})})})}),Qr="ScrollAreaThumb",Gd=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Hd(Qr,e.__scopeScrollArea);return f.jsx(mt,{present:n||o.hasThumb,children:f.jsx(N_,{ref:t,...r})})}),N_=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=gt(Qr,n),s=Hd(Qr,n),{onThumbPositionChange:a}=s,l=Re(t,h=>s.onThumbChange(h)),c=v.useRef(void 0),u=So(()=>{c.current&&(c.current(),c.current=void 0)},100);return v.useEffect(()=>{const h=i.viewport;if(h){const p=()=>{if(u(),!c.current){const d=z_(h,a);c.current=d,a()}};return a(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[i.viewport,u,a]),f.jsx(Ce.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ve(e.onPointerDownCapture,h=>{const d=h.target.getBoundingClientRect(),g=h.clientX-d.left,m=h.clientY-d.top;s.onThumbPointerDown({x:g,y:m})}),onPointerUp:ve(e.onPointerUp,s.onThumbPointerUp)})});Gd.displayName=Qr;var Es="ScrollAreaCorner",Kd=v.forwardRef((e,t)=>{const n=gt(Es,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?f.jsx(T_,{...e,ref:t}):null});Kd.displayName=Es;var T_=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=gt(Es,n),[i,s]=v.useState(0),[a,l]=v.useState(0),c=!!(i&&a);return Dn(o.scrollbarX,()=>{const u=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(u),l(u)}),Dn(o.scrollbarY,()=>{const u=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(u),s(u)}),c?f.jsx(Ce.div,{...r,ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function eo(e){return e?parseInt(e,10):0}function Jd(e,t){const n=e/t;return isNaN(n)?0:n}function ko(e){const t=Jd(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function j_(e,t,n,r="ltr"){const o=ko(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,h=r==="ltr"?[0,u]:[u*-1,0];return Yd([l,c],h)(e)}function il(e,t,n="ltr"){const r=ko(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=Ni(e,l);return Yd([0,s],[0,a])(c)}function Yd(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Xd(e,t){return e>0&&e<t}var z_=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&t(),n=i,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)};function So(e,t){const n=Qe(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Dn(e,t){const n=Qe(t);qe(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var I_=Bd,A_=Zd,R_=Kd,P_=[" ","Enter","ArrowUp","ArrowDown"],O_=[" ","Enter"],un="Select",[Co,Eo,D_]=zu(un),[Zn]=Bt(un,[D_,_o]),No=_o(),[M_,Qt]=Zn(un),[L_,F_]=Zn(un),Qd=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:h,disabled:p,required:d,form:g}=e,m=No(t),[y,x]=v.useState(null),[b,w]=v.useState(null),[S,C]=v.useState(!1),N=ho(c),[z,A]=an({prop:r,defaultProp:o??!1,onChange:i,caller:un}),[O,P]=an({prop:s,defaultProp:a,onChange:l,caller:un}),L=v.useRef(null),T=y?g||!!y.closest("form"):!0,[M,_]=v.useState(new Set),D=Array.from(M).map(G=>G.props.value).join(";");return f.jsx(zd,{...m,children:f.jsxs(M_,{required:d,scope:t,trigger:y,onTriggerChange:x,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Tt(),value:O,onValueChange:P,open:z,onOpenChange:A,dir:N,triggerPointerDownPosRef:L,disabled:p,children:[f.jsx(Co.Provider,{scope:t,children:f.jsx(L_,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(G=>{_(Z=>new Set(Z).add(G))},[]),onNativeOptionRemove:v.useCallback(G=>{_(Z=>{const te=new Set(Z);return te.delete(G),te})},[]),children:n})}),T?f.jsxs(_f,{"aria-hidden":!0,required:d,tabIndex:-1,name:u,autoComplete:h,value:O,onChange:G=>P(G.target.value),disabled:p,form:g,children:[O===void 0?f.jsx("option",{value:""}):null,Array.from(M)]},D):null]})})};Qd.displayName=un;var ef="SelectTrigger",tf=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=No(n),s=Qt(ef,n),a=s.disabled||r,l=Re(t,s.onTriggerChange),c=Eo(n),u=v.useRef("touch"),[h,p,d]=Sf(m=>{const y=c().filter(w=>!w.disabled),x=y.find(w=>w.value===s.value),b=Cf(y,m,x);b!==void 0&&s.onValueChange(b.value)}),g=m=>{a||(s.onOpenChange(!0),d()),m&&(s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return f.jsx(Id,{asChild:!0,...i,children:f.jsx(Ce.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":kf(s.value)?"":void 0,...o,ref:l,onClick:ve(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&g(m)}),onPointerDown:ve(o.onPointerDown,m=>{u.current=m.pointerType;const y=m.target;y.hasPointerCapture(m.pointerId)&&y.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(g(m),m.preventDefault())}),onKeyDown:ve(o.onKeyDown,m=>{const y=h.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(y&&m.key===" ")&&P_.includes(m.key)&&(g(),m.preventDefault())})})})});tf.displayName=ef;var nf="SelectValue",rf=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Qt(nf,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,h=Re(t,l.onValueNodeChange);return qe(()=>{c(u)},[c,u]),f.jsx(Ce.span,{...a,ref:h,style:{pointerEvents:"none"},children:kf(l.value)?f.jsx(f.Fragment,{children:s}):i})});rf.displayName=nf;var $_="SelectIcon",of=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return f.jsx(Ce.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});of.displayName=$_;var B_="SelectPortal",sf=e=>f.jsx(mo,{asChild:!0,...e});sf.displayName=B_;var dn="SelectContent",af=v.forwardRef((e,t)=>{const n=Qt(dn,e.__scopeSelect),[r,o]=v.useState();if(qe(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?dr.createPortal(f.jsx(lf,{scope:e.__scopeSelect,children:f.jsx(Co.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),i):null}return f.jsx(cf,{...e,ref:t})});af.displayName=dn;var yt=10,[lf,en]=Zn(dn),U_="SelectContentImpl",Z_=Pn("SelectContent.RemoveScroll"),cf=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:d,sticky:g,hideWhenDetached:m,avoidCollisions:y,...x}=e,b=Qt(dn,n),[w,S]=v.useState(null),[C,N]=v.useState(null),z=Re(t,ie=>S(ie)),[A,O]=v.useState(null),[P,L]=v.useState(null),T=Eo(n),[M,_]=v.useState(!1),D=v.useRef(!1);v.useEffect(()=>{if(w)return qu(w)},[w]),Lu();const G=v.useCallback(ie=>{const[re,...le]=T().map(Te=>Te.ref.current),[me]=le.slice(-1),xe=document.activeElement;for(const Te of ie)if(Te===xe||(Te?.scrollIntoView({block:"nearest"}),Te===re&&C&&(C.scrollTop=0),Te===me&&C&&(C.scrollTop=C.scrollHeight),Te?.focus(),document.activeElement!==xe))return},[T,C]),Z=v.useCallback(()=>G([A,w]),[G,A,w]);v.useEffect(()=>{M&&Z()},[M,Z]);const{onOpenChange:te,triggerPointerDownPosRef:q}=b;v.useEffect(()=>{if(w){let ie={x:0,y:0};const re=me=>{ie={x:Math.abs(Math.round(me.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(me.pageY)-(q.current?.y??0))}},le=me=>{ie.x<=10&&ie.y<=10?me.preventDefault():w.contains(me.target)||te(!1),document.removeEventListener("pointermove",re),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",le,{capture:!0})}}},[w,te,q]),v.useEffect(()=>{const ie=()=>te(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[te]);const[E,U]=Sf(ie=>{const re=T().filter(xe=>!xe.disabled),le=re.find(xe=>xe.ref.current===document.activeElement),me=Cf(re,ie,le);me&&setTimeout(()=>me.ref.current.focus())}),B=v.useCallback((ie,re,le)=>{const me=!D.current&&!le;(b.value!==void 0&&b.value===re||me)&&(O(ie),me&&(D.current=!0))},[b.value]),j=v.useCallback(()=>w?.focus(),[w]),Y=v.useCallback((ie,re,le)=>{const me=!D.current&&!le;(b.value!==void 0&&b.value===re||me)&&L(ie)},[b.value]),H=r==="popper"?Ti:uf,ce=H===Ti?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:d,sticky:g,hideWhenDetached:m,avoidCollisions:y}:{};return f.jsx(lf,{scope:n,content:w,viewport:C,onViewportChange:N,itemRefCallback:B,selectedItem:A,onItemLeave:j,itemTextRefCallback:Y,focusSelectedItem:Z,selectedItemText:P,position:r,isPositioned:M,searchRef:E,children:f.jsx(fs,{as:Z_,allowPinchZoom:!0,children:f.jsx(ds,{asChild:!0,trapped:b.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:ve(o,ie=>{b.trigger?.focus({preventScroll:!0}),ie.preventDefault()}),children:f.jsx(po,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:f.jsx(H,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:ie=>ie.preventDefault(),...x,...ce,onPlaced:()=>_(!0),ref:z,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:ve(x.onKeyDown,ie=>{const re=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!re&&ie.key.length===1&&U(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let me=T().filter(xe=>!xe.disabled).map(xe=>xe.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(me=me.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const xe=ie.target,Te=me.indexOf(xe);me=me.slice(Te+1)}setTimeout(()=>G(me)),ie.preventDefault()}})})})})})})});cf.displayName=U_;var W_="SelectItemAlignedPosition",uf=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Qt(dn,n),s=en(dn,n),[a,l]=v.useState(null),[c,u]=v.useState(null),h=Re(t,z=>u(z)),p=Eo(n),d=v.useRef(!1),g=v.useRef(!0),{viewport:m,selectedItem:y,selectedItemText:x,focusSelectedItem:b}=s,w=v.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&m&&y&&x){const z=i.trigger.getBoundingClientRect(),A=c.getBoundingClientRect(),O=i.valueNode.getBoundingClientRect(),P=x.getBoundingClientRect();if(i.dir!=="rtl"){const xe=P.left-A.left,Te=O.left-xe,Pe=z.left-Te,k=z.width+Pe,J=Math.max(k,A.width),V=window.innerWidth-yt,R=Ni(Te,[yt,Math.max(yt,V-J)]);a.style.minWidth=k+"px",a.style.left=R+"px"}else{const xe=A.right-P.right,Te=window.innerWidth-O.right-xe,Pe=window.innerWidth-z.right-Te,k=z.width+Pe,J=Math.max(k,A.width),V=window.innerWidth-yt,R=Ni(Te,[yt,Math.max(yt,V-J)]);a.style.minWidth=k+"px",a.style.right=R+"px"}const L=p(),T=window.innerHeight-yt*2,M=m.scrollHeight,_=window.getComputedStyle(c),D=parseInt(_.borderTopWidth,10),G=parseInt(_.paddingTop,10),Z=parseInt(_.borderBottomWidth,10),te=parseInt(_.paddingBottom,10),q=D+G+M+te+Z,E=Math.min(y.offsetHeight*5,q),U=window.getComputedStyle(m),B=parseInt(U.paddingTop,10),j=parseInt(U.paddingBottom,10),Y=z.top+z.height/2-yt,H=T-Y,ce=y.offsetHeight/2,ie=y.offsetTop+ce,re=D+G+ie,le=q-re;if(re<=Y){const xe=L.length>0&&y===L[L.length-1].ref.current;a.style.bottom="0px";const Te=c.clientHeight-m.offsetTop-m.offsetHeight,Pe=Math.max(H,ce+(xe?j:0)+Te+Z),k=re+Pe;a.style.height=k+"px"}else{const xe=L.length>0&&y===L[0].ref.current;a.style.top="0px";const Pe=Math.max(Y,D+m.offsetTop+(xe?B:0)+ce)+le;a.style.height=Pe+"px",m.scrollTop=re-Y+m.offsetTop}a.style.margin=`${yt}px 0`,a.style.minHeight=E+"px",a.style.maxHeight=T+"px",r?.(),requestAnimationFrame(()=>d.current=!0)}},[p,i.trigger,i.valueNode,a,c,m,y,x,i.dir,r]);qe(()=>w(),[w]);const[S,C]=v.useState();qe(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const N=v.useCallback(z=>{z&&g.current===!0&&(w(),b?.(),g.current=!1)},[w,b]);return f.jsx(H_,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:d,onScrollButtonChange:N,children:f.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:f.jsx(Ce.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});uf.displayName=W_;var V_="SelectPopperPosition",Ti=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=yt,...i}=e,s=No(n);return f.jsx(Ad,{...s,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Ti.displayName=V_;var[H_,Ns]=Zn(dn,{}),ji="SelectViewport",df=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=en(ji,n),s=Ns(ji,n),a=Re(t,i.onViewportChange),l=v.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),f.jsx(Co.Slot,{scope:n,children:f.jsx(Ce.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ve(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:p}=s;if(p?.current&&h){const d=Math.abs(l.current-u.scrollTop);if(d>0){const g=window.innerHeight-yt*2,m=parseFloat(h.style.minHeight),y=parseFloat(h.style.height),x=Math.max(m,y);if(x<g){const b=x+d,w=Math.min(g,b),S=b-w;h.style.height=w+"px",h.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,h.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});df.displayName=ji;var ff="SelectGroup",[q_,G_]=Zn(ff),K_=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Tt();return f.jsx(q_,{scope:n,id:o,children:f.jsx(Ce.div,{role:"group","aria-labelledby":o,...r,ref:t})})});K_.displayName=ff;var hf="SelectLabel",J_=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=G_(hf,n);return f.jsx(Ce.div,{id:o.id,...r,ref:t})});J_.displayName=hf;var to="SelectItem",[Y_,pf]=Zn(to),mf=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Qt(to,n),l=en(to,n),c=a.value===r,[u,h]=v.useState(i??""),[p,d]=v.useState(!1),g=Re(t,b=>l.itemRefCallback?.(b,r,o)),m=Tt(),y=v.useRef("touch"),x=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return f.jsx(Y_,{scope:n,value:r,disabled:o,textId:m,isSelected:c,onItemTextChange:v.useCallback(b=>{h(w=>w||(b?.textContent??"").trim())},[]),children:f.jsx(Co.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:f.jsx(Ce.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:g,onFocus:ve(s.onFocus,()=>d(!0)),onBlur:ve(s.onBlur,()=>d(!1)),onClick:ve(s.onClick,()=>{y.current!=="mouse"&&x()}),onPointerUp:ve(s.onPointerUp,()=>{y.current==="mouse"&&x()}),onPointerDown:ve(s.onPointerDown,b=>{y.current=b.pointerType}),onPointerMove:ve(s.onPointerMove,b=>{y.current=b.pointerType,o?l.onItemLeave?.():y.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ve(s.onPointerLeave,b=>{b.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:ve(s.onKeyDown,b=>{l.searchRef?.current!==""&&b.key===" "||(O_.includes(b.key)&&x(),b.key===" "&&b.preventDefault())})})})})});mf.displayName=to;var tr="SelectItemText",gf=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Qt(tr,n),a=en(tr,n),l=pf(tr,n),c=F_(tr,n),[u,h]=v.useState(null),p=Re(t,x=>h(x),l.onItemTextChange,x=>a.itemTextRefCallback?.(x,l.value,l.disabled)),d=u?.textContent,g=v.useMemo(()=>f.jsx("option",{value:l.value,disabled:l.disabled,children:d},l.value),[l.disabled,l.value,d]),{onNativeOptionAdd:m,onNativeOptionRemove:y}=c;return qe(()=>(m(g),()=>y(g)),[m,y,g]),f.jsxs(f.Fragment,{children:[f.jsx(Ce.span,{id:l.textId,...i,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?dr.createPortal(i.children,s.valueNode):null]})});gf.displayName=tr;var xf="SelectItemIndicator",yf=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return pf(xf,n).isSelected?f.jsx(Ce.span,{"aria-hidden":!0,...r,ref:t}):null});yf.displayName=xf;var zi="SelectScrollUpButton",bf=v.forwardRef((e,t)=>{const n=en(zi,e.__scopeSelect),r=Ns(zi,e.__scopeSelect),[o,i]=v.useState(!1),s=Re(t,r.onScrollButtonChange);return qe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?f.jsx(wf,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});bf.displayName=zi;var Ii="SelectScrollDownButton",vf=v.forwardRef((e,t)=>{const n=en(Ii,e.__scopeSelect),r=Ns(Ii,e.__scopeSelect),[o,i]=v.useState(!1),s=Re(t,r.onScrollButtonChange);return qe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?f.jsx(wf,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});vf.displayName=Ii;var wf=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=en("SelectScrollButton",n),s=v.useRef(null),a=Eo(n),l=v.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return v.useEffect(()=>()=>l(),[l]),qe(()=>{a().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),f.jsx(Ce.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ve(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:ve(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:ve(o.onPointerLeave,()=>{l()})})}),X_="SelectSeparator",Q_=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(Ce.div,{"aria-hidden":!0,...r,ref:t})});Q_.displayName=X_;var Ai="SelectArrow",ek=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=No(n),i=Qt(Ai,n),s=en(Ai,n);return i.open&&s.position==="popper"?f.jsx(Rd,{...o,...r,ref:t}):null});ek.displayName=Ai;var tk="SelectBubbleInput",_f=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=v.useRef(null),i=Re(r,o),s=Gw(t);return v.useEffect(()=>{const a=o.current;if(!a)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&u){const h=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(h)}},[s,t]),f.jsx(Ce.select,{...n,style:{...Tu,...n.style},ref:i,defaultValue:t})});_f.displayName=tk;function kf(e){return e===""||e===void 0}function Sf(e){const t=Qe(e),n=v.useRef(""),r=v.useRef(0),o=v.useCallback(s=>{const a=n.current+s;t(a),(function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))})(a)},[t]),i=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Cf(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=nk(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function nk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var rk=Qd,ok=tf,ik=rf,sk=of,ak=sf,lk=af,ck=df,uk=mf,dk=gf,fk=yf,hk=bf,pk=vf,mk="Separator",sl="horizontal",gk=["horizontal","vertical"],Ef=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=sl,...o}=e,i=xk(r)?r:sl,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return f.jsx(Ce.div,{"data-orientation":i,...a,...o,ref:t})});Ef.displayName=mk;function xk(e){return gk.includes(e)}var yk=Ef,To="Tabs",[bk]=Bt(To,[Od]),Nf=Od(),[vk,Ts]=bk(To),Tf=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=ho(a),[h,p]=an({prop:r,onChange:o,defaultProp:i??"",caller:To});return f.jsx(vk,{scope:n,baseId:Tt(),value:h,onValueChange:p,orientation:s,dir:u,activationMode:l,children:f.jsx(Ce.div,{dir:u,"data-orientation":s,...c,ref:t})})});Tf.displayName=To;var jf="TabsList",zf=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Ts(jf,n),s=Nf(n);return f.jsx(y_,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:f.jsx(Ce.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});zf.displayName=jf;var If="TabsTrigger",Af=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=Ts(If,n),a=Nf(n),l=Of(s.baseId,r),c=Df(s.baseId,r),u=r===s.value;return f.jsx(b_,{asChild:!0,...a,focusable:!o,active:u,children:f.jsx(Ce.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:ve(e.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:ve(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:ve(e.onFocus,()=>{const h=s.activationMode!=="manual";!u&&!o&&h&&s.onValueChange(r)})})})});Af.displayName=If;var Rf="TabsContent",Pf=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=Ts(Rf,n),l=Of(a.baseId,r),c=Df(a.baseId,r),u=r===a.value,h=v.useRef(u);return v.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),f.jsx(mt,{present:o||u,children:({present:p})=>f.jsx(Ce.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:p&&i})})});Pf.displayName=Rf;function Of(e,t){return`${e}-trigger-${t}`}function Df(e,t){return`${e}-content-${t}`}var wk=Tf,_k=zf,kk=Af,Sk=Pf,[jo]=Bt("Tooltip",[_o]),zo=_o(),Mf="TooltipProvider",Ck=700,Ri="tooltip.open",[Ek,js]=jo(Mf),Lf=e=>{const{__scopeTooltip:t,delayDuration:n=Ck,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=v.useRef(!0),a=v.useRef(!1),l=v.useRef(0);return v.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),f.jsx(Ek,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:v.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:i})};Lf.displayName=Mf;var lr="Tooltip",[Nk,xr]=jo(lr),Ff=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=js(lr,e.__scopeTooltip),c=zo(t),[u,h]=v.useState(null),p=Tt(),d=v.useRef(0),g=s??l.disableHoverableContent,m=a??l.delayDuration,y=v.useRef(!1),[x,b]=an({prop:r,defaultProp:o??!1,onChange:z=>{z?(l.onOpen(),document.dispatchEvent(new CustomEvent(Ri))):l.onClose(),i?.(z)},caller:lr}),w=v.useMemo(()=>x?y.current?"delayed-open":"instant-open":"closed",[x]),S=v.useCallback(()=>{window.clearTimeout(d.current),d.current=0,y.current=!1,b(!0)},[b]),C=v.useCallback(()=>{window.clearTimeout(d.current),d.current=0,b(!1)},[b]),N=v.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>{y.current=!0,b(!0),d.current=0},m)},[m,b]);return v.useEffect(()=>()=>{d.current&&(window.clearTimeout(d.current),d.current=0)},[]),f.jsx(zd,{...c,children:f.jsx(Nk,{scope:t,contentId:p,open:x,stateAttribute:w,trigger:u,onTriggerChange:h,onTriggerEnter:v.useCallback(()=>{l.isOpenDelayedRef.current?N():S()},[l.isOpenDelayedRef,N,S]),onTriggerLeave:v.useCallback(()=>{g?C():(window.clearTimeout(d.current),d.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})};Ff.displayName=lr;var Pi="TooltipTrigger",$f=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=xr(Pi,n),i=js(Pi,n),s=zo(n),a=v.useRef(null),l=Re(t,a,o.onTriggerChange),c=v.useRef(!1),u=v.useRef(!1),h=v.useCallback(()=>c.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),f.jsx(Id,{asChild:!0,...s,children:f.jsx(Ce.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:ve(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:ve(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:ve(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:ve(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:ve(e.onBlur,o.onClose),onClick:ve(e.onClick,o.onClose)})})});$f.displayName=Pi;var zs="TooltipPortal",[Tk,jk]=jo(zs,{forceMount:void 0}),Bf=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=xr(zs,t);return f.jsx(Tk,{scope:t,forceMount:n,children:f.jsx(mt,{present:n||i.open,children:f.jsx(mo,{asChild:!0,container:o,children:r})})})};Bf.displayName=zs;var Mn="TooltipContent",Uf=v.forwardRef((e,t)=>{const n=jk(Mn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=xr(Mn,e.__scopeTooltip);return f.jsx(mt,{present:r||s.open,children:s.disableHoverableContent?f.jsx(Zf,{side:o,...i,ref:t}):f.jsx(zk,{side:o,...i,ref:t})})}),zk=v.forwardRef((e,t)=>{const n=xr(Mn,e.__scopeTooltip),r=js(Mn,e.__scopeTooltip),o=v.useRef(null),i=Re(t,o),[s,a]=v.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:h}=r,p=v.useCallback(()=>{a(null),h(!1)},[h]),d=v.useCallback((g,m)=>{const y=g.currentTarget,x={x:g.clientX,y:g.clientY},b=Pk(x,y.getBoundingClientRect()),w=Ok(x,b),S=Dk(m.getBoundingClientRect()),C=Lk([...w,...S]);a(C),h(!0)},[h]);return v.useEffect(()=>()=>p(),[p]),v.useEffect(()=>{if(l&&u){const g=y=>d(y,u),m=y=>d(y,l);return l.addEventListener("pointerleave",g),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",g),u.removeEventListener("pointerleave",m)}}},[l,u,d,p]),v.useEffect(()=>{if(s){const g=m=>{const y=m.target,x={x:m.clientX,y:m.clientY},b=l?.contains(y)||u?.contains(y),w=!Mk(x,s);b?p():w&&(p(),c())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,u,s,c,p]),f.jsx(Zf,{...e,ref:i})}),[Ik,Ak]=jo(lr,{isInside:!1}),Rk=a1("TooltipContent"),Zf=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=xr(Mn,n),c=zo(n),{onClose:u}=l;return v.useEffect(()=>(document.addEventListener(Ri,u),()=>document.removeEventListener(Ri,u)),[u]),v.useEffect(()=>{if(l.trigger){const h=p=>{p.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,u]),f.jsx(po,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:u,children:f.jsxs(Ad,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.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:[f.jsx(Rk,{children:r}),f.jsx(Ik,{scope:n,isInside:!0,children:f.jsx(p1,{id:l.contentId,role:"tooltip",children:o||r})})]})})});Uf.displayName=Mn;var Wf="TooltipArrow",Vf=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=zo(n);return Ak(Wf,n).isInside?null:f.jsx(Rd,{...o,...r,ref:t})});Vf.displayName=Wf;function Pk(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ok(e,t,n=5){const 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});break}return r}function Dk(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Mk(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],l=t[s],c=a.x,u=a.y,h=l.x,p=l.y;u>r!=p>r&&n<(h-c)*(r-u)/(p-u)+c&&(o=!o)}return o}function Lk(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Fk(t)}function Fk(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}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)}var $k=Lf,Bk=Ff,Uk=$f,Zk=Bf,Wk=Uf,Vk=Vf;const Hk=as("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function lt({className:e,variant:t="default",asChild:n=!1,...r}){const o=n?i1:"span";return f.jsx(o,{"data-slot":"badge","data-variant":t,className:Se(Hk({variant:t}),e),...r})}const qk={anthropic:"Anthropic",openai:"OpenAI",unknown:"Unknown"};function al(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Gk({conversationId:e,startTime:t,endTime:n,totalCalls:r,totalInputTokens:o,totalOutputTokens:i,apiFormat:s,expanded:a,onToggle:l,hideApiFormat:c=!1}){return f.jsxs("div",{role:"button",tabIndex:0,className:Se("flex items-center gap-3 px-3 py-2 cursor-pointer transition-colors","hover:bg-muted/50","select-none","border border-border rounded-lg mb-2 bg-muted/30"),onClick:l,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),l())},children:[a?f.jsx(zt,{className:"size-4 text-muted-foreground shrink-0"}):f.jsx(Ht,{className:"size-4 text-muted-foreground shrink-0"}),f.jsx("span",{className:"text-purple-400/90 font-mono text-xs font-semibold shrink-0",title:e,children:e.length>24?e.slice(0,12)+"…"+e.slice(-12):e}),!c&&f.jsx(lt,{variant:"outline",className:Se("text-[10px] px-1.5 py-0 h-5 font-mono shrink-0",s==="openai"&&"border-blue-500/40 text-blue-400",s==="anthropic"&&"border-orange-500/40 text-orange-400",s==="unknown"&&"border-muted text-muted-foreground"),children:qk[s]}),f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[f.jsx(os,{className:"size-3"}),f.jsxs("span",{className:"font-mono tabular-nums",children:[al(t)," - ",al(n)]})]}),f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[f.jsx(su,{className:"size-3"}),f.jsxs("span",{className:"font-mono tabular-nums",children:[r," call",r!==1?"s":""]})]}),f.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[f.jsx(pr,{className:"size-3 text-muted-foreground"}),f.jsxs("span",{className:"font-mono tabular-nums",children:[f.jsx("span",{className:"text-blue-400",children:Je(o)})," / ",f.jsx("span",{className:"text-amber-400",children:Je(i)})]})]}),f.jsx("span",{className:"flex-1 min-w-0"})]})}function Kk(e){const t=e.find(n=>n.apiFormat!=="unknown");return t!==void 0?t.apiFormat:e[0]?.apiFormat??"unknown"}function Jk(e){let t=!1,n=!1;for(const r of e)if(r.apiFormat==="anthropic"?t=!0:r.apiFormat==="openai"&&(n=!0),t&&n)return!0;return!1}function Yk(e){if(e.sessionId!==null&&e.sessionId!=="")return e.sessionId;const t=e.clientPid!==null?`PID:${e.clientPid}`:"unknown",n=e.clientProjectFolder!==null?e.clientProjectFolder:"no-folder";return`${t}|${n}`}function Xk(e){const t=new Map;for(const r of e){const o=Yk(r),i=t.get(o);i!==void 0?i.push(r):t.set(o,[r])}const n=[];for(const[r,o]of t){const i=[...o].sort((s,a)=>s.timestamp.localeCompare(a.timestamp));n.push({id:r,conversationId:r,logs:i})}return n.sort((r,o)=>(r.logs[0]?.timestamp??"").localeCompare(o.logs[0]?.timestamp??"")),n}const Qk="x-anthropic-billing-header:";function eS(e){return e.trimStart().toLowerCase().startsWith(Qk)}function ll(e,t){return Object.getOwnPropertyDescriptor(e,t)?.value}function tS(e){return typeof e!="object"||e===null||Array.isArray(e)?!1:Object.prototype.hasOwnProperty.call(e,"system")}function nS(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;const t=ll(e,"type"),n=ll(e,"text");return typeof t!="string"||t!=="text"||typeof n!="string"?!1:eS(n)}function rS(e){let t;try{t=JSON.parse(e)}catch{return{body:e,removed:0}}if(!tS(t))return{body:e,removed:0};const n=t.system;if(!Array.isArray(n)||n.length===0)return{body:e,removed:0};const r=[];let o=0;for(const i of n){if(nS(i)){o+=1;continue}r.push(i)}return o===0?{body:e,removed:0}:(r.length===0?delete t.system:t.system=r,{body:JSON.stringify(t),removed:o})}const oS=as("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function ft({className:e,variant:t,size:n,...r}){return f.jsx("button",{"data-slot":"button",className:Se(oS({variant:t,size:n,className:e})),...r})}function iS(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const sS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,aS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lS={};function cl(e,t){return(lS.jsx?aS:sS).test(e)}const cS=/[ \t\n\f\r]/g;function uS(e){return typeof e=="object"?e.type==="text"?ul(e.value):!1:ul(e)}function ul(e){return e.replace(cS,"")===""}class yr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}yr.prototype.normal={};yr.prototype.property={};yr.prototype.space=void 0;function Hf(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new yr(n,r,t)}function Oi(e){return e.toLowerCase()}class ot{constructor(t,n){this.attribute=n,this.property=t}}ot.prototype.attribute="";ot.prototype.booleanish=!1;ot.prototype.boolean=!1;ot.prototype.commaOrSpaceSeparated=!1;ot.prototype.commaSeparated=!1;ot.prototype.defined=!1;ot.prototype.mustUseProperty=!1;ot.prototype.number=!1;ot.prototype.overloadedBoolean=!1;ot.prototype.property="";ot.prototype.spaceSeparated=!1;ot.prototype.space=void 0;let dS=0;const ke=mn(),Ve=mn(),Di=mn(),oe=mn(),Oe=mn(),on=mn(),st=mn();function mn(){return 2**++dS}const Mi=Object.freeze(Object.defineProperty({__proto__:null,boolean:ke,booleanish:Ve,commaOrSpaceSeparated:st,commaSeparated:on,number:oe,overloadedBoolean:Di,spaceSeparated:Oe},Symbol.toStringTag,{value:"Module"})),Yo=Object.keys(Mi);class Is extends ot{constructor(t,n,r,o){let i=-1;if(super(t,n),dl(this,"space",o),typeof r=="number")for(;++i<Yo.length;){const s=Yo[i];dl(this,Yo[i],(r&Mi[s])===Mi[s])}}}Is.prototype.defined=!0;function dl(e,t,n){n&&(e[t]=n)}function Wn(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new Is(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Oi(r)]=r,n[Oi(i.attribute)]=r}return new yr(t,n,e.space)}const qf=Wn({properties:{ariaActiveDescendant:null,ariaAtomic:Ve,ariaAutoComplete:null,ariaBusy:Ve,ariaChecked:Ve,ariaColCount:oe,ariaColIndex:oe,ariaColSpan:oe,ariaControls:Oe,ariaCurrent:null,ariaDescribedBy:Oe,ariaDetails:null,ariaDisabled:Ve,ariaDropEffect:Oe,ariaErrorMessage:null,ariaExpanded:Ve,ariaFlowTo:Oe,ariaGrabbed:Ve,ariaHasPopup:null,ariaHidden:Ve,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Oe,ariaLevel:oe,ariaLive:null,ariaModal:Ve,ariaMultiLine:Ve,ariaMultiSelectable:Ve,ariaOrientation:null,ariaOwns:Oe,ariaPlaceholder:null,ariaPosInSet:oe,ariaPressed:Ve,ariaReadOnly:Ve,ariaRelevant:null,ariaRequired:Ve,ariaRoleDescription:Oe,ariaRowCount:oe,ariaRowIndex:oe,ariaRowSpan:oe,ariaSelected:Ve,ariaSetSize:oe,ariaSort:null,ariaValueMax:oe,ariaValueMin:oe,ariaValueNow:oe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Gf(e,t){return t in e?e[t]:t}function Kf(e,t){return Gf(e,t.toLowerCase())}const fS=Wn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:on,acceptCharset:Oe,accessKey:Oe,action:null,allow:null,allowFullScreen:ke,allowPaymentRequest:ke,allowUserMedia:ke,alpha:ke,alt:null,as:null,async:ke,autoCapitalize:null,autoComplete:Oe,autoFocus:ke,autoPlay:ke,blocking:Oe,capture:null,charSet:null,checked:ke,cite:null,className:Oe,closedBy:null,colorSpace:null,cols:oe,colSpan:oe,command:null,commandFor:null,content:null,contentEditable:Ve,controls:ke,controlsList:Oe,coords:oe|on,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ke,defer:ke,dir:null,dirName:null,disabled:ke,download:Di,draggable:Ve,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ke,formTarget:null,headers:Oe,height:oe,hidden:Di,high:oe,href:null,hrefLang:null,htmlFor:Oe,httpEquiv:Oe,id:null,imageSizes:null,imageSrcSet:null,inert:ke,inputMode:null,integrity:null,is:null,isMap:ke,itemId:null,itemProp:Oe,itemRef:Oe,itemScope:ke,itemType:Oe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ke,low:oe,manifest:null,max:null,maxLength:oe,media:null,method:null,min:null,minLength:oe,multiple:ke,muted:ke,name:null,nonce:null,noModule:ke,noValidate:ke,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ke,optimum:oe,pattern:null,ping:Oe,placeholder:null,playsInline:ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ke,referrerPolicy:null,rel:Oe,required:ke,reversed:ke,rows:oe,rowSpan:oe,sandbox:Oe,scope:null,scoped:ke,seamless:ke,selected:ke,shadowRootClonable:ke,shadowRootCustomElementRegistry:ke,shadowRootDelegatesFocus:ke,shadowRootMode:null,shadowRootSerializable:ke,shape:null,size:oe,sizes:null,slot:null,span:oe,spellCheck:Ve,src:null,srcDoc:null,srcLang:null,srcSet:null,start:oe,step:null,style:null,tabIndex:oe,target:null,title:null,translate:null,type:null,typeMustMatch:ke,useMap:null,value:Ve,width:oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Oe,axis:null,background:null,bgColor:null,border:oe,borderColor:null,bottomMargin:oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ke,declare:ke,event:null,face:null,frame:null,frameBorder:null,hSpace:oe,leftMargin:oe,link:null,longDesc:null,lowSrc:null,marginHeight:oe,marginWidth:oe,noResize:ke,noHref:ke,noShade:ke,noWrap:ke,object:null,profile:null,prompt:null,rev:null,rightMargin:oe,rules:null,scheme:null,scrolling:Ve,standby:null,summary:null,text:null,topMargin:oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:oe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ke,disablePictureInPicture:ke,disableRemotePlayback:ke,exportParts:on,part:Oe,prefix:null,property:null,results:oe,security:null,unselectable:null},space:"html",transform:Kf}),hS=Wn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:st,accentHeight:oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:oe,amplitude:oe,arabicForm:null,ascent:oe,attributeName:null,attributeType:null,azimuth:oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:oe,by:null,calcMode:null,capHeight:oe,className:Oe,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:oe,diffuseConstant:oe,direction:null,display:null,dur:null,divisor:oe,dominantBaseline:null,download:ke,dx:null,dy:null,edgeMode:null,editable:null,elevation:oe,enableBackground:null,end:null,event:null,exponent:oe,externalResourcesRequired:null,fill:null,fillOpacity:oe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:on,g2:on,glyphName:on,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:oe,horizOriginX:oe,horizOriginY:oe,id:null,ideographic:oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:oe,k:oe,k1:oe,k2:oe,k3:oe,k4:oe,kernelMatrix:st,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:oe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:oe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:oe,overlineThickness:oe,paintOrder:null,panose1:null,path:null,pathLength:oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Oe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:oe,pointsAtY:oe,pointsAtZ:oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:st,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:st,rev:st,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:st,requiredFeatures:st,requiredFonts:st,requiredFormats:st,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:oe,specularExponent:oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:oe,strikethroughThickness:oe,string:null,stroke:null,strokeDashArray:st,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:oe,strokeOpacity:oe,strokeWidth:null,style:null,surfaceScale:oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:st,tabIndex:oe,tableValues:null,target:null,targetX:oe,targetY:oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:st,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:oe,underlineThickness:oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:oe,values:null,vAlphabetic:oe,vMathematical:oe,vectorEffect:null,vHanging:oe,vIdeographic:oe,version:null,vertAdvY:oe,vertOriginX:oe,vertOriginY:oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Gf}),Jf=Wn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Yf=Wn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Kf}),Xf=Wn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),pS={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},mS=/[A-Z]/g,fl=/-[a-z]/g,gS=/^data[-\w.:]+$/i;function xS(e,t){const n=Oi(t);let r=t,o=ot;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&gS.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(fl,bS);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!fl.test(i)){let s=i.replace(mS,yS);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=Is}return new o(r,t)}function yS(e){return"-"+e.toLowerCase()}function bS(e){return e.charAt(1).toUpperCase()}const vS=Hf([qf,fS,Jf,Yf,Xf],"html"),As=Hf([qf,hS,Jf,Yf,Xf],"svg");function wS(e){return e.join(" ").trim()}var wn={},Xo,hl;function _S(){if(hl)return Xo;hl=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
110
+ `,c="/",u="*",h="",p="comment",d="declaration";function g(y,x){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];x=x||{};var b=1,w=1;function S(_){var D=_.match(t);D&&(b+=D.length);var G=_.lastIndexOf(l);w=~G?_.length-G:w+_.length}function C(){var _={line:b,column:w};return function(D){return D.position=new N(_),O(),D}}function N(_){this.start=_,this.end={line:b,column:w},this.source=x.source}N.prototype.content=y;function z(_){var D=new Error(x.source+":"+b+":"+w+": "+_);if(D.reason=_,D.filename=x.source,D.line=b,D.column=w,D.source=y,!x.silent)throw D}function A(_){var D=_.exec(y);if(D){var G=D[0];return S(G),y=y.slice(G.length),D}}function O(){A(n)}function P(_){var D;for(_=_||[];D=L();)D!==!1&&_.push(D);return _}function L(){var _=C();if(!(c!=y.charAt(0)||u!=y.charAt(1))){for(var D=2;h!=y.charAt(D)&&(u!=y.charAt(D)||c!=y.charAt(D+1));)++D;if(D+=2,h===y.charAt(D-1))return z("End of comment missing");var G=y.slice(2,D-2);return w+=2,S(G),y=y.slice(D),w+=2,_({type:p,comment:G})}}function T(){var _=C(),D=A(r);if(D){if(L(),!A(o))return z("property missing ':'");var G=A(i),Z=_({type:d,property:m(D[0].replace(e,h)),value:G?m(G[0].replace(e,h)):h});return A(s),Z}}function M(){var _=[];P(_);for(var D;D=T();)D!==!1&&(_.push(D),P(_));return _}return O(),M()}function m(y){return y?y.replace(a,h):h}return Xo=g,Xo}var pl;function kS(){if(pl)return wn;pl=1;var e=wn&&wn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wn,"__esModule",{value:!0}),wn.default=n;const t=e(_S());function n(r,o){let i=null;if(!r||typeof r!="string")return i;const s=(0,t.default)(r),a=typeof o=="function";return s.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:u}=l;a?o(c,u,l):u&&(i=i||{},i[c]=u)}),i}return wn}var Kn={},ml;function SS(){if(ml)return Kn;ml=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(c){return!c||n.test(c)||e.test(c)},s=function(c,u){return u.toUpperCase()},a=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),i(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(o,a):c=c.replace(r,a),c.replace(t,s))};return Kn.camelCase=l,Kn}var Jn,gl;function CS(){if(gl)return Jn;gl=1;var e=Jn&&Jn.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(kS()),n=SS();function r(o,i){var s={};return!o||typeof o!="string"||(0,t.default)(o,function(a,l){a&&l&&(s[(0,n.camelCase)(a,i)]=l)}),s}return r.default=r,Jn=r,Jn}var ES=CS();const NS=qi(ES),Qf=eh("end"),Rs=eh("start");function eh(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function TS(e){const t=Rs(e),n=Qf(e);if(t&&n)return{start:t,end:n}}function nr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?xl(e.position):"start"in e||"end"in e?xl(e):"line"in e||"column"in e?Li(e):""}function Li(e){return yl(e&&e.line)+":"+yl(e&&e.column)}function xl(e){return Li(e&&e.start)+"-"+Li(e&&e.end)}function yl(e){return e&&typeof e=="number"?e:1}class Ye extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(s=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=a?a.line:void 0,this.name=nr(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ye.prototype.file="";Ye.prototype.name="";Ye.prototype.reason="";Ye.prototype.message="";Ye.prototype.stack="";Ye.prototype.column=void 0;Ye.prototype.line=void 0;Ye.prototype.ancestors=void 0;Ye.prototype.cause=void 0;Ye.prototype.fatal=void 0;Ye.prototype.place=void 0;Ye.prototype.ruleId=void 0;Ye.prototype.source=void 0;const Ps={}.hasOwnProperty,jS=new Map,zS=/[A-Z]/g,IS=new Set(["table","tbody","thead","tfoot","tr"]),AS=new Set(["td","th"]),th="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function RS(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=BS(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=$S(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?As:vS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=nh(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function nh(e,t,n){if(t.type==="element")return PS(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return OS(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return MS(e,t,n);if(t.type==="mdxjsEsm")return DS(e,t);if(t.type==="root")return LS(e,t,n);if(t.type==="text")return FS(e,t)}function PS(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=As,e.schema=o),e.ancestors.push(t);const i=oh(e,t.tagName,!1),s=US(e,t);let a=Ds(e,t);return IS.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!uS(l):!0})),rh(e,s,i,t),Os(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function OS(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}cr(e,t.position)}function DS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cr(e,t.position)}function MS(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=As,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:oh(e,t.name,!0),s=ZS(e,t),a=Ds(e,t);return rh(e,s,i,t),Os(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function LS(e,t,n){const r={};return Os(r,Ds(e,t)),e.create(t,e.Fragment,r,n)}function FS(e,t){return t.value}function rh(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Os(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function $S(e,t,n){return r;function r(o,i,s,a){const c=Array.isArray(s.children)?n:t;return a?c(i,s,a):c(i,s)}}function BS(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=Rs(r);return t(o,i,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function US(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&Ps.call(t.properties,o)){const i=WS(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&AS.has(t.tagName)?r=a:n[s]=a}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function ZS(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const s=i.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else cr(e,t.position);else{const o=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else cr(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function Ds(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:jS;for(;++r<t.children.length;){const i=t.children[r];let s;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=o.get(l)||0;s=l+"-"+c,o.set(l,c+1)}}const a=nh(e,i,s);a!==void 0&&n.push(a)}return n}function WS(e,t,n){const r=xS(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?iS(n):wS(n)),r.property==="style"){let o=typeof n=="object"?n:VS(e,String(n));return e.stylePropertyNameCase==="css"&&(o=HS(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?pS[r.property]||r.property:r.attribute,n]}}function VS(e,t){try{return NS(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Ye("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=th+"#cannot-parse-style-attribute",o}}function oh(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,s;for(;++i<o.length;){const a=cl(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=s}else r=cl(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return Ps.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);cr(e)}function cr(e,t){const n=new Ye("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=th+"#cannot-handle-mdx-estrees-without-createevaluater",n}function HS(e){const t={};let n;for(n in e)Ps.call(e,n)&&(t[qS(n)]=e[n]);return t}function qS(e){let t=e.replace(zS,GS);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function GS(e){return"-"+e.toLowerCase()}const Qo={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},KS={};function JS(e,t){const n=KS,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ih(e,r,o)}function ih(e,t,n){if(YS(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return bl(e.children,t,n)}return Array.isArray(e)?bl(e,t,n):""}function bl(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=ih(e[o],t,n);return r.join("")}function YS(e){return!!(e&&typeof e=="object")}const vl=document.createElement("i");function Ms(e){const t="&"+e+";";vl.innerHTML=t;const n=vl.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function It(e,t,n,r){const o=e.length;let i=0,s;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function dt(e,t){return e.length>0?(It(e,e.length,0,t),e):t}const wl={}.hasOwnProperty;function XS(e){const t={};let n=-1;for(;++n<e.length;)QS(t,e[n]);return t}function QS(e,t){let n;for(n in t){const o=(wl.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){wl.call(o,s)||(o[s]=[]);const a=i[s];eC(o[s],Array.isArray(a)?a:a?[a]:[])}}}function eC(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);It(e,0,0,r)}function sh(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function zn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Et=tn(/[A-Za-z]/),ct=tn(/[\dA-Za-z]/),tC=tn(/[#-'*+\--9=?A-Z^-~]/);function Fi(e){return e!==null&&(e<32||e===127)}const $i=tn(/\d/),nC=tn(/[\dA-Fa-f]/),rC=tn(/[!-/:-@[-`{-~]/);function we(e){return e!==null&&e<-2}function nt(e){return e!==null&&(e<0||e===32)}function Ae(e){return e===-2||e===-1||e===32}const oC=tn(new RegExp("\\p{P}|\\p{S}","u")),iC=tn(/\s/);function tn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Vn(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&ct(e.charCodeAt(n+1))&&ct(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(s=String.fromCharCode(i,a),o=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+o+1,s=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function De(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return Ae(l)?(e.enter(n),a(l)):t(l)}function a(l){return Ae(l)&&i++<o?(e.consume(l),a):(e.exit(n),t(l))}}const sC={tokenize:aC};function aC(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),De(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),i(a)}function i(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return we(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}const lC={tokenize:cC},_l={tokenize:uC};function cC(e){const t=this,n=[];let r=0,o,i,s;return a;function a(w){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&b();const S=t.events.length;let C=S,N;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){N=t.events[C][1].end;break}x(r);let z=S;for(;z<t.events.length;)t.events[z][1].end={...N},z++;return It(t.events,C+1,0,t.events.slice(S)),t.events.length=z,c(w)}return a(w)}function c(w){if(r===n.length){if(!o)return p(w);if(o.currentConstruct&&o.currentConstruct.concrete)return g(w);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(_l,u,h)(w)}function u(w){return o&&b(),x(r),p(w)}function h(w){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(w)}function p(w){return t.containerState={},e.attempt(_l,d,g)(w)}function d(w){return r++,n.push([t.currentConstruct,t.containerState]),p(w)}function g(w){if(w===null){o&&b(),x(0),e.consume(w);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),m(w)}function m(w){if(w===null){y(e.exit("chunkFlow"),!0),x(0),e.consume(w);return}return we(w)?(e.consume(w),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(w),m)}function y(w,S){const C=t.sliceStream(w);if(S&&C.push(null),w.previous=i,i&&(i.next=w),i=w,o.defineSkip(w.start),o.write(C),t.parser.lazy[w.start.line]){let N=o.events.length;for(;N--;)if(o.events[N][1].start.offset<s&&(!o.events[N][1].end||o.events[N][1].end.offset>s))return;const z=t.events.length;let A=z,O,P;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(O){P=t.events[A][1].end;break}O=!0}for(x(r),N=z;N<t.events.length;)t.events[N][1].end={...P},N++;It(t.events,A+1,0,t.events.slice(z)),t.events.length=N}}function x(w){let S=n.length;for(;S-- >w;){const C=n[S];t.containerState=C[1],C[0].exit.call(t,e)}n.length=w}function b(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function uC(e,t,n){return De(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function kl(e){if(e===null||nt(e)||iC(e))return 1;if(oC(e))return 2}function Ls(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const Bi={name:"attention",resolveAll:dC,tokenize:fC};function dC(e,t){let n=-1,r,o,i,s,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},p={...e[n][1].start};Sl(h,-l),Sl(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=dt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=dt(c,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=dt(c,Ls(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=dt(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=dt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,It(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function fC(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=kl(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const c=e.exit("attentionSequence"),u=kl(l),h=!u||u===2&&o||n.includes(l),p=!o||o===2&&u||n.includes(r);return c._open=!!(i===42?h:h&&(o||!p)),c._close=!!(i===42?p:p&&(u||!h)),t(l)}}function Sl(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const hC={name:"autolink",tokenize:pC};function pC(e,t,n){let r=0;return o;function o(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(d){return Et(d)?(e.consume(d),s):d===64?n(d):c(d)}function s(d){return d===43||d===45||d===46||ct(d)?(r=1,a(d)):c(d)}function a(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||ct(d))&&r++<32?(e.consume(d),a):(r=0,c(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||Fi(d)?n(d):(e.consume(d),l)}function c(d){return d===64?(e.consume(d),u):tC(d)?(e.consume(d),c):n(d)}function u(d){return ct(d)?h(d):n(d)}function h(d){return d===46?(e.consume(d),r=0,u):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):p(d)}function p(d){if((d===45||ct(d))&&r++<63){const g=d===45?p:h;return e.consume(d),g}return n(d)}}const Io={partial:!0,tokenize:mC};function mC(e,t,n){return r;function r(i){return Ae(i)?De(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||we(i)?t(i):n(i)}}const ah={continuation:{tokenize:xC},exit:yC,name:"blockQuote",tokenize:gC};function gC(e,t,n){const r=this;return o;function o(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return n(s)}function i(s){return Ae(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function xC(e,t,n){const r=this;return o;function o(s){return Ae(s)?De(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(ah,t,n)(s)}}function yC(e){e.exit("blockQuote")}const lh={name:"characterEscape",tokenize:bC};function bC(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return rC(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const ch={name:"characterReference",tokenize:vC};function vC(e,t,n){const r=this;let o=0,i,s;return a;function a(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),l}function l(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,s=ct,u(h))}function c(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=nC,u):(e.enter("characterReferenceValue"),i=7,s=$i,u(h))}function u(h){if(h===59&&o){const p=e.exit("characterReferenceValue");return s===ct&&!Ms(r.sliceSerialize(p))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(h)&&o++<i?(e.consume(h),u):n(h)}}const Cl={partial:!0,tokenize:_C},El={concrete:!0,name:"codeFenced",tokenize:wC};function wC(e,t,n){const r=this,o={partial:!0,tokenize:C};let i=0,s=0,a;return l;function l(N){return c(N)}function c(N){const z=r.events[r.events.length-1];return i=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,a=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(N)}function u(N){return N===a?(s++,e.consume(N),u):s<3?n(N):(e.exit("codeFencedFenceSequence"),Ae(N)?De(e,h,"whitespace")(N):h(N))}function h(N){return N===null||we(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(Cl,m,S)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(N))}function p(N){return N===null||we(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(N)):Ae(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),De(e,d,"whitespace")(N)):N===96&&N===a?n(N):(e.consume(N),p)}function d(N){return N===null||we(N)?h(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(N))}function g(N){return N===null||we(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(N)):N===96&&N===a?n(N):(e.consume(N),g)}function m(N){return e.attempt(o,S,y)(N)}function y(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),x}function x(N){return i>0&&Ae(N)?De(e,b,"linePrefix",i+1)(N):b(N)}function b(N){return N===null||we(N)?e.check(Cl,m,S)(N):(e.enter("codeFlowValue"),w(N))}function w(N){return N===null||we(N)?(e.exit("codeFlowValue"),b(N)):(e.consume(N),w)}function S(N){return e.exit("codeFenced"),t(N)}function C(N,z,A){let O=0;return P;function P(D){return N.enter("lineEnding"),N.consume(D),N.exit("lineEnding"),L}function L(D){return N.enter("codeFencedFence"),Ae(D)?De(N,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):T(D)}function T(D){return D===a?(N.enter("codeFencedFenceSequence"),M(D)):A(D)}function M(D){return D===a?(O++,N.consume(D),M):O>=s?(N.exit("codeFencedFenceSequence"),Ae(D)?De(N,_,"whitespace")(D):_(D)):A(D)}function _(D){return D===null||we(D)?(N.exit("codeFencedFence"),z(D)):A(D)}}}function _C(e,t,n){const r=this;return o;function o(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ei={name:"codeIndented",tokenize:SC},kC={partial:!0,tokenize:CC};function SC(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),De(e,i,"linePrefix",5)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):we(c)?e.attempt(kC,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||we(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function CC(e,t,n){const r=this;return o;function o(s){return r.parser.lazy[r.now().line]?n(s):we(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):De(e,i,"linePrefix",5)(s)}function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):we(s)?o(s):n(s)}}const EC={name:"codeText",previous:TC,resolve:NC,tokenize:jC};function NC(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function TC(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function jC(e,t,n){let r=0,o,i;return s;function s(h){return e.enter("codeText"),e.enter("codeTextSequence"),a(h)}function a(h){return h===96?(e.consume(h),r++,a):(e.exit("codeTextSequence"),l(h))}function l(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),l):h===96?(i=e.enter("codeTextSequence"),o=0,u(h)):we(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||we(h)?(e.exit("codeTextData"),l(h)):(e.consume(h),c)}function u(h){return h===96?(e.consume(h),o++,u):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(i.type="codeTextData",c(h))}}class zC{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const o=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&Yn(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Yn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Yn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Yn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Yn(this.left,n.reverse())}}}function Yn(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function uh(e){const t={};let n=-1,r,o,i,s,a,l,c;const u=new zC(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,IC(u,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,o=void 0;i--;)if(s=u.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(o&&(u.get(o)[1].type="lineEndingBlank"),s[1].type="lineEnding",o=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;o&&(r[1].end={...u.get(o)[1].start},a=u.slice(o,n),a.unshift(r),u.splice(o,n-o+1,a))}}return It(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function IC(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],c={};let u,h,p=-1,d=n,g=0,m=0;const y=[m];for(;d;){for(;e.get(++o)[1]!==d;);i.push(o),d._tokenizer||(u=r.sliceStream(d),d.next||u.push(null),h&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=d,d=d.next}for(d=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(m=p+1,y.push(m),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):y.pop(),p=y.length;p--;){const x=a.slice(y[p],y[p+1]),b=i.pop();l.push([b,b+x.length-1]),e.splice(b,2,x)}for(l.reverse(),p=-1;++p<l.length;)c[g+l[p][0]]=g+l[p][1],g+=l[p][1]-l[p][0]-1;return c}const AC={resolve:PC,tokenize:OC},RC={partial:!0,tokenize:DC};function PC(e){return uh(e),e}function OC(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(a)}function o(a){return a===null?i(a):we(a)?e.check(RC,s,i)(a):(e.consume(a),o)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function DC(e,t,n){const r=this;return o;function o(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),De(e,i,"linePrefix")}function i(s){if(s===null||we(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function dh(e,t,n,r,o,i,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return h;function h(x){return x===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(x),e.exit(i),p):x===null||x===32||x===41||Fi(x)?n(x):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(x))}function p(x){return x===62?(e.enter(i),e.consume(x),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(x))}function d(x){return x===62?(e.exit("chunkString"),e.exit(a),p(x)):x===null||x===60||we(x)?n(x):(e.consume(x),x===92?g:d)}function g(x){return x===60||x===62||x===92?(e.consume(x),d):d(x)}function m(x){return!u&&(x===null||x===41||nt(x))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(x)):u<c&&x===40?(e.consume(x),u++,m):x===41?(e.consume(x),u--,m):x===null||x===32||x===40||Fi(x)?n(x):(e.consume(x),x===92?y:m)}function y(x){return x===40||x===41||x===92?(e.consume(x),m):m(x)}}function fh(e,t,n,r,o,i){const s=this;let a=0,l;return c;function c(d){return e.enter(r),e.enter(o),e.consume(d),e.exit(o),e.enter(i),u}function u(d){return a>999||d===null||d===91||d===93&&!l||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):we(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),h(d))}function h(d){return d===null||d===91||d===93||we(d)||a++>999?(e.exit("chunkString"),u(d)):(e.consume(d),l||(l=!Ae(d)),d===92?p:h)}function p(d){return d===91||d===92||d===93?(e.consume(d),a++,h):h(d)}}function hh(e,t,n,r,o,i){let s;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(o),e.consume(p),e.exit(o),s=p===40?41:p,l):n(p)}function l(p){return p===s?(e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):(e.enter(i),c(p))}function c(p){return p===s?(e.exit(i),l(s)):p===null?n(p):we(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),De(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===s||p===null||we(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?h:u)}function h(p){return p===s||p===92?(e.consume(p),u):u(p)}}function rr(e,t){let n;return r;function r(o){return we(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Ae(o)?De(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const MC={name:"definition",tokenize:FC},LC={partial:!0,tokenize:$C};function FC(e,t,n){const r=this;let o;return i;function i(d){return e.enter("definition"),s(d)}function s(d){return fh.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return o=zn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return nt(d)?rr(e,c)(d):c(d)}function c(d){return dh(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function u(d){return e.attempt(LC,h,h)(d)}function h(d){return Ae(d)?De(e,p,"whitespace")(d):p(d)}function p(d){return d===null||we(d)?(e.exit("definition"),r.parser.defined.push(o),t(d)):n(d)}}function $C(e,t,n){return r;function r(a){return nt(a)?rr(e,o)(a):n(a)}function o(a){return hh(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return Ae(a)?De(e,s,"whitespace")(a):s(a)}function s(a){return a===null||we(a)?t(a):n(a)}}const BC={name:"hardBreakEscape",tokenize:UC};function UC(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return we(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const ZC={name:"headingAtx",resolve:WC,tokenize:VC};function WC(e,t){let n=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},It(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function VC(e,t,n){let r=0;return o;function o(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||nt(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||we(u)?(e.exit("atxHeading"),t(u)):Ae(u)?De(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||nt(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const HC=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Nl=["pre","script","style","textarea"],qC={concrete:!0,name:"htmlFlow",resolveTo:JC,tokenize:YC},GC={partial:!0,tokenize:QC},KC={partial:!0,tokenize:XC};function JC(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function YC(e,t,n){const r=this;let o,i,s,a,l;return c;function c(j){return u(j)}function u(j){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(j),h}function h(j){return j===33?(e.consume(j),p):j===47?(e.consume(j),i=!0,m):j===63?(e.consume(j),o=3,r.interrupt?t:E):Et(j)?(e.consume(j),s=String.fromCharCode(j),y):n(j)}function p(j){return j===45?(e.consume(j),o=2,d):j===91?(e.consume(j),o=5,a=0,g):Et(j)?(e.consume(j),o=4,r.interrupt?t:E):n(j)}function d(j){return j===45?(e.consume(j),r.interrupt?t:E):n(j)}function g(j){const Y="CDATA[";return j===Y.charCodeAt(a++)?(e.consume(j),a===Y.length?r.interrupt?t:T:g):n(j)}function m(j){return Et(j)?(e.consume(j),s=String.fromCharCode(j),y):n(j)}function y(j){if(j===null||j===47||j===62||nt(j)){const Y=j===47,H=s.toLowerCase();return!Y&&!i&&Nl.includes(H)?(o=1,r.interrupt?t(j):T(j)):HC.includes(s.toLowerCase())?(o=6,Y?(e.consume(j),x):r.interrupt?t(j):T(j)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(j):i?b(j):w(j))}return j===45||ct(j)?(e.consume(j),s+=String.fromCharCode(j),y):n(j)}function x(j){return j===62?(e.consume(j),r.interrupt?t:T):n(j)}function b(j){return Ae(j)?(e.consume(j),b):P(j)}function w(j){return j===47?(e.consume(j),P):j===58||j===95||Et(j)?(e.consume(j),S):Ae(j)?(e.consume(j),w):P(j)}function S(j){return j===45||j===46||j===58||j===95||ct(j)?(e.consume(j),S):C(j)}function C(j){return j===61?(e.consume(j),N):Ae(j)?(e.consume(j),C):w(j)}function N(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),l=j,z):Ae(j)?(e.consume(j),N):A(j)}function z(j){return j===l?(e.consume(j),l=null,O):j===null||we(j)?n(j):(e.consume(j),z)}function A(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||nt(j)?C(j):(e.consume(j),A)}function O(j){return j===47||j===62||Ae(j)?w(j):n(j)}function P(j){return j===62?(e.consume(j),L):n(j)}function L(j){return j===null||we(j)?T(j):Ae(j)?(e.consume(j),L):n(j)}function T(j){return j===45&&o===2?(e.consume(j),G):j===60&&o===1?(e.consume(j),Z):j===62&&o===4?(e.consume(j),U):j===63&&o===3?(e.consume(j),E):j===93&&o===5?(e.consume(j),q):we(j)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(GC,B,M)(j)):j===null||we(j)?(e.exit("htmlFlowData"),M(j)):(e.consume(j),T)}function M(j){return e.check(KC,_,B)(j)}function _(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),D}function D(j){return j===null||we(j)?M(j):(e.enter("htmlFlowData"),T(j))}function G(j){return j===45?(e.consume(j),E):T(j)}function Z(j){return j===47?(e.consume(j),s="",te):T(j)}function te(j){if(j===62){const Y=s.toLowerCase();return Nl.includes(Y)?(e.consume(j),U):T(j)}return Et(j)&&s.length<8?(e.consume(j),s+=String.fromCharCode(j),te):T(j)}function q(j){return j===93?(e.consume(j),E):T(j)}function E(j){return j===62?(e.consume(j),U):j===45&&o===2?(e.consume(j),E):T(j)}function U(j){return j===null||we(j)?(e.exit("htmlFlowData"),B(j)):(e.consume(j),U)}function B(j){return e.exit("htmlFlow"),t(j)}}function XC(e,t,n){const r=this;return o;function o(s){return we(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function QC(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Io,t,n)}}const eE={name:"htmlText",tokenize:tE};function tE(e,t,n){const r=this;let o,i,s;return a;function a(E){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(E),l}function l(E){return E===33?(e.consume(E),c):E===47?(e.consume(E),C):E===63?(e.consume(E),w):Et(E)?(e.consume(E),A):n(E)}function c(E){return E===45?(e.consume(E),u):E===91?(e.consume(E),i=0,g):Et(E)?(e.consume(E),b):n(E)}function u(E){return E===45?(e.consume(E),d):n(E)}function h(E){return E===null?n(E):E===45?(e.consume(E),p):we(E)?(s=h,Z(E)):(e.consume(E),h)}function p(E){return E===45?(e.consume(E),d):h(E)}function d(E){return E===62?G(E):E===45?p(E):h(E)}function g(E){const U="CDATA[";return E===U.charCodeAt(i++)?(e.consume(E),i===U.length?m:g):n(E)}function m(E){return E===null?n(E):E===93?(e.consume(E),y):we(E)?(s=m,Z(E)):(e.consume(E),m)}function y(E){return E===93?(e.consume(E),x):m(E)}function x(E){return E===62?G(E):E===93?(e.consume(E),x):m(E)}function b(E){return E===null||E===62?G(E):we(E)?(s=b,Z(E)):(e.consume(E),b)}function w(E){return E===null?n(E):E===63?(e.consume(E),S):we(E)?(s=w,Z(E)):(e.consume(E),w)}function S(E){return E===62?G(E):w(E)}function C(E){return Et(E)?(e.consume(E),N):n(E)}function N(E){return E===45||ct(E)?(e.consume(E),N):z(E)}function z(E){return we(E)?(s=z,Z(E)):Ae(E)?(e.consume(E),z):G(E)}function A(E){return E===45||ct(E)?(e.consume(E),A):E===47||E===62||nt(E)?O(E):n(E)}function O(E){return E===47?(e.consume(E),G):E===58||E===95||Et(E)?(e.consume(E),P):we(E)?(s=O,Z(E)):Ae(E)?(e.consume(E),O):G(E)}function P(E){return E===45||E===46||E===58||E===95||ct(E)?(e.consume(E),P):L(E)}function L(E){return E===61?(e.consume(E),T):we(E)?(s=L,Z(E)):Ae(E)?(e.consume(E),L):O(E)}function T(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),o=E,M):we(E)?(s=T,Z(E)):Ae(E)?(e.consume(E),T):(e.consume(E),_)}function M(E){return E===o?(e.consume(E),o=void 0,D):E===null?n(E):we(E)?(s=M,Z(E)):(e.consume(E),M)}function _(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||nt(E)?O(E):(e.consume(E),_)}function D(E){return E===47||E===62||nt(E)?O(E):n(E)}function G(E){return E===62?(e.consume(E),e.exit("htmlTextData"),e.exit("htmlText"),t):n(E)}function Z(E){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),te}function te(E){return Ae(E)?De(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):q(E)}function q(E){return e.enter("htmlTextData"),s(E)}}const Fs={name:"labelEnd",resolveAll:iE,resolveTo:sE,tokenize:aE},nE={tokenize:lE},rE={tokenize:cE},oE={tokenize:uE};function iE(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&It(e,0,e.length,n),e}function sE(e,t){let n=e.length,r=0,o,i,s,a;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=dt(a,e.slice(i+1,i+r+3)),a=dt(a,[["enter",u,t]]),a=dt(a,Ls(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=dt(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=dt(a,e.slice(s+1)),a=dt(a,[["exit",l,t]]),It(e,i,e.length,a),e}function aE(e,t,n){const r=this;let o=r.events.length,i,s;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return a;function a(p){return i?i._inactive?h(p):(s=r.parser.defined.includes(zn(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(nE,u,s?u:h)(p):p===91?e.attempt(rE,u,s?c:h)(p):s?u(p):h(p)}function c(p){return e.attempt(oE,u,h)(p)}function u(p){return t(p)}function h(p){return i._balanced=!0,n(p)}}function lE(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),o}function o(h){return nt(h)?rr(e,i)(h):i(h)}function i(h){return h===41?u(h):dh(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return nt(h)?rr(e,l)(h):u(h)}function a(h){return n(h)}function l(h){return h===34||h===39||h===40?hh(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):u(h)}function c(h){return nt(h)?rr(e,u)(h):u(h)}function u(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function cE(e,t,n){const r=this;return o;function o(a){return fh.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(zn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function uE(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const dE={name:"labelStartImage",resolveAll:Fs.resolveAll,tokenize:fE};function fE(e,t,n){const r=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const hE={name:"labelStartLink",resolveAll:Fs.resolveAll,tokenize:pE};function pE(e,t,n){const r=this;return o;function o(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const ti={name:"lineEnding",tokenize:mE};function mE(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),De(e,t,"linePrefix")}}const Br={name:"thematicBreak",tokenize:gE};function gE(e,t,n){let r=0,o;return i;function i(c){return e.enter("thematicBreak"),s(c)}function s(c){return o=c,a(c)}function a(c){return c===o?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||we(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===o?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Ae(c)?De(e,a,"whitespace")(c):a(c))}}const et={continuation:{tokenize:vE},exit:_E,name:"list",tokenize:bE},xE={partial:!0,tokenize:kE},yE={partial:!0,tokenize:wE};function bE(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,s=0;return a;function a(d){const g=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:$i(d)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(Br,n,c)(d):c(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return $i(d)&&++s<10?(e.consume(d),l):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),c(d)):n(d)}function c(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(Io,r.interrupt?n:u,e.attempt(xE,p,h))}function u(d){return r.containerState.initialBlankLine=!0,i++,p(d)}function h(d){return Ae(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),p):n(d)}function p(d){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function vE(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Io,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,De(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!Ae(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(yE,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,De(e,e.attempt(et,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function wE(e,t,n){const r=this;return De(e,o,"listItemIndent",r.containerState.size+1);function o(i){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(i):n(i)}}function _E(e){e.exit(this.containerState.type)}function kE(e,t,n){const r=this;return De(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const s=r.events[r.events.length-1];return!Ae(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const Tl={name:"setextUnderline",resolveTo:SE,tokenize:CE};function SE(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function CE(e,t,n){const r=this;let o;return i;function i(c){let u=r.events.length,h;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){h=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),o=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===o?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Ae(c)?De(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||we(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const EE={tokenize:NE};function NE(e){const t=this,n=e.attempt(Io,r,e.attempt(this.parser.constructs.flowInitial,o,De(e,e.attempt(this.parser.constructs.flow,o,e.attempt(AC,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const TE={resolveAll:mh()},jE=ph("string"),zE=ph("text");function ph(e){return{resolveAll:mh(e==="text"?IE:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,s,a);return s;function s(u){return c(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const h=o[u];let p=-1;if(h)for(;++p<h.length;){const d=h[p];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function mh(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function IE(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let i=o.length,s=-1,a=0,l;for(;i--;){const c=o[i];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:r.start._bufferIndex+s,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const AE={42:et,43:et,45:et,48:et,49:et,50:et,51:et,52:et,53:et,54:et,55:et,56:et,57:et,62:ah},RE={91:MC},PE={[-2]:ei,[-1]:ei,32:ei},OE={35:ZC,42:Br,45:[Tl,Br],60:qC,61:Tl,95:Br,96:El,126:El},DE={38:ch,92:lh},ME={[-5]:ti,[-4]:ti,[-3]:ti,33:dE,38:ch,42:Bi,60:[hC,eE],91:hE,92:[BC,lh],93:Fs,95:Bi,96:EC},LE={null:[Bi,TE]},FE={null:[42,95]},$E={null:[]},BE=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:FE,contentInitial:RE,disable:$E,document:AE,flow:OE,flowInitial:PE,insideSpan:LE,string:DE,text:ME},Symbol.toStringTag,{value:"Module"}));function UE(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let s=[],a=[];const l={attempt:z(C),check:z(N),consume:b,enter:w,exit:S,interrupt:z(N,{interrupt:!0})},c={code:null,containerState:{},defineSkip:m,events:[],now:g,parser:e,previous:null,sliceSerialize:p,sliceStream:d,write:h};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function h(L){return s=dt(s,L),y(),s[s.length-1]!==null?[]:(A(t,0),c.events=Ls(i,c.events,c),c.events)}function p(L,T){return WE(d(L),T)}function d(L){return ZE(s,L)}function g(){const{_bufferIndex:L,_index:T,line:M,column:_,offset:D}=r;return{_bufferIndex:L,_index:T,line:M,column:_,offset:D}}function m(L){o[L.line]=L.column,P()}function y(){let L;for(;r._index<s.length;){const T=s[r._index];if(typeof T=="string")for(L=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===L&&r._bufferIndex<T.length;)x(T.charCodeAt(r._bufferIndex));else x(T)}}function x(L){u=u(L)}function b(L){we(L)?(r.line++,r.column=1,r.offset+=L===-3?2:1,P()):L!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=L}function w(L,T){const M=T||{};return M.type=L,M.start=g(),c.events.push(["enter",M,c]),a.push(M),M}function S(L){const T=a.pop();return T.end=g(),c.events.push(["exit",T,c]),T}function C(L,T){A(L,T.from)}function N(L,T){T.restore()}function z(L,T){return M;function M(_,D,G){let Z,te,q,E;return Array.isArray(_)?B(_):"tokenize"in _?B([_]):U(_);function U(ce){return ie;function ie(re){const le=re!==null&&ce[re],me=re!==null&&ce.null,xe=[...Array.isArray(le)?le:le?[le]:[],...Array.isArray(me)?me:me?[me]:[]];return B(xe)(re)}}function B(ce){return Z=ce,te=0,ce.length===0?G:j(ce[te])}function j(ce){return ie;function ie(re){return E=O(),q=ce,ce.partial||(c.currentConstruct=ce),ce.name&&c.parser.constructs.disable.null.includes(ce.name)?H():ce.tokenize.call(T?Object.assign(Object.create(c),T):c,l,Y,H)(re)}}function Y(ce){return L(q,E),D}function H(ce){return E.restore(),++te<Z.length?j(Z[te]):G}}}function A(L,T){L.resolveAll&&!i.includes(L)&&i.push(L),L.resolve&&It(c.events,T,c.events.length-T,L.resolve(c.events.slice(T),c)),L.resolveTo&&(c.events=L.resolveTo(c.events,c))}function O(){const L=g(),T=c.previous,M=c.currentConstruct,_=c.events.length,D=Array.from(a);return{from:_,restore:G};function G(){r=L,c.previous=T,c.currentConstruct=M,c.events.length=_,a=D,P()}}function P(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function ZE(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let s;if(n===o)s=[e[n].slice(r,i)];else{if(s=e.slice(n,o),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}i>0&&s.push(e[o].slice(0,i))}return s}function WE(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
111
111
  `;break}case-3:{s=`\r
112
- `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&o)continue;s=" ";break}default:s=String.fromCharCode(i)}o=i===-2,r.push(s)}return r.join("")}function VE(e){const r={constructs:XS([BE,...(e||{}).extensions||[]]),content:o(sC),defined:[],document:o(lC),flow:o(EE),lazy:{},string:o(jE),text:o(zE)};return r;function o(i){return s;function s(a){return UE(r,i,a)}}}function HE(e){for(;!uh(e););return e}const jl=/[\0\t\n\r]/g;function qE(){let e=1,t="",n=!0,r;return o;function o(i,s,a){const l=[];let c,u,h,p,d;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),h=0,t="",n&&(i.charCodeAt(0)===65279&&h++,n=void 0);h<i.length;){if(jl.lastIndex=h,c=jl.exec(i),p=c&&c.index!==void 0?c.index:i.length,d=i.charCodeAt(p),!c){t=i.slice(h);break}if(d===10&&h===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),h<p&&(l.push(i.slice(h,p)),e+=p-h),d){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}h=p+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const GE=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function KE(e){return e.replace(GE,JE)}function JE(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return sh(n.slice(i?2:1),i?16:10)}return Ms(n)||e}const gh={}.hasOwnProperty;function YE(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),XE(n)(HE(VE(n).document().write(qE()(e,t,!0))))}function XE(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(F),autolinkProtocol:O,autolinkEmail:O,atxHeading:i(J),blockQuote:i(me),characterEscape:O,characterReference:O,codeFenced:i(xe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(xe,s),codeText:i(Te,s),codeTextData:O,data:O,codeFlowValue:O,definition:i(Pe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(k),hardBreakEscape:i(V),hardBreakTrailing:i(V),htmlFlow:i(R,s),htmlFlowData:O,htmlText:i(R,s),htmlTextData:O,image:i(A),label:s,link:i(F),listItem:i(ne),listItemValue:p,listOrdered:i(Q,h),listUnordered:i(Q),paragraph:i(W),reference:j,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(J),strong:i(se),thematicBreak:i(ae)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:le,autolinkProtocol:re,blockQuote:l(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:H,characterReferenceMarkerNumeric:H,characterReferenceValue:ce,characterReference:ie,codeFenced:l(y),codeFencedFence:m,codeFencedFenceInfo:d,codeFencedFenceMeta:g,codeFlowValue:P,codeIndented:l(x),codeText:l(D),codeTextData:P,data:P,definition:l(),definitionDestinationString:S,definitionLabelString:b,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(T),hardBreakTrailing:l(T),htmlFlow:l(M),htmlFlowData:P,htmlText:l(_),htmlTextData:P,image:l(Z),label:q,labelText:te,lineEnding:L,link:l(G),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Y,resourceDestinationString:E,resourceTitleString:U,resource:B,setextHeading:l(I),setextHeadingLineSequence:z,setextHeadingText:N,strong:l(),thematicBreak:l()}};xh(t,(e||{}).mdastExtensions||[]);const n={};return r;function r($){let ee={type:"root",children:[]};const ue={stack:[ee],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},be=[];let ze=-1;for(;++ze<$.length;)if($[ze][1].type==="listOrdered"||$[ze][1].type==="listUnordered")if($[ze][0]==="enter")be.push(ze);else{const Ze=be.pop();ze=o($,Ze,ze)}for(ze=-1;++ze<$.length;){const Ze=t[$[ze][0]];gh.call(Ze,$[ze][1].type)&&Ze[$[ze][1].type].call(Object.assign({sliceSerialize:$[ze][2].sliceSerialize},ue),$[ze][1])}if(ue.tokenStack.length>0){const Ze=ue.tokenStack[ue.tokenStack.length-1];(Ze[1]||zl).call(ue,void 0,Ze[0])}for(ee.position={start:Wt($.length>0?$[0][1].start:{line:1,column:1,offset:0}),end:Wt($.length>0?$[$.length-2][1].end:{line:1,column:1,offset:0})},ze=-1;++ze<t.transforms.length;)ee=t.transforms[ze](ee)||ee;return ee}function o($,ee,ue){let be=ee-1,ze=-1,Ze=!1,it,Ae,_t,Pt;for(;++be<=ue;){const $e=$[be];switch($e[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{$e[0]==="enter"?ze++:ze--,Pt=void 0;break}case"lineEndingBlank":{$e[0]==="enter"&&(it&&!Pt&&!ze&&!_t&&(_t=be),Pt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Pt=void 0}if(!ze&&$e[0]==="enter"&&$e[1].type==="listItemPrefix"||ze===-1&&$e[0]==="exit"&&($e[1].type==="listUnordered"||$e[1].type==="listOrdered")){if(it){let Ot=be;for(Ae=void 0;Ot--;){const xt=$[Ot];if(xt[1].type==="lineEnding"||xt[1].type==="lineEndingBlank"){if(xt[0]==="exit")continue;Ae&&($[Ae][1].type="lineEndingBlank",Ze=!0),xt[1].type="lineEnding",Ae=Ot}else if(!(xt[1].type==="linePrefix"||xt[1].type==="blockQuotePrefix"||xt[1].type==="blockQuotePrefixWhitespace"||xt[1].type==="blockQuoteMarker"||xt[1].type==="listItemIndent"))break}_t&&(!Ae||_t<Ae)&&(it._spread=!0),it.end=Object.assign({},Ae?$[Ae][1].start:$e[1].end),$.splice(Ae||be,0,["exit",it,$e[2]]),be++,ue++}if($e[1].type==="listItemPrefix"){const Ot={type:"listItem",_spread:!1,start:Object.assign({},$e[1].start),end:void 0};it=Ot,$.splice(be,0,["enter",Ot,$e[2]]),be++,ue++,_t=void 0,Pt=!0}}}return $[ee][1]._spread=Ze,ue}function i($,ee){return ue;function ue(be){a.call(this,$(be),be),ee&&ee.call(this,be)}}function s(){this.stack.push({type:"fragment",children:[]})}function a($,ee,ue){this.stack[this.stack.length-1].children.push($),this.stack.push($),this.tokenStack.push([ee,ue||void 0]),$.position={start:Wt(ee.start),end:void 0}}function l($){return ee;function ee(ue){$&&$.call(this,ue),c.call(this,ue)}}function c($,ee){const ue=this.stack.pop(),be=this.tokenStack.pop();if(be)be[0].type!==$.type&&(ee?ee.call(this,$,be[0]):(be[1]||zl).call(this,$,be[0]));else throw new Error("Cannot close `"+$.type+"` ("+nr({start:$.start,end:$.end})+"): it’s not open");ue.position.end=Wt($.end)}function u(){return JS(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p($){if(this.data.expectingFirstListItemValue){const ee=this.stack[this.stack.length-2];ee.start=Number.parseInt(this.sliceSerialize($),10),this.data.expectingFirstListItemValue=void 0}}function d(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.lang=$}function g(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.meta=$}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.value=$.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.value=$.replace(/(\r?\n|\r)$/g,"")}function b($){const ee=this.resume(),ue=this.stack[this.stack.length-1];ue.label=ee,ue.identifier=zn(this.sliceSerialize($)).toLowerCase()}function w(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.title=$}function S(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.url=$}function C($){const ee=this.stack[this.stack.length-1];if(!ee.depth){const ue=this.sliceSerialize($).length;ee.depth=ue}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function z($){const ee=this.stack[this.stack.length-1];ee.depth=this.sliceSerialize($).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function O($){const ue=this.stack[this.stack.length-1].children;let be=ue[ue.length-1];(!be||be.type!=="text")&&(be=fe(),be.position={start:Wt($.start),end:void 0},ue.push(be)),this.stack.push(be)}function P($){const ee=this.stack.pop();ee.value+=this.sliceSerialize($),ee.position.end=Wt($.end)}function L($){const ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ue=ee.children[ee.children.length-1];ue.position.end=Wt($.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ee.type)&&(O.call(this,$),P.call(this,$))}function T(){this.data.atHardBreak=!0}function M(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.value=$}function _(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.value=$}function D(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.value=$}function G(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=ee,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function Z(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=ee,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function te($){const ee=this.sliceSerialize($),ue=this.stack[this.stack.length-2];ue.label=KE(ee),ue.identifier=zn(ee).toLowerCase()}function q(){const $=this.stack[this.stack.length-1],ee=this.resume(),ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,ue.type==="link"){const be=$.children;ue.children=be}else ue.alt=ee}function E(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.url=$}function U(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.title=$}function B(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function Y($){const ee=this.resume(),ue=this.stack[this.stack.length-1];ue.label=ee,ue.identifier=zn(this.sliceSerialize($)).toLowerCase(),this.data.referenceType="full"}function H($){this.data.characterReferenceType=$.type}function ce($){const ee=this.sliceSerialize($),ue=this.data.characterReferenceType;let be;ue?(be=sh(ee,ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):be=Ms(ee);const ze=this.stack[this.stack.length-1];ze.value+=be}function ie($){const ee=this.stack.pop();ee.position.end=Wt($.end)}function re($){P.call(this,$);const ee=this.stack[this.stack.length-1];ee.url=this.sliceSerialize($)}function le($){P.call(this,$);const ee=this.stack[this.stack.length-1];ee.url="mailto:"+this.sliceSerialize($)}function me(){return{type:"blockquote",children:[]}}function xe(){return{type:"code",lang:null,meta:null,value:""}}function Te(){return{type:"inlineCode",value:""}}function Pe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function k(){return{type:"emphasis",children:[]}}function J(){return{type:"heading",depth:0,children:[]}}function V(){return{type:"break"}}function R(){return{type:"html",value:""}}function A(){return{type:"image",title:null,url:"",alt:null}}function F(){return{type:"link",title:null,url:"",children:[]}}function Q($){return{type:"list",ordered:$.type==="listOrdered",start:null,spread:$._spread,children:[]}}function ne($){return{type:"listItem",spread:$._spread,checked:null,children:[]}}function W(){return{type:"paragraph",children:[]}}function se(){return{type:"strong",children:[]}}function fe(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}function Wt(e){return{line:e.line,column:e.column,offset:e.offset}}function xh(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?xh(e,r):QE(e,r)}}function QE(e,t){let n;for(n in t)if(gh.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function zl(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+nr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+nr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+nr({start:t.start,end:t.end})+") is still open")}function e3(e){const t=this;t.parser=n;function n(r){return YE(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function t3(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function n3(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
112
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&o)continue;s=" ";break}default:s=String.fromCharCode(i)}o=i===-2,r.push(s)}return r.join("")}function VE(e){const r={constructs:XS([BE,...(e||{}).extensions||[]]),content:o(sC),defined:[],document:o(lC),flow:o(EE),lazy:{},string:o(jE),text:o(zE)};return r;function o(i){return s;function s(a){return UE(r,i,a)}}}function HE(e){for(;!uh(e););return e}const jl=/[\0\t\n\r]/g;function qE(){let e=1,t="",n=!0,r;return o;function o(i,s,a){const l=[];let c,u,h,p,d;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),h=0,t="",n&&(i.charCodeAt(0)===65279&&h++,n=void 0);h<i.length;){if(jl.lastIndex=h,c=jl.exec(i),p=c&&c.index!==void 0?c.index:i.length,d=i.charCodeAt(p),!c){t=i.slice(h);break}if(d===10&&h===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),h<p&&(l.push(i.slice(h,p)),e+=p-h),d){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}h=p+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const GE=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function KE(e){return e.replace(GE,JE)}function JE(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return sh(n.slice(i?2:1),i?16:10)}return Ms(n)||e}const gh={}.hasOwnProperty;function YE(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),XE(n)(HE(VE(n).document().write(qE()(e,t,!0))))}function XE(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(F),autolinkProtocol:O,autolinkEmail:O,atxHeading:i(J),blockQuote:i(me),characterEscape:O,characterReference:O,codeFenced:i(xe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(xe,s),codeText:i(Te,s),codeTextData:O,data:O,codeFlowValue:O,definition:i(Pe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(k),hardBreakEscape:i(V),hardBreakTrailing:i(V),htmlFlow:i(R,s),htmlFlowData:O,htmlText:i(R,s),htmlTextData:O,image:i(I),label:s,link:i(F),listItem:i(ne),listItemValue:p,listOrdered:i(Q,h),listUnordered:i(Q),paragraph:i(W),reference:j,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(J),strong:i(se),thematicBreak:i(ae)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:le,autolinkProtocol:re,blockQuote:l(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:H,characterReferenceMarkerNumeric:H,characterReferenceValue:ce,characterReference:ie,codeFenced:l(y),codeFencedFence:m,codeFencedFenceInfo:d,codeFencedFenceMeta:g,codeFlowValue:P,codeIndented:l(x),codeText:l(D),codeTextData:P,data:P,definition:l(),definitionDestinationString:S,definitionLabelString:b,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(T),hardBreakTrailing:l(T),htmlFlow:l(M),htmlFlowData:P,htmlText:l(_),htmlTextData:P,image:l(Z),label:q,labelText:te,lineEnding:L,link:l(G),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Y,resourceDestinationString:E,resourceTitleString:U,resource:B,setextHeading:l(A),setextHeadingLineSequence:z,setextHeadingText:N,strong:l(),thematicBreak:l()}};xh(t,(e||{}).mdastExtensions||[]);const n={};return r;function r($){let ee={type:"root",children:[]};const ue={stack:[ee],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},be=[];let ze=-1;for(;++ze<$.length;)if($[ze][1].type==="listOrdered"||$[ze][1].type==="listUnordered")if($[ze][0]==="enter")be.push(ze);else{const Ze=be.pop();ze=o($,Ze,ze)}for(ze=-1;++ze<$.length;){const Ze=t[$[ze][0]];gh.call(Ze,$[ze][1].type)&&Ze[$[ze][1].type].call(Object.assign({sliceSerialize:$[ze][2].sliceSerialize},ue),$[ze][1])}if(ue.tokenStack.length>0){const Ze=ue.tokenStack[ue.tokenStack.length-1];(Ze[1]||zl).call(ue,void 0,Ze[0])}for(ee.position={start:Wt($.length>0?$[0][1].start:{line:1,column:1,offset:0}),end:Wt($.length>0?$[$.length-2][1].end:{line:1,column:1,offset:0})},ze=-1;++ze<t.transforms.length;)ee=t.transforms[ze](ee)||ee;return ee}function o($,ee,ue){let be=ee-1,ze=-1,Ze=!1,it,Ie,_t,Pt;for(;++be<=ue;){const $e=$[be];switch($e[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{$e[0]==="enter"?ze++:ze--,Pt=void 0;break}case"lineEndingBlank":{$e[0]==="enter"&&(it&&!Pt&&!ze&&!_t&&(_t=be),Pt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Pt=void 0}if(!ze&&$e[0]==="enter"&&$e[1].type==="listItemPrefix"||ze===-1&&$e[0]==="exit"&&($e[1].type==="listUnordered"||$e[1].type==="listOrdered")){if(it){let Ot=be;for(Ie=void 0;Ot--;){const xt=$[Ot];if(xt[1].type==="lineEnding"||xt[1].type==="lineEndingBlank"){if(xt[0]==="exit")continue;Ie&&($[Ie][1].type="lineEndingBlank",Ze=!0),xt[1].type="lineEnding",Ie=Ot}else if(!(xt[1].type==="linePrefix"||xt[1].type==="blockQuotePrefix"||xt[1].type==="blockQuotePrefixWhitespace"||xt[1].type==="blockQuoteMarker"||xt[1].type==="listItemIndent"))break}_t&&(!Ie||_t<Ie)&&(it._spread=!0),it.end=Object.assign({},Ie?$[Ie][1].start:$e[1].end),$.splice(Ie||be,0,["exit",it,$e[2]]),be++,ue++}if($e[1].type==="listItemPrefix"){const Ot={type:"listItem",_spread:!1,start:Object.assign({},$e[1].start),end:void 0};it=Ot,$.splice(be,0,["enter",Ot,$e[2]]),be++,ue++,_t=void 0,Pt=!0}}}return $[ee][1]._spread=Ze,ue}function i($,ee){return ue;function ue(be){a.call(this,$(be),be),ee&&ee.call(this,be)}}function s(){this.stack.push({type:"fragment",children:[]})}function a($,ee,ue){this.stack[this.stack.length-1].children.push($),this.stack.push($),this.tokenStack.push([ee,ue||void 0]),$.position={start:Wt(ee.start),end:void 0}}function l($){return ee;function ee(ue){$&&$.call(this,ue),c.call(this,ue)}}function c($,ee){const ue=this.stack.pop(),be=this.tokenStack.pop();if(be)be[0].type!==$.type&&(ee?ee.call(this,$,be[0]):(be[1]||zl).call(this,$,be[0]));else throw new Error("Cannot close `"+$.type+"` ("+nr({start:$.start,end:$.end})+"): it’s not open");ue.position.end=Wt($.end)}function u(){return JS(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p($){if(this.data.expectingFirstListItemValue){const ee=this.stack[this.stack.length-2];ee.start=Number.parseInt(this.sliceSerialize($),10),this.data.expectingFirstListItemValue=void 0}}function d(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.lang=$}function g(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.meta=$}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.value=$.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.value=$.replace(/(\r?\n|\r)$/g,"")}function b($){const ee=this.resume(),ue=this.stack[this.stack.length-1];ue.label=ee,ue.identifier=zn(this.sliceSerialize($)).toLowerCase()}function w(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.title=$}function S(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.url=$}function C($){const ee=this.stack[this.stack.length-1];if(!ee.depth){const ue=this.sliceSerialize($).length;ee.depth=ue}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function z($){const ee=this.stack[this.stack.length-1];ee.depth=this.sliceSerialize($).codePointAt(0)===61?1:2}function A(){this.data.setextHeadingSlurpLineEnding=void 0}function O($){const ue=this.stack[this.stack.length-1].children;let be=ue[ue.length-1];(!be||be.type!=="text")&&(be=fe(),be.position={start:Wt($.start),end:void 0},ue.push(be)),this.stack.push(be)}function P($){const ee=this.stack.pop();ee.value+=this.sliceSerialize($),ee.position.end=Wt($.end)}function L($){const ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ue=ee.children[ee.children.length-1];ue.position.end=Wt($.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ee.type)&&(O.call(this,$),P.call(this,$))}function T(){this.data.atHardBreak=!0}function M(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.value=$}function _(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.value=$}function D(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.value=$}function G(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=ee,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function Z(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=ee,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function te($){const ee=this.sliceSerialize($),ue=this.stack[this.stack.length-2];ue.label=KE(ee),ue.identifier=zn(ee).toLowerCase()}function q(){const $=this.stack[this.stack.length-1],ee=this.resume(),ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,ue.type==="link"){const be=$.children;ue.children=be}else ue.alt=ee}function E(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.url=$}function U(){const $=this.resume(),ee=this.stack[this.stack.length-1];ee.title=$}function B(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function Y($){const ee=this.resume(),ue=this.stack[this.stack.length-1];ue.label=ee,ue.identifier=zn(this.sliceSerialize($)).toLowerCase(),this.data.referenceType="full"}function H($){this.data.characterReferenceType=$.type}function ce($){const ee=this.sliceSerialize($),ue=this.data.characterReferenceType;let be;ue?(be=sh(ee,ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):be=Ms(ee);const ze=this.stack[this.stack.length-1];ze.value+=be}function ie($){const ee=this.stack.pop();ee.position.end=Wt($.end)}function re($){P.call(this,$);const ee=this.stack[this.stack.length-1];ee.url=this.sliceSerialize($)}function le($){P.call(this,$);const ee=this.stack[this.stack.length-1];ee.url="mailto:"+this.sliceSerialize($)}function me(){return{type:"blockquote",children:[]}}function xe(){return{type:"code",lang:null,meta:null,value:""}}function Te(){return{type:"inlineCode",value:""}}function Pe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function k(){return{type:"emphasis",children:[]}}function J(){return{type:"heading",depth:0,children:[]}}function V(){return{type:"break"}}function R(){return{type:"html",value:""}}function I(){return{type:"image",title:null,url:"",alt:null}}function F(){return{type:"link",title:null,url:"",children:[]}}function Q($){return{type:"list",ordered:$.type==="listOrdered",start:null,spread:$._spread,children:[]}}function ne($){return{type:"listItem",spread:$._spread,checked:null,children:[]}}function W(){return{type:"paragraph",children:[]}}function se(){return{type:"strong",children:[]}}function fe(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}function Wt(e){return{line:e.line,column:e.column,offset:e.offset}}function xh(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?xh(e,r):QE(e,r)}}function QE(e,t){let n;for(n in t)if(gh.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function zl(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+nr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+nr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+nr({start:t.start,end:t.end})+") is still open")}function e3(e){const t=this;t.parser=n;function n(r){return YE(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function t3(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function n3(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
113
113
  `}]}function r3(e,t){const n=t.value?t.value+`
114
114
  `:"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function o3(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function i3(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function s3(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Vn(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=i+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function a3(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function l3(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function yh(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const s=o[o.length-1];return s&&s.type==="text"?s.value+=r:o.push({type:"text",value:r}),o}function c3(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yh(e,t);const o={src:Vn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function u3(e,t){const n={src:Vn(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function d3(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function f3(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yh(e,t);const o={href:Vn(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function h3(e,t){const n={href:Vn(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function p3(e,t,n){const r=e.all(t),o=n?m3(n):bh(t),i={},s=[];if(typeof t.checked=="boolean"){const u=r[0];let h;u&&u.type==="element"&&u.tagName==="p"?h=u:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(o||a!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
115
115
  `}),u.type==="element"&&u.tagName==="p"&&!o?s.push(...u.children):s.push(u)}const l=r[r.length-1];l&&(o||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
116
- `});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function m3(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=bh(n[r])}return t}function bh(e){const t=e.spread;return t??e.children.length>1}function g3(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const s=r[o];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function x3(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function y3(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function b3(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function v3(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),o.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Rs(t.children[1]),l=Qf(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),o.push(s)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function w3(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const h=t.children[l],p={},d=s?s[l]:void 0;d&&(p.align=d);let g={type:"element",tagName:i,properties:p,children:[]};h&&(g.children=e.all(h),e.patch(h,g),g=e.applyData(h,g)),c.push(g)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function _3(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Al=9,Il=32;function k3(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(Rl(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(Rl(t.slice(o),o>0,!1)),i.join("")}function Rl(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===Al||i===Il;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===Al||i===Il;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function S3(e,t){const n={type:"text",value:k3(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function C3(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const E3={blockquote:t3,break:n3,code:r3,delete:o3,emphasis:i3,footnoteReference:s3,heading:a3,html:l3,imageReference:c3,image:u3,inlineCode:d3,linkReference:f3,link:h3,listItem:p3,list:g3,paragraph:x3,root:y3,strong:b3,table:v3,tableCell:_3,tableRow:w3,text:S3,thematicBreak:C3,toml:Pr,yaml:Pr,definition:Pr,footnoteDefinition:Pr};function Pr(){}const vh=-1,Io=0,or=1,no=2,$s=3,Bs=4,Us=5,Zs=6,wh=7,_h=8,N3=typeof self=="object"?self:globalThis,Pl=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new N3[e](t)},T3=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,s]=t[o];switch(i){case Io:case vh:return n(s,o);case or:{const a=n([],o);for(const l of s)a.push(r(l));return a}case no:{const a=n({},o);for(const[l,c]of s)a[r(l)]=r(c);return a}case $s:return n(new Date(s),o);case Bs:{const{source:a,flags:l}=s;return n(new RegExp(a,l),o)}case Us:{const a=n(new Map,o);for(const[l,c]of s)a.set(r(l),r(c));return a}case Zs:{const a=n(new Set,o);for(const l of s)a.add(r(l));return a}case wh:{const{name:a,message:l}=s;return n(Pl(a,l),o)}case _h:return n(BigInt(s),o);case"BigInt":return n(Object(BigInt(s)),o);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(Pl(i,s),o)};return r},Ol=e=>T3(new Map,e)(0),_n="",{toString:j3}={},{keys:z3}=Object,Xn=e=>{const t=typeof e;if(t!=="object"||!e)return[Io,t];const n=j3.call(e).slice(8,-1);switch(n){case"Array":return[or,_n];case"Object":return[no,_n];case"Date":return[$s,_n];case"RegExp":return[Bs,_n];case"Map":return[Us,_n];case"Set":return[Zs,_n];case"DataView":return[or,n]}return n.includes("Array")?[or,n]:n.includes("Error")?[wh,n]:[no,n]},Or=([e,t])=>e===Io&&(t==="function"||t==="symbol"),A3=(e,t,n,r)=>{const o=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},i=s=>{if(n.has(s))return n.get(s);let[a,l]=Xn(s);switch(a){case Io:{let u=s;switch(l){case"bigint":a=_h,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return o([vh],s)}return o([a,u],s)}case or:{if(l){let p=s;return l==="DataView"?p=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(s)),o([l,[...p]],s)}const u=[],h=o([a,u],s);for(const p of s)u.push(i(p));return h}case no:{if(l)switch(l){case"BigInt":return o([l,s.toString()],s);case"Boolean":case"Number":case"String":return o([l,s.valueOf()],s)}if(t&&"toJSON"in s)return i(s.toJSON());const u=[],h=o([a,u],s);for(const p of z3(s))(e||!Or(Xn(s[p])))&&u.push([i(p),i(s[p])]);return h}case $s:return o([a,s.toISOString()],s);case Bs:{const{source:u,flags:h}=s;return o([a,{source:u,flags:h}],s)}case Us:{const u=[],h=o([a,u],s);for(const[p,d]of s)(e||!(Or(Xn(p))||Or(Xn(d))))&&u.push([i(p),i(d)]);return h}case Zs:{const u=[],h=o([a,u],s);for(const p of s)(e||!Or(Xn(p)))&&u.push(i(p));return h}}const{message:c}=s;return o([a,{name:l,message:c}],s)};return i},Dl=(e,{json:t,lossy:n}={})=>{const r=[];return A3(!(t||n),!!t,new Map,r)(e),r},ro=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ol(Dl(e,t)):structuredClone(e):(e,t)=>Ol(Dl(e,t));function I3(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function R3(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function P3(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||I3,r=e.options.footnoteBackLabel||R3,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),h=String(c.identifier).toUpperCase(),p=Vn(h.toLowerCase());let d=0;const g=[],m=e.footnoteCounts.get(h);for(;m!==void 0&&++d<=m;){g.length>0&&g.push({type:"text",value:" "});let b=typeof n=="string"?n:n(l,d);typeof b=="string"&&(b={type:"text",value:b}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const b=y.children[y.children.length-1];b&&b.type==="text"?b.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...g)}else u.push(...g);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(u,!0)};e.patch(c,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...ro(s),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
116
+ `});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function m3(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=bh(n[r])}return t}function bh(e){const t=e.spread;return t??e.children.length>1}function g3(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const s=r[o];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function x3(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function y3(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function b3(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function v3(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),o.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Rs(t.children[1]),l=Qf(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),o.push(s)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function w3(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const h=t.children[l],p={},d=s?s[l]:void 0;d&&(p.align=d);let g={type:"element",tagName:i,properties:p,children:[]};h&&(g.children=e.all(h),e.patch(h,g),g=e.applyData(h,g)),c.push(g)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function _3(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Il=9,Al=32;function k3(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(Rl(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(Rl(t.slice(o),o>0,!1)),i.join("")}function Rl(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===Il||i===Al;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===Il||i===Al;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function S3(e,t){const n={type:"text",value:k3(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function C3(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const E3={blockquote:t3,break:n3,code:r3,delete:o3,emphasis:i3,footnoteReference:s3,heading:a3,html:l3,imageReference:c3,image:u3,inlineCode:d3,linkReference:f3,link:h3,listItem:p3,list:g3,paragraph:x3,root:y3,strong:b3,table:v3,tableCell:_3,tableRow:w3,text:S3,thematicBreak:C3,toml:Pr,yaml:Pr,definition:Pr,footnoteDefinition:Pr};function Pr(){}const vh=-1,Ao=0,or=1,no=2,$s=3,Bs=4,Us=5,Zs=6,wh=7,_h=8,N3=typeof self=="object"?self:globalThis,Pl=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new N3[e](t)},T3=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,s]=t[o];switch(i){case Ao:case vh:return n(s,o);case or:{const a=n([],o);for(const l of s)a.push(r(l));return a}case no:{const a=n({},o);for(const[l,c]of s)a[r(l)]=r(c);return a}case $s:return n(new Date(s),o);case Bs:{const{source:a,flags:l}=s;return n(new RegExp(a,l),o)}case Us:{const a=n(new Map,o);for(const[l,c]of s)a.set(r(l),r(c));return a}case Zs:{const a=n(new Set,o);for(const l of s)a.add(r(l));return a}case wh:{const{name:a,message:l}=s;return n(Pl(a,l),o)}case _h:return n(BigInt(s),o);case"BigInt":return n(Object(BigInt(s)),o);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(Pl(i,s),o)};return r},Ol=e=>T3(new Map,e)(0),_n="",{toString:j3}={},{keys:z3}=Object,Xn=e=>{const t=typeof e;if(t!=="object"||!e)return[Ao,t];const n=j3.call(e).slice(8,-1);switch(n){case"Array":return[or,_n];case"Object":return[no,_n];case"Date":return[$s,_n];case"RegExp":return[Bs,_n];case"Map":return[Us,_n];case"Set":return[Zs,_n];case"DataView":return[or,n]}return n.includes("Array")?[or,n]:n.includes("Error")?[wh,n]:[no,n]},Or=([e,t])=>e===Ao&&(t==="function"||t==="symbol"),I3=(e,t,n,r)=>{const o=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},i=s=>{if(n.has(s))return n.get(s);let[a,l]=Xn(s);switch(a){case Ao:{let u=s;switch(l){case"bigint":a=_h,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return o([vh],s)}return o([a,u],s)}case or:{if(l){let p=s;return l==="DataView"?p=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(s)),o([l,[...p]],s)}const u=[],h=o([a,u],s);for(const p of s)u.push(i(p));return h}case no:{if(l)switch(l){case"BigInt":return o([l,s.toString()],s);case"Boolean":case"Number":case"String":return o([l,s.valueOf()],s)}if(t&&"toJSON"in s)return i(s.toJSON());const u=[],h=o([a,u],s);for(const p of z3(s))(e||!Or(Xn(s[p])))&&u.push([i(p),i(s[p])]);return h}case $s:return o([a,s.toISOString()],s);case Bs:{const{source:u,flags:h}=s;return o([a,{source:u,flags:h}],s)}case Us:{const u=[],h=o([a,u],s);for(const[p,d]of s)(e||!(Or(Xn(p))||Or(Xn(d))))&&u.push([i(p),i(d)]);return h}case Zs:{const u=[],h=o([a,u],s);for(const p of s)(e||!Or(Xn(p)))&&u.push(i(p));return h}}const{message:c}=s;return o([a,{name:l,message:c}],s)};return i},Dl=(e,{json:t,lossy:n}={})=>{const r=[];return I3(!(t||n),!!t,new Map,r)(e),r},ro=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Ol(Dl(e,t)):structuredClone(e):(e,t)=>Ol(Dl(e,t));function A3(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function R3(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function P3(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||A3,r=e.options.footnoteBackLabel||R3,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),h=String(c.identifier).toUpperCase(),p=Vn(h.toLowerCase());let d=0;const g=[],m=e.footnoteCounts.get(h);for(;m!==void 0&&++d<=m;){g.length>0&&g.push({type:"text",value:" "});let b=typeof n=="string"?n:n(l,d);typeof b=="string"&&(b={type:"text",value:b}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const b=y.children[y.children.length-1];b&&b.type==="text"?b.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...g)}else u.push(...g);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(u,!0)};e.patch(c,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...ro(s),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
117
117
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
118
118
  `}]}}const kh=(function(e){if(e==null)return L3;if(typeof e=="function")return Ro(e);if(typeof e=="object")return Array.isArray(e)?O3(e):D3(e);if(typeof e=="string")return M3(e);throw new Error("Expected function, string, or object as test")});function O3(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=kh(e[n]);return Ro(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function D3(e){const t=e;return Ro(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function M3(e){return Ro(t);function t(n){return n&&n.type===e}}function Ro(e){return t;function t(n,r,o){return!!(F3(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function L3(){return!0}function F3(e){return e!==null&&typeof e=="object"&&"type"in e}const Sh=[],$3=!0,Ml=!1,B3="skip";function U3(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=kh(o),s=r?-1:1;a(e,void 0,[])();function a(l,c,u){const h=l&&typeof l=="object"?l:{};if(typeof h.type=="string"){const d=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return p;function p(){let d=Sh,g,m,y;if((!t||i(l,c,u[u.length-1]||void 0))&&(d=Z3(n(l,u)),d[0]===Ml))return d;if("children"in l&&l.children){const x=l;if(x.children&&d[0]!==B3)for(m=(r?x.children.length:-1)+s,y=u.concat(x);m>-1&&m<x.children.length;){const b=x.children[m];if(g=a(b,m,y)(),g[0]===Ml)return g;m=typeof g[1]=="number"?g[1]:m+s}}return d}}}function Z3(e){return Array.isArray(e)?e:typeof e=="number"?[$3,e]:e==null?Sh:[e]}function Ch(e,t,n,r){let o,i,s;typeof t=="function"&&typeof n!="function"?(i=void 0,s=t,o=n):(i=t,s=n,o=r),U3(e,i,a,o);function a(l,c){const u=c[c.length-1],h=u?u.children.indexOf(l):void 0;return s(l,h,u)}}const Ui={}.hasOwnProperty,W3={};function V3(e,t){const n=t||W3,r=new Map,o=new Map,i=new Map,s={...E3,...n.handlers},a={all:c,applyData:q3,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:H3,wrap:K3};return Ch(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const h=u.type==="definition"?r:o,p=String(u.identifier).toUpperCase();h.has(p)||h.set(p,u)}}),a;function l(u,h){const p=u.type,d=a.handlers[p];if(Ui.call(a.handlers,p)&&d)return d(a,u,h);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in u){const{children:m,...y}=u,x=ro(y);return x.children=a.all(u),x}return ro(u)}return(a.options.unknownHandler||G3)(a,u,h)}function c(u){const h=[];if("children"in u){const p=u.children;let d=-1;for(;++d<p.length;){const g=a.one(p[d],u);if(g){if(d&&p[d-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=Ll(g.value)),!Array.isArray(g)&&g.type==="element")){const m=g.children[0];m&&m.type==="text"&&(m.value=Ll(m.value))}Array.isArray(g)?h.push(...g):h.push(g)}}}return h}}function H3(e,t){e.position&&(t.position=TS(e))}function q3(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&i&&Object.assign(n.properties,ro(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function G3(e,t){const n=t.data||{},r="value"in t&&!(Ui.call(n,"hProperties")||Ui.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function K3(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
119
119
  `});++r<e.length;)r&&n.push({type:"text",value:`
120
120
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
121
121
  `}),n}function Ll(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Fl(e,t){const n=V3(e,t),r=n.one(e,void 0),o=P3(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
122
- `},o),i}function J3(e,t){return e&&"run"in e?async function(n,r){const o=Fl(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Fl(n,{file:r,...e||t})}}function $l(e){if(e)throw e}var ni,Bl;function Y3(){if(Bl)return ni;Bl=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},i=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var u=e.call(c,"constructor"),h=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!h)return!1;var p;for(p in c);return typeof p>"u"||e.call(c,p)},s=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},a=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return ni=function l(){var c,u,h,p,d,g,m=arguments[0],y=1,x=arguments.length,b=!1;for(typeof m=="boolean"&&(b=m,m=arguments[1]||{},y=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});y<x;++y)if(c=arguments[y],c!=null)for(u in c)h=a(m,u),p=a(c,u),m!==p&&(b&&p&&(i(p)||(d=o(p)))?(d?(d=!1,g=h&&o(h)?h:[]):g=h&&i(h)?h:{},s(m,{name:u,newValue:l(b,g,p)})):typeof p<"u"&&s(m,{name:u,newValue:p}));return m},ni}var X3=Y3();const ri=qi(X3);function Zi(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Q3(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const s=o.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...o);function a(l,...c){const u=e[++i];let h=-1;if(l){s(l);return}for(;++h<o.length;)(c[h]===null||c[h]===void 0)&&(c[h]=o[h]);o=c,u?eN(u,a)(...c):s(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function eN(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(o);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return o(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){n||(n=!0,t(s,...a))}function i(s){o(null,s)}}const St={basename:tN,dirname:nN,extname:rN,join:oN,sep:"/"};function tN(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');br(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else s<0&&(i=!0,s=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function nN(e){if(br(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function rN(e){br(e);let t=e.length,n=-1,r=0,o=-1,i=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function oN(...e){let t=-1,n;for(;++t<e.length;)br(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":iN(n)}function iN(e){br(e);const t=e.codePointAt(0)===47;let n=sN(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function sN(e,t){let n="",r=0,o=-1,i=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(o===s-1||i===1))if(o!==s-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=s,i=0;continue}}else if(n.length>0){n="",r=0,o=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,i=0}else a===46&&i>-1?i++:i=-1}return n}function br(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const aN={cwd:lN};function lN(){return"/"}function Wi(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function cN(e){if(typeof e=="string")e=new URL(e);else if(!Wi(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return uN(e)}function uN(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const oi=["history","path","basename","stem","extname","dirname"];class Eh{constructor(t){let n;t?Wi(t)?n={path:t}:typeof t=="string"||dN(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":aN.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<oi.length;){const i=oi[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)oi.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?St.basename(this.path):void 0}set basename(t){si(t,"basename"),ii(t,"basename"),this.path=St.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?St.dirname(this.path):void 0}set dirname(t){Ul(this.basename,"dirname"),this.path=St.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?St.extname(this.path):void 0}set extname(t){if(ii(t,"extname"),Ul(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=St.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Wi(t)&&(t=cN(t)),si(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?St.basename(this.path,this.extname):void 0}set stem(t){si(t,"stem"),ii(t,"stem"),this.path=St.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new Ye(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ii(e,t){if(e&&e.includes(St.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+St.sep+"`")}function si(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ul(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function dN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const fN=(function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),hN={}.hasOwnProperty;class Ws extends fN{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Q3()}copy(){const t=new Ws;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ri(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ci("data",this.frozen),this.namespace[t]=n,this):hN.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ci("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Dr(t),r=this.parser||this.Parser;return ai("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ai("process",this.parser||this.Parser),li("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Dr(t),l=r.parse(a);r.run(l,a,function(u,h,p){if(u||!h||!p)return c(u);const d=h,g=r.stringify(d,p);gN(g)?p.value=g:p.result=g,c(u,p)});function c(u,h){u||!h?s(u):i?i(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),ai("processSync",this.parser||this.Parser),li("processSync",this.compiler||this.Compiler),this.process(t,o),Wl("processSync","process",n),r;function o(i,s){n=!0,$l(i),r=s}}run(t,n,r){Zl(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,a){const l=Dr(n);o.run(t,l,c);function c(u,h,p){const d=h||t;u?a(u):s?s(d):r(void 0,d,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),Wl("runSync","run",r),o;function i(s,a){$l(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Dr(n),o=this.compiler||this.Compiler;return li("stringify",o),Zl(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(ci("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...h]=c;l(u,h)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(o.settings=ri(!0,o.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const h=c[u];i(h)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let h=-1,p=-1;for(;++h<r.length;)if(r[h][0]===c){p=h;break}if(p===-1)r.push([c,...u]);else if(u.length>0){let[d,...g]=u;const m=r[p][1];Zi(m)&&Zi(d)&&(d=ri(!0,m,d)),r[p]=[c,d,...g]}}}}const pN=new Ws().freeze();function ai(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function li(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ci(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Zl(e){if(!Zi(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Wl(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Dr(e){return mN(e)?e:new Eh(e)}function mN(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function gN(e){return typeof e=="string"||xN(e)}function xN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const yN="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Vl=[],Hl={allowDangerousHtml:!0},bN=/^(https?|ircs?|mailto|xmpp)$/i,vN=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Ln(e){const t=wN(e),n=_N(e);return kN(t.runSync(t.parse(n),n),e)}function wN(e){const t=e.rehypePlugins||Vl,n=e.remarkPlugins||Vl,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Hl}:Hl;return pN().use(e3).use(n).use(J3,r).use(t)}function _N(e){const t=e.children||"",n=new Eh;return typeof t=="string"&&(n.value=t),n}function kN(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||SN;for(const u of vN)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+yN+u.id,void 0);return Ch(e,c),RS(e,{Fragment:f.Fragment,components:o,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function c(u,h,p){if(u.type==="raw"&&p&&typeof h=="number")return s?p.children.splice(h,1):p.children[h]={type:"text",value:u.value},h;if(u.type==="element"){let d;for(d in Qo)if(Object.hasOwn(Qo,d)&&Object.hasOwn(u.properties,d)){const g=u.properties[d],m=Qo[d];(m===null||m.includes(u.tagName))&&(u.properties[d]=l(String(g||""),d,u))}}if(u.type==="element"){let d=n?!n.includes(u.tagName):i?i.includes(u.tagName):!1;if(!d&&r&&typeof h=="number"&&(d=!r(u,h,p)),d&&p&&typeof h=="number")return a&&u.children?p.children.splice(h,1,...u.children):p.children.splice(h,1),h}}}function SN(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||bN.test(e.slice(0,t))?e:""}function ql({delayDuration:e=0,...t}){return f.jsx($k,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function CN({...e}){return f.jsx(Bk,{"data-slot":"tooltip",...e})}function EN({...e}){return f.jsx(Uk,{"data-slot":"tooltip-trigger",...e})}function NN({className:e,sideOffset:t=0,children:n,...r}){return f.jsx(Zk,{children:f.jsxs(Wk,{"data-slot":"tooltip-content",sideOffset:t,className:Se("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[n,f.jsx(Vk,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function Nh(e){if(e===null)return"null";if(Array.isArray(e))return"array";switch(typeof e){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"object":return"object";case"bigint":case"symbol":case"undefined":case"function":return"object"}}function oo(e){return e!==null&&(Array.isArray(e)||typeof e=="object")}function TN(e,t){const n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0)return n.value}function Vs(e){return Array.isArray(e)?e.map((t,n)=>[String(n),t]):typeof e=="object"&&e!==null?Object.keys(e).map(t=>{const n=TN(e,t);return[t,ur(n)]}):[]}function Gl(e){return Array.isArray(e)?e.length:typeof e=="object"&&e!==null?Object.keys(e).length:0}const Kl=120;function jN({text:e}){const[t,n]=v.useState(!1);return e.length>Kl?f.jsxs("span",{className:"text-emerald-400 break-all",children:['"',t?f.jsx("span",{className:"cursor-pointer prose prose-sm dark:prose-invert inline max-w-none [&_p]:inline [&_p]:my-0 [&_code]:text-emerald-300 [&_a]:text-emerald-300",onClick:o=>{o.stopPropagation(),n(!1)},onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.stopPropagation(),n(!1))},role:"button",tabIndex:0,children:f.jsx(Ln,{children:e})}):f.jsxs(CN,{delayDuration:300,children:[f.jsxs(EN,{onClick:o=>{o.stopPropagation(),n(!0)},className:"text-left cursor-pointer",children:[f.jsx("span",{children:e.slice(0,Kl)}),f.jsx("span",{className:"text-emerald-400/50",children:"…"})]}),f.jsxs(NN,{side:"bottom",className:"max-w-md text-xs p-2 break-words whitespace-pre-wrap",children:[e.slice(0,500),e.length>500?"…":""]})]}),'"']}):f.jsxs("span",{className:"text-emerald-400 break-all",children:['"',f.jsx("span",{className:"prose prose-sm dark:prose-invert inline max-w-none [&_p]:inline [&_p]:my-0 [&_code]:text-emerald-300 [&_a]:text-emerald-300",children:f.jsx(Ln,{children:e})}),'"']})}function Th({value:e}){if(e===null)return f.jsx("span",{className:"text-rose-400 italic",children:"null"});switch(typeof e){case"string":return f.jsx(jN,{text:e});case"number":return f.jsx("span",{className:"text-amber-400",children:e});case"boolean":return f.jsx("span",{className:"text-blue-400",children:e?"true":"false"});case"object":case"bigint":case"symbol":case"undefined":case"function":return f.jsx("span",{className:"text-muted-foreground",children:JSON.stringify(e)})}}function Jl({value:e}){const[t,n]=v.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return f.jsx("button",{type:"button",onClick:r,className:"inline-flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors",title:"Copy JSON",children:t?f.jsx(hr,{className:"size-3 text-green-500"}):f.jsx(uo,{className:"size-3"})})}function zN({value:e}){const[t,n]=v.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return f.jsx("button",{type:"button",onClick:r,className:"opacity-0 group-hover/row:opacity-100 hover:bg-muted p-0.5 rounded transition-opacity shrink-0",title:"Copy to clipboard",children:t?f.jsx(hr,{className:"size-3 text-green-500"}):f.jsx(uo,{className:"size-3 text-muted-foreground"})})}function AN(e){return oo(e)?Vs(e).some(([,t])=>oo(t)):!1}function IN({allExpanded:e,onClick:t}){return f.jsx("button",{type:"button",onClick:t,className:"opacity-0 group-hover/row:opacity-100 hover:bg-muted p-0.5 rounded transition-opacity shrink-0",title:e?"Collapse all":"Expand all",children:e?f.jsx(Ky,{className:"size-3.5 text-muted-foreground"}):f.jsx(qy,{className:"size-3.5 text-muted-foreground"})})}function jh({name:e,value:t,level:n,defaultExpandDepth:r,isArrayItem:o}){const[i,s]=v.useState(n<r),[a,l]=v.useState(0),[c,u]=v.useState(null),[h,p]=v.useState(!1),d=oo(t),g=Nh(t),m=g==="array"?"[":"{",y=g==="array"?"]":"}";function x(w){w.stopPropagation(),h?(s(!1),u(0),l(S=>S+1),p(!1)):(s(!0),u(Number.POSITIVE_INFINITY),l(S=>S+1),p(!0))}const b=c??r;return f.jsxs("div",{className:Se(n>0&&"border-l border-border/50 ml-2"),children:[f.jsxs("div",{className:Se("flex items-start gap-1 py-0.5 px-1 -ml-1 rounded-sm group/row",d&&"cursor-pointer hover:bg-muted/50"),onClick:d?()=>{i&&p(!1),s(!i)}:void 0,onKeyDown:d?w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),s(!i))}:void 0,role:d?"button":void 0,tabIndex:d?0:void 0,children:[d?f.jsx("span",{className:"w-4 h-5 flex items-center justify-center shrink-0",children:i?f.jsx(zt,{className:"size-3 text-muted-foreground"}):f.jsx(Ht,{className:"size-3 text-muted-foreground"})}):f.jsx("span",{className:"w-4 shrink-0"}),f.jsx("span",{className:Se("shrink-0",o?"text-muted-foreground":"text-cyan-400"),children:o?e:`"${e}"`}),f.jsx("span",{className:"text-muted-foreground shrink-0",children:d?"":":"}),d?f.jsxs("span",{className:"text-muted-foreground",children:[m,f.jsxs("span",{className:"text-muted-foreground/60 text-xs",children:[" ",Gl(t)," ",Gl(t)===1?"item":"items"," ",y]})]}):f.jsx("span",{className:"min-w-0",children:f.jsx(Th,{value:t})}),d&&AN(t)&&f.jsx(IN,{allExpanded:h,onClick:x}),f.jsx(zN,{value:t})]}),d&&i&&f.jsxs("div",{className:"pl-4",children:[Vs(t).map(([w,S])=>f.jsx(jh,{name:w,value:S,level:n+1,defaultExpandDepth:b,isArrayItem:g==="array"},w)),f.jsx("div",{className:"text-muted-foreground py-0.5 px-1",children:y})]},a)]})}function Hs({data:e,defaultExpandDepth:t=2,className:n,showCopy:r=!1}){if(!oo(e))return f.jsx(ql,{children:f.jsx("div",{className:Se("font-mono text-xs leading-relaxed",n),children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(Th,{value:e}),r&&f.jsx(Jl,{value:e})]})})});const s=Nh(e)==="array";return f.jsx(ql,{children:f.jsxs("div",{className:Se("font-mono text-xs leading-relaxed",n),children:[r&&f.jsx(Jl,{value:e}),Vs(e).map(([a,l])=>f.jsx(jh,{name:a,value:l,level:0,defaultExpandDepth:t,isArrayItem:s},a))]})})}function ui({text:e,defaultExpandDepth:t=2,className:n}){try{const r=JSON.parse(e);return f.jsx(Hs,{data:ur(r),defaultExpandDepth:t,className:n})}catch{return f.jsx("pre",{className:Se("font-mono text-xs whitespace-pre-wrap break-words",n),children:e})}}function ur(e){if(e==null)return null;switch(typeof e){case"string":return e;case"number":return e;case"boolean":return e;case"object":{if(Array.isArray(e))return e.map(n=>ur(n));const t={};for(const n of Object.keys(e)){const r=Object.getOwnPropertyDescriptor(e,n);t[n]=ur(r?.value)}return t}case"bigint":case"symbol":case"function":case"undefined":return String(e)}return null}function Cn({className:e,orientation:t="horizontal",...n}){return f.jsx(wk,{"data-slot":"tabs","data-orientation":t,orientation:t,className:Se("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const RN=as("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function En({className:e,variant:t="default",...n}){return f.jsx(_k,{"data-slot":"tabs-list","data-variant":t,className:Se(RN({variant:t}),e),...n})}function Ge({className:e,...t}){return f.jsx(kk,{"data-slot":"tabs-trigger",className:Se("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function Ke({className:e,...t}){return f.jsx(Sk,{"data-slot":"tabs-content",className:Se("flex-1 outline-none",e),...t})}class zh{diff(t,n,r={}){let o;typeof r=="function"?(o=r,r={}):"callback"in r&&(o=r.callback);const i=this.castInput(t,r),s=this.castInput(n,r),a=this.removeEmpty(this.tokenize(i,r)),l=this.removeEmpty(this.tokenize(s,r));return this.diffWithOptionsObj(a,l,r,o)}diffWithOptionsObj(t,n,r,o){var i;const s=b=>{if(b=this.postProcess(b,r),o){setTimeout(function(){o(b)},0);return}else return b},a=n.length,l=t.length;let c=1,u=a+l;r.maxEditLength!=null&&(u=Math.min(u,r.maxEditLength));const h=(i=r.timeout)!==null&&i!==void 0?i:1/0,p=Date.now()+h,d=[{oldPos:-1,lastComponent:void 0}];let g=this.extractCommon(d[0],n,t,0,r);if(d[0].oldPos+1>=l&&g+1>=a)return s(this.buildValues(d[0].lastComponent,n,t));let m=-1/0,y=1/0;const x=()=>{for(let b=Math.max(m,-c);b<=Math.min(y,c);b+=2){let w;const S=d[b-1],C=d[b+1];S&&(d[b-1]=void 0);let N=!1;if(C){const I=C.oldPos-b;N=C&&0<=I&&I<a}const z=S&&S.oldPos+1<l;if(!N&&!z){d[b]=void 0;continue}if(!z||N&&S.oldPos<C.oldPos?w=this.addToPath(C,!0,!1,0,r):w=this.addToPath(S,!1,!0,1,r),g=this.extractCommon(w,n,t,b,r),w.oldPos+1>=l&&g+1>=a)return s(this.buildValues(w.lastComponent,n,t))||!0;d[b]=w,w.oldPos+1>=l&&(y=Math.min(y,b-1)),g+1>=a&&(m=Math.max(m,b+1))}c++};if(o)(function b(){setTimeout(function(){if(c>u||Date.now()>p)return o(void 0);x()||b()},0)})();else for(;c<=u&&Date.now()<=p;){const b=x();if(b)return b}}addToPath(t,n,r,o,i){const s=t.lastComponent;return s&&!i.oneChangePerToken&&s.added===n&&s.removed===r?{oldPos:t.oldPos+o,lastComponent:{count:s.count+1,added:n,removed:r,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:n,removed:r,previousComponent:s}}}extractCommon(t,n,r,o,i){const s=n.length,a=r.length;let l=t.oldPos,c=l-o,u=0;for(;c+1<s&&l+1<a&&this.equals(r[l+1],n[c+1],i);)c++,l++,u++,i.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return u&&!i.oneChangePerToken&&(t.lastComponent={count:u,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=l,c}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){const o=[];let i;for(;t;)o.push(t),i=t.previousComponent,delete t.previousComponent,t=i;o.reverse();const s=o.length;let a=0,l=0,c=0;for(;a<s;a++){const u=o[a];if(u.removed)u.value=this.join(r.slice(c,c+u.count)),c+=u.count;else{if(!u.added&&this.useLongestToken){let h=n.slice(l,l+u.count);h=h.map(function(p,d){const g=r[c+d];return g.length>p.length?g:p}),u.value=this.join(h)}else u.value=this.join(n.slice(l,l+u.count));l+=u.count,u.added||(c+=u.count)}}return o}}class PN extends zh{constructor(){super(...arguments),this.tokenize=Ih}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
122
+ `},o),i}function J3(e,t){return e&&"run"in e?async function(n,r){const o=Fl(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Fl(n,{file:r,...e||t})}}function $l(e){if(e)throw e}var ni,Bl;function Y3(){if(Bl)return ni;Bl=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},i=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var u=e.call(c,"constructor"),h=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!h)return!1;var p;for(p in c);return typeof p>"u"||e.call(c,p)},s=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},a=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return ni=function l(){var c,u,h,p,d,g,m=arguments[0],y=1,x=arguments.length,b=!1;for(typeof m=="boolean"&&(b=m,m=arguments[1]||{},y=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});y<x;++y)if(c=arguments[y],c!=null)for(u in c)h=a(m,u),p=a(c,u),m!==p&&(b&&p&&(i(p)||(d=o(p)))?(d?(d=!1,g=h&&o(h)?h:[]):g=h&&i(h)?h:{},s(m,{name:u,newValue:l(b,g,p)})):typeof p<"u"&&s(m,{name:u,newValue:p}));return m},ni}var X3=Y3();const ri=qi(X3);function Zi(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Q3(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const s=o.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...o);function a(l,...c){const u=e[++i];let h=-1;if(l){s(l);return}for(;++h<o.length;)(c[h]===null||c[h]===void 0)&&(c[h]=o[h]);o=c,u?eN(u,a)(...c):s(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function eN(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(o);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return o(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){n||(n=!0,t(s,...a))}function i(s){o(null,s)}}const St={basename:tN,dirname:nN,extname:rN,join:oN,sep:"/"};function tN(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');br(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else s<0&&(i=!0,s=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function nN(e){if(br(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function rN(e){br(e);let t=e.length,n=-1,r=0,o=-1,i=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function oN(...e){let t=-1,n;for(;++t<e.length;)br(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":iN(n)}function iN(e){br(e);const t=e.codePointAt(0)===47;let n=sN(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function sN(e,t){let n="",r=0,o=-1,i=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(o===s-1||i===1))if(o!==s-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=s,i=0;continue}}else if(n.length>0){n="",r=0,o=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,i=0}else a===46&&i>-1?i++:i=-1}return n}function br(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const aN={cwd:lN};function lN(){return"/"}function Wi(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function cN(e){if(typeof e=="string")e=new URL(e);else if(!Wi(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return uN(e)}function uN(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const oi=["history","path","basename","stem","extname","dirname"];class Eh{constructor(t){let n;t?Wi(t)?n={path:t}:typeof t=="string"||dN(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":aN.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<oi.length;){const i=oi[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)oi.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?St.basename(this.path):void 0}set basename(t){si(t,"basename"),ii(t,"basename"),this.path=St.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?St.dirname(this.path):void 0}set dirname(t){Ul(this.basename,"dirname"),this.path=St.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?St.extname(this.path):void 0}set extname(t){if(ii(t,"extname"),Ul(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=St.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Wi(t)&&(t=cN(t)),si(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?St.basename(this.path,this.extname):void 0}set stem(t){si(t,"stem"),ii(t,"stem"),this.path=St.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new Ye(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ii(e,t){if(e&&e.includes(St.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+St.sep+"`")}function si(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ul(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function dN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const fN=(function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),hN={}.hasOwnProperty;class Ws extends fN{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Q3()}copy(){const t=new Ws;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ri(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ci("data",this.frozen),this.namespace[t]=n,this):hN.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ci("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Dr(t),r=this.parser||this.Parser;return ai("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ai("process",this.parser||this.Parser),li("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Dr(t),l=r.parse(a);r.run(l,a,function(u,h,p){if(u||!h||!p)return c(u);const d=h,g=r.stringify(d,p);gN(g)?p.value=g:p.result=g,c(u,p)});function c(u,h){u||!h?s(u):i?i(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),ai("processSync",this.parser||this.Parser),li("processSync",this.compiler||this.Compiler),this.process(t,o),Wl("processSync","process",n),r;function o(i,s){n=!0,$l(i),r=s}}run(t,n,r){Zl(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,a){const l=Dr(n);o.run(t,l,c);function c(u,h,p){const d=h||t;u?a(u):s?s(d):r(void 0,d,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),Wl("runSync","run",r),o;function i(s,a){$l(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Dr(n),o=this.compiler||this.Compiler;return li("stringify",o),Zl(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(ci("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...h]=c;l(u,h)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(o.settings=ri(!0,o.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const h=c[u];i(h)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let h=-1,p=-1;for(;++h<r.length;)if(r[h][0]===c){p=h;break}if(p===-1)r.push([c,...u]);else if(u.length>0){let[d,...g]=u;const m=r[p][1];Zi(m)&&Zi(d)&&(d=ri(!0,m,d)),r[p]=[c,d,...g]}}}}const pN=new Ws().freeze();function ai(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function li(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ci(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Zl(e){if(!Zi(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Wl(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Dr(e){return mN(e)?e:new Eh(e)}function mN(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function gN(e){return typeof e=="string"||xN(e)}function xN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const yN="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Vl=[],Hl={allowDangerousHtml:!0},bN=/^(https?|ircs?|mailto|xmpp)$/i,vN=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Ln(e){const t=wN(e),n=_N(e);return kN(t.runSync(t.parse(n),n),e)}function wN(e){const t=e.rehypePlugins||Vl,n=e.remarkPlugins||Vl,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Hl}:Hl;return pN().use(e3).use(n).use(J3,r).use(t)}function _N(e){const t=e.children||"",n=new Eh;return typeof t=="string"&&(n.value=t),n}function kN(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||SN;for(const u of vN)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+yN+u.id,void 0);return Ch(e,c),RS(e,{Fragment:f.Fragment,components:o,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function c(u,h,p){if(u.type==="raw"&&p&&typeof h=="number")return s?p.children.splice(h,1):p.children[h]={type:"text",value:u.value},h;if(u.type==="element"){let d;for(d in Qo)if(Object.hasOwn(Qo,d)&&Object.hasOwn(u.properties,d)){const g=u.properties[d],m=Qo[d];(m===null||m.includes(u.tagName))&&(u.properties[d]=l(String(g||""),d,u))}}if(u.type==="element"){let d=n?!n.includes(u.tagName):i?i.includes(u.tagName):!1;if(!d&&r&&typeof h=="number"&&(d=!r(u,h,p)),d&&p&&typeof h=="number")return a&&u.children?p.children.splice(h,1,...u.children):p.children.splice(h,1),h}}}function SN(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||bN.test(e.slice(0,t))?e:""}function ql({delayDuration:e=0,...t}){return f.jsx($k,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function CN({...e}){return f.jsx(Bk,{"data-slot":"tooltip",...e})}function EN({...e}){return f.jsx(Uk,{"data-slot":"tooltip-trigger",...e})}function NN({className:e,sideOffset:t=0,children:n,...r}){return f.jsx(Zk,{children:f.jsxs(Wk,{"data-slot":"tooltip-content",sideOffset:t,className:Se("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[n,f.jsx(Vk,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function Nh(e){if(e===null)return"null";if(Array.isArray(e))return"array";switch(typeof e){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"object":return"object";case"bigint":case"symbol":case"undefined":case"function":return"object"}}function oo(e){return e!==null&&(Array.isArray(e)||typeof e=="object")}function TN(e,t){const n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0)return n.value}function Vs(e){return Array.isArray(e)?e.map((t,n)=>[String(n),t]):typeof e=="object"&&e!==null?Object.keys(e).map(t=>{const n=TN(e,t);return[t,ur(n)]}):[]}function Gl(e){return Array.isArray(e)?e.length:typeof e=="object"&&e!==null?Object.keys(e).length:0}const Kl=120;function jN({text:e}){const[t,n]=v.useState(!1);return e.length>Kl?f.jsxs("span",{className:"text-emerald-400 break-all",children:['"',t?f.jsx("span",{className:"cursor-pointer prose prose-sm dark:prose-invert inline max-w-none [&_p]:inline [&_p]:my-0 [&_code]:text-emerald-300 [&_a]:text-emerald-300",onClick:o=>{o.stopPropagation(),n(!1)},onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.stopPropagation(),n(!1))},role:"button",tabIndex:0,children:f.jsx(Ln,{children:e})}):f.jsxs(CN,{delayDuration:300,children:[f.jsxs(EN,{onClick:o=>{o.stopPropagation(),n(!0)},className:"text-left cursor-pointer",children:[f.jsx("span",{children:e.slice(0,Kl)}),f.jsx("span",{className:"text-emerald-400/50",children:"…"})]}),f.jsxs(NN,{side:"bottom",className:"max-w-md text-xs p-2 break-words whitespace-pre-wrap",children:[e.slice(0,500),e.length>500?"…":""]})]}),'"']}):f.jsxs("span",{className:"text-emerald-400 break-all",children:['"',f.jsx("span",{className:"prose prose-sm dark:prose-invert inline max-w-none [&_p]:inline [&_p]:my-0 [&_code]:text-emerald-300 [&_a]:text-emerald-300",children:f.jsx(Ln,{children:e})}),'"']})}function Th({value:e}){if(e===null)return f.jsx("span",{className:"text-rose-400 italic",children:"null"});switch(typeof e){case"string":return f.jsx(jN,{text:e});case"number":return f.jsx("span",{className:"text-amber-400",children:e});case"boolean":return f.jsx("span",{className:"text-blue-400",children:e?"true":"false"});case"object":case"bigint":case"symbol":case"undefined":case"function":return f.jsx("span",{className:"text-muted-foreground",children:JSON.stringify(e)})}}function Jl({value:e}){const[t,n]=v.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return f.jsx("button",{type:"button",onClick:r,className:"inline-flex items-center gap-1 text-[10px] text-muted-foreground hover:text-foreground transition-colors",title:"Copy JSON",children:t?f.jsx(hr,{className:"size-3 text-green-500"}):f.jsx(uo,{className:"size-3"})})}function zN({value:e}){const[t,n]=v.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return f.jsx("button",{type:"button",onClick:r,className:"opacity-0 group-hover/row:opacity-100 hover:bg-muted p-0.5 rounded transition-opacity shrink-0",title:"Copy to clipboard",children:t?f.jsx(hr,{className:"size-3 text-green-500"}):f.jsx(uo,{className:"size-3 text-muted-foreground"})})}function IN(e){return oo(e)?Vs(e).some(([,t])=>oo(t)):!1}function AN({allExpanded:e,onClick:t}){return f.jsx("button",{type:"button",onClick:t,className:"opacity-0 group-hover/row:opacity-100 hover:bg-muted p-0.5 rounded transition-opacity shrink-0",title:e?"Collapse all":"Expand all",children:e?f.jsx(Ky,{className:"size-3.5 text-muted-foreground"}):f.jsx(qy,{className:"size-3.5 text-muted-foreground"})})}function jh({name:e,value:t,level:n,defaultExpandDepth:r,isArrayItem:o}){const[i,s]=v.useState(n<r),[a,l]=v.useState(0),[c,u]=v.useState(null),[h,p]=v.useState(!1),d=oo(t),g=Nh(t),m=g==="array"?"[":"{",y=g==="array"?"]":"}";function x(w){w.stopPropagation(),h?(s(!1),u(0),l(S=>S+1),p(!1)):(s(!0),u(Number.POSITIVE_INFINITY),l(S=>S+1),p(!0))}const b=c??r;return f.jsxs("div",{className:Se(n>0&&"border-l border-border/50 ml-2"),children:[f.jsxs("div",{className:Se("flex items-start gap-1 py-0.5 px-1 -ml-1 rounded-sm group/row",d&&"cursor-pointer hover:bg-muted/50"),onClick:d?()=>{i&&p(!1),s(!i)}:void 0,onKeyDown:d?w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),s(!i))}:void 0,role:d?"button":void 0,tabIndex:d?0:void 0,children:[d?f.jsx("span",{className:"w-4 h-5 flex items-center justify-center shrink-0",children:i?f.jsx(zt,{className:"size-3 text-muted-foreground"}):f.jsx(Ht,{className:"size-3 text-muted-foreground"})}):f.jsx("span",{className:"w-4 shrink-0"}),f.jsx("span",{className:Se("shrink-0",o?"text-muted-foreground":"text-cyan-400"),children:o?e:`"${e}"`}),f.jsx("span",{className:"text-muted-foreground shrink-0",children:d?"":":"}),d?f.jsxs("span",{className:"text-muted-foreground",children:[m,f.jsxs("span",{className:"text-muted-foreground/60 text-xs",children:[" ",Gl(t)," ",Gl(t)===1?"item":"items"," ",y]})]}):f.jsx("span",{className:"min-w-0",children:f.jsx(Th,{value:t})}),d&&IN(t)&&f.jsx(AN,{allExpanded:h,onClick:x}),f.jsx(zN,{value:t})]}),d&&i&&f.jsxs("div",{className:"pl-4",children:[Vs(t).map(([w,S])=>f.jsx(jh,{name:w,value:S,level:n+1,defaultExpandDepth:b,isArrayItem:g==="array"},w)),f.jsx("div",{className:"text-muted-foreground py-0.5 px-1",children:y})]},a)]})}function Hs({data:e,defaultExpandDepth:t=2,className:n,showCopy:r=!1}){if(!oo(e))return f.jsx(ql,{children:f.jsx("div",{className:Se("font-mono text-xs leading-relaxed",n),children:f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(Th,{value:e}),r&&f.jsx(Jl,{value:e})]})})});const s=Nh(e)==="array";return f.jsx(ql,{children:f.jsxs("div",{className:Se("font-mono text-xs leading-relaxed",n),children:[r&&f.jsx(Jl,{value:e}),Vs(e).map(([a,l])=>f.jsx(jh,{name:a,value:l,level:0,defaultExpandDepth:t,isArrayItem:s},a))]})})}function ui({text:e,defaultExpandDepth:t=2,className:n}){try{const r=JSON.parse(e);return f.jsx(Hs,{data:ur(r),defaultExpandDepth:t,className:n})}catch{return f.jsx("pre",{className:Se("font-mono text-xs whitespace-pre-wrap break-words",n),children:e})}}function ur(e){if(e==null)return null;switch(typeof e){case"string":return e;case"number":return e;case"boolean":return e;case"object":{if(Array.isArray(e))return e.map(n=>ur(n));const t={};for(const n of Object.keys(e)){const r=Object.getOwnPropertyDescriptor(e,n);t[n]=ur(r?.value)}return t}case"bigint":case"symbol":case"function":case"undefined":return String(e)}return null}function Cn({className:e,orientation:t="horizontal",...n}){return f.jsx(wk,{"data-slot":"tabs","data-orientation":t,orientation:t,className:Se("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const RN=as("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function En({className:e,variant:t="default",...n}){return f.jsx(_k,{"data-slot":"tabs-list","data-variant":t,className:Se(RN({variant:t}),e),...n})}function Ge({className:e,...t}){return f.jsx(kk,{"data-slot":"tabs-trigger",className:Se("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function Ke({className:e,...t}){return f.jsx(Sk,{"data-slot":"tabs-content",className:Se("flex-1 outline-none",e),...t})}class zh{diff(t,n,r={}){let o;typeof r=="function"?(o=r,r={}):"callback"in r&&(o=r.callback);const i=this.castInput(t,r),s=this.castInput(n,r),a=this.removeEmpty(this.tokenize(i,r)),l=this.removeEmpty(this.tokenize(s,r));return this.diffWithOptionsObj(a,l,r,o)}diffWithOptionsObj(t,n,r,o){var i;const s=b=>{if(b=this.postProcess(b,r),o){setTimeout(function(){o(b)},0);return}else return b},a=n.length,l=t.length;let c=1,u=a+l;r.maxEditLength!=null&&(u=Math.min(u,r.maxEditLength));const h=(i=r.timeout)!==null&&i!==void 0?i:1/0,p=Date.now()+h,d=[{oldPos:-1,lastComponent:void 0}];let g=this.extractCommon(d[0],n,t,0,r);if(d[0].oldPos+1>=l&&g+1>=a)return s(this.buildValues(d[0].lastComponent,n,t));let m=-1/0,y=1/0;const x=()=>{for(let b=Math.max(m,-c);b<=Math.min(y,c);b+=2){let w;const S=d[b-1],C=d[b+1];S&&(d[b-1]=void 0);let N=!1;if(C){const A=C.oldPos-b;N=C&&0<=A&&A<a}const z=S&&S.oldPos+1<l;if(!N&&!z){d[b]=void 0;continue}if(!z||N&&S.oldPos<C.oldPos?w=this.addToPath(C,!0,!1,0,r):w=this.addToPath(S,!1,!0,1,r),g=this.extractCommon(w,n,t,b,r),w.oldPos+1>=l&&g+1>=a)return s(this.buildValues(w.lastComponent,n,t))||!0;d[b]=w,w.oldPos+1>=l&&(y=Math.min(y,b-1)),g+1>=a&&(m=Math.max(m,b+1))}c++};if(o)(function b(){setTimeout(function(){if(c>u||Date.now()>p)return o(void 0);x()||b()},0)})();else for(;c<=u&&Date.now()<=p;){const b=x();if(b)return b}}addToPath(t,n,r,o,i){const s=t.lastComponent;return s&&!i.oneChangePerToken&&s.added===n&&s.removed===r?{oldPos:t.oldPos+o,lastComponent:{count:s.count+1,added:n,removed:r,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:n,removed:r,previousComponent:s}}}extractCommon(t,n,r,o,i){const s=n.length,a=r.length;let l=t.oldPos,c=l-o,u=0;for(;c+1<s&&l+1<a&&this.equals(r[l+1],n[c+1],i);)c++,l++,u++,i.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return u&&!i.oneChangePerToken&&(t.lastComponent={count:u,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=l,c}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){const o=[];let i;for(;t;)o.push(t),i=t.previousComponent,delete t.previousComponent,t=i;o.reverse();const s=o.length;let a=0,l=0,c=0;for(;a<s;a++){const u=o[a];if(u.removed)u.value=this.join(r.slice(c,c+u.count)),c+=u.count;else{if(!u.added&&this.useLongestToken){let h=n.slice(l,l+u.count);h=h.map(function(p,d){const g=r[c+d];return g.length>p.length?g:p}),u.value=this.join(h)}else u.value=this.join(n.slice(l,l+u.count));l+=u.count,u.added||(c+=u.count)}}return o}}class PN extends zh{constructor(){super(...arguments),this.tokenize=Ah}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
123
123
  `))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
124
124
  `))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
125
125
  `)&&(t=t.slice(0,-1)),n.endsWith(`
126
- `)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const ON=new PN;function Ah(e,t,n){return ON.diff(e,t,n)}function Ih(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
127
- `));const n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let o=0;o<r.length;o++){const i=r[o];o%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}class DN extends zh{constructor(){super(...arguments),this.tokenize=Ih}get useLongestToken(){return!0}castInput(t,n){const{undefinedReplacement:r,stringifyReplacer:o=(i,s)=>typeof s>"u"?r:s}=n;return typeof t=="string"?t:JSON.stringify(Vi(t,null,null,o),null," ")}equals(t,n,r){return super.equals(t.replace(/,([\r\n])/g,"$1"),n.replace(/,([\r\n])/g,"$1"),r)}}const MN=new DN;function LN(e,t,n){return MN.diff(e,t,n)}function Vi(e,t,n,r,o){t=t||[],n=n||[],r&&(e=r(o===void 0?"":o,e));let i;for(i=0;i<t.length;i+=1)if(t[i]===e)return n[i];let s;if(Object.prototype.toString.call(e)==="[object Array]"){for(t.push(e),s=new Array(e.length),n.push(s),i=0;i<e.length;i+=1)s[i]=Vi(e[i],t,n,r,String(i));return t.pop(),n.pop(),s}if(e&&e.toJSON&&(e=e.toJSON()),typeof e=="object"&&e!==null){t.push(e),s={},n.push(s);const a=[];let l;for(l in e)Object.prototype.hasOwnProperty.call(e,l)&&a.push(l);for(a.sort(),i=0;i<a.length;i+=1)l=a[i],s[l]=Vi(e[l],t,n,r,l);t.pop(),n.pop()}else s=e;return s}function Yl(e){return e===void 0?[]:Object.entries(e).map(t=>[t[0].toLowerCase(),t[1]]).sort(([t],[n])=>t.localeCompare(n))}function Xl([e,t]){return`${e}: ${t}`}function Hi(e){const t=[];let n=0,r=0;for(const o of e){const i=o.value.split(`
126
+ `)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const ON=new PN;function Ih(e,t,n){return ON.diff(e,t,n)}function Ah(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
127
+ `));const n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let o=0;o<r.length;o++){const i=r[o];o%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}class DN extends zh{constructor(){super(...arguments),this.tokenize=Ah}get useLongestToken(){return!0}castInput(t,n){const{undefinedReplacement:r,stringifyReplacer:o=(i,s)=>typeof s>"u"?r:s}=n;return typeof t=="string"?t:JSON.stringify(Vi(t,null,null,o),null," ")}equals(t,n,r){return super.equals(t.replace(/,([\r\n])/g,"$1"),n.replace(/,([\r\n])/g,"$1"),r)}}const MN=new DN;function LN(e,t,n){return MN.diff(e,t,n)}function Vi(e,t,n,r,o){t=t||[],n=n||[],r&&(e=r(o===void 0?"":o,e));let i;for(i=0;i<t.length;i+=1)if(t[i]===e)return n[i];let s;if(Object.prototype.toString.call(e)==="[object Array]"){for(t.push(e),s=new Array(e.length),n.push(s),i=0;i<e.length;i+=1)s[i]=Vi(e[i],t,n,r,String(i));return t.pop(),n.pop(),s}if(e&&e.toJSON&&(e=e.toJSON()),typeof e=="object"&&e!==null){t.push(e),s={},n.push(s);const a=[];let l;for(l in e)Object.prototype.hasOwnProperty.call(e,l)&&a.push(l);for(a.sort(),i=0;i<a.length;i+=1)l=a[i],s[l]=Vi(e[l],t,n,r,l);t.pop(),n.pop()}else s=e;return s}function Yl(e){return e===void 0?[]:Object.entries(e).map(t=>[t[0].toLowerCase(),t[1]]).sort(([t],[n])=>t.localeCompare(n))}function Xl([e,t]){return`${e}: ${t}`}function Hi(e){const t=[];let n=0,r=0;for(const o of e){const i=o.value.split(`
128
128
  `);i.length>0&&i[i.length-1]===""&&i.pop();for(const s of i)o.added?(r+=1,t.push({kind:"added",text:s,oldLineNumber:null,newLineNumber:r})):o.removed?(n+=1,t.push({kind:"removed",text:s,oldLineNumber:n,newLineNumber:null})):(n+=1,r+=1,t.push({kind:"context",text:s,oldLineNumber:n,newLineNumber:r}))}return t}function FN(e,t){const n=Yl(e).map(Xl).join(`
129
129
  `),r=Yl(t).map(Xl).join(`
130
- `);if(n===r)return{lines:[],isEmpty:!0};const o=Ah(n,r);return{lines:Hi(o),isEmpty:!1}}function Ql(e){try{const t=JSON.parse(e);return t===null||typeof t=="string"||typeof t=="object"?t:null}catch{return null}}function $N(e,t){const n=e??"",r=t??"";if(n===r)return{lines:[],isEmpty:!0};const o=Ql(n),i=Ql(r);if(o!==null&&i!==null){const a=LN(o,i)??[];if(a.length===1){const l=a[0];if(l!==void 0&&!l.added&&!l.removed)return{lines:[],isEmpty:!0}}return{lines:Hi(a),isEmpty:!1}}const s=Ah(n,r);return{lines:Hi(s),isEmpty:!1}}const BN=22,di=1e4;function UN(e){return e==="added"?"+":e==="removed"?"-":" "}function ZN(e){return e==="added"?"bg-green-500/10 text-green-700 dark:text-green-300":e==="removed"?"bg-red-500/10 text-red-700 dark:text-red-300":"text-foreground/80"}function ec({result:e,emptyLabel:t}){const[n,r]=v.useState("unified"),o=v.useRef(null),i=Qc({count:e.lines.length,getScrollElement:()=>o.current,estimateSize:()=>BN,overscan:10});if(e.isEmpty)return f.jsx("div",{className:"rounded border border-dashed border-border bg-muted/30 px-4 py-6 text-center text-xs text-muted-foreground","data-testid":"diff-empty",children:t??"No transformation applied — raw and processed are identical."});const s=e.lines.length,a=s>di,l=a?e.lines.slice(0,di):e.lines;return f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[f.jsxs("span",{children:[s.toLocaleString()," line",s===1?"":"s",a&&` (showing first ${di.toLocaleString()})`]}),f.jsxs("div",{className:"inline-flex rounded-md border border-border overflow-hidden",children:[f.jsxs("button",{type:"button",onClick:()=>r("unified"),"aria-pressed":n==="unified",className:Se("flex items-center gap-1 px-2 py-1 transition-colors",n==="unified"?"bg-muted text-foreground":"hover:bg-muted/50"),title:"Unified diff (single column)",children:[f.jsx(Mb,{className:"size-3"}),"Unified"]}),f.jsxs("button",{type:"button",onClick:()=>r("split"),"aria-pressed":n==="split",className:Se("flex items-center gap-1 px-2 py-1 transition-colors border-l border-border",n==="split"?"bg-muted text-foreground":"hover:bg-muted/50"),title:"Split diff (side by side)",children:[f.jsx(ob,{className:"size-3"}),"Split"]})]})]}),f.jsx("div",{ref:o,className:"max-h-[60vh] overflow-auto rounded border border-border bg-background font-mono text-xs","data-testid":"diff-viewport",children:n==="unified"?f.jsx(WN,{virtualizer:i,lines:l}):f.jsx(qN,{lines:l})})]})}function WN({virtualizer:e,lines:t}){return f.jsx("div",{style:{height:`${e.getTotalSize()}px`,width:"100%",position:"relative"},children:e.getVirtualItems().map(n=>{const r=t[n.index];return r===void 0?null:f.jsxs("div",{"data-index":n.index,ref:e.measureElement,className:Se("flex items-start gap-3 px-2",ZN(r.kind)),style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${n.start}px)`},children:[f.jsx("span",{className:"select-none text-muted-foreground/60 w-10 text-right tabular-nums",children:r.oldLineNumber??""}),f.jsx("span",{className:"select-none text-muted-foreground/60 w-10 text-right tabular-nums",children:r.newLineNumber??""}),f.jsx("span",{className:Se("select-none w-3 text-right font-bold",r.kind==="added"&&"text-green-600 dark:text-green-400",r.kind==="removed"&&"text-red-600 dark:text-red-400"),children:UN(r.kind)}),f.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:r.text})]},n.key)})})}function VN(e){const t=[];let n=0;for(;n<e.length;){const r=e[n];if(r===void 0)break;if(r.kind==="context"){t.push({left:{text:r.text,lineNumber:r.oldLineNumber},right:{text:r.text,lineNumber:r.newLineNumber},kind:"equal"}),n+=1;continue}const o=[],i=[];for(;n<e.length&&e[n]?.kind==="removed";){const a=e[n];a!==void 0&&o.push(a),n+=1}for(;n<e.length&&e[n]?.kind==="added";){const a=e[n];a!==void 0&&i.push(a),n+=1}const s=Math.max(o.length,i.length);for(let a=0;a<s;a+=1){const l=o[a],c=i[a];l!==void 0&&c!==void 0?t.push({left:{text:l.text,lineNumber:l.oldLineNumber},right:{text:c.text,lineNumber:c.newLineNumber},kind:"changed"}):l!==void 0?t.push({left:{text:l.text,lineNumber:l.oldLineNumber},right:null,kind:"removed"}):c!==void 0&&t.push({left:null,right:{text:c.text,lineNumber:c.newLineNumber},kind:"added"})}}return t}function HN(e){switch(e){case"changed":return"bg-amber-500/10";case"removed":return"bg-red-500/10";case"added":return"bg-green-500/10";case"equal":return""}}function qN({lines:e}){const t=VN(e);return f.jsx("div",{"data-testid":"diff-split",children:t.map((n,r)=>f.jsxs("div",{className:Se("grid grid-cols-2 font-mono text-xs",HN(n.kind)),children:[f.jsxs("div",{className:"flex items-start gap-2 px-2 border-r border-border/50",children:[f.jsx("span",{className:"select-none text-muted-foreground/60 w-8 text-right tabular-nums",children:n.left?.lineNumber??""}),f.jsx("span",{className:Se("select-none w-3 text-right font-bold",(n.kind==="removed"||n.kind==="changed")&&"text-red-600 dark:text-red-400"),children:n.left!==null?"-":" "}),f.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:n.left?.text??""})]}),f.jsxs("div",{className:"flex items-start gap-2 px-2",children:[f.jsx("span",{className:"select-none text-muted-foreground/60 w-8 text-right tabular-nums",children:n.right?.lineNumber??""}),f.jsx("span",{className:Se("select-none w-3 text-right font-bold",(n.kind==="added"||n.kind==="changed")&&"text-green-600 dark:text-green-400"),children:n.right!==null?"+":" "}),f.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:n.right?.text??""})]})]},r))})}const GN="data:image/svg+xml,%3csvg%20height='2500'%20viewBox='0%206.603%201192.672%201193.397'%20width='2500'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m233.96%20800.215%20234.684-131.678%203.947-11.436-3.947-6.363h-11.436l-39.221-2.416-134.094-3.624-116.296-4.832-112.67-6.04-28.35-6.04-26.577-35.035%202.738-17.477%2023.84-16.027%2034.147%202.98%2075.463%205.155%20113.235%207.812%2082.147%204.832%20121.692%2012.644h19.329l2.738-7.812-6.604-4.832-5.154-4.832-117.182-79.41-126.845-83.92-66.443-48.321-35.92-24.484-18.12-22.953-7.813-50.093%2032.618-35.92%2043.812%202.98%2011.195%202.98%2044.375%2034.147%2094.792%2073.37%20123.786%2091.167%2018.12%2015.06%207.249-5.154.886-3.624-8.135-13.61-67.329-121.692-71.838-123.785-31.974-51.302-8.456-30.765c-2.98-12.645-5.154-23.275-5.154-36.242l37.127-50.416%2020.537-6.604%2049.53%206.604%2020.86%2018.121%2030.765%2070.39%2049.852%20110.818%2077.315%20150.684%2022.631%2044.698%2012.08%2041.396%204.51%2012.645h7.813v-7.248l6.362-84.886%2011.759-104.215%2011.436-134.094%203.946-37.772%2018.685-45.262%2037.127-24.482%2028.994%2013.852%2023.839%2034.148-3.303%2022.067-14.174%2092.134-27.785%20144.323-18.121%2096.644h10.55l12.08-12.08%2048.887-64.913%2082.147-102.685%2036.242-40.752%2042.282-45.02%2027.14-21.423h51.303l37.772%2056.135-16.913%2057.986-52.832%2067.007-43.812%2056.779-62.82%2084.563-39.22%2067.651%203.623%205.396%209.343-.886%20141.906-30.201%2076.671-13.852%2091.49-15.705%2041.396%2019.329%204.51%2019.65-16.269%2040.189-97.852%2024.16-114.764%2022.954-170.9%2040.43-2.093%201.53%202.416%202.98%2076.993%207.248%2032.94%201.771h80.617l150.12%2011.195%2039.222%2025.933%2023.517%2031.732-3.946%2024.16-60.403%2030.766-81.503-19.33-190.228-45.26-65.235-16.27h-9.02v5.397l54.362%2053.154%2099.624%2089.96%20124.752%20115.973%206.362%2028.671-16.027%2022.63-16.912-2.415-109.611-82.47-42.282-37.127-95.758-80.618h-6.363v8.456l22.067%2032.296%20116.537%20175.167%206.04%2053.719-8.456%2017.476-30.201%2010.55-33.181-6.04-68.215-95.758-70.39-107.84-56.778-96.644-6.926%203.947-33.503%20360.886-15.705%2018.443-36.243%2013.852-30.201-22.953-16.027-37.127%2016.027-73.37%2019.329-95.758%2015.704-76.107%2014.175-94.55%208.456-31.41-.563-2.094-6.927.886-71.275%2097.852-108.402%20146.497-85.772%2091.812-20.537%208.134-35.597-18.443%203.301-32.94%2019.893-29.315%20118.712-151.007%2071.597-93.583%2046.228-54.04-.322-7.813h-2.738l-315.302%20204.725-56.135%207.248-24.16-22.63%202.98-37.128%2011.435-12.08%2094.792-65.236-.322.323z'%20fill='%23d97757'/%3e%3c/svg%3e",KN="data:image/svg+xml,%3csvg%20height='2500'%20viewBox='-1%20-.1%20949.1%20959.8'%20width='2474'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m925.8%20456.3c10.4%2023.2%2017%2048%2019.7%2073.3%202.6%2025.3%201.3%2050.9-4.1%2075.8-5.3%2024.9-14.5%2048.8-27.3%2070.8-8.4%2014.7-18.3%2028.5-29.7%2041.2-11.3%2012.6-23.9%2024-37.6%2034-13.8%2010-28.5%2018.4-44.1%2025.3-15.5%206.8-31.7%2012-48.3%2015.4-7.8%2024.2-19.4%2047.1-34.4%2067.7-14.9%2020.6-33%2038.7-53.6%2053.6-20.6%2015-43.4%2026.6-67.6%2034.4-24.2%207.9-49.5%2011.8-75%2011.8-16.9.1-33.9-1.7-50.5-5.1-16.5-3.5-32.7-8.8-48.2-15.7s-30.2-15.5-43.9-25.5c-13.6-10-26.2-21.5-37.4-34.2-25%205.4-50.6%206.7-75.9%204.1-25.3-2.7-50.1-9.3-73.4-19.7-23.2-10.3-44.7-24.3-63.6-41.4s-35-37.1-47.7-59.1c-8.5-14.7-15.5-30.2-20.8-46.3s-8.8-32.7-10.6-49.6c-1.8-16.8-1.7-33.8.1-50.7%201.8-16.8%205.5-33.4%2010.8-49.5-17-18.9-31-40.4-41.4-63.6-10.3-23.3-17-48-19.6-73.3-2.7-25.3-1.3-50.9%204-75.8s14.5-48.8%2027.3-70.8c8.4-14.7%2018.3-28.6%2029.6-41.2s24-24%2037.7-34%2028.5-18.5%2044-25.3c15.6-6.9%2031.8-12%2048.4-15.4%207.8-24.3%2019.4-47.1%2034.3-67.7%2015-20.6%2033.1-38.7%2053.7-53.7%2020.6-14.9%2043.4-26.5%2067.6-34.4%2024.2-7.8%2049.5-11.8%2075-11.7%2016.9-.1%2033.9%201.6%2050.5%205.1s32.8%208.7%2048.3%2015.6c15.5%207%2030.2%2015.5%2043.9%2025.5%2013.7%2010.1%2026.3%2021.5%2037.5%2034.2%2024.9-5.3%2050.5-6.6%2075.8-4s50%209.3%2073.3%2019.6c23.2%2010.4%2044.7%2024.3%2063.6%2041.4%2018.9%2017%2035%2036.9%2047.7%2059%208.5%2014.6%2015.5%2030.1%2020.8%2046.3%205.3%2016.1%208.9%2032.7%2010.6%2049.6%201.8%2016.9%201.8%2033.9-.1%2050.8-1.8%2016.9-5.5%2033.5-10.8%2049.6%2017.1%2018.9%2031%2040.3%2041.4%2063.6zm-333.2%20426.9c21.8-9%2041.6-22.3%2058.3-39s30-36.5%2039-58.4c9-21.8%2013.7-45.2%2013.7-68.8v-223q-.1-.3-.2-.7-.1-.3-.3-.6-.2-.3-.5-.5-.3-.3-.6-.4l-80.7-46.6v269.4c0%202.7-.4%205.5-1.1%208.1-.7%202.7-1.7%205.2-3.1%207.6s-3%204.6-5%206.5a32.1%2032.1%200%200%201%20-6.5%205l-191.1%20110.3c-1.6%201-4.3%202.4-5.7%203.2%207.9%206.7%2016.5%2012.6%2025.5%2017.8%209.1%205.2%2018.5%209.6%2028.3%2013.2%209.8%203.5%2019.9%206.2%2030.1%208%2010.3%201.8%2020.7%202.7%2031.1%202.7%2023.6%200%2047-4.7%2068.8-13.8zm-455.1-151.4c11.9%2020.5%2027.6%2038.3%2046.3%2052.7%2018.8%2014.4%2040.1%2024.9%2062.9%2031s46.6%207.7%2070%204.6%2045.9-10.7%2066.4-22.5l193.2-111.5.5-.5q.2-.2.3-.6.2-.3.3-.6v-94l-233.2%20134.9c-2.4%201.4-4.9%202.4-7.5%203.2-2.7.7-5.4%201-8.2%201-2.7%200-5.4-.3-8.1-1-2.6-.8-5.2-1.8-7.6-3.2l-191.1-110.4c-1.7-1-4.2-2.5-5.6-3.4-1.8%2010.3-2.7%2020.7-2.7%2031.1s1%2020.8%202.8%2031.1c1.8%2010.2%204.6%2020.3%208.1%2030.1%203.6%209.8%208%2019.2%2013.2%2028.2zm-50.2-417c-11.8%2020.5-19.4%2043.1-22.5%2066.5s-1.5%2047.1%204.6%2070c6.1%2022.8%2016.6%2044.1%2031%2062.9%2014.4%2018.7%2032.3%2034.4%2052.7%2046.2l193.1%20111.6q.3.1.7.2h.7q.4%200%20.7-.2.3-.1.6-.3l81-46.8-233.2-134.6c-2.3-1.4-4.5-3.1-6.5-5a32.1%2032.1%200%200%201%20-5-6.5c-1.3-2.4-2.4-4.9-3.1-7.6-.7-2.6-1.1-5.3-1-8.1v-227.1c-9.8%203.6-19.3%208-28.3%2013.2-9%205.3-17.5%2011.3-25.5%2018-7.9%206.7-15.3%2014.1-22%2022.1-6.7%207.9-12.6%2016.5-17.8%2025.5zm663.3%20154.4c2.4%201.4%204.6%203%206.6%205%201.9%201.9%203.6%204.1%205%206.5%201.3%202.4%202.4%205%203.1%207.6.6%202.7%201%205.4.9%208.2v227.1c32.1-11.8%2060.1-32.5%2080.8-59.7%2020.8-27.2%2033.3-59.7%2036.2-93.7s-3.9-68.2-19.7-98.5-39.9-55.5-69.5-72.5l-193.1-111.6q-.3-.1-.7-.2h-.7q-.3.1-.7.2-.3.1-.6.3l-80.6%2046.6%20233.2%20134.7zm80.5-121h-.1v.1zm-.1-.1c5.8-33.6%201.9-68.2-11.3-99.7-13.1-31.5-35-58.6-63-78.2-28-19.5-61-30.7-95.1-32.2-34.2-1.4-68%206.9-97.6%2023.9l-193.1%20111.5q-.3.2-.5.5l-.4.6q-.1.3-.2.7-.1.3-.1.7v93.2l233.2-134.7c2.4-1.4%205-2.4%207.6-3.2%202.7-.7%205.4-1%208.1-1%202.8%200%205.5.3%208.2%201%202.6.8%205.1%201.8%207.5%203.2l191.1%20110.4c1.7%201%204.2%202.4%205.6%203.3zm-505.3-103.2c0-2.7.4-5.4%201.1-8.1.7-2.6%201.7-5.2%203.1-7.6%201.4-2.3%203-4.5%205-6.5%201.9-1.9%204.1-3.6%206.5-4.9l191.1-110.3c1.8-1.1%204.3-2.5%205.7-3.2-26.2-21.9-58.2-35.9-92.1-40.2-33.9-4.4-68.3%201-99.2%2015.5-31%2014.5-57.2%2037.6-75.5%2066.4-18.3%2028.9-28%2062.3-28%2096.5v223q.1.4.2.7.1.3.3.6.2.3.5.6.2.2.6.4l80.7%2046.6zm43.8%20294.7%20103.9%2060%20103.9-60v-119.9l-103.8-60-103.9%2060z'/%3e%3c/svg%3e",JN="data:image/svg+xml,%3csvg%20fill='none'%20height='1320'%20viewBox='3.771%206.973%2023.993%2017.652'%20width='2500'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m27.501%208.469c-.252-.123-.36.111-.508.23-.05.04-.093.09-.135.135-.368.395-.797.652-1.358.621-.821-.045-1.521.213-2.14.842-.132-.776-.57-1.238-1.235-1.535-.349-.155-.701-.309-.944-.645-.171-.238-.217-.504-.303-.765-.054-.159-.108-.32-.29-.348-.197-.031-.274.135-.352.273-.31.567-.43%201.192-.419%201.825.028%201.421.628%202.554%201.82%203.36.136.093.17.186.128.321-.081.278-.178.547-.264.824-.054.178-.135.217-.324.14a5.448%205.448%200%200%201%20-1.719-1.169c-.848-.82-1.614-1.726-2.57-2.435-.225-.166-.449-.32-.681-.467-.976-.95.128-1.729.383-1.82.267-.096.093-.428-.77-.424s-1.653.293-2.659.677a2.782%202.782%200%200%201%20-.46.135%209.554%209.554%200%200%200%20-2.853-.1c-1.866.21-3.356%201.092-4.452%202.6-1.315%201.81-1.625%203.87-1.246%206.018.399%202.261%201.552%204.136%203.326%205.601%201.837%201.518%203.955%202.262%206.37%202.12%201.466-.085%203.1-.282%204.942-1.842.465.23.952.322%201.762.392.623.059%201.223-.031%201.687-.127.728-.154.677-.828.414-.953-2.132-.994-1.665-.59-2.09-.916%201.084-1.285%202.717-2.619%203.356-6.94.05-.343.007-.558%200-.837-.004-.168.034-.235.228-.254a4.084%204.084%200%200%200%201.529-.47c1.382-.757%201.938-1.997%202.07-3.485.02-.227-.004-.463-.243-.582zm-12.041%2013.391c-2.067-1.627-3.07-2.162-3.483-2.138-.387.021-.318.465-.233.754.089.285.205.482.368.732.113.166.19.414-.112.598-.666.414-1.823-.139-1.878-.166-1.347-.793-2.473-1.842-3.267-3.276-.765-1.38-1.21-2.861-1.284-4.441-.02-.383.093-.518.472-.586a4.692%204.692%200%200%201%201.514-.04c2.109.31%203.905%201.255%205.41%202.749.86.853%201.51%201.871%202.18%202.865.711%201.057%201.478%202.063%202.454%202.887.343.289.619.51.881.672-.792.088-2.117.107-3.022-.61zm.99-6.38a.304.304%200%201%201%20.609%200c0%20.17-.136.304-.306.304a.3.3%200%200%201%20-.303-.305zm3.077%201.581c-.197.08-.394.15-.584.159a1.246%201.246%200%200%201%20-.79-.252c-.27-.227-.463-.354-.546-.752a1.752%201.752%200%200%201%20.016-.582c.07-.324-.008-.531-.235-.72-.187-.155-.422-.196-.682-.196a.551.551%200%200%201%20-.252-.078c-.108-.055-.197-.19-.112-.356.027-.053.159-.183.19-.207.352-.201.758-.135%201.134.016.349.142.611.404.99.773.388.448.457.573.678.906.174.264.333.534.441.842.066.192-.02.35-.248.448z'%20fill='%234d6bfe'/%3e%3c/svg%3e",YN="/assets/minimax-BPMzvuL-.jpeg",XN="/assets/alibaba-TTwafVwX.svg",QN="/assets/qwen-CONDcHqt.png",e5="/assets/zhipuai-BPNAnxo-.svg",t5={"claude-":"anthropic","gpt-":"openai","o1-":"openai","o3-":"openai","deepseek-":"deepseek",MiniMax:"minimax",qwen:"qwen","glm-":"zhipuai"};function n5(e){if(e===null)return"unknown";const t=e.toLowerCase();for(const[n,r]of Object.entries(t5))if(t.startsWith(n.toLowerCase()))return r;return"unknown"}const gn={width:24,height:24,objectFit:"contain"},r5=tt.memo(({className:e})=>f.jsx("img",{src:GN,alt:"Anthropic",className:e,style:gn})),o5=tt.memo(({className:e})=>f.jsx("img",{src:KN,alt:"OpenAI",className:e,style:{...gn,background:"white",borderRadius:"4px"}})),i5=tt.memo(({className:e})=>f.jsx("img",{src:JN,alt:"DeepSeek",className:e,style:gn})),s5=tt.memo(({className:e})=>f.jsx("img",{src:YN,alt:"MiniMax",className:e,style:gn})),a5=tt.memo(({className:e})=>f.jsx("img",{src:XN,alt:"Alibaba",className:e,style:gn})),l5=tt.memo(({className:e})=>f.jsx("img",{src:QN,alt:"Qwen",className:e,style:gn})),c5=tt.memo(({className:e})=>f.jsx("img",{src:e5,alt:"ZhipuAI",className:e,style:gn}));function u5({provider:e,className:t}){switch(e){case"anthropic":return f.jsx(r5,{className:t});case"openai":return f.jsx(o5,{className:t});case"deepseek":return f.jsx(i5,{className:t});case"minimax":return f.jsx(s5,{className:t});case"alibaba":return f.jsx(a5,{className:t});case"qwen":return f.jsx(l5,{className:t});case"zhipuai":return f.jsx(c5,{className:t});case"unknown":return null}}function d5(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}const tc={success:"bg-emerald-500/15 text-emerald-400 border-emerald-500/25",client_error:"bg-amber-500/15 text-amber-400 border-amber-500/25",server_error:"",pending:"bg-muted text-muted-foreground border-border"},f5=v.memo(function({log:e,parsedRequest:t,expanded:n,onToggle:r,suppressApiFormatBadge:o=!1}){const i=Cu(e.responseStatus),s=e.inputTokens!==null||e.outputTokens!==null,a=t!==null?t.messages.length:null,l=t!==null&&t.tools!==void 0&&t.tools.length>0?t.tools.length:null;return f.jsxs("div",{role:"button",tabIndex:0,className:Se("flex items-center gap-2.5 px-3 py-2 cursor-pointer transition-colors","hover:bg-muted/50","select-none"),onClick:r,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),r())},children:[f.jsxs("span",{className:"text-blue-400/80 font-mono text-xs font-semibold tabular-nums shrink-0",children:["#",e.id]}),e.model!==null&&f.jsxs(f.Fragment,{children:[f.jsx(u5,{provider:n5(e.model),className:"size-4 shrink-0"}),f.jsx(lt,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model})]}),!o&&f.jsx(lt,{variant:"outline",className:Se("text-[10px] px-1.5 py-0 h-5 font-mono shrink-0",e.apiFormat==="openai"&&"border-blue-500/40 text-blue-400",e.apiFormat==="anthropic"&&"border-orange-500/40 text-orange-400",e.apiFormat==="unknown"&&"border-muted text-muted-foreground"),children:e.apiFormat==="anthropic"?"Anthropic":e.apiFormat==="openai"?"OpenAI":"Unknown"}),i==="server_error"?f.jsx(lt,{variant:"destructive",className:"text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",children:e.responseStatus}):i==="pending"?f.jsx(lt,{variant:"outline",className:Se("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",tc[i]),children:f.jsx(iu,{className:"size-3 animate-spin"})}):f.jsx(lt,{variant:"outline",className:Se("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",tc[i]),children:e.responseStatus}),e.elapsedMs!==null&&f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[f.jsx(os,{className:"size-3"}),f.jsx("span",{className:"font-mono tabular-nums",children:d5(e.elapsedMs)})]}),s&&f.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[f.jsx(pr,{className:"size-3 text-muted-foreground"}),f.jsxs("span",{className:"font-mono tabular-nums",children:[f.jsxs("span",{className:e.inputTokens!==null?"text-blue-400":"text-muted-foreground",children:["IN ",e.inputTokens!==null?Je(e.inputTokens):"—"]})," / ",f.jsxs("span",{className:e.outputTokens!==null?"text-amber-400":"text-muted-foreground",children:["OUT ",e.outputTokens!==null?Je(e.outputTokens):"—"]})]})]}),e.cacheCreationInputTokens!==null&&e.cacheCreationInputTokens>0&&f.jsx("span",{className:"flex items-center gap-1 text-xs shrink-0",children:f.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Je(e.cacheCreationInputTokens)]})}),e.cacheReadInputTokens!==null&&e.cacheReadInputTokens>0&&f.jsx("span",{className:"flex items-center gap-1 text-xs shrink-0",children:f.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Je(e.cacheReadInputTokens)]})}),a!==null&&f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[f.jsx(su,{className:"size-3"}),f.jsx("span",{className:"font-mono tabular-nums",children:a})]}),l!==null&&f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[f.jsx(rv,{className:"size-3"}),f.jsx("span",{className:"font-mono tabular-nums",children:l})]}),e.origin!==null&&f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",title:`Origin: ${e.origin}`,children:[f.jsx(yb,{className:"size-3"}),f.jsx("span",{className:"font-mono tabular-nums truncate max-w-[120px]",title:e.origin,children:e.origin})]}),e.userAgent!==null&&f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",title:`User-Agent: ${e.userAgent}`,children:[f.jsx(Yb,{className:"size-3"}),f.jsx("span",{className:"font-mono tabular-nums truncate max-w-[150px]",title:e.userAgent,children:e.userAgent})]}),(e.clientPid!==null||e.clientProjectFolder!==null)&&f.jsxs("span",{className:"flex items-center gap-1 text-purple-400/80 text-xs shrink-0",title:e.clientCwd!==null?`PID: ${e.clientPid??"?"} | CWD: ${e.clientCwd}`:`PID: ${e.clientPid??"?"}`,children:[f.jsx(fb,{className:"size-3"}),e.clientProjectFolder!==null?f.jsx("span",{className:"font-mono tabular-nums",children:e.clientProjectFolder}):f.jsxs("span",{className:"font-mono tabular-nums",children:["PID ",e.clientPid]})]}),e.streaming&&f.jsx(Rb,{className:"size-3 text-muted-foreground/60 shrink-0"}),f.jsx("span",{className:"flex-1 min-w-0"}),n?f.jsx(zt,{className:"size-4 text-muted-foreground shrink-0"}):f.jsx(Ht,{className:"size-4 text-muted-foreground shrink-0"})]})});function Rh({...e}){return f.jsx(Bw,{"data-slot":"dialog",...e})}function h5({...e}){return f.jsx(Uw,{"data-slot":"dialog-trigger",...e})}function p5({...e}){return f.jsx(Zw,{"data-slot":"dialog-portal",...e})}function m5({className:e,...t}){return f.jsx(Ww,{"data-slot":"dialog-overlay",className:Se("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t})}function Ph({className:e,children:t,...n}){return f.jsxs(p5,{children:[f.jsx(m5,{}),f.jsxs(Vw,{"data-slot":"dialog-content",className:Se("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...n,children:[t,f.jsxs(qw,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[f.jsx(iv,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Oh({className:e,...t}){return f.jsx("div",{"data-slot":"dialog-header",className:Se("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function Dh({className:e,...t}){return f.jsx(Hw,{"data-slot":"dialog-title",className:Se("text-lg font-semibold leading-none tracking-tight",e),...t})}function Mh({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return f.jsx(yk,{"data-slot":"separator",decorative:n,orientation:t,className:Se("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function qs({...e}){return f.jsx(T1,{"data-slot":"collapsible",...e})}function Gs({...e}){return f.jsx(Ru,{"data-slot":"collapsible-trigger",...e})}function Ks({...e}){return f.jsx(Pu,{"data-slot":"collapsible-content",...e})}function Lh({className:e,children:t,...n}){return f.jsxs(A_,{"data-slot":"scroll-area",className:Se("relative",e),...n,children:[f.jsx(I_,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),f.jsx(g5,{}),f.jsx(R_,{})]})}function g5({className:e,orientation:t="vertical",...n}){return f.jsx(Wd,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Se("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:f.jsx(Gd,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function x5(e){return f.jsx(f.Fragment,{})}function y5({text:e}){const[t,n]=v.useState(!1);return f.jsxs(qs,{open:t,onOpenChange:n,children:[f.jsxs(Gs,{className:"flex items-center gap-1.5 py-0.5 cursor-pointer hover:opacity-80 transition-opacity group",children:[t?f.jsx(zt,{className:"size-3 text-muted-foreground"}):f.jsx(Ht,{className:"size-3 text-muted-foreground"}),f.jsx("span",{className:"text-muted-foreground text-xs italic select-none opacity-60",children:"[system-reminder]"})]}),f.jsx(Ks,{children:f.jsx("div",{className:"pl-4 pt-1",children:f.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1",children:f.jsx(Ln,{children:e})})})})]})}const b5=/<think>([\s\S]*?)<\/think>/gi,v5=/<think>([\s\S]*?)<\/think>/i;function Fh(e){const t=v5.exec(e);if(!t||t[1]===void 0)return{thinking:null,remainingText:e};const n=t[1].trim(),r=e.replace(b5,"").trim();return{thinking:n,remainingText:r}}function w5({text:e}){if(e.includes("<system-reminder>"))return f.jsx(y5,{text:e});const{thinking:t,remainingText:n}=Fh(e);return f.jsxs("div",{className:"space-y-2",children:[t!==null&&f.jsx(io,{thinking:t}),n.length>0&&f.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1",children:f.jsx(Ln,{children:n})}),t===null&&n.length===0&&f.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty text block"})]})}function io({thinking:e}){const[t,n]=v.useState(!1);return f.jsx(qs,{open:t,onOpenChange:n,children:f.jsxs("div",{className:"border-l-2 border-purple-500/40 my-1",children:[f.jsxs(Gs,{className:"flex items-center gap-1.5 px-3 py-1 w-full text-left cursor-pointer hover:bg-purple-500/5 transition-colors rounded-r-sm group",children:[f.jsx($y,{className:"size-3.5 text-purple-400 shrink-0"}),f.jsx("span",{className:"text-xs font-medium text-purple-400",children:"Thinking"}),f.jsxs(lt,{variant:"ghost",className:"text-[10px] text-muted-foreground px-1.5 py-0 h-4 font-mono",children:[e.length.toLocaleString()," chars"]}),f.jsx("span",{className:"flex-1"}),t?f.jsx(zt,{className:"size-3 text-muted-foreground"}):f.jsx(Ht,{className:"size-3 text-muted-foreground"})]}),f.jsx(Ks,{children:f.jsx("div",{className:"px-3 pb-2",children:f.jsx(Lh,{className:"max-h-[60vh]",children:f.jsx("pre",{className:"text-xs text-muted-foreground whitespace-pre-wrap font-mono leading-relaxed",children:e})})})})]})})}function _5({name:e,input:t}){const[n,r]=v.useState(!1);return f.jsx(qs,{open:n,onOpenChange:r,children:f.jsxs("div",{className:"border-l-2 border-blue-500/40 my-1",children:[f.jsxs(Gs,{className:"flex items-center gap-1.5 px-3 py-1 w-full text-left cursor-pointer hover:bg-blue-500/5 transition-colors rounded-r-sm group",children:[f.jsx(Zb,{className:"size-3.5 text-blue-400 shrink-0"}),f.jsx(lt,{variant:"outline",className:"text-[10px] font-mono px-1.5 py-0 h-4",children:e}),f.jsx("span",{className:"flex-1"}),n?f.jsx(zt,{className:"size-3 text-muted-foreground"}):f.jsx(Ht,{className:"size-3 text-muted-foreground"})]}),f.jsx(Ks,{children:f.jsx("div",{className:"px-3 pb-2",children:f.jsx(Lh,{className:"max-h-[60vh]",children:f.jsx(Hs,{data:ur(t),defaultExpandDepth:2})})})})]})})}function k5({block:e}){switch(e.type){case"text":return f.jsx(w5,{text:e.text});case"thinking":case"think":return f.jsx(io,{thinking:e.thinking});case"tool_use":return f.jsx(_5,{name:e.name,input:e.input});default:return x5()}}function S5({response:e}){return f.jsxs("div",{className:"space-y-3",children:[f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.jsx(lt,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model}),e.stop_reason!==null&&f.jsxs(lt,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[f.jsx(tu,{className:"size-2.5"}),e.stop_reason]}),f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[f.jsx(pr,{className:"size-3"}),f.jsxs("span",{className:"font-mono tabular-nums",children:[Je(e.usage.input_tokens??0)," in /"," ",Je(e.usage.output_tokens??0)," out"]}),e.usage.cache_creation_input_tokens!==void 0&&e.usage.cache_creation_input_tokens!==null&&e.usage.cache_creation_input_tokens>0&&f.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Je(e.usage.cache_creation_input_tokens)]}),e.usage.cache_read_input_tokens!==void 0&&e.usage.cache_read_input_tokens!==null&&e.usage.cache_read_input_tokens>0&&f.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Je(e.usage.cache_read_input_tokens)]})]})]}),f.jsx(Mh,{className:"opacity-50"}),f.jsxs("div",{className:"space-y-2",children:[e.content.map((t,n)=>f.jsx(k5,{block:t},n)),e.content.length===0&&f.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})}function C5({response:e}){const t=e.choices[0],n=t?.message;return f.jsxs("div",{className:"space-y-3",children:[f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.jsx(lt,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model}),t?.finish_reason!==null&&t?.finish_reason!==void 0&&f.jsxs(lt,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[f.jsx(tu,{className:"size-2.5"}),t.finish_reason]}),f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[f.jsx(pr,{className:"size-3"}),f.jsxs("span",{className:"font-mono tabular-nums",children:[Je(e.usage.prompt_tokens??0)," in /"," ",Je(e.usage.completion_tokens??0)," out"]})]})]}),f.jsx(Mh,{className:"opacity-50"}),f.jsxs("div",{className:"space-y-2",children:[n?.reasoning_content!==null&&n?.reasoning_content!==void 0&&n.reasoning_content.length>0&&f.jsx(io,{thinking:n.reasoning_content}),n?.content!==null&&n?.content!==void 0&&n.content.length>0&&(()=>{const r=n.reasoning_content!==null&&n.reasoning_content!==void 0&&n.reasoning_content.length>0,{thinking:o,remainingText:i}=Fh(n.content);return f.jsxs("div",{className:"space-y-2",children:[o!==null&&!r&&f.jsx(io,{thinking:o}),i.length>0&&f.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1",children:f.jsx(Ln,{children:i})})]})})(),n?.function_call!==null&&n?.function_call!==void 0&&f.jsxs("div",{className:"border border-blue-500/30 rounded-md p-3 bg-blue-500/5",children:[f.jsx("div",{className:"text-xs text-blue-400 font-mono mb-1",children:"function_call"}),f.jsxs("div",{className:"font-mono text-xs",children:[f.jsx("span",{className:"text-blue-300",children:n.function_call.name}),f.jsxs("span",{className:"text-muted-foreground",children:["(",n.function_call.arguments,")"]})]})]}),(n?.content===null||n?.content===void 0||n.content.length===0)&&(n?.reasoning_content===null||n?.reasoning_content===void 0||n.reasoning_content.length===0)&&(n?.function_call===null||n?.function_call===void 0)&&f.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})}function E5(e){return typeof e!="object"||e===null?!1:Object.getOwnPropertyDescriptor(e,"object")?.value==="chat.completion"}function N5(e,t){return E5(t)?f.jsx(C5,{response:t}):f.jsx(S5,{response:t})}function T5(e){switch(e){case"success":return"text-emerald-400";case"client_error":return"text-amber-400";case"server_error":return"text-red-400";case"pending":return"text-muted-foreground"}}function j5(e,t){try{let n=JSON.parse(e);if(typeof n=="string"&&(n=JSON.parse(n)),t==="openai"){const o=fy(e);if(o)return o}const r=sy.safeParse(n);return r.success?r.data:null}catch{return null}}function Qn({status:e}){const t=Cu(e),n=T5(t);return e===null?f.jsx("span",{className:"text-xs text-muted-foreground italic",children:"pending"}):f.jsxs("span",{className:Se("flex items-center gap-1 text-xs font-mono font-semibold",n),children:[t==="server_error"&&f.jsx(qb,{className:"size-3"}),e]})}function nc({text:e}){return f.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-3",children:f.jsx("pre",{className:"text-xs text-red-300 whitespace-pre-wrap font-mono leading-relaxed overflow-auto max-h-[60vh]",children:e})})}function z5({text:e}){return f.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1",children:f.jsx(Ln,{children:e})})}function Ur({responseText:e,responseStatus:t,streaming:n,inputTokens:r,outputTokens:o,cacheCreationInputTokens:i,cacheReadInputTokens:s,apiFormat:a,error:l}){if(e===null&&l===void 0)return f.jsxs("div",{className:"flex items-center gap-2 py-3",children:[f.jsx(Qn,{status:t}),f.jsx("span",{className:"text-xs text-muted-foreground italic",children:"No response"})]});if(t!==null&&t>=400)return f.jsxs("div",{className:"space-y-2",children:[f.jsx(Qn,{status:t}),f.jsx(nc,{text:e??""}),l!=null&&f.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[f.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),f.jsx("div",{className:"text-muted-foreground font-mono",children:l})]})]});if(l!=null)return f.jsxs("div",{className:"space-y-2",children:[f.jsx(Qn,{status:t}),f.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[f.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),f.jsx("div",{className:"text-muted-foreground font-mono",children:l})]}),e!==null&&f.jsx("div",{className:"mt-2",children:f.jsx(nc,{text:e})})]});const u=e!==null?j5(e,a):null;return u!==null?f.jsxs("div",{className:"space-y-2",children:[f.jsx(Qn,{status:t}),N5(a,u)]}):f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Qn,{status:t}),n&&(r!==null||o!==null)&&f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[f.jsx(pr,{className:"size-3"}),f.jsxs("span",{className:"font-mono tabular-nums",children:[r!==null?Je(r):"—"," in /"," ",o!==null?Je(o):"—"," out"]}),i!=null&&i>0&&f.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Je(i)]}),s!=null&&s>0&&f.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Je(s)]})]})]}),f.jsx(z5,{text:e??""})]})}const A5=de({success:ht(),error:X().optional(),responseStatus:ye().optional(),responseText:X().optional(),inputTokens:ye().optional(),outputTokens:ye().optional(),elapsedMs:ye().optional(),streaming:ht().optional()});function I5({log:e,open:t,onOpenChange:n}){const[r,o]=v.useState(()=>e.rawRequestBody??"{}"),[i,s]=v.useState(null),[a,l]=v.useState(!1),[c,u]=v.useState(null);async function h(){l(!0),u(null),s(null);try{const g=await(await fetch(`/api/logs/${e.id}/replay`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({modifiedBody:r})})).json(),m=A5.safeParse(g);if(!m.success){u("Invalid response from server"),l(!1);return}const y=m.data;s(y),y.success||u(y.error??"Replay failed")}catch(d){u(d instanceof Error?d.message:"Network error")}finally{l(!1)}}function p(){s(null),u(null),n(!1)}return f.jsx(Rh,{open:t,onOpenChange:p,children:f.jsxs(Ph,{className:"max-w-4xl max-h-[85vh] overflow-auto",children:[f.jsx(Oh,{children:f.jsxs(Dh,{className:"flex items-center gap-2",children:[f.jsx(au,{className:"size-4"}),"Replay Request #",e.id]})}),f.jsxs(Cn,{defaultValue:"modified",children:[f.jsxs(En,{children:[f.jsx(Ge,{value:"modified",children:"Modified Request"}),f.jsx(Ge,{value:"original",children:"Original Response"}),i&&f.jsx(Ge,{value:"replay",children:"Replay Response"})]}),f.jsxs(Ke,{value:"modified",className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Request Body (JSON)"}),f.jsx("textarea",{className:"w-full h-64 p-3 font-mono text-xs bg-muted rounded-md border border-input resize-none focus:outline-none focus:ring-2 focus:ring-ring",value:r,onChange:d=>o(d.target.value),spellCheck:!1})]}),c!==null&&c!==""&&f.jsx("div",{className:"text-sm text-destructive bg-destructive/10 px-3 py-2 rounded-md",children:c}),f.jsx("div",{className:"flex justify-end",children:f.jsx(ft,{onClick:()=>{h()},disabled:a,children:a?"Replaying...":"Replay"})}),i&&i.success&&f.jsxs(Cn,{defaultValue:"parsed",children:[f.jsxs(En,{children:[f.jsx(Ge,{value:"parsed",children:"Response"}),f.jsx(Ge,{value:"raw",children:"Raw Response"})]}),f.jsx(Ke,{value:"parsed",children:f.jsx(Ur,{responseText:i.responseText??null,responseStatus:i.responseStatus??null,streaming:i.streaming??!1,inputTokens:i.inputTokens??null,outputTokens:i.outputTokens??null,apiFormat:e.apiFormat})}),f.jsx(Ke,{value:"raw",children:f.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:i.responseText??"No response"})})]})]}),f.jsx(Ke,{value:"original",children:e.responseText!==null?f.jsxs(Cn,{defaultValue:"parsed",children:[f.jsxs(En,{children:[f.jsx(Ge,{value:"parsed",children:"Response"}),f.jsx(Ge,{value:"raw",children:"Raw Response"})]}),f.jsx(Ke,{value:"parsed",children:f.jsx(Ur,{responseText:e.responseText,responseStatus:e.responseStatus,streaming:e.streaming,inputTokens:e.inputTokens,outputTokens:e.outputTokens,cacheCreationInputTokens:e.cacheCreationInputTokens,cacheReadInputTokens:e.cacheReadInputTokens,apiFormat:e.apiFormat})}),f.jsx(Ke,{value:"raw",children:f.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:e.responseText})})]}):f.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No original response"})}),i&&i.success&&f.jsx(Ke,{value:"replay",children:i.responseText!==null?f.jsxs(Cn,{defaultValue:"parsed",children:[f.jsxs(En,{children:[f.jsx(Ge,{value:"parsed",children:"Response"}),f.jsx(Ge,{value:"raw",children:"Raw Response"})]}),f.jsx(Ke,{value:"parsed",children:f.jsx(Ur,{responseText:i.responseText??null,responseStatus:i.responseStatus??null,streaming:i.streaming??!1,inputTokens:i.inputTokens??null,outputTokens:i.outputTokens??null,apiFormat:e.apiFormat})}),f.jsx(Ke,{value:"raw",children:f.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:i.responseText})})]}):f.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No replay response"})})]})]})})}function R5({logId:e,truncated:t}){const[n,r]=v.useState(!1),[o,i]=v.useState({status:"idle"}),[s,a]=v.useState(new Set);v.useEffect(()=>{if(!n||o.status!=="idle")return;let h=!1;return i({status:"loading"}),fetch(`/api/logs/${e}/chunks`).then(p=>p.ok?p.json():Promise.reject(new Error("Chunks not found"))).then(p=>{h||i({status:"success",chunks:p.chunks})}).catch(()=>{h||i({status:"error",message:"Chunk data unavailable"})}),()=>{h=!0}},[n,e]);const l=v.useMemo(()=>{if(o.status!=="success")return[];const h=new Map;for(const p of o.chunks){const d=h.get(p.index);d?d.push(p):h.set(p.index,[p])}return Array.from(h.entries()).map(([p,d])=>({index:p,chunks:d})).sort((p,d)=>p.index-d.index)},[o]),c=h=>{a(p=>{const d=new Set(p);return d.has(h)?d.delete(h):d.add(h),d})};function u(){return o.status==="idle"||o.status==="loading"?f.jsxs("div",{className:"flex items-center gap-2 py-2 text-xs text-muted-foreground",children:[f.jsx(iu,{className:"size-3 animate-spin"}),f.jsx("span",{children:"Loading chunks..."})]}):o.status==="error"?f.jsx("div",{className:"py-2 text-xs text-muted-foreground italic",children:o.message}):f.jsxs("div",{className:"p-2 space-y-1",children:[f.jsxs("div",{className:"text-[10px] text-muted-foreground font-mono mb-2",children:[l.length," index group",l.length!==1?"s":""," available"]}),l.map(h=>{const p=s.has(h.index);return f.jsxs("div",{className:"rounded border border-border bg-background",children:[f.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-2 py-1.5 text-left hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>c(h.index),children:[p?f.jsx(zt,{className:"size-3 text-muted-foreground"}):f.jsx(Ht,{className:"size-3 text-muted-foreground"}),f.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:["[",h.index,"] ",h.chunks[0]?.type??""]}),f.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:[h.chunks.length," chunk",h.chunks.length!==1?"s":""]})]}),p&&f.jsx("div",{className:"px-2 pb-2 space-y-1",children:h.chunks.map(d=>f.jsxs("div",{className:"rounded border border-border bg-muted/20 p-2",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[f.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:["+",d.timestamp,"ms"]}),f.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:d.type})]}),f.jsx(Hs,{data:d,defaultExpandDepth:1,showCopy:!0})]},d.index))})]},h.index)})]})}return f.jsxs("div",{className:"space-y-1",children:[f.jsxs("button",{type:"button",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",onClick:()=>r(h=>!h),children:[n?f.jsx(zt,{className:"size-3"}):f.jsx(Ht,{className:"size-3"}),f.jsx("span",{children:"Raw SSE Events"}),f.jsxs(lt,{variant:"outline",className:"text-[9px] px-1 py-0 h-4 font-mono ml-1",children:[e,t===!0?"+":""]})]}),n===!0?f.jsx("div",{className:"rounded-md border border-border bg-muted/20 overflow-auto max-h-64",children:u()}):null]})}function rc(e,t,n){return e==="anthropic"&&t==="full"&&n}function P5(e,t){return e==="full"&&t}function O5(e,t,n,r){return e==="anthropic"&&t==="full"&&n&&r}function fi({text:e,label:t,copied:n,onCopy:r}){return e===null?null:f.jsx("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1 rounded hover:bg-muted",children:n?f.jsxs(f.Fragment,{children:[f.jsx(hr,{className:"size-3 text-green-500"}),f.jsx("span",{className:"text-green-500",children:"Copied!"})]}):f.jsxs(f.Fragment,{children:[f.jsx(uo,{className:"size-3"}),f.jsx("span",{children:t})]})})}function oc({active:e,onClick:t}){return f.jsxs("button",{type:"button",onClick:t,"aria-pressed":e,className:Se("flex items-center gap-1.5 text-xs px-2 py-1 rounded transition-colors",e?"bg-primary/10 text-primary":"text-muted-foreground hover:text-foreground hover:bg-muted"),title:e?"Hide diff with raw":"Diff this view against the raw version",children:[f.jsx(gb,{className:"size-3"}),e?"Showing diff":"Diff with Raw"]})}const $h=v.memo(function({log:e,viewMode:t="simple",suppressApiFormatBadge:n=!1,strip:r}){const[o,i]=v.useState(!1),[s,a]=v.useState(!1),[l,c]=v.useState(!1),[u,h]=v.useState(!1),[p,d]=v.useState(!1),[g,m]=v.useState(!1),[y,x]=v.useState(!1),b=v.useMemo(()=>my(e.rawRequestBody),[e.rawRequestBody]),S=v.useMemo(()=>!r||e.apiFormat!=="anthropic"||e.rawRequestBody===null?null:rS(e.rawRequestBody).body,[e.rawRequestBody,e.apiFormat,r])??e.rawRequestBody,C=v.useMemo(()=>FN(e.rawHeaders,e.headers),[e.rawHeaders,e.headers]),N=v.useMemo(()=>$N(e.rawRequestBody,S),[e.rawRequestBody,S]);function z(P){P.stopPropagation(),S!==null&&window.navigator.clipboard.writeText(S).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})}function I(P){P.stopPropagation(),e.rawRequestBody!==null&&window.navigator.clipboard.writeText(e.rawRequestBody).then(()=>{c(!0),setTimeout(()=>c(!1),2e3)})}function O(P){P.stopPropagation(),e.responseText!==null&&window.navigator.clipboard.writeText(e.responseText).then(()=>{h(!0),setTimeout(()=>h(!1),2e3)})}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Se("border border-border rounded-lg mb-3 overflow-hidden"),children:[f.jsx(f5,{log:e,parsedRequest:b,expanded:o,onToggle:()=>i(!o),suppressApiFormatBadge:n}),o&&f.jsx("div",{onClick:P=>P.stopPropagation(),onKeyDown:P=>P.stopPropagation(),children:f.jsxs(Cn,{defaultValue:"request",children:[f.jsxs(En,{className:"mx-4 mt-2",children:[t==="full"&&f.jsx(Ge,{value:"raw-headers",children:"Raw Headers"}),t==="full"&&f.jsx(Ge,{value:"headers",children:"Headers"}),rc(e.apiFormat,t,r)&&f.jsx(Ge,{value:"raw-request",children:"Raw Request"}),f.jsx(Ge,{value:"request",children:"Request"}),t==="full"&&f.jsx(Ge,{value:"raw",children:"Raw Response"}),f.jsx(Ge,{value:"parsed",children:"Response"})]}),rc(e.apiFormat,t,r)&&f.jsx(Ke,{value:"raw-request",children:f.jsxs("div",{className:"px-4 py-3",children:[f.jsx("div",{className:"flex justify-end mb-2",children:f.jsx(fi,{text:e.rawRequestBody,label:"Copy Raw Request",copied:l,onCopy:I})}),e.rawRequestBody!==null?f.jsx(ui,{text:e.rawRequestBody,defaultExpandDepth:1}):f.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No request body"})]})}),f.jsx(Ke,{value:"request",children:f.jsxs("div",{className:"px-4 py-3",children:[f.jsxs("div",{className:"flex justify-end gap-2 mb-2",children:[O5(e.apiFormat,t,r,e.rawRequestBody!==null)&&f.jsx(oc,{active:y,onClick:P=>{P.stopPropagation(),x(!y)}}),f.jsxs(ft,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:P=>{P.stopPropagation(),d(!0)},children:[f.jsx(au,{className:"size-3 mr-1"}),"Replay"]}),f.jsx(fi,{text:S,label:"Copy Request",copied:s,onCopy:z})]}),y?f.jsx(ec,{result:N,emptyLabel:"No transformation applied — raw and sent request bodies are identical."}):S!==null?f.jsx(ui,{text:S,defaultExpandDepth:1}):f.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No request body"})]})}),t==="full"&&f.jsx(Ke,{value:"headers",children:f.jsxs("div",{className:"px-4 py-3",children:[f.jsx("div",{className:"flex justify-end gap-2 mb-2",children:P5(t,e.rawHeaders!==void 0&&Object.keys(e.rawHeaders).length>0)&&f.jsx(oc,{active:g,onClick:P=>{P.stopPropagation(),m(!g)}})}),g?f.jsx(ec,{result:C,emptyLabel:"No transformation applied — raw and processed headers are identical."}):e.headers&&Object.keys(e.headers).length>0?f.jsx("div",{className:"space-y-1 font-mono text-xs",children:Object.entries(e.headers).sort(([P],[L])=>P.localeCompare(L)).map(([P,L])=>f.jsxs("div",{className:"flex gap-2",children:[f.jsxs("span",{className:"text-blue-600 dark:text-blue-400 font-semibold shrink-0",children:[P,":"]}),f.jsx("span",{className:"text-muted-foreground truncate",title:L,children:L})]},P))}):f.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No headers captured"})]})}),t==="full"&&f.jsx(Ke,{value:"raw-headers",children:f.jsx("div",{className:"px-4 py-3",children:e.rawHeaders&&Object.keys(e.rawHeaders).length>0?f.jsx("div",{className:"space-y-1 font-mono text-xs",children:Object.entries(e.rawHeaders).sort(([P],[L])=>P.localeCompare(L)).map(([P,L])=>f.jsxs("div",{className:"flex gap-2",children:[f.jsxs("span",{className:"text-blue-600 dark:text-blue-400 font-semibold shrink-0",children:[P,":"]}),f.jsx("span",{className:"text-muted-foreground truncate",title:L,children:L})]},P))}):f.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No raw headers captured"})})}),f.jsx(Ke,{value:"raw",children:f.jsxs("div",{className:"px-4 py-3 space-y-3",children:[e.error!==void 0&&e.error!==null&&f.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[f.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),f.jsx("div",{className:"text-muted-foreground font-mono",children:e.error})]}),f.jsx("div",{className:"flex justify-end",children:f.jsx(fi,{text:e.responseText,label:"Copy Response",copied:u,onCopy:O})}),e.responseText!==null?f.jsx(ui,{text:e.responseText,defaultExpandDepth:1}):f.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No response"}),e.streaming===!0&&f.jsx(R5,{logId:e.id,truncated:e.streamingChunksPath!==null})]})}),f.jsx(Ke,{value:"parsed",children:f.jsx("div",{className:"px-4 py-3",children:f.jsx(Ur,{responseText:e.responseText,responseStatus:e.responseStatus,streaming:e.streaming,inputTokens:e.inputTokens,outputTokens:e.outputTokens,cacheCreationInputTokens:e.cacheCreationInputTokens,cacheReadInputTokens:e.cacheReadInputTokens,apiFormat:e.apiFormat,error:e.error})})})]})})]}),f.jsx(I5,{log:e,open:p,onOpenChange:d})]})});function D5(e){let t=0,n=0;for(const r of e)r.inputTokens!==null&&(t+=r.inputTokens),r.outputTokens!==null&&(n+=r.outputTokens);return{totalInputTokens:t,totalOutputTokens:n}}const M5=v.memo(function({group:e,viewMode:t="simple",strip:n}){const[r,o]=v.useState(!1),i=D5(e.logs),s=e.logs[0]?.timestamp??new Date().toISOString(),a=e.logs[e.logs.length-1]?.timestamp??new Date().toISOString(),l=Jk(e.logs),c=e.conversationId.startsWith("PID:")||e.conversationId.includes("|")?e.conversationId:e.conversationId.length>24?e.conversationId.slice(0,12)+"…"+e.conversationId.slice(-12):e.conversationId;return f.jsxs("div",{className:"mb-4",children:[f.jsx(Gk,{conversationId:c,startTime:s,endTime:a,totalCalls:e.logs.length,totalInputTokens:i.totalInputTokens,totalOutputTokens:i.totalOutputTokens,apiFormat:Kk(e.logs),expanded:r,onToggle:()=>o(!r),hideApiFormat:l}),r&&f.jsx("div",{className:"pl-4 border-l-2 border-muted ml-3",children:e.logs.map(u=>f.jsx($h,{log:u,viewMode:t,suppressApiFormatBadge:!l,strip:n},u.id))})]})});function L5({className:e}){return f.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:Se("inline-block size-5",e),children:[f.jsx("path",{d:"M5 13 C5 9 8 7 12 7 C16 7 19 9 19 13 C19 16 16 18 12 18 C8 18 5 16 5 13 Z"}),f.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),f.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"}),f.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),f.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"}),f.jsx("circle",{cx:"9.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"}),f.jsx("circle",{cx:"14.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"}),f.jsx("line",{x1:"6.5",y1:"16",x2:"4.5",y2:"19.5"}),f.jsx("line",{x1:"9",y1:"17.5",x2:"8",y2:"20.5"}),f.jsx("line",{x1:"15",y1:"17.5",x2:"16",y2:"20.5"}),f.jsx("line",{x1:"17.5",y1:"16",x2:"19.5",y2:"19.5"})]})}function ic({...e}){return f.jsx(rk,{"data-slot":"select",...e})}function sc({...e}){return f.jsx(ik,{"data-slot":"select-value",...e})}function ac({className:e,size:t="default",children:n,...r}){return f.jsxs(ok,{"data-slot":"select-trigger","data-size":t,className:Se("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,f.jsx(sk,{asChild:!0,children:f.jsx(zt,{className:"size-4 opacity-50"})})]})}function lc({className:e,children:t,position:n="popper",align:r="center",...o}){return f.jsx(ak,{children:f.jsxs(lk,{"data-slot":"select-content",className:Se("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...o,children:[f.jsx(F5,{}),f.jsx(ck,{className:Se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),f.jsx($5,{})]})})}function Mr({className:e,children:t,...n}){return f.jsxs(uk,{"data-slot":"select-item",className:Se("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[f.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx(fk,{children:f.jsx(hr,{className:"size-4"})})}),f.jsx(dk,{children:t})]})}function F5({className:e,...t}){return f.jsx(hk,{"data-slot":"select-scroll-up-button",className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(Vy,{className:"size-4"})})}function $5({className:e,...t}){return f.jsx(pk,{"data-slot":"select-scroll-down-button",className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(zt,{className:"size-4"})})}const B5={deepseek:"https://api-docs.deepseek.com/zh-cn/"};function U5(e){return e.length<=8?"••••••••":e.slice(0,4)+"••••••••"+e.slice(-4)}function Z5(e){return Object.prototype.hasOwnProperty.call(e,"success")}function W5(e){return Object.prototype.hasOwnProperty.call(e,"notConfigured")}function V5(e){const t={className:"size-3",strokeWidth:2};switch(e){case"timeout":return f.jsx(os,{...t});case"network_unreachable":return f.jsx(Qb,{...t});case"connection_refused":return f.jsx(tv,{...t});case"auth_failed":return f.jsx(Cb,{...t});case"rate_limited":return f.jsx(pb,{...t});case"server_error":return f.jsx(Fb,{...t});case"invalid_response":return f.jsx(eb,{...t});case"unknown":return f.jsx(bi,{...t});default:return f.jsx(bi,{...t})}}function cc({result:e}){const[t,n]=v.useState(!1);if(!Z5(e))return W5(e)?f.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[f.jsx(Tb,{className:"size-3"}),f.jsx("span",{children:"Not configured"})]}):f.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[f.jsx(lu,{className:"size-3 animate-spin"}),f.jsx("span",{children:"Testing..."})]});if(e.success)return f.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600 shrink-0",children:[f.jsx(Xy,{className:"size-3"}),f.jsx("span",{children:"Connected"})]});const r=e.error,o=r?.message??"Connection failed",i=r?.hint,s=r?.details,a=r?.type??"unknown";return f.jsxs("div",{className:"flex flex-col gap-1 shrink-0",children:[f.jsxs("div",{className:"flex items-center gap-1 text-xs text-red-600 max-w-[200px]",children:[V5(a),f.jsx("span",{className:"truncate",children:o}),s!==void 0&&f.jsx("button",{type:"button",onClick:()=>n(!t),className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",title:t?"Hide details":"Show details",children:t?f.jsx(ru,{className:"size-3"}):f.jsx(ou,{className:"size-3"})})]}),t&&s!==void 0&&f.jsxs("div",{className:"text-xs text-muted-foreground bg-muted/50 rounded p-2 max-w-[300px]",children:[i!==void 0&&f.jsx("div",{className:"mb-1",children:i}),f.jsx("div",{className:"font-mono whitespace-pre-wrap break-all text-red-400/80",children:s})]})]})}function H5({provider:e,testResults:t,isTesting:n,testingTimeLeft:r,onEdit:o,onDelete:i,onTest:s}){const[a,l]=v.useState(!1),c=e.apiDocsUrl??Object.entries(B5).find(([u])=>e.name.toLowerCase().includes(u))?.[1];return f.jsxs("div",{className:"border rounded-lg p-4 flex flex-col gap-3 bg-card",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2",children:[f.jsx("div",{className:"flex items-center gap-2 min-w-0",children:f.jsx("span",{className:"font-medium truncate",children:e.model!==void 0&&e.model!==""?`${e.model} (${e.name})`:e.name})}),c!==void 0&&f.jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1 text-xs",title:"View API documentation",children:[f.jsx(lb,{className:"size-3"}),f.jsx("span",{className:"sr-only",children:"Docs"})]})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("code",{className:"text-xs text-muted-foreground bg-muted px-2 py-1 rounded flex-1 truncate",children:a?e.apiKey:U5(e.apiKey)}),f.jsx("button",{type:"button",onClick:()=>l(u=>!u),className:"text-muted-foreground hover:text-foreground transition-colors p-1","aria-label":a?"Hide API key":"Show API key",children:a?f.jsx(ru,{className:"size-4"}):f.jsx(ou,{className:"size-4"})})]}),e.anthropicBaseUrl!==void 0&&e.anthropicBaseUrl!==""&&f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"text-xs text-muted-foreground min-w-0 flex-1",children:[f.jsx("span",{className:"font-medium",children:"Anthropic:"})," ",f.jsx("span",{className:"truncate",children:e.anthropicBaseUrl})]}),t&&f.jsx(cc,{result:t.anthropic.nonStreaming})]}),e.openaiBaseUrl!==void 0&&e.openaiBaseUrl!==""&&f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"text-xs text-muted-foreground min-w-0 flex-1",children:[f.jsx("span",{className:"font-medium",children:"OpenAI:"})," ",f.jsx("span",{className:"truncate",children:e.openaiBaseUrl})]}),t&&f.jsx(cc,{result:t.openai.nonStreaming})]}),f.jsxs("div",{className:"flex gap-2 pt-1 border-t",children:[s!==void 0&&f.jsxs(ft,{variant:"outline",size:"sm",onClick:()=>s(e.id),className:"text-xs h-7 gap-1",disabled:n??!1,children:[f.jsx(lu,{className:`size-3 ${n??!1?"animate-spin":""}`}),n??!1?r!==void 0?`Testing (${r}s)`:"Testing...":"Test"]}),f.jsxs(ft,{variant:"outline",size:"sm",onClick:()=>o(e),className:"text-xs h-7 gap-1",children:[f.jsx(zb,{className:"size-3"}),"Edit"]}),f.jsxs(ft,{variant:"outline",size:"sm",onClick:()=>i(e.id),className:"text-xs h-7 gap-1 text-destructive hover:text-destructive",children:[f.jsx(Vb,{className:"size-3"}),"Delete"]})]})]})}const q5={deepseek:{format:"openai",baseUrl:"https://api.deepseek.com"},minimax:{format:"anthropic",baseUrl:"https://api.minimaxi.com/anthropic",apiDocsUrl:"https://platform.minimaxi.com/docs/api-reference/api-overview"},alibaba:{format:"openai",baseUrl:"https://dashscope.aliyuncs.com/compatible-mode"}},uc=["MiniMax M3","MiniMax M2.7","MiniMax M2.7-highspeed","MiniMax M2.5","MiniMax M2.5-highspeed","MiniMax M2.1","MiniMax M2.1-highspeed","MiniMax M2"],dc=["glm-5","glm-5.1","qwen3.6-plus","qwen3.7-max"];function G5({provider:e,onSubmit:t,onCancel:n}){const[r,o]=v.useState(e?.name??"Provider Name"),[i,s]=v.useState(e?.apiKey??""),[a,l]=v.useState(e?.model??""),[c,u]=v.useState(e?.format??"anthropic"),[h,p]=v.useState(e?.baseUrl??""),[d,g]=v.useState(e?.apiDocsUrl??""),[m,y]=v.useState({}),[x,b]=v.useState(!1),[w,S]=v.useState(!1),C=r.toLowerCase().includes("minimax"),N=r.toLowerCase().includes("alibaba");v.useEffect(()=>{e&&(o(e.name),s(e.apiKey),l(e.model??""),u(e.format??"anthropic"),p(e.baseUrl??""),g(e.apiDocsUrl??""),S(!1))},[e]),v.useEffect(()=>{const P=r.toLowerCase();for(const[L,T]of Object.entries(q5))if(P.includes(L)){w||(u(T.format),p(T.baseUrl)),T.apiDocsUrl!==void 0&&!d&&g(T.apiDocsUrl),L==="minimax"&&!a&&l(uc[0]??""),L==="alibaba"&&!a&&l(dc[0]??"");break}},[r]);function z(){const P={};return r.trim()||(P.name="Name is required"),i.trim()||(P.apiKey="API key is required"),a.trim()||(P.model="Model is required"),h.trim()?I(h.trim())||(P.baseUrl="Invalid URL format"):P.baseUrl="Base URL is required",y(P),Object.keys(P).length===0}function I(P){try{return new URL(P),!0}catch{return!1}}function O(P){if(P.preventDefault(),!!z()){b(!0);try{t({name:r.trim(),apiKey:i.trim(),model:a.trim()||void 0,format:c,baseUrl:h.trim()||void 0,apiDocsUrl:d.trim()||void 0})}finally{b(!1)}}}return f.jsxs("form",{onSubmit:O,className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsxs("label",{htmlFor:"provider-name",className:"text-sm font-medium",children:["Name ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx("input",{id:"provider-name",type:"text",value:r,onChange:P=>o(P.target.value),placeholder:"Model Name",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.name!==void 0&&f.jsx("p",{className:"text-xs text-destructive",children:m.name})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("label",{htmlFor:"provider-apikey",className:"text-sm font-medium",children:["API Key ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx("input",{id:"provider-apikey",type:"password",value:i,onChange:P=>s(P.target.value),placeholder:"sk-ant-...",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.apiKey!==void 0&&f.jsx("p",{className:"text-xs text-destructive",children:m.apiKey})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("label",{htmlFor:"provider-model",className:"text-sm font-medium",children:["Model ",f.jsx("span",{className:"text-destructive",children:"*"})]}),C||N?f.jsx("select",{id:"provider-model",value:a,onChange:P=>l(P.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",children:(C?uc:dc).map(P=>f.jsx("option",{value:P,children:P},P))}):f.jsx("input",{id:"provider-model",type:"text",value:a,onChange:P=>l(P.target.value),placeholder:"",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.model!==void 0&&f.jsx("p",{className:"text-xs text-destructive",children:m.model})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("label",{htmlFor:"provider-format",className:"text-sm font-medium",children:["API Format ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsxs("select",{id:"provider-format",value:c,onChange:P=>u(P.target.value==="anthropic"?"anthropic":"openai"),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",children:[f.jsx("option",{value:"anthropic",children:"Anthropic (/v1/messages)"}),f.jsx("option",{value:"openai",children:"OpenAI (/v1/chat/completions)"})]}),f.jsx("p",{className:"text-xs text-muted-foreground",children:c==="anthropic"?"Use Anthropic format for /v1/messages endpoint":"Use OpenAI format for /v1/chat/completions endpoint"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("label",{htmlFor:"provider-base-url",className:"text-sm font-medium",children:["Base URL ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx("input",{id:"provider-base-url",type:"text",value:h,onChange:P=>{S(!0),p(P.target.value)},placeholder:c==="anthropic"?"https://api.anthropic.com":"https://api.openai.com/v1",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.baseUrl!==void 0&&f.jsx("p",{className:"text-xs text-destructive",children:m.baseUrl}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Base URL for the provider API."})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{htmlFor:"provider-api-docs-url",className:"text-sm font-medium",children:"API Docs URL"}),f.jsx("input",{id:"provider-api-docs-url",type:"text",value:d,onChange:P=>g(P.target.value),placeholder:"https://api.example.com/docs",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional API documentation URL. If not set, uses known provider docs."})]}),f.jsxs("div",{className:"flex gap-2 justify-end pt-2",children:[f.jsx(ft,{type:"button",variant:"outline",onClick:n,disabled:x,children:"Cancel"}),f.jsx(ft,{type:"submit",disabled:x,children:x?"Saving...":e?"Update Provider":"Add Provider"})]})]})}function K5({externalProviders:e,isLoading:t=!1,externalTestResults:n,externalTestingProviders:r,externalTestingTimeLeft:o,onProvidersMutate:i,onTestResultsChange:s,onTestingProvidersChange:a,onTestingTimeLeftChange:l}){const[c,u]=v.useState(!1),[h,p]=v.useState(),[d,g]=v.useState(null),[m,y]=v.useState({}),[x,b]=v.useState(new Set),[w,S]=v.useState({}),[C,N]=v.useState(null),[z,I]=v.useState(!1),O=e??[],P=n??m,L=r??x,T=o??w,M=l?(j,Y)=>l(j,Y):(j,Y)=>{S(Y===void 0?H=>{const ce={...H};return delete ce[j],ce}:H=>({...H,[j]:Y}))};v.useEffect(()=>{(async()=>{try{const j=await fetch("/api/config/paths");if(j.ok){const Y=await j.json();N(Y.providerConfig)}}catch{}})()},[]);const _=30,D=v.useCallback(async j=>{const Y={anthropic:{nonStreaming:{testing:!0},streaming:{testing:!0}},openai:{nonStreaming:{testing:!0},streaming:{testing:!0}}};s?s(j,Y):y(re=>({...re,[j]:Y})),a?a(j,!0):b(re=>new Set(re).add(j));const H=new AbortController;let ce=_;M(j,ce);const ie=setInterval(()=>{ce--,M(j,ce),ce<=0&&(clearInterval(ie),H.abort())},1e3);try{const re=await fetch(`/api/providers/${j}/test`,{method:"POST",signal:H.signal});if(re.ok){const le=await re.json();s?s(j,le):y(me=>({...me,[j]:le}))}else{const le={anthropic:{nonStreaming:{success:!1,error:{message:`HTTP ${re.status}: ${re.statusText}`,type:"server_error"}},streaming:{notConfigured:!0}},openai:{nonStreaming:{success:!1,error:{message:`HTTP ${re.status}: ${re.statusText}`,type:"server_error"}},streaming:{notConfigured:!0}}};s?s(j,le):y(me=>({...me,[j]:le}))}}catch(re){if(re instanceof Error&&re.name==="AbortError"){const me={anthropic:{nonStreaming:{success:!1,error:{message:"Request timed out",type:"timeout"}},streaming:{notConfigured:!0}},openai:{nonStreaming:{success:!1,error:{message:"Request timed out",type:"timeout"}},streaming:{notConfigured:!0}}};s?s(j,me):y(xe=>({...xe,[j]:me}))}}finally{clearInterval(ie),M(j,void 0);try{a?a(j,!1):b(re=>{const le=new Set(re);return le.delete(j),le})}catch{}}},[a,s,M]);function G(j){(async()=>{const Y={name:j.name,apiKey:j.apiKey,model:j.model,format:j.format,anthropicBaseUrl:j.format==="anthropic"?j.baseUrl:void 0,openaiBaseUrl:j.format==="openai"?j.baseUrl:void 0};let H;try{H=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Y)})}catch{g("Network error: could not reach the server. Is the proxy running?");return}if(!H.ok){const ie=await H.json();g(ie.error??"Failed to add provider");return}const ce=await H.json();i?.(),u(!1),await D(ce.id)})()}function Z(j){h&&(async()=>{const Y={name:j.name,apiKey:j.apiKey,model:j.model,format:j.format,anthropicBaseUrl:j.format==="anthropic"?j.baseUrl:void 0,openaiBaseUrl:j.format==="openai"?j.baseUrl:void 0};let H;try{H=await fetch(`/api/providers/${h.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(Y)})}catch{g("Network error: could not reach the server. Is the proxy running?");return}if(!H.ok){const ie=await H.json();g(ie.error??"Failed to update provider");return}const ce=await H.json();i?.(),p(void 0),await D(ce.id)})()}function te(j){window.confirm("Are you sure you want to delete this provider?")&&(async()=>{let Y;try{Y=await fetch(`/api/providers/${j}`,{method:"DELETE"})}catch{g("Network error: could not reach the server. Is the proxy running?");return}if(!Y.ok){const H=await Y.json();g(H.error??"Failed to delete provider");return}i?.()})()}const q=v.useRef(null);function E(j){const Y="/api/providers/export";(async()=>{try{const H=await fetch(Y);if(!H.ok){g("Failed to export providers");return}const ce=await H.blob(),ie=URL.createObjectURL(ce),re=document.createElement("a");re.href=ie,re.download=H.headers.get("Content-Disposition")?.match(/filename="(.+)"/)?.[1]??"providers.json",document.body.appendChild(re),re.click(),document.body.removeChild(re),URL.revokeObjectURL(ie)}catch{g("Failed to export providers")}})()}function U(){q.current?.click()}function B(j){const Y=j.target.files?.[0];Y&&(async()=>{try{const H=await Y.text(),ce=await fetch("/api/providers/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(H)}),re=de({success:ht().optional(),imported:ye().optional(),message:X().optional(),errors:Be(X()).optional()}).parse(await ce.json());ce.ok&&re.imported!==void 0&&re.imported>0?(i?.(),g(null)):re.errors&&re.errors.length>0?g(re.errors.join("; ")):g(re.message??"Import failed")}catch{g("Failed to import providers")}j.target.value=""})()}return t?f.jsx("div",{className:"flex items-center justify-center py-8",children:f.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading providers..."})}):c||h?f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"flex items-center justify-between",children:f.jsx("h3",{className:"text-lg font-medium",children:h?"Edit Provider":"Add New Provider"})}),f.jsx(G5,{provider:h,onSubmit:h?Z:G,onCancel:()=>{u(!1),p(void 0)}})]}):f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"flex items-center justify-between sticky top-0 z-10 bg-background pb-2",children:[f.jsx("h3",{className:"text-lg font-medium",children:"Providers"}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs(ft,{variant:"outline",size:"sm",onClick:()=>E(),className:"gap-1 hover:bg-muted",children:[f.jsx(nu,{className:"size-3"}),"Export"]}),f.jsxs(ft,{variant:"outline",size:"sm",onClick:U,className:"gap-1 hover:bg-muted",children:[f.jsx(Kb,{className:"size-3"}),"Import"]}),f.jsx("input",{type:"file",ref:q,accept:".json",onChange:B,style:{display:"none"}}),f.jsxs(ft,{onClick:()=>u(!0),size:"sm",className:"gap-1",children:[f.jsx(Ca,{className:"size-4"}),"Add Provider"]})]})]}),C!==null&&f.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/30 rounded-md px-3 py-2",children:[f.jsx("span",{className:"shrink-0",children:"Config:"}),f.jsx("span",{className:"font-mono truncate",title:C,children:C}),f.jsx("button",{type:"button",onClick:()=>{window.navigator.clipboard.writeText(C).then(()=>{I(!0),setTimeout(()=>I(!1),2e3)})},className:"shrink-0 ml-auto text-muted-foreground hover:text-foreground transition-colors",title:"Copy path",children:z?f.jsx(hr,{className:"size-3 text-green-500"}):f.jsx(uo,{className:"size-3"})})]}),d!==null&&f.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive bg-destructive/10 rounded-md px-3 py-2",children:[f.jsx(bi,{className:"size-4 shrink-0"}),d]}),O.length===0?f.jsxs("div",{className:"text-center py-12 space-y-3",children:[f.jsx("p",{className:"text-sm text-muted-foreground",children:"No providers configured yet."}),f.jsxs(ft,{onClick:()=>u(!0),variant:"outline",size:"sm",children:[f.jsx(Ca,{className:"size-4"}),"Add Your First Provider"]})]}):f.jsx("div",{className:"space-y-3",children:O.map(j=>f.jsx(H5,{provider:j,testResults:P[j.id],isTesting:L.has(j.id),testingTimeLeft:T[j.id],onEdit:Y=>p(Y),onDelete:te,onTest:Y=>{D(Y)}},j.id))})]})}async function J5(e){const n=await(await fetch(e)).json();return Array.isArray(n)?n:[]}function Y5(){const e=fc("/api/providers",J5,{revalidateOnFocus:!1,revalidateIfStale:!1});return{providers:e.data??[],isLoading:e.isLoading,isError:e.error,mutate:e.mutate}}function X5(){const[e,t]=v.useState(!1),[n,r]=v.useState("providers"),{providers:o,isLoading:i,mutate:s}=Y5(),[a,l]=v.useState({}),[c,u]=v.useState(new Set),[h,p]=v.useState({}),d=v.useCallback((y,x)=>{l(b=>({...b,[y]:x}))},[]),g=v.useCallback((y,x)=>{u(b=>{const w=new Set(b);return x?w.add(y):w.delete(y),w})},[]),m=v.useCallback((y,x)=>{p(b=>{if(x===void 0){const w={...b};return delete w[y],w}return{...b,[y]:x}})},[]);return f.jsxs(Rh,{open:e,onOpenChange:t,children:[f.jsx(h5,{asChild:!0,children:f.jsxs(ft,{variant:"ghost",size:"icon",className:"size-8",children:[f.jsx(Bb,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Settings"})]})}),f.jsxs(Ph,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[f.jsx(Oh,{children:f.jsx(Dh,{children:"Settings"})}),f.jsxs(Cn,{value:n,onValueChange:r,className:"flex-1 overflow-hidden",children:[f.jsxs(En,{children:[f.jsx(Ge,{value:"providers",children:"Providers"}),f.jsx(Ge,{value:"proxy",children:"Proxy"})]}),f.jsxs("div",{className:"mt-4 overflow-y-auto flex-1",children:[f.jsx(Ke,{value:"providers",children:f.jsx(K5,{externalProviders:o,isLoading:i,externalTestResults:a,externalTestingProviders:c,externalTestingTimeLeft:h,onProvidersMutate:()=>{s()},onTestResultsChange:d,onTestingProvidersChange:g,onTestingTimeLeftChange:m})}),f.jsx(Ke,{value:"proxy",children:f.jsx(Q5,{})})]})]})]})]})}function Q5(){const{strip:e,isLoading:t,setStrip:n}=Yc(),[r,o]=v.useState(null),[i,s]=v.useState(!1),a=v.useCallback(async l=>{o(null),s(!0);try{await n(l)}catch(c){o(c instanceof Error?c.message:String(c))}finally{s(!1)}},[n]);return f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"space-y-1",children:[f.jsx("h3",{className:"text-sm font-semibold",children:"Claude Code billing header"}),f.jsxs("p",{className:"text-xs text-muted-foreground",children:["When enabled, the proxy strips the synthetic ",f.jsx("code",{children:"x-anthropic-billing-header"})," text block that Claude Code prepends to the system prompt before forwarding to upstream. Improves prefix-cache hit rates against third-party upstreams. The default at startup is controlled by the ",f.jsx("code",{children:"LLM_INSPECTOR_STRIP_CLAUDE_CODE_BILLING_HEADER"})," environment variable; your choice is persisted to ",f.jsx("code",{children:"config.json"})," and overrides the env var for subsequent requests."]})]}),f.jsxs("label",{className:"flex items-center gap-3",children:[f.jsx("input",{type:"checkbox",role:"switch",checked:e,disabled:t||i,onChange:l=>{a(l.currentTarget.checked)},className:"size-4 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50"}),f.jsx("span",{className:"text-sm",children:t?"Loading…":e?"Stripping enabled":"Stripping disabled"})]}),r!==null&&f.jsxs("p",{className:"text-xs text-destructive",children:["Failed to save: ",r]})]})}function eT(e){return e.length<=30?e:e.slice(0,12)+"…"+e.slice(-12)}function tT(e){let t=0,n=0;for(const r of e)r.inputTokens!==null&&(t+=r.inputTokens),r.outputTokens!==null&&(n+=r.outputTokens);return{totalIn:t,totalOut:n}}function nT({command:e}){const[t,n]=v.useState(!1),r=v.useCallback(()=>{window.navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})},[e]);return f.jsxs("div",{className:"inline-flex items-center gap-2 bg-muted rounded-md px-3 py-2",children:[f.jsx("pre",{className:"text-blue-500 font-mono text-sm m-0",children:e}),f.jsx("button",{type:"button",onClick:r,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0 cursor-pointer","aria-label":"Copy command",children:t?f.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"M20 6 9 17l-5-5"})}):f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),f.jsx("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})})]})}function rT({logs:e,sessions:t,models:n,selectedSession:r,selectedModel:o,onSessionChange:i,onModelChange:s,onClearAll:a,viewMode:l,onViewModeChange:c,strip:u}){const{totalIn:h,totalOut:p}=tT(e),[d,g]=v.useState(!0),[m,y]=v.useState(!1),x=v.useCallback(async()=>{y(!0);try{await dv(e)}finally{y(!1)}},[e]),b=v.useRef(null),w=v.useMemo(()=>Xk(e),[e]),S=e.length>0&&d&&!(w.length===1&&w[0]?.logs.length===e.length),C=Qc({count:S?w.length:e.length,getScrollElement:()=>b.current,estimateSize:()=>150,measureElement:typeof window<"u"?N=>N.getBoundingClientRect().height:void 0,overscan:5});return f.jsxs("div",{className:"max-w-[1200px] mx-auto flex flex-col h-screen",style:{maxHeight:"100vh"},children:[f.jsxs("div",{className:"flex items-center gap-4 mb-4 px-6 pt-6",children:[f.jsxs("h1",{className:"text-lg font-bold flex-1 flex items-center gap-2",children:[f.jsx(L5,{className:"size-10 text-amber-500"}),"LLM Inspector"]}),f.jsxs("span",{className:"text-muted-foreground text-xs font-mono",children:["v",hv.version]}),f.jsxs("div",{className:"flex items-center border border-border rounded-md overflow-hidden",children:[f.jsx("button",{type:"button",onClick:()=>c("simple"),className:`px-2 py-1 cursor-pointer transition-colors text-xs ${l==="simple"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:"Simple"}),f.jsx("button",{type:"button",onClick:()=>c("full"),className:`px-2 py-1 cursor-pointer transition-colors text-xs ${l==="full"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:"Full"})]}),f.jsx(X5,{}),f.jsxs("span",{className:"text-muted-foreground text-xs font-mono",children:[e.length," request",e.length!==1?"s":"",h>0||p>0?` · ${h.toLocaleString()} in / ${p.toLocaleString()} out`:""]}),e.length>0&&f.jsx("button",{type:"button",onClick:()=>{x()},disabled:m,className:"text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center gap-1",title:"Export all logs as JSON ZIP",children:m?f.jsx("span",{children:"Exporting..."}):f.jsxs(f.Fragment,{children:[f.jsx(nu,{className:"size-3"}),f.jsx("span",{children:"Export All"})]})}),f.jsx("button",{type:"button",onClick:a,className:"text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Clear all logs",children:"Clear All"})]}),f.jsxs("div",{className:"flex gap-3 px-6 mb-4",children:[f.jsxs(ic,{value:r,onValueChange:i,children:[f.jsx(ac,{className:"flex-1 max-w-[400px] text-xs",children:f.jsx(sc,{placeholder:"All sessions"})}),f.jsxs(lc,{children:[f.jsx(Mr,{value:"__all__",children:"All sessions"}),t.map(N=>f.jsx(Mr,{value:N,children:eT(N)},N))]})]}),f.jsxs(ic,{value:o,onValueChange:s,children:[f.jsx(ac,{className:"text-xs",children:f.jsx(sc,{placeholder:"All models"})}),f.jsxs(lc,{children:[f.jsx(Mr,{value:"__all__",children:"All models"}),n.map(N=>f.jsx(Mr,{value:N,children:N},N))]})]}),f.jsxs("div",{className:"flex items-center border border-border rounded-md overflow-hidden",children:[f.jsx("button",{type:"button",onClick:()=>g(!0),className:`px-2 py-1.5 cursor-pointer transition-colors ${d?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,title:"Grouped view",children:f.jsx(vb,{className:"size-4"})}),f.jsx("button",{type:"button",onClick:()=>g(!1),className:`px-2 py-1.5 cursor-pointer transition-colors ${d?"text-muted-foreground hover:bg-muted/50":"bg-muted text-foreground"}`,title:"Flat view",children:f.jsx(_b,{className:"size-4"})})]})]}),f.jsx("div",{className:"flex-1 min-h-0 px-6 pb-6",children:e.length===0?f.jsxs("div",{className:"text-center text-muted-foreground py-16 space-y-4",children:[f.jsx("p",{className:"text-sm",children:"No requests captured yet."}),f.jsx("p",{className:"text-xs",children:"Route AI coding tools through the proxy:"}),f.jsx(nT,{command:"LLM_BASE_URL=http://localhost:25947/proxy <your-tool>"})]}):f.jsx("div",{ref:b,className:"overflow-y-auto h-full",children:f.jsx("div",{style:{height:`${C.getTotalSize()}px`,width:"100%",position:"relative"},children:C.getVirtualItems().map(N=>{if(S){const z=w[N.index];return z===void 0?null:f.jsx("div",{"data-index":N.index,ref:C.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${N.start}px)`},children:f.jsx(M5,{group:z,viewMode:l,strip:u})},z.id)}else{const z=e[N.index];return z===void 0?null:f.jsx("div",{"data-index":N.index,ref:C.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${N.start}px)`},children:f.jsx($h,{log:z,viewMode:l,strip:u})},z.id)}})})})})]})}de({logs:Be(xi),total:ye(),offset:ye(),limit:ye()});const oT=Yt([de({type:Ne("init"),logs:Be(xi)}),de({type:Ne("update"),log:xi})]);function iT(e){const t=new Set;for(const n of e)n.sessionId!==null&&n.sessionId!==""&&t.add(n.sessionId);return[...t]}function sT(e){const t=new Set;for(const n of e)n.model!==null&&n.model!==""&&t.add(n.model);return[...t]}function aT(){const[e,t]=v.useState([]),[n,r]=v.useState([]),[o,i]=v.useState([]),[s,a]=v.useState("__all__"),[l,c]=v.useState("__all__"),[u,h]=v.useState("simple"),[p,d]=v.useState(null),g=v.useRef(null),m=v.useRef(null),y=v.useCallback(async()=>{try{const[S,C]=await Promise.all([fetch("/api/sessions"),fetch("/api/models")]);if(S.ok&&C.ok){const N=await S.json(),z=await C.json(),I=Be(X()).safeParse(N),O=Be(X()).safeParse(z);I.success&&r(I.data),O.success&&i(O.data)}}catch{}},[]),x=v.useCallback(()=>{g.current&&g.current.close();const S=new URLSearchParams;s!=="__all__"&&S.set("sessionId",s),l!=="__all__"&&S.set("model",l);const C=new EventSource(`/api/logs/stream?${S}`);g.current=C,C.onmessage=N=>{try{const z=String(N.data),I=JSON.parse(z),O=oT.safeParse(I);if(!O.success){d("Failed to parse SSE data");return}const P=O.data;P.type==="init"?(t(P.logs),r(iT(P.logs)),i(sT(P.logs)),d(null)):P.type==="update"&&(t(L=>{const T=s==="__all__"||P.log.sessionId===s,M=l==="__all__"||P.log.model===l;return!T||!M?L:L.findIndex(D=>D.id===P.log.id)>=0?L.map(D=>D.id===P.log.id?P.log:D):[...L,P.log]}),r(L=>{const T=P.log.sessionId;return T!=null&&T!==""?L.includes(T)?L:[...L,T]:L}),i(L=>{const T=P.log.model;return T!=null&&T!==""?L.includes(T)?L:[...L,T]:L}))}catch{d("Failed to parse SSE data")}},C.onerror=()=>{d("SSE connection lost, reconnecting..."),C.close(),m.current!==null&&clearTimeout(m.current),m.current=setTimeout(x,3e3)},y()},[s,l,y]);v.useEffect(()=>(x(),()=>{g.current&&(g.current.close(),g.current=null),m.current!==null&&(clearTimeout(m.current),m.current=null)}),[x]);const b=v.useCallback(()=>{(async()=>{try{if(!(await fetch("/api/logs",{method:"DELETE"})).ok){d("Failed to clear logs");return}t([]),r([]),i([]),d(null)}catch(S){d(S instanceof Error?S.message:"Unknown error clearing logs")}})()},[]),{strip:w}=Yc();return f.jsxs(f.Fragment,{children:[p!==null&&f.jsx("div",{className:"fixed top-4 right-4 bg-destructive text-destructive-foreground px-4 py-2 rounded-md text-sm z-50",children:p}),f.jsx(rT,{logs:e,sessions:n,models:o,selectedSession:s,selectedModel:l,onSessionChange:a,onModelChange:c,onClearAll:b,viewMode:u,onViewModeChange:h,strip:w})]})}const uT=aT;export{uT as component};
130
+ `);if(n===r)return{lines:[],isEmpty:!0};const o=Ih(n,r);return{lines:Hi(o),isEmpty:!1}}function Ql(e){try{const t=JSON.parse(e);return t===null||typeof t=="string"||typeof t=="object"?t:null}catch{return null}}function $N(e,t){const n=e??"",r=t??"";if(n===r)return{lines:[],isEmpty:!0};const o=Ql(n),i=Ql(r);if(o!==null&&i!==null){const a=LN(o,i)??[];if(a.length===1){const l=a[0];if(l!==void 0&&!l.added&&!l.removed)return{lines:[],isEmpty:!0}}return{lines:Hi(a),isEmpty:!1}}const s=Ih(n,r);return{lines:Hi(s),isEmpty:!1}}const BN=22,di=1e4;function UN(e){return e==="added"?"+":e==="removed"?"-":" "}function ZN(e){return e==="added"?"bg-green-500/10 text-green-700 dark:text-green-300":e==="removed"?"bg-red-500/10 text-red-700 dark:text-red-300":"text-foreground/80"}function ec({result:e,emptyLabel:t}){const[n,r]=v.useState("unified"),o=v.useRef(null),i=Qc({count:e.lines.length,getScrollElement:()=>o.current,estimateSize:()=>BN,overscan:10});if(e.isEmpty)return f.jsx("div",{className:"rounded border border-dashed border-border bg-muted/30 px-4 py-6 text-center text-xs text-muted-foreground","data-testid":"diff-empty",children:t??"No transformation applied — raw and processed are identical."});const s=e.lines.length,a=s>di,l=a?e.lines.slice(0,di):e.lines;return f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[f.jsxs("span",{children:[s.toLocaleString()," line",s===1?"":"s",a&&` (showing first ${di.toLocaleString()})`]}),f.jsxs("div",{className:"inline-flex rounded-md border border-border overflow-hidden",children:[f.jsxs("button",{type:"button",onClick:()=>r("unified"),"aria-pressed":n==="unified",className:Se("flex items-center gap-1 px-2 py-1 transition-colors",n==="unified"?"bg-muted text-foreground":"hover:bg-muted/50"),title:"Unified diff (single column)",children:[f.jsx(Mb,{className:"size-3"}),"Unified"]}),f.jsxs("button",{type:"button",onClick:()=>r("split"),"aria-pressed":n==="split",className:Se("flex items-center gap-1 px-2 py-1 transition-colors border-l border-border",n==="split"?"bg-muted text-foreground":"hover:bg-muted/50"),title:"Split diff (side by side)",children:[f.jsx(ob,{className:"size-3"}),"Split"]})]})]}),f.jsx("div",{ref:o,className:"max-h-[60vh] overflow-auto rounded border border-border bg-background font-mono text-xs","data-testid":"diff-viewport",children:n==="unified"?f.jsx(WN,{virtualizer:i,lines:l}):f.jsx(qN,{lines:l})})]})}function WN({virtualizer:e,lines:t}){return f.jsx("div",{style:{height:`${e.getTotalSize()}px`,width:"100%",position:"relative"},children:e.getVirtualItems().map(n=>{const r=t[n.index];return r===void 0?null:f.jsxs("div",{"data-index":n.index,ref:e.measureElement,className:Se("flex items-start gap-3 px-2",ZN(r.kind)),style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${n.start}px)`},children:[f.jsx("span",{className:"select-none text-muted-foreground/60 w-10 text-right tabular-nums",children:r.oldLineNumber??""}),f.jsx("span",{className:"select-none text-muted-foreground/60 w-10 text-right tabular-nums",children:r.newLineNumber??""}),f.jsx("span",{className:Se("select-none w-3 text-right font-bold",r.kind==="added"&&"text-green-600 dark:text-green-400",r.kind==="removed"&&"text-red-600 dark:text-red-400"),children:UN(r.kind)}),f.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:r.text})]},n.key)})})}function VN(e){const t=[];let n=0;for(;n<e.length;){const r=e[n];if(r===void 0)break;if(r.kind==="context"){t.push({left:{text:r.text,lineNumber:r.oldLineNumber},right:{text:r.text,lineNumber:r.newLineNumber},kind:"equal"}),n+=1;continue}const o=[],i=[];for(;n<e.length&&e[n]?.kind==="removed";){const a=e[n];a!==void 0&&o.push(a),n+=1}for(;n<e.length&&e[n]?.kind==="added";){const a=e[n];a!==void 0&&i.push(a),n+=1}const s=Math.max(o.length,i.length);for(let a=0;a<s;a+=1){const l=o[a],c=i[a];l!==void 0&&c!==void 0?t.push({left:{text:l.text,lineNumber:l.oldLineNumber},right:{text:c.text,lineNumber:c.newLineNumber},kind:"changed"}):l!==void 0?t.push({left:{text:l.text,lineNumber:l.oldLineNumber},right:null,kind:"removed"}):c!==void 0&&t.push({left:null,right:{text:c.text,lineNumber:c.newLineNumber},kind:"added"})}}return t}function HN(e){switch(e){case"changed":return"bg-amber-500/10";case"removed":return"bg-red-500/10";case"added":return"bg-green-500/10";case"equal":return""}}function qN({lines:e}){const t=VN(e);return f.jsx("div",{"data-testid":"diff-split",children:t.map((n,r)=>f.jsxs("div",{className:Se("grid grid-cols-2 font-mono text-xs",HN(n.kind)),children:[f.jsxs("div",{className:"flex items-start gap-2 px-2 border-r border-border/50",children:[f.jsx("span",{className:"select-none text-muted-foreground/60 w-8 text-right tabular-nums",children:n.left?.lineNumber??""}),f.jsx("span",{className:Se("select-none w-3 text-right font-bold",(n.kind==="removed"||n.kind==="changed")&&"text-red-600 dark:text-red-400"),children:n.left!==null?"-":" "}),f.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:n.left?.text??""})]}),f.jsxs("div",{className:"flex items-start gap-2 px-2",children:[f.jsx("span",{className:"select-none text-muted-foreground/60 w-8 text-right tabular-nums",children:n.right?.lineNumber??""}),f.jsx("span",{className:Se("select-none w-3 text-right font-bold",(n.kind==="added"||n.kind==="changed")&&"text-green-600 dark:text-green-400"),children:n.right!==null?"+":" "}),f.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:n.right?.text??""})]})]},r))})}const GN="data:image/svg+xml,%3csvg%20height='2500'%20viewBox='0%206.603%201192.672%201193.397'%20width='2500'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m233.96%20800.215%20234.684-131.678%203.947-11.436-3.947-6.363h-11.436l-39.221-2.416-134.094-3.624-116.296-4.832-112.67-6.04-28.35-6.04-26.577-35.035%202.738-17.477%2023.84-16.027%2034.147%202.98%2075.463%205.155%20113.235%207.812%2082.147%204.832%20121.692%2012.644h19.329l2.738-7.812-6.604-4.832-5.154-4.832-117.182-79.41-126.845-83.92-66.443-48.321-35.92-24.484-18.12-22.953-7.813-50.093%2032.618-35.92%2043.812%202.98%2011.195%202.98%2044.375%2034.147%2094.792%2073.37%20123.786%2091.167%2018.12%2015.06%207.249-5.154.886-3.624-8.135-13.61-67.329-121.692-71.838-123.785-31.974-51.302-8.456-30.765c-2.98-12.645-5.154-23.275-5.154-36.242l37.127-50.416%2020.537-6.604%2049.53%206.604%2020.86%2018.121%2030.765%2070.39%2049.852%20110.818%2077.315%20150.684%2022.631%2044.698%2012.08%2041.396%204.51%2012.645h7.813v-7.248l6.362-84.886%2011.759-104.215%2011.436-134.094%203.946-37.772%2018.685-45.262%2037.127-24.482%2028.994%2013.852%2023.839%2034.148-3.303%2022.067-14.174%2092.134-27.785%20144.323-18.121%2096.644h10.55l12.08-12.08%2048.887-64.913%2082.147-102.685%2036.242-40.752%2042.282-45.02%2027.14-21.423h51.303l37.772%2056.135-16.913%2057.986-52.832%2067.007-43.812%2056.779-62.82%2084.563-39.22%2067.651%203.623%205.396%209.343-.886%20141.906-30.201%2076.671-13.852%2091.49-15.705%2041.396%2019.329%204.51%2019.65-16.269%2040.189-97.852%2024.16-114.764%2022.954-170.9%2040.43-2.093%201.53%202.416%202.98%2076.993%207.248%2032.94%201.771h80.617l150.12%2011.195%2039.222%2025.933%2023.517%2031.732-3.946%2024.16-60.403%2030.766-81.503-19.33-190.228-45.26-65.235-16.27h-9.02v5.397l54.362%2053.154%2099.624%2089.96%20124.752%20115.973%206.362%2028.671-16.027%2022.63-16.912-2.415-109.611-82.47-42.282-37.127-95.758-80.618h-6.363v8.456l22.067%2032.296%20116.537%20175.167%206.04%2053.719-8.456%2017.476-30.201%2010.55-33.181-6.04-68.215-95.758-70.39-107.84-56.778-96.644-6.926%203.947-33.503%20360.886-15.705%2018.443-36.243%2013.852-30.201-22.953-16.027-37.127%2016.027-73.37%2019.329-95.758%2015.704-76.107%2014.175-94.55%208.456-31.41-.563-2.094-6.927.886-71.275%2097.852-108.402%20146.497-85.772%2091.812-20.537%208.134-35.597-18.443%203.301-32.94%2019.893-29.315%20118.712-151.007%2071.597-93.583%2046.228-54.04-.322-7.813h-2.738l-315.302%20204.725-56.135%207.248-24.16-22.63%202.98-37.128%2011.435-12.08%2094.792-65.236-.322.323z'%20fill='%23d97757'/%3e%3c/svg%3e",KN="data:image/svg+xml,%3csvg%20height='2500'%20viewBox='-1%20-.1%20949.1%20959.8'%20width='2474'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m925.8%20456.3c10.4%2023.2%2017%2048%2019.7%2073.3%202.6%2025.3%201.3%2050.9-4.1%2075.8-5.3%2024.9-14.5%2048.8-27.3%2070.8-8.4%2014.7-18.3%2028.5-29.7%2041.2-11.3%2012.6-23.9%2024-37.6%2034-13.8%2010-28.5%2018.4-44.1%2025.3-15.5%206.8-31.7%2012-48.3%2015.4-7.8%2024.2-19.4%2047.1-34.4%2067.7-14.9%2020.6-33%2038.7-53.6%2053.6-20.6%2015-43.4%2026.6-67.6%2034.4-24.2%207.9-49.5%2011.8-75%2011.8-16.9.1-33.9-1.7-50.5-5.1-16.5-3.5-32.7-8.8-48.2-15.7s-30.2-15.5-43.9-25.5c-13.6-10-26.2-21.5-37.4-34.2-25%205.4-50.6%206.7-75.9%204.1-25.3-2.7-50.1-9.3-73.4-19.7-23.2-10.3-44.7-24.3-63.6-41.4s-35-37.1-47.7-59.1c-8.5-14.7-15.5-30.2-20.8-46.3s-8.8-32.7-10.6-49.6c-1.8-16.8-1.7-33.8.1-50.7%201.8-16.8%205.5-33.4%2010.8-49.5-17-18.9-31-40.4-41.4-63.6-10.3-23.3-17-48-19.6-73.3-2.7-25.3-1.3-50.9%204-75.8s14.5-48.8%2027.3-70.8c8.4-14.7%2018.3-28.6%2029.6-41.2s24-24%2037.7-34%2028.5-18.5%2044-25.3c15.6-6.9%2031.8-12%2048.4-15.4%207.8-24.3%2019.4-47.1%2034.3-67.7%2015-20.6%2033.1-38.7%2053.7-53.7%2020.6-14.9%2043.4-26.5%2067.6-34.4%2024.2-7.8%2049.5-11.8%2075-11.7%2016.9-.1%2033.9%201.6%2050.5%205.1s32.8%208.7%2048.3%2015.6c15.5%207%2030.2%2015.5%2043.9%2025.5%2013.7%2010.1%2026.3%2021.5%2037.5%2034.2%2024.9-5.3%2050.5-6.6%2075.8-4s50%209.3%2073.3%2019.6c23.2%2010.4%2044.7%2024.3%2063.6%2041.4%2018.9%2017%2035%2036.9%2047.7%2059%208.5%2014.6%2015.5%2030.1%2020.8%2046.3%205.3%2016.1%208.9%2032.7%2010.6%2049.6%201.8%2016.9%201.8%2033.9-.1%2050.8-1.8%2016.9-5.5%2033.5-10.8%2049.6%2017.1%2018.9%2031%2040.3%2041.4%2063.6zm-333.2%20426.9c21.8-9%2041.6-22.3%2058.3-39s30-36.5%2039-58.4c9-21.8%2013.7-45.2%2013.7-68.8v-223q-.1-.3-.2-.7-.1-.3-.3-.6-.2-.3-.5-.5-.3-.3-.6-.4l-80.7-46.6v269.4c0%202.7-.4%205.5-1.1%208.1-.7%202.7-1.7%205.2-3.1%207.6s-3%204.6-5%206.5a32.1%2032.1%200%200%201%20-6.5%205l-191.1%20110.3c-1.6%201-4.3%202.4-5.7%203.2%207.9%206.7%2016.5%2012.6%2025.5%2017.8%209.1%205.2%2018.5%209.6%2028.3%2013.2%209.8%203.5%2019.9%206.2%2030.1%208%2010.3%201.8%2020.7%202.7%2031.1%202.7%2023.6%200%2047-4.7%2068.8-13.8zm-455.1-151.4c11.9%2020.5%2027.6%2038.3%2046.3%2052.7%2018.8%2014.4%2040.1%2024.9%2062.9%2031s46.6%207.7%2070%204.6%2045.9-10.7%2066.4-22.5l193.2-111.5.5-.5q.2-.2.3-.6.2-.3.3-.6v-94l-233.2%20134.9c-2.4%201.4-4.9%202.4-7.5%203.2-2.7.7-5.4%201-8.2%201-2.7%200-5.4-.3-8.1-1-2.6-.8-5.2-1.8-7.6-3.2l-191.1-110.4c-1.7-1-4.2-2.5-5.6-3.4-1.8%2010.3-2.7%2020.7-2.7%2031.1s1%2020.8%202.8%2031.1c1.8%2010.2%204.6%2020.3%208.1%2030.1%203.6%209.8%208%2019.2%2013.2%2028.2zm-50.2-417c-11.8%2020.5-19.4%2043.1-22.5%2066.5s-1.5%2047.1%204.6%2070c6.1%2022.8%2016.6%2044.1%2031%2062.9%2014.4%2018.7%2032.3%2034.4%2052.7%2046.2l193.1%20111.6q.3.1.7.2h.7q.4%200%20.7-.2.3-.1.6-.3l81-46.8-233.2-134.6c-2.3-1.4-4.5-3.1-6.5-5a32.1%2032.1%200%200%201%20-5-6.5c-1.3-2.4-2.4-4.9-3.1-7.6-.7-2.6-1.1-5.3-1-8.1v-227.1c-9.8%203.6-19.3%208-28.3%2013.2-9%205.3-17.5%2011.3-25.5%2018-7.9%206.7-15.3%2014.1-22%2022.1-6.7%207.9-12.6%2016.5-17.8%2025.5zm663.3%20154.4c2.4%201.4%204.6%203%206.6%205%201.9%201.9%203.6%204.1%205%206.5%201.3%202.4%202.4%205%203.1%207.6.6%202.7%201%205.4.9%208.2v227.1c32.1-11.8%2060.1-32.5%2080.8-59.7%2020.8-27.2%2033.3-59.7%2036.2-93.7s-3.9-68.2-19.7-98.5-39.9-55.5-69.5-72.5l-193.1-111.6q-.3-.1-.7-.2h-.7q-.3.1-.7.2-.3.1-.6.3l-80.6%2046.6%20233.2%20134.7zm80.5-121h-.1v.1zm-.1-.1c5.8-33.6%201.9-68.2-11.3-99.7-13.1-31.5-35-58.6-63-78.2-28-19.5-61-30.7-95.1-32.2-34.2-1.4-68%206.9-97.6%2023.9l-193.1%20111.5q-.3.2-.5.5l-.4.6q-.1.3-.2.7-.1.3-.1.7v93.2l233.2-134.7c2.4-1.4%205-2.4%207.6-3.2%202.7-.7%205.4-1%208.1-1%202.8%200%205.5.3%208.2%201%202.6.8%205.1%201.8%207.5%203.2l191.1%20110.4c1.7%201%204.2%202.4%205.6%203.3zm-505.3-103.2c0-2.7.4-5.4%201.1-8.1.7-2.6%201.7-5.2%203.1-7.6%201.4-2.3%203-4.5%205-6.5%201.9-1.9%204.1-3.6%206.5-4.9l191.1-110.3c1.8-1.1%204.3-2.5%205.7-3.2-26.2-21.9-58.2-35.9-92.1-40.2-33.9-4.4-68.3%201-99.2%2015.5-31%2014.5-57.2%2037.6-75.5%2066.4-18.3%2028.9-28%2062.3-28%2096.5v223q.1.4.2.7.1.3.3.6.2.3.5.6.2.2.6.4l80.7%2046.6zm43.8%20294.7%20103.9%2060%20103.9-60v-119.9l-103.8-60-103.9%2060z'/%3e%3c/svg%3e",JN="data:image/svg+xml,%3csvg%20fill='none'%20height='1320'%20viewBox='3.771%206.973%2023.993%2017.652'%20width='2500'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m27.501%208.469c-.252-.123-.36.111-.508.23-.05.04-.093.09-.135.135-.368.395-.797.652-1.358.621-.821-.045-1.521.213-2.14.842-.132-.776-.57-1.238-1.235-1.535-.349-.155-.701-.309-.944-.645-.171-.238-.217-.504-.303-.765-.054-.159-.108-.32-.29-.348-.197-.031-.274.135-.352.273-.31.567-.43%201.192-.419%201.825.028%201.421.628%202.554%201.82%203.36.136.093.17.186.128.321-.081.278-.178.547-.264.824-.054.178-.135.217-.324.14a5.448%205.448%200%200%201%20-1.719-1.169c-.848-.82-1.614-1.726-2.57-2.435-.225-.166-.449-.32-.681-.467-.976-.95.128-1.729.383-1.82.267-.096.093-.428-.77-.424s-1.653.293-2.659.677a2.782%202.782%200%200%201%20-.46.135%209.554%209.554%200%200%200%20-2.853-.1c-1.866.21-3.356%201.092-4.452%202.6-1.315%201.81-1.625%203.87-1.246%206.018.399%202.261%201.552%204.136%203.326%205.601%201.837%201.518%203.955%202.262%206.37%202.12%201.466-.085%203.1-.282%204.942-1.842.465.23.952.322%201.762.392.623.059%201.223-.031%201.687-.127.728-.154.677-.828.414-.953-2.132-.994-1.665-.59-2.09-.916%201.084-1.285%202.717-2.619%203.356-6.94.05-.343.007-.558%200-.837-.004-.168.034-.235.228-.254a4.084%204.084%200%200%200%201.529-.47c1.382-.757%201.938-1.997%202.07-3.485.02-.227-.004-.463-.243-.582zm-12.041%2013.391c-2.067-1.627-3.07-2.162-3.483-2.138-.387.021-.318.465-.233.754.089.285.205.482.368.732.113.166.19.414-.112.598-.666.414-1.823-.139-1.878-.166-1.347-.793-2.473-1.842-3.267-3.276-.765-1.38-1.21-2.861-1.284-4.441-.02-.383.093-.518.472-.586a4.692%204.692%200%200%201%201.514-.04c2.109.31%203.905%201.255%205.41%202.749.86.853%201.51%201.871%202.18%202.865.711%201.057%201.478%202.063%202.454%202.887.343.289.619.51.881.672-.792.088-2.117.107-3.022-.61zm.99-6.38a.304.304%200%201%201%20.609%200c0%20.17-.136.304-.306.304a.3.3%200%200%201%20-.303-.305zm3.077%201.581c-.197.08-.394.15-.584.159a1.246%201.246%200%200%201%20-.79-.252c-.27-.227-.463-.354-.546-.752a1.752%201.752%200%200%201%20.016-.582c.07-.324-.008-.531-.235-.72-.187-.155-.422-.196-.682-.196a.551.551%200%200%201%20-.252-.078c-.108-.055-.197-.19-.112-.356.027-.053.159-.183.19-.207.352-.201.758-.135%201.134.016.349.142.611.404.99.773.388.448.457.573.678.906.174.264.333.534.441.842.066.192-.02.35-.248.448z'%20fill='%234d6bfe'/%3e%3c/svg%3e",YN="/assets/minimax-BPMzvuL-.jpeg",XN="/assets/alibaba-TTwafVwX.svg",QN="/assets/qwen-CONDcHqt.png",e5="/assets/zhipuai-BPNAnxo-.svg",t5={"claude-":"anthropic","gpt-":"openai","o1-":"openai","o3-":"openai","deepseek-":"deepseek",MiniMax:"minimax",qwen:"qwen","glm-":"zhipuai"};function n5(e){if(e===null)return"unknown";const t=e.toLowerCase();for(const[n,r]of Object.entries(t5))if(t.startsWith(n.toLowerCase()))return r;return"unknown"}const gn={width:24,height:24,objectFit:"contain"},r5=tt.memo(({className:e})=>f.jsx("img",{src:GN,alt:"Anthropic",className:e,style:gn})),o5=tt.memo(({className:e})=>f.jsx("img",{src:KN,alt:"OpenAI",className:e,style:{...gn,background:"white",borderRadius:"4px"}})),i5=tt.memo(({className:e})=>f.jsx("img",{src:JN,alt:"DeepSeek",className:e,style:gn})),s5=tt.memo(({className:e})=>f.jsx("img",{src:YN,alt:"MiniMax",className:e,style:gn})),a5=tt.memo(({className:e})=>f.jsx("img",{src:XN,alt:"Alibaba",className:e,style:gn})),l5=tt.memo(({className:e})=>f.jsx("img",{src:QN,alt:"Qwen",className:e,style:gn})),c5=tt.memo(({className:e})=>f.jsx("img",{src:e5,alt:"ZhipuAI",className:e,style:gn}));function u5({provider:e,className:t}){switch(e){case"anthropic":return f.jsx(r5,{className:t});case"openai":return f.jsx(o5,{className:t});case"deepseek":return f.jsx(i5,{className:t});case"minimax":return f.jsx(s5,{className:t});case"alibaba":return f.jsx(a5,{className:t});case"qwen":return f.jsx(l5,{className:t});case"zhipuai":return f.jsx(c5,{className:t});case"unknown":return null}}function d5(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}const tc={success:"bg-emerald-500/15 text-emerald-400 border-emerald-500/25",client_error:"bg-amber-500/15 text-amber-400 border-amber-500/25",server_error:"",pending:"bg-muted text-muted-foreground border-border"},f5=v.memo(function({log:e,parsedRequest:t,expanded:n,onToggle:r,suppressApiFormatBadge:o=!1}){const i=Cu(e.responseStatus),s=e.inputTokens!==null||e.outputTokens!==null,a=t!==null?t.messages.length:null,l=t!==null&&t.tools!==void 0&&t.tools.length>0?t.tools.length:null;return f.jsxs("div",{role:"button",tabIndex:0,className:Se("flex items-center gap-2.5 px-3 py-2 cursor-pointer transition-colors","hover:bg-muted/50","select-none"),onClick:r,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),r())},children:[f.jsxs("span",{className:"text-blue-400/80 font-mono text-xs font-semibold tabular-nums shrink-0",children:["#",e.id]}),e.model!==null&&f.jsxs(f.Fragment,{children:[f.jsx(u5,{provider:n5(e.model),className:"size-4 shrink-0"}),f.jsx(lt,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model})]}),!o&&f.jsx(lt,{variant:"outline",className:Se("text-[10px] px-1.5 py-0 h-5 font-mono shrink-0",e.apiFormat==="openai"&&"border-blue-500/40 text-blue-400",e.apiFormat==="anthropic"&&"border-orange-500/40 text-orange-400",e.apiFormat==="unknown"&&"border-muted text-muted-foreground"),children:e.apiFormat==="anthropic"?"Anthropic":e.apiFormat==="openai"?"OpenAI":"Unknown"}),i==="server_error"?f.jsx(lt,{variant:"destructive",className:"text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",children:e.responseStatus}):i==="pending"?f.jsx(lt,{variant:"outline",className:Se("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",tc[i]),children:f.jsx(iu,{className:"size-3 animate-spin"})}):f.jsx(lt,{variant:"outline",className:Se("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",tc[i]),children:e.responseStatus}),e.elapsedMs!==null&&f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[f.jsx(os,{className:"size-3"}),f.jsx("span",{className:"font-mono tabular-nums",children:d5(e.elapsedMs)})]}),s&&f.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[f.jsx(pr,{className:"size-3 text-muted-foreground"}),f.jsxs("span",{className:"font-mono tabular-nums",children:[f.jsxs("span",{className:e.inputTokens!==null?"text-blue-400":"text-muted-foreground",children:["IN ",e.inputTokens!==null?Je(e.inputTokens):"—"]})," / ",f.jsxs("span",{className:e.outputTokens!==null?"text-amber-400":"text-muted-foreground",children:["OUT ",e.outputTokens!==null?Je(e.outputTokens):"—"]})]})]}),e.cacheCreationInputTokens!==null&&e.cacheCreationInputTokens>0&&f.jsx("span",{className:"flex items-center gap-1 text-xs shrink-0",children:f.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Je(e.cacheCreationInputTokens)]})}),e.cacheReadInputTokens!==null&&e.cacheReadInputTokens>0&&f.jsx("span",{className:"flex items-center gap-1 text-xs shrink-0",children:f.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Je(e.cacheReadInputTokens)]})}),a!==null&&f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[f.jsx(su,{className:"size-3"}),f.jsx("span",{className:"font-mono tabular-nums",children:a})]}),l!==null&&f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[f.jsx(rv,{className:"size-3"}),f.jsx("span",{className:"font-mono tabular-nums",children:l})]}),e.origin!==null&&f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",title:`Origin: ${e.origin}`,children:[f.jsx(yb,{className:"size-3"}),f.jsx("span",{className:"font-mono tabular-nums truncate max-w-[120px]",title:e.origin,children:e.origin})]}),e.userAgent!==null&&f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",title:`User-Agent: ${e.userAgent}`,children:[f.jsx(Yb,{className:"size-3"}),f.jsx("span",{className:"font-mono tabular-nums truncate max-w-[150px]",title:e.userAgent,children:e.userAgent})]}),(e.clientPid!==null||e.clientProjectFolder!==null)&&f.jsxs("span",{className:"flex items-center gap-1 text-purple-400/80 text-xs shrink-0",title:e.clientCwd!==null?`PID: ${e.clientPid??"?"} | CWD: ${e.clientCwd}`:`PID: ${e.clientPid??"?"}`,children:[f.jsx(fb,{className:"size-3"}),e.clientProjectFolder!==null?f.jsx("span",{className:"font-mono tabular-nums",children:e.clientProjectFolder}):f.jsxs("span",{className:"font-mono tabular-nums",children:["PID ",e.clientPid]})]}),e.streaming&&f.jsx(Rb,{className:"size-3 text-muted-foreground/60 shrink-0"}),f.jsx("span",{className:"flex-1 min-w-0"}),n?f.jsx(zt,{className:"size-4 text-muted-foreground shrink-0"}):f.jsx(Ht,{className:"size-4 text-muted-foreground shrink-0"})]})});function Rh({...e}){return f.jsx(Bw,{"data-slot":"dialog",...e})}function h5({...e}){return f.jsx(Uw,{"data-slot":"dialog-trigger",...e})}function p5({...e}){return f.jsx(Zw,{"data-slot":"dialog-portal",...e})}function m5({className:e,...t}){return f.jsx(Ww,{"data-slot":"dialog-overlay",className:Se("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t})}function Ph({className:e,children:t,...n}){return f.jsxs(p5,{children:[f.jsx(m5,{}),f.jsxs(Vw,{"data-slot":"dialog-content",className:Se("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...n,children:[t,f.jsxs(qw,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[f.jsx(iv,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Oh({className:e,...t}){return f.jsx("div",{"data-slot":"dialog-header",className:Se("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function Dh({className:e,...t}){return f.jsx(Hw,{"data-slot":"dialog-title",className:Se("text-lg font-semibold leading-none tracking-tight",e),...t})}function Mh({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return f.jsx(yk,{"data-slot":"separator",decorative:n,orientation:t,className:Se("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function qs({...e}){return f.jsx(T1,{"data-slot":"collapsible",...e})}function Gs({...e}){return f.jsx(Ru,{"data-slot":"collapsible-trigger",...e})}function Ks({...e}){return f.jsx(Pu,{"data-slot":"collapsible-content",...e})}function Lh({className:e,children:t,...n}){return f.jsxs(I_,{"data-slot":"scroll-area",className:Se("relative",e),...n,children:[f.jsx(A_,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),f.jsx(g5,{}),f.jsx(R_,{})]})}function g5({className:e,orientation:t="vertical",...n}){return f.jsx(Wd,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Se("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:f.jsx(Gd,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function x5(e){return f.jsx(f.Fragment,{})}function y5({text:e}){const[t,n]=v.useState(!1);return f.jsxs(qs,{open:t,onOpenChange:n,children:[f.jsxs(Gs,{className:"flex items-center gap-1.5 py-0.5 cursor-pointer hover:opacity-80 transition-opacity group",children:[t?f.jsx(zt,{className:"size-3 text-muted-foreground"}):f.jsx(Ht,{className:"size-3 text-muted-foreground"}),f.jsx("span",{className:"text-muted-foreground text-xs italic select-none opacity-60",children:"[system-reminder]"})]}),f.jsx(Ks,{children:f.jsx("div",{className:"pl-4 pt-1",children:f.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1",children:f.jsx(Ln,{children:e})})})})]})}const b5=/<think>([\s\S]*?)<\/think>/gi,v5=/<think>([\s\S]*?)<\/think>/i;function Fh(e){const t=v5.exec(e);if(!t||t[1]===void 0)return{thinking:null,remainingText:e};const n=t[1].trim(),r=e.replace(b5,"").trim();return{thinking:n,remainingText:r}}function w5({text:e}){if(e.includes("<system-reminder>"))return f.jsx(y5,{text:e});const{thinking:t,remainingText:n}=Fh(e);return f.jsxs("div",{className:"space-y-2",children:[t!==null&&f.jsx(io,{thinking:t}),n.length>0&&f.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1",children:f.jsx(Ln,{children:n})}),t===null&&n.length===0&&f.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty text block"})]})}function io({thinking:e}){const[t,n]=v.useState(!1);return f.jsx(qs,{open:t,onOpenChange:n,children:f.jsxs("div",{className:"border-l-2 border-purple-500/40 my-1",children:[f.jsxs(Gs,{className:"flex items-center gap-1.5 px-3 py-1 w-full text-left cursor-pointer hover:bg-purple-500/5 transition-colors rounded-r-sm group",children:[f.jsx($y,{className:"size-3.5 text-purple-400 shrink-0"}),f.jsx("span",{className:"text-xs font-medium text-purple-400",children:"Thinking"}),f.jsxs(lt,{variant:"ghost",className:"text-[10px] text-muted-foreground px-1.5 py-0 h-4 font-mono",children:[e.length.toLocaleString()," chars"]}),f.jsx("span",{className:"flex-1"}),t?f.jsx(zt,{className:"size-3 text-muted-foreground"}):f.jsx(Ht,{className:"size-3 text-muted-foreground"})]}),f.jsx(Ks,{children:f.jsx("div",{className:"px-3 pb-2",children:f.jsx(Lh,{className:"max-h-[60vh]",children:f.jsx("pre",{className:"text-xs text-muted-foreground whitespace-pre-wrap font-mono leading-relaxed",children:e})})})})]})})}function _5({name:e,input:t}){const[n,r]=v.useState(!1);return f.jsx(qs,{open:n,onOpenChange:r,children:f.jsxs("div",{className:"border-l-2 border-blue-500/40 my-1",children:[f.jsxs(Gs,{className:"flex items-center gap-1.5 px-3 py-1 w-full text-left cursor-pointer hover:bg-blue-500/5 transition-colors rounded-r-sm group",children:[f.jsx(Zb,{className:"size-3.5 text-blue-400 shrink-0"}),f.jsx(lt,{variant:"outline",className:"text-[10px] font-mono px-1.5 py-0 h-4",children:e}),f.jsx("span",{className:"flex-1"}),n?f.jsx(zt,{className:"size-3 text-muted-foreground"}):f.jsx(Ht,{className:"size-3 text-muted-foreground"})]}),f.jsx(Ks,{children:f.jsx("div",{className:"px-3 pb-2",children:f.jsx(Lh,{className:"max-h-[60vh]",children:f.jsx(Hs,{data:ur(t),defaultExpandDepth:2})})})})]})})}function k5({block:e}){switch(e.type){case"text":return f.jsx(w5,{text:e.text});case"thinking":case"think":return f.jsx(io,{thinking:e.thinking});case"tool_use":return f.jsx(_5,{name:e.name,input:e.input});default:return x5()}}function S5({response:e}){return f.jsxs("div",{className:"space-y-3",children:[f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.jsx(lt,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model}),e.stop_reason!==null&&f.jsxs(lt,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[f.jsx(tu,{className:"size-2.5"}),e.stop_reason]}),f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[f.jsx(pr,{className:"size-3"}),f.jsxs("span",{className:"font-mono tabular-nums",children:[Je(e.usage.input_tokens??0)," in /"," ",Je(e.usage.output_tokens??0)," out"]}),e.usage.cache_creation_input_tokens!==void 0&&e.usage.cache_creation_input_tokens!==null&&e.usage.cache_creation_input_tokens>0&&f.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Je(e.usage.cache_creation_input_tokens)]}),e.usage.cache_read_input_tokens!==void 0&&e.usage.cache_read_input_tokens!==null&&e.usage.cache_read_input_tokens>0&&f.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Je(e.usage.cache_read_input_tokens)]})]})]}),f.jsx(Mh,{className:"opacity-50"}),f.jsxs("div",{className:"space-y-2",children:[e.content.map((t,n)=>f.jsx(k5,{block:t},n)),e.content.length===0&&f.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})}function C5({response:e}){const t=e.choices[0],n=t?.message;return f.jsxs("div",{className:"space-y-3",children:[f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[f.jsx(lt,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model}),t?.finish_reason!==null&&t?.finish_reason!==void 0&&f.jsxs(lt,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[f.jsx(tu,{className:"size-2.5"}),t.finish_reason]}),f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[f.jsx(pr,{className:"size-3"}),f.jsxs("span",{className:"font-mono tabular-nums",children:[Je(e.usage.prompt_tokens??0)," in /"," ",Je(e.usage.completion_tokens??0)," out"]})]})]}),f.jsx(Mh,{className:"opacity-50"}),f.jsxs("div",{className:"space-y-2",children:[n?.reasoning_content!==null&&n?.reasoning_content!==void 0&&n.reasoning_content.length>0&&f.jsx(io,{thinking:n.reasoning_content}),n?.content!==null&&n?.content!==void 0&&n.content.length>0&&(()=>{const r=n.reasoning_content!==null&&n.reasoning_content!==void 0&&n.reasoning_content.length>0,{thinking:o,remainingText:i}=Fh(n.content);return f.jsxs("div",{className:"space-y-2",children:[o!==null&&!r&&f.jsx(io,{thinking:o}),i.length>0&&f.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1",children:f.jsx(Ln,{children:i})})]})})(),n?.function_call!==null&&n?.function_call!==void 0&&f.jsxs("div",{className:"border border-blue-500/30 rounded-md p-3 bg-blue-500/5",children:[f.jsx("div",{className:"text-xs text-blue-400 font-mono mb-1",children:"function_call"}),f.jsxs("div",{className:"font-mono text-xs",children:[f.jsx("span",{className:"text-blue-300",children:n.function_call.name}),f.jsxs("span",{className:"text-muted-foreground",children:["(",n.function_call.arguments,")"]})]})]}),(n?.content===null||n?.content===void 0||n.content.length===0)&&(n?.reasoning_content===null||n?.reasoning_content===void 0||n.reasoning_content.length===0)&&(n?.function_call===null||n?.function_call===void 0)&&f.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})}function E5(e){return typeof e!="object"||e===null?!1:Object.getOwnPropertyDescriptor(e,"object")?.value==="chat.completion"}function N5(e,t){return E5(t)?f.jsx(C5,{response:t}):f.jsx(S5,{response:t})}function T5(e){switch(e){case"success":return"text-emerald-400";case"client_error":return"text-amber-400";case"server_error":return"text-red-400";case"pending":return"text-muted-foreground"}}function j5(e,t){try{let n=JSON.parse(e);if(typeof n=="string"&&(n=JSON.parse(n)),t==="openai"){const o=fy(e);if(o)return o}const r=sy.safeParse(n);return r.success?r.data:null}catch{return null}}function Qn({status:e}){const t=Cu(e),n=T5(t);return e===null?f.jsx("span",{className:"text-xs text-muted-foreground italic",children:"pending"}):f.jsxs("span",{className:Se("flex items-center gap-1 text-xs font-mono font-semibold",n),children:[t==="server_error"&&f.jsx(qb,{className:"size-3"}),e]})}function nc({text:e}){return f.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-3",children:f.jsx("pre",{className:"text-xs text-red-300 whitespace-pre-wrap font-mono leading-relaxed overflow-auto max-h-[60vh]",children:e})})}function z5({text:e}){return f.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&_pre]:bg-muted [&_pre]:text-foreground [&_code]:text-[0.8em] [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1",children:f.jsx(Ln,{children:e})})}function Ur({responseText:e,responseStatus:t,streaming:n,inputTokens:r,outputTokens:o,cacheCreationInputTokens:i,cacheReadInputTokens:s,apiFormat:a,error:l}){if(e===null&&l===void 0)return f.jsxs("div",{className:"flex items-center gap-2 py-3",children:[f.jsx(Qn,{status:t}),f.jsx("span",{className:"text-xs text-muted-foreground italic",children:"No response"})]});if(t!==null&&t>=400)return f.jsxs("div",{className:"space-y-2",children:[f.jsx(Qn,{status:t}),f.jsx(nc,{text:e??""}),l!=null&&f.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[f.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),f.jsx("div",{className:"text-muted-foreground font-mono",children:l})]})]});if(l!=null)return f.jsxs("div",{className:"space-y-2",children:[f.jsx(Qn,{status:t}),f.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[f.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),f.jsx("div",{className:"text-muted-foreground font-mono",children:l})]}),e!==null&&f.jsx("div",{className:"mt-2",children:f.jsx(nc,{text:e})})]});const u=e!==null?j5(e,a):null;return u!==null?f.jsxs("div",{className:"space-y-2",children:[f.jsx(Qn,{status:t}),N5(a,u)]}):f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Qn,{status:t}),n&&(r!==null||o!==null)&&f.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[f.jsx(pr,{className:"size-3"}),f.jsxs("span",{className:"font-mono tabular-nums",children:[r!==null?Je(r):"—"," in /"," ",o!==null?Je(o):"—"," out"]}),i!=null&&i>0&&f.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Je(i)]}),s!=null&&s>0&&f.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Je(s)]})]})]}),f.jsx(z5,{text:e??""})]})}const I5=de({success:ht(),error:X().optional(),responseStatus:ye().optional(),responseText:X().optional(),inputTokens:ye().optional(),outputTokens:ye().optional(),elapsedMs:ye().optional(),streaming:ht().optional()});function A5({log:e,open:t,onOpenChange:n}){const[r,o]=v.useState(()=>e.rawRequestBody??"{}"),[i,s]=v.useState(null),[a,l]=v.useState(!1),[c,u]=v.useState(null);async function h(){l(!0),u(null),s(null);try{const g=await(await fetch(`/api/logs/${e.id}/replay`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({modifiedBody:r})})).json(),m=I5.safeParse(g);if(!m.success){u("Invalid response from server"),l(!1);return}const y=m.data;s(y),y.success||u(y.error??"Replay failed")}catch(d){u(d instanceof Error?d.message:"Network error")}finally{l(!1)}}function p(){s(null),u(null),n(!1)}return f.jsx(Rh,{open:t,onOpenChange:p,children:f.jsxs(Ph,{className:"max-w-4xl max-h-[85vh] overflow-auto",children:[f.jsx(Oh,{children:f.jsxs(Dh,{className:"flex items-center gap-2",children:[f.jsx(au,{className:"size-4"}),"Replay Request #",e.id]})}),f.jsxs(Cn,{defaultValue:"modified",children:[f.jsxs(En,{children:[f.jsx(Ge,{value:"modified",children:"Modified Request"}),f.jsx(Ge,{value:"original",children:"Original Response"}),i&&f.jsx(Ge,{value:"replay",children:"Replay Response"})]}),f.jsxs(Ke,{value:"modified",className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Request Body (JSON)"}),f.jsx("textarea",{className:"w-full h-64 p-3 font-mono text-xs bg-muted rounded-md border border-input resize-none focus:outline-none focus:ring-2 focus:ring-ring",value:r,onChange:d=>o(d.target.value),spellCheck:!1})]}),c!==null&&c!==""&&f.jsx("div",{className:"text-sm text-destructive bg-destructive/10 px-3 py-2 rounded-md",children:c}),f.jsx("div",{className:"flex justify-end",children:f.jsx(ft,{onClick:()=>{h()},disabled:a,children:a?"Replaying...":"Replay"})}),i&&i.success&&f.jsxs(Cn,{defaultValue:"parsed",children:[f.jsxs(En,{children:[f.jsx(Ge,{value:"parsed",children:"Response"}),f.jsx(Ge,{value:"raw",children:"Raw Response"})]}),f.jsx(Ke,{value:"parsed",children:f.jsx(Ur,{responseText:i.responseText??null,responseStatus:i.responseStatus??null,streaming:i.streaming??!1,inputTokens:i.inputTokens??null,outputTokens:i.outputTokens??null,apiFormat:e.apiFormat})}),f.jsx(Ke,{value:"raw",children:f.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:i.responseText??"No response"})})]})]}),f.jsx(Ke,{value:"original",children:e.responseText!==null?f.jsxs(Cn,{defaultValue:"parsed",children:[f.jsxs(En,{children:[f.jsx(Ge,{value:"parsed",children:"Response"}),f.jsx(Ge,{value:"raw",children:"Raw Response"})]}),f.jsx(Ke,{value:"parsed",children:f.jsx(Ur,{responseText:e.responseText,responseStatus:e.responseStatus,streaming:e.streaming,inputTokens:e.inputTokens,outputTokens:e.outputTokens,cacheCreationInputTokens:e.cacheCreationInputTokens,cacheReadInputTokens:e.cacheReadInputTokens,apiFormat:e.apiFormat})}),f.jsx(Ke,{value:"raw",children:f.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:e.responseText})})]}):f.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No original response"})}),i&&i.success&&f.jsx(Ke,{value:"replay",children:i.responseText!==null?f.jsxs(Cn,{defaultValue:"parsed",children:[f.jsxs(En,{children:[f.jsx(Ge,{value:"parsed",children:"Response"}),f.jsx(Ge,{value:"raw",children:"Raw Response"})]}),f.jsx(Ke,{value:"parsed",children:f.jsx(Ur,{responseText:i.responseText??null,responseStatus:i.responseStatus??null,streaming:i.streaming??!1,inputTokens:i.inputTokens??null,outputTokens:i.outputTokens??null,apiFormat:e.apiFormat})}),f.jsx(Ke,{value:"raw",children:f.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:i.responseText})})]}):f.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No replay response"})})]})]})})}function R5({logId:e,truncated:t}){const[n,r]=v.useState(!1),[o,i]=v.useState({status:"idle"}),[s,a]=v.useState(new Set);v.useEffect(()=>{if(!n||o.status!=="idle")return;let h=!1;return i({status:"loading"}),fetch(`/api/logs/${e}/chunks`).then(p=>p.ok?p.json():Promise.reject(new Error("Chunks not found"))).then(p=>{h||i({status:"success",chunks:p.chunks})}).catch(()=>{h||i({status:"error",message:"Chunk data unavailable"})}),()=>{h=!0}},[n,e]);const l=v.useMemo(()=>{if(o.status!=="success")return[];const h=new Map;for(const p of o.chunks){const d=h.get(p.index);d?d.push(p):h.set(p.index,[p])}return Array.from(h.entries()).map(([p,d])=>({index:p,chunks:d})).sort((p,d)=>p.index-d.index)},[o]),c=h=>{a(p=>{const d=new Set(p);return d.has(h)?d.delete(h):d.add(h),d})};function u(){return o.status==="idle"||o.status==="loading"?f.jsxs("div",{className:"flex items-center gap-2 py-2 text-xs text-muted-foreground",children:[f.jsx(iu,{className:"size-3 animate-spin"}),f.jsx("span",{children:"Loading chunks..."})]}):o.status==="error"?f.jsx("div",{className:"py-2 text-xs text-muted-foreground italic",children:o.message}):f.jsxs("div",{className:"p-2 space-y-1",children:[f.jsxs("div",{className:"text-[10px] text-muted-foreground font-mono mb-2",children:[l.length," index group",l.length!==1?"s":""," available"]}),l.map(h=>{const p=s.has(h.index);return f.jsxs("div",{className:"rounded border border-border bg-background",children:[f.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-2 py-1.5 text-left hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>c(h.index),children:[p?f.jsx(zt,{className:"size-3 text-muted-foreground"}):f.jsx(Ht,{className:"size-3 text-muted-foreground"}),f.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:["[",h.index,"] ",h.chunks[0]?.type??""]}),f.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:[h.chunks.length," chunk",h.chunks.length!==1?"s":""]})]}),p&&f.jsx("div",{className:"px-2 pb-2 space-y-1",children:h.chunks.map(d=>f.jsxs("div",{className:"rounded border border-border bg-muted/20 p-2",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[f.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:["+",d.timestamp,"ms"]}),f.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:d.type})]}),f.jsx(Hs,{data:d,defaultExpandDepth:1,showCopy:!0})]},d.index))})]},h.index)})]})}return f.jsxs("div",{className:"space-y-1",children:[f.jsxs("button",{type:"button",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",onClick:()=>r(h=>!h),children:[n?f.jsx(zt,{className:"size-3"}):f.jsx(Ht,{className:"size-3"}),f.jsx("span",{children:"Raw SSE Events"}),f.jsxs(lt,{variant:"outline",className:"text-[9px] px-1 py-0 h-4 font-mono ml-1",children:[e,t===!0?"+":""]})]}),n===!0?f.jsx("div",{className:"rounded-md border border-border bg-muted/20 overflow-auto max-h-64",children:u()}):null]})}function rc(e,t,n){return e==="anthropic"&&t==="full"&&n}function P5(e,t){return e==="full"&&t}function O5(e,t,n,r){return e==="anthropic"&&t==="full"&&n&&r}function fi({text:e,label:t,copied:n,onCopy:r}){return e===null?null:f.jsx("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1 rounded hover:bg-muted",children:n?f.jsxs(f.Fragment,{children:[f.jsx(hr,{className:"size-3 text-green-500"}),f.jsx("span",{className:"text-green-500",children:"Copied!"})]}):f.jsxs(f.Fragment,{children:[f.jsx(uo,{className:"size-3"}),f.jsx("span",{children:t})]})})}function oc({active:e,onClick:t}){return f.jsxs("button",{type:"button",onClick:t,"aria-pressed":e,className:Se("flex items-center gap-1.5 text-xs px-2 py-1 rounded transition-colors",e?"bg-primary/10 text-primary":"text-muted-foreground hover:text-foreground hover:bg-muted"),title:e?"Hide diff with raw":"Diff this view against the raw version",children:[f.jsx(gb,{className:"size-3"}),e?"Showing diff":"Diff with Raw"]})}const $h=v.memo(function({log:e,viewMode:t="simple",suppressApiFormatBadge:n=!1,strip:r}){const[o,i]=v.useState(!1),[s,a]=v.useState(!1),[l,c]=v.useState(!1),[u,h]=v.useState(!1),[p,d]=v.useState(!1),[g,m]=v.useState(!1),[y,x]=v.useState(!1),b=v.useMemo(()=>my(e.rawRequestBody),[e.rawRequestBody]),S=v.useMemo(()=>!r||e.apiFormat!=="anthropic"||e.rawRequestBody===null?null:rS(e.rawRequestBody).body,[e.rawRequestBody,e.apiFormat,r])??e.rawRequestBody,C=v.useMemo(()=>FN(e.rawHeaders,e.headers),[e.rawHeaders,e.headers]),N=v.useMemo(()=>$N(e.rawRequestBody,S),[e.rawRequestBody,S]);function z(P){P.stopPropagation(),S!==null&&window.navigator.clipboard.writeText(S).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})}function A(P){P.stopPropagation(),e.rawRequestBody!==null&&window.navigator.clipboard.writeText(e.rawRequestBody).then(()=>{c(!0),setTimeout(()=>c(!1),2e3)})}function O(P){P.stopPropagation(),e.responseText!==null&&window.navigator.clipboard.writeText(e.responseText).then(()=>{h(!0),setTimeout(()=>h(!1),2e3)})}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Se("border border-border rounded-lg mb-3 overflow-hidden"),children:[f.jsx(f5,{log:e,parsedRequest:b,expanded:o,onToggle:()=>i(!o),suppressApiFormatBadge:n}),o&&f.jsx("div",{onClick:P=>P.stopPropagation(),onKeyDown:P=>P.stopPropagation(),children:f.jsxs(Cn,{defaultValue:"request",children:[f.jsxs(En,{className:"mx-4 mt-2",children:[t==="full"&&f.jsx(Ge,{value:"raw-headers",children:"Raw Headers"}),t==="full"&&f.jsx(Ge,{value:"headers",children:"Headers"}),rc(e.apiFormat,t,r)&&f.jsx(Ge,{value:"raw-request",children:"Raw Request"}),f.jsx(Ge,{value:"request",children:"Request"}),t==="full"&&f.jsx(Ge,{value:"raw",children:"Raw Response"}),f.jsx(Ge,{value:"parsed",children:"Response"})]}),rc(e.apiFormat,t,r)&&f.jsx(Ke,{value:"raw-request",children:f.jsxs("div",{className:"px-4 py-3",children:[f.jsx("div",{className:"flex justify-end mb-2",children:f.jsx(fi,{text:e.rawRequestBody,label:"Copy Raw Request",copied:l,onCopy:A})}),e.rawRequestBody!==null?f.jsx(ui,{text:e.rawRequestBody,defaultExpandDepth:1}):f.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No request body"})]})}),f.jsx(Ke,{value:"request",children:f.jsxs("div",{className:"px-4 py-3",children:[f.jsxs("div",{className:"flex justify-end gap-2 mb-2",children:[O5(e.apiFormat,t,r,e.rawRequestBody!==null)&&f.jsx(oc,{active:y,onClick:P=>{P.stopPropagation(),x(!y)}}),f.jsxs(ft,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:P=>{P.stopPropagation(),d(!0)},children:[f.jsx(au,{className:"size-3 mr-1"}),"Replay"]}),f.jsx(fi,{text:S,label:"Copy Request",copied:s,onCopy:z})]}),y?f.jsx(ec,{result:N,emptyLabel:"No transformation applied — raw and sent request bodies are identical."}):S!==null?f.jsx(ui,{text:S,defaultExpandDepth:1}):f.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No request body"})]})}),t==="full"&&f.jsx(Ke,{value:"headers",children:f.jsxs("div",{className:"px-4 py-3",children:[f.jsx("div",{className:"flex justify-end gap-2 mb-2",children:P5(t,e.rawHeaders!==void 0&&Object.keys(e.rawHeaders).length>0)&&f.jsx(oc,{active:g,onClick:P=>{P.stopPropagation(),m(!g)}})}),g?f.jsx(ec,{result:C,emptyLabel:"No transformation applied — raw and processed headers are identical."}):e.headers&&Object.keys(e.headers).length>0?f.jsx("div",{className:"space-y-1 font-mono text-xs",children:Object.entries(e.headers).sort(([P],[L])=>P.localeCompare(L)).map(([P,L])=>f.jsxs("div",{className:"flex gap-2",children:[f.jsxs("span",{className:"text-blue-600 dark:text-blue-400 font-semibold shrink-0",children:[P,":"]}),f.jsx("span",{className:"text-muted-foreground truncate",title:L,children:L})]},P))}):f.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No headers captured"})]})}),t==="full"&&f.jsx(Ke,{value:"raw-headers",children:f.jsx("div",{className:"px-4 py-3",children:e.rawHeaders&&Object.keys(e.rawHeaders).length>0?f.jsx("div",{className:"space-y-1 font-mono text-xs",children:Object.entries(e.rawHeaders).sort(([P],[L])=>P.localeCompare(L)).map(([P,L])=>f.jsxs("div",{className:"flex gap-2",children:[f.jsxs("span",{className:"text-blue-600 dark:text-blue-400 font-semibold shrink-0",children:[P,":"]}),f.jsx("span",{className:"text-muted-foreground truncate",title:L,children:L})]},P))}):f.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No raw headers captured"})})}),f.jsx(Ke,{value:"raw",children:f.jsxs("div",{className:"px-4 py-3 space-y-3",children:[e.error!==void 0&&e.error!==null&&f.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[f.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),f.jsx("div",{className:"text-muted-foreground font-mono",children:e.error})]}),f.jsx("div",{className:"flex justify-end",children:f.jsx(fi,{text:e.responseText,label:"Copy Response",copied:u,onCopy:O})}),e.responseText!==null?f.jsx(ui,{text:e.responseText,defaultExpandDepth:1}):f.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No response"}),e.streaming===!0&&f.jsx(R5,{logId:e.id,truncated:e.streamingChunksPath!==null})]})}),f.jsx(Ke,{value:"parsed",children:f.jsx("div",{className:"px-4 py-3",children:f.jsx(Ur,{responseText:e.responseText,responseStatus:e.responseStatus,streaming:e.streaming,inputTokens:e.inputTokens,outputTokens:e.outputTokens,cacheCreationInputTokens:e.cacheCreationInputTokens,cacheReadInputTokens:e.cacheReadInputTokens,apiFormat:e.apiFormat,error:e.error})})})]})})]}),f.jsx(A5,{log:e,open:p,onOpenChange:d})]})});function D5(e){let t=0,n=0;for(const r of e)r.inputTokens!==null&&(t+=r.inputTokens),r.outputTokens!==null&&(n+=r.outputTokens);return{totalInputTokens:t,totalOutputTokens:n}}const M5=v.memo(function({group:e,viewMode:t="simple",strip:n}){const[r,o]=v.useState(!1),i=D5(e.logs),s=e.logs[0]?.timestamp??new Date().toISOString(),a=e.logs[e.logs.length-1]?.timestamp??new Date().toISOString(),l=Jk(e.logs),c=e.conversationId.startsWith("PID:")||e.conversationId.includes("|")?e.conversationId:e.conversationId.length>24?e.conversationId.slice(0,12)+"…"+e.conversationId.slice(-12):e.conversationId;return f.jsxs("div",{className:"mb-4",children:[f.jsx(Gk,{conversationId:c,startTime:s,endTime:a,totalCalls:e.logs.length,totalInputTokens:i.totalInputTokens,totalOutputTokens:i.totalOutputTokens,apiFormat:Kk(e.logs),expanded:r,onToggle:()=>o(!r),hideApiFormat:l}),r&&f.jsx("div",{className:"pl-4 border-l-2 border-muted ml-3",children:e.logs.map(u=>f.jsx($h,{log:u,viewMode:t,suppressApiFormatBadge:!l,strip:n},u.id))})]})});function L5({className:e}){return f.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:Se("inline-block size-5",e),children:[f.jsx("path",{d:"M5 13 C5 9 8 7 12 7 C16 7 19 9 19 13 C19 16 16 18 12 18 C8 18 5 16 5 13 Z"}),f.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),f.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"}),f.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),f.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"}),f.jsx("circle",{cx:"9.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"}),f.jsx("circle",{cx:"14.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"}),f.jsx("line",{x1:"6.5",y1:"16",x2:"4.5",y2:"19.5"}),f.jsx("line",{x1:"9",y1:"17.5",x2:"8",y2:"20.5"}),f.jsx("line",{x1:"15",y1:"17.5",x2:"16",y2:"20.5"}),f.jsx("line",{x1:"17.5",y1:"16",x2:"19.5",y2:"19.5"})]})}function ic({...e}){return f.jsx(rk,{"data-slot":"select",...e})}function sc({...e}){return f.jsx(ik,{"data-slot":"select-value",...e})}function ac({className:e,size:t="default",children:n,...r}){return f.jsxs(ok,{"data-slot":"select-trigger","data-size":t,className:Se("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,f.jsx(sk,{asChild:!0,children:f.jsx(zt,{className:"size-4 opacity-50"})})]})}function lc({className:e,children:t,position:n="popper",align:r="center",...o}){return f.jsx(ak,{children:f.jsxs(lk,{"data-slot":"select-content",className:Se("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...o,children:[f.jsx(F5,{}),f.jsx(ck,{className:Se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),f.jsx($5,{})]})})}function Mr({className:e,children:t,...n}){return f.jsxs(uk,{"data-slot":"select-item",className:Se("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[f.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx(fk,{children:f.jsx(hr,{className:"size-4"})})}),f.jsx(dk,{children:t})]})}function F5({className:e,...t}){return f.jsx(hk,{"data-slot":"select-scroll-up-button",className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(Vy,{className:"size-4"})})}function $5({className:e,...t}){return f.jsx(pk,{"data-slot":"select-scroll-down-button",className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(zt,{className:"size-4"})})}const B5={deepseek:"https://api-docs.deepseek.com/zh-cn/"};function U5(e){return e.length<=8?"••••••••":e.slice(0,4)+"••••••••"+e.slice(-4)}function Z5(e){return Object.prototype.hasOwnProperty.call(e,"success")}function W5(e){return Object.prototype.hasOwnProperty.call(e,"notConfigured")}function V5(e){const t={className:"size-3",strokeWidth:2};switch(e){case"timeout":return f.jsx(os,{...t});case"network_unreachable":return f.jsx(Qb,{...t});case"connection_refused":return f.jsx(tv,{...t});case"auth_failed":return f.jsx(Cb,{...t});case"rate_limited":return f.jsx(pb,{...t});case"server_error":return f.jsx(Fb,{...t});case"invalid_response":return f.jsx(eb,{...t});case"unknown":return f.jsx(bi,{...t});default:return f.jsx(bi,{...t})}}function cc({result:e}){const[t,n]=v.useState(!1);if(!Z5(e))return W5(e)?f.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[f.jsx(Tb,{className:"size-3"}),f.jsx("span",{children:"Not configured"})]}):f.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[f.jsx(lu,{className:"size-3 animate-spin"}),f.jsx("span",{children:"Testing..."})]});if(e.success){const l=[];e.inputTokens!==void 0&&l.push(f.jsxs("span",{children:[e.inputTokens," in"]},"in")),e.outputTokens!==void 0&&l.push(f.jsxs("span",{children:[e.outputTokens," out"]},"out")),e.cacheCreationInputTokens!==void 0&&e.cacheCreationInputTokens>0&&l.push(f.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["+",e.cacheCreationInputTokens," cache"]},"cache-create")),e.cacheReadInputTokens!==void 0&&e.cacheReadInputTokens>0&&l.push(f.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["~",e.cacheReadInputTokens," cached"]},"cache-read"));const c=[];for(let u=0;u<l.length;u++)u>0&&c.push(", "),c.push(l[u]);return f.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600 shrink-0",children:[f.jsx(Xy,{className:"size-3"}),f.jsx("span",{children:"Connected"}),l.length>0&&f.jsxs("span",{className:"text-muted-foreground",children:["(",c,")"]})]})}const r=e.error,o=r?.message??"Connection failed",i=r?.hint,s=r?.details,a=r?.type??"unknown";return f.jsxs("div",{className:"flex flex-col gap-1 shrink-0",children:[f.jsxs("div",{className:"flex items-center gap-1 text-xs text-red-600 max-w-[200px]",children:[V5(a),f.jsx("span",{className:"truncate",children:o}),s!==void 0&&f.jsx("button",{type:"button",onClick:()=>n(!t),className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",title:t?"Hide details":"Show details",children:t?f.jsx(ru,{className:"size-3"}):f.jsx(ou,{className:"size-3"})})]}),t&&s!==void 0&&f.jsxs("div",{className:"text-xs text-muted-foreground bg-muted/50 rounded p-2 max-w-[300px]",children:[i!==void 0&&f.jsx("div",{className:"mb-1",children:i}),f.jsx("div",{className:"font-mono whitespace-pre-wrap break-all text-red-400/80",children:s})]})]})}function H5({provider:e,testResults:t,isTesting:n,testingTimeLeft:r,onEdit:o,onDelete:i,onTest:s}){const[a,l]=v.useState(!1),c=e.apiDocsUrl??Object.entries(B5).find(([u])=>e.name.toLowerCase().includes(u))?.[1];return f.jsxs("div",{className:"border rounded-lg p-4 flex flex-col gap-3 bg-card",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2",children:[f.jsx("div",{className:"flex items-center gap-2 min-w-0",children:f.jsx("span",{className:"font-medium truncate",children:e.model!==void 0&&e.model!==""?`${e.model} (${e.name})`:e.name})}),c!==void 0&&f.jsxs("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1 text-xs",title:"View API documentation",children:[f.jsx(lb,{className:"size-3"}),f.jsx("span",{className:"sr-only",children:"Docs"})]})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("code",{className:"text-xs text-muted-foreground bg-muted px-2 py-1 rounded flex-1 truncate",children:a?e.apiKey:U5(e.apiKey)}),f.jsx("button",{type:"button",onClick:()=>l(u=>!u),className:"text-muted-foreground hover:text-foreground transition-colors p-1","aria-label":a?"Hide API key":"Show API key",children:a?f.jsx(ru,{className:"size-4"}):f.jsx(ou,{className:"size-4"})})]}),e.anthropicBaseUrl!==void 0&&e.anthropicBaseUrl!==""&&f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"text-xs text-muted-foreground min-w-0 flex-1",children:[f.jsx("span",{className:"font-medium",children:"Anthropic:"})," ",f.jsx("span",{className:"truncate",children:e.anthropicBaseUrl})]}),t&&f.jsx(cc,{result:t.anthropic.nonStreaming})]}),e.openaiBaseUrl!==void 0&&e.openaiBaseUrl!==""&&f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"text-xs text-muted-foreground min-w-0 flex-1",children:[f.jsx("span",{className:"font-medium",children:"OpenAI:"})," ",f.jsx("span",{className:"truncate",children:e.openaiBaseUrl})]}),t&&f.jsx(cc,{result:t.openai.nonStreaming})]}),f.jsxs("div",{className:"flex gap-2 pt-1 border-t",children:[s!==void 0&&f.jsxs(ft,{variant:"outline",size:"sm",onClick:()=>s(e.id),className:"text-xs h-7 gap-1",disabled:n??!1,children:[f.jsx(lu,{className:`size-3 ${n??!1?"animate-spin":""}`}),n??!1?r!==void 0?`Testing (${r}s)`:"Testing...":"Test"]}),f.jsxs(ft,{variant:"outline",size:"sm",onClick:()=>o(e),className:"text-xs h-7 gap-1",children:[f.jsx(zb,{className:"size-3"}),"Edit"]}),f.jsxs(ft,{variant:"outline",size:"sm",onClick:()=>i(e.id),className:"text-xs h-7 gap-1 text-destructive hover:text-destructive",children:[f.jsx(Vb,{className:"size-3"}),"Delete"]})]})]})}const q5={deepseek:{format:"openai",baseUrl:"https://api.deepseek.com"},minimax:{format:"anthropic",baseUrl:"https://api.minimaxi.com/anthropic",apiDocsUrl:"https://platform.minimaxi.com/docs/api-reference/api-overview"},alibaba:{format:"openai",baseUrl:"https://dashscope.aliyuncs.com/compatible-mode"}},uc=["MiniMax M3","MiniMax M2.7","MiniMax M2.7-highspeed","MiniMax M2.5","MiniMax M2.5-highspeed","MiniMax M2.1","MiniMax M2.1-highspeed","MiniMax M2"],dc=["glm-5","glm-5.1","qwen3.6-plus","qwen3.7-max"];function G5({provider:e,onSubmit:t,onCancel:n}){const[r,o]=v.useState(e?.name??"Provider Name"),[i,s]=v.useState(e?.apiKey??""),[a,l]=v.useState(e?.model??""),[c,u]=v.useState(e?.format??"anthropic"),[h,p]=v.useState(e?.baseUrl??""),[d,g]=v.useState(e?.apiDocsUrl??""),[m,y]=v.useState({}),[x,b]=v.useState(!1),[w,S]=v.useState(!1),C=r.toLowerCase().includes("minimax"),N=r.toLowerCase().includes("alibaba");v.useEffect(()=>{e&&(o(e.name),s(e.apiKey),l(e.model??""),u(e.format??"anthropic"),p(e.baseUrl??""),g(e.apiDocsUrl??""),S(!1))},[e]),v.useEffect(()=>{const P=r.toLowerCase();for(const[L,T]of Object.entries(q5))if(P.includes(L)){w||(u(T.format),p(T.baseUrl)),T.apiDocsUrl!==void 0&&!d&&g(T.apiDocsUrl),L==="minimax"&&!a&&l(uc[0]??""),L==="alibaba"&&!a&&l(dc[0]??"");break}},[r]);function z(){const P={};return r.trim()||(P.name="Name is required"),i.trim()||(P.apiKey="API key is required"),a.trim()||(P.model="Model is required"),h.trim()?A(h.trim())||(P.baseUrl="Invalid URL format"):P.baseUrl="Base URL is required",y(P),Object.keys(P).length===0}function A(P){try{return new URL(P),!0}catch{return!1}}function O(P){if(P.preventDefault(),!!z()){b(!0);try{t({name:r.trim(),apiKey:i.trim(),model:a.trim()||void 0,format:c,baseUrl:h.trim()||void 0,apiDocsUrl:d.trim()||void 0})}finally{b(!1)}}}return f.jsxs("form",{onSubmit:O,className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsxs("label",{htmlFor:"provider-name",className:"text-sm font-medium",children:["Name ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx("input",{id:"provider-name",type:"text",value:r,onChange:P=>o(P.target.value),placeholder:"Model Name",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.name!==void 0&&f.jsx("p",{className:"text-xs text-destructive",children:m.name})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("label",{htmlFor:"provider-apikey",className:"text-sm font-medium",children:["API Key ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx("input",{id:"provider-apikey",type:"password",value:i,onChange:P=>s(P.target.value),placeholder:"sk-ant-...",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.apiKey!==void 0&&f.jsx("p",{className:"text-xs text-destructive",children:m.apiKey})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("label",{htmlFor:"provider-model",className:"text-sm font-medium",children:["Model ",f.jsx("span",{className:"text-destructive",children:"*"})]}),C||N?f.jsx("select",{id:"provider-model",value:a,onChange:P=>l(P.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",children:(C?uc:dc).map(P=>f.jsx("option",{value:P,children:P},P))}):f.jsx("input",{id:"provider-model",type:"text",value:a,onChange:P=>l(P.target.value),placeholder:"",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.model!==void 0&&f.jsx("p",{className:"text-xs text-destructive",children:m.model})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("label",{htmlFor:"provider-format",className:"text-sm font-medium",children:["API Format ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsxs("select",{id:"provider-format",value:c,onChange:P=>u(P.target.value==="anthropic"?"anthropic":"openai"),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",children:[f.jsx("option",{value:"anthropic",children:"Anthropic (/v1/messages)"}),f.jsx("option",{value:"openai",children:"OpenAI (/v1/chat/completions)"})]}),f.jsx("p",{className:"text-xs text-muted-foreground",children:c==="anthropic"?"Use Anthropic format for /v1/messages endpoint":"Use OpenAI format for /v1/chat/completions endpoint"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("label",{htmlFor:"provider-base-url",className:"text-sm font-medium",children:["Base URL ",f.jsx("span",{className:"text-destructive",children:"*"})]}),f.jsx("input",{id:"provider-base-url",type:"text",value:h,onChange:P=>{S(!0),p(P.target.value)},placeholder:c==="anthropic"?"https://api.anthropic.com":"https://api.openai.com/v1",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.baseUrl!==void 0&&f.jsx("p",{className:"text-xs text-destructive",children:m.baseUrl}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Base URL for the provider API."})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("label",{htmlFor:"provider-api-docs-url",className:"text-sm font-medium",children:"API Docs URL"}),f.jsx("input",{id:"provider-api-docs-url",type:"text",value:d,onChange:P=>g(P.target.value),placeholder:"https://api.example.com/docs",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional API documentation URL. If not set, uses known provider docs."})]}),f.jsxs("div",{className:"flex gap-2 justify-end pt-2",children:[f.jsx(ft,{type:"button",variant:"outline",onClick:n,disabled:x,children:"Cancel"}),f.jsx(ft,{type:"submit",disabled:x,children:x?"Saving...":e?"Update Provider":"Add Provider"})]})]})}function K5({externalProviders:e,isLoading:t=!1,externalTestResults:n,externalTestingProviders:r,externalTestingTimeLeft:o,onProvidersMutate:i,onTestResultsChange:s,onTestingProvidersChange:a,onTestingTimeLeftChange:l}){const[c,u]=v.useState(!1),[h,p]=v.useState(),[d,g]=v.useState(null),[m,y]=v.useState({}),[x,b]=v.useState(new Set),[w,S]=v.useState({}),[C,N]=v.useState(null),[z,A]=v.useState(!1),O=e??[],P=n??m,L=r??x,T=o??w,M=l?(j,Y)=>l(j,Y):(j,Y)=>{S(Y===void 0?H=>{const ce={...H};return delete ce[j],ce}:H=>({...H,[j]:Y}))};v.useEffect(()=>{(async()=>{try{const j=await fetch("/api/config/paths");if(j.ok){const Y=await j.json();N(Y.providerConfig)}}catch{}})()},[]);const _=30,D=v.useCallback(async j=>{const Y={anthropic:{nonStreaming:{testing:!0},streaming:{testing:!0}},openai:{nonStreaming:{testing:!0},streaming:{testing:!0}}};s?s(j,Y):y(re=>({...re,[j]:Y})),a?a(j,!0):b(re=>new Set(re).add(j));const H=new AbortController;let ce=_;M(j,ce);const ie=setInterval(()=>{ce--,M(j,ce),ce<=0&&(clearInterval(ie),H.abort())},1e3);try{const re=await fetch(`/api/providers/${j}/test`,{method:"POST",signal:H.signal});if(re.ok){const le=await re.json();s?s(j,le):y(me=>({...me,[j]:le}))}else{const le={anthropic:{nonStreaming:{success:!1,error:{message:`HTTP ${re.status}: ${re.statusText}`,type:"server_error"}},streaming:{notConfigured:!0}},openai:{nonStreaming:{success:!1,error:{message:`HTTP ${re.status}: ${re.statusText}`,type:"server_error"}},streaming:{notConfigured:!0}}};s?s(j,le):y(me=>({...me,[j]:le}))}}catch(re){if(re instanceof Error&&re.name==="AbortError"){const me={anthropic:{nonStreaming:{success:!1,error:{message:"Request timed out",type:"timeout"}},streaming:{notConfigured:!0}},openai:{nonStreaming:{success:!1,error:{message:"Request timed out",type:"timeout"}},streaming:{notConfigured:!0}}};s?s(j,me):y(xe=>({...xe,[j]:me}))}}finally{clearInterval(ie),M(j,void 0);try{a?a(j,!1):b(re=>{const le=new Set(re);return le.delete(j),le})}catch{}}},[a,s,M]);function G(j){(async()=>{const Y={name:j.name,apiKey:j.apiKey,model:j.model,format:j.format,anthropicBaseUrl:j.format==="anthropic"?j.baseUrl:void 0,openaiBaseUrl:j.format==="openai"?j.baseUrl:void 0};let H;try{H=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Y)})}catch{g("Network error: could not reach the server. Is the proxy running?");return}if(!H.ok){const ie=await H.json();g(ie.error??"Failed to add provider");return}const ce=await H.json();i?.(),u(!1),await D(ce.id)})()}function Z(j){h&&(async()=>{const Y={name:j.name,apiKey:j.apiKey,model:j.model,format:j.format,anthropicBaseUrl:j.format==="anthropic"?j.baseUrl:void 0,openaiBaseUrl:j.format==="openai"?j.baseUrl:void 0};let H;try{H=await fetch(`/api/providers/${h.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(Y)})}catch{g("Network error: could not reach the server. Is the proxy running?");return}if(!H.ok){const ie=await H.json();g(ie.error??"Failed to update provider");return}const ce=await H.json();i?.(),p(void 0),await D(ce.id)})()}function te(j){window.confirm("Are you sure you want to delete this provider?")&&(async()=>{let Y;try{Y=await fetch(`/api/providers/${j}`,{method:"DELETE"})}catch{g("Network error: could not reach the server. Is the proxy running?");return}if(!Y.ok){const H=await Y.json();g(H.error??"Failed to delete provider");return}i?.()})()}const q=v.useRef(null);function E(j){const Y="/api/providers/export";(async()=>{try{const H=await fetch(Y);if(!H.ok){g("Failed to export providers");return}const ce=await H.blob(),ie=URL.createObjectURL(ce),re=document.createElement("a");re.href=ie,re.download=H.headers.get("Content-Disposition")?.match(/filename="(.+)"/)?.[1]??"providers.json",document.body.appendChild(re),re.click(),document.body.removeChild(re),URL.revokeObjectURL(ie)}catch{g("Failed to export providers")}})()}function U(){q.current?.click()}function B(j){const Y=j.target.files?.[0];Y&&(async()=>{try{const H=await Y.text(),ce=await fetch("/api/providers/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(H)}),re=de({success:ht().optional(),imported:ye().optional(),message:X().optional(),errors:Be(X()).optional()}).parse(await ce.json());ce.ok&&re.imported!==void 0&&re.imported>0?(i?.(),g(null)):re.errors&&re.errors.length>0?g(re.errors.join("; ")):g(re.message??"Import failed")}catch{g("Failed to import providers")}j.target.value=""})()}return t?f.jsx("div",{className:"flex items-center justify-center py-8",children:f.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading providers..."})}):c||h?f.jsxs("div",{className:"space-y-4",children:[f.jsx("div",{className:"flex items-center justify-between",children:f.jsx("h3",{className:"text-lg font-medium",children:h?"Edit Provider":"Add New Provider"})}),f.jsx(G5,{provider:h,onSubmit:h?Z:G,onCancel:()=>{u(!1),p(void 0)}})]}):f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"flex items-center justify-between sticky top-0 z-10 bg-background pb-2",children:[f.jsx("h3",{className:"text-lg font-medium",children:"Providers"}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs(ft,{variant:"outline",size:"sm",onClick:()=>E(),className:"gap-1 hover:bg-muted",children:[f.jsx(nu,{className:"size-3"}),"Export"]}),f.jsxs(ft,{variant:"outline",size:"sm",onClick:U,className:"gap-1 hover:bg-muted",children:[f.jsx(Kb,{className:"size-3"}),"Import"]}),f.jsx("input",{type:"file",ref:q,accept:".json",onChange:B,style:{display:"none"}}),f.jsxs(ft,{onClick:()=>u(!0),size:"sm",className:"gap-1",children:[f.jsx(Ca,{className:"size-4"}),"Add Provider"]})]})]}),C!==null&&f.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/30 rounded-md px-3 py-2",children:[f.jsx("span",{className:"shrink-0",children:"Config:"}),f.jsx("span",{className:"font-mono truncate",title:C,children:C}),f.jsx("button",{type:"button",onClick:()=>{window.navigator.clipboard.writeText(C).then(()=>{A(!0),setTimeout(()=>A(!1),2e3)})},className:"shrink-0 ml-auto text-muted-foreground hover:text-foreground transition-colors",title:"Copy path",children:z?f.jsx(hr,{className:"size-3 text-green-500"}):f.jsx(uo,{className:"size-3"})})]}),d!==null&&f.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive bg-destructive/10 rounded-md px-3 py-2",children:[f.jsx(bi,{className:"size-4 shrink-0"}),d]}),O.length===0?f.jsxs("div",{className:"text-center py-12 space-y-3",children:[f.jsx("p",{className:"text-sm text-muted-foreground",children:"No providers configured yet."}),f.jsxs(ft,{onClick:()=>u(!0),variant:"outline",size:"sm",children:[f.jsx(Ca,{className:"size-4"}),"Add Your First Provider"]})]}):f.jsx("div",{className:"space-y-3",children:O.map(j=>f.jsx(H5,{provider:j,testResults:P[j.id],isTesting:L.has(j.id),testingTimeLeft:T[j.id],onEdit:Y=>p(Y),onDelete:te,onTest:Y=>{D(Y)}},j.id))})]})}async function J5(e){const n=await(await fetch(e)).json();return Array.isArray(n)?n:[]}function Y5(){const e=fc("/api/providers",J5,{revalidateOnFocus:!1,revalidateIfStale:!1});return{providers:e.data??[],isLoading:e.isLoading,isError:e.error,mutate:e.mutate}}function X5(){const[e,t]=v.useState(!1),[n,r]=v.useState("providers"),{providers:o,isLoading:i,mutate:s}=Y5(),[a,l]=v.useState({}),[c,u]=v.useState(new Set),[h,p]=v.useState({}),d=v.useCallback((y,x)=>{l(b=>({...b,[y]:x}))},[]),g=v.useCallback((y,x)=>{u(b=>{const w=new Set(b);return x?w.add(y):w.delete(y),w})},[]),m=v.useCallback((y,x)=>{p(b=>{if(x===void 0){const w={...b};return delete w[y],w}return{...b,[y]:x}})},[]);return f.jsxs(Rh,{open:e,onOpenChange:t,children:[f.jsx(h5,{asChild:!0,children:f.jsxs(ft,{variant:"ghost",size:"icon",className:"size-8",children:[f.jsx(Bb,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Settings"})]})}),f.jsxs(Ph,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[f.jsx(Oh,{children:f.jsx(Dh,{children:"Settings"})}),f.jsxs(Cn,{value:n,onValueChange:r,className:"flex-1 overflow-hidden",children:[f.jsxs(En,{children:[f.jsx(Ge,{value:"providers",children:"Providers"}),f.jsx(Ge,{value:"proxy",children:"Proxy"})]}),f.jsxs("div",{className:"mt-4 overflow-y-auto flex-1",children:[f.jsx(Ke,{value:"providers",children:f.jsx(K5,{externalProviders:o,isLoading:i,externalTestResults:a,externalTestingProviders:c,externalTestingTimeLeft:h,onProvidersMutate:()=>{s()},onTestResultsChange:d,onTestingProvidersChange:g,onTestingTimeLeftChange:m})}),f.jsx(Ke,{value:"proxy",children:f.jsx(Q5,{})})]})]})]})]})}function Q5(){const{strip:e,isLoading:t,setStrip:n}=Yc(),[r,o]=v.useState(null),[i,s]=v.useState(!1),a=v.useCallback(async l=>{o(null),s(!0);try{await n(l)}catch(c){o(c instanceof Error?c.message:String(c))}finally{s(!1)}},[n]);return f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"space-y-1",children:[f.jsx("h3",{className:"text-sm font-semibold",children:"Claude Code billing header"}),f.jsxs("p",{className:"text-xs text-muted-foreground",children:["When enabled, the proxy strips the synthetic ",f.jsx("code",{children:"x-anthropic-billing-header"})," text block that Claude Code prepends to the system prompt before forwarding to upstream. Improves prefix-cache hit rates against third-party upstreams. The default at startup is controlled by the ",f.jsx("code",{children:"LLM_INSPECTOR_STRIP_CLAUDE_CODE_BILLING_HEADER"})," environment variable; your choice is persisted to ",f.jsx("code",{children:"config.json"})," and overrides the env var for subsequent requests."]})]}),f.jsxs("label",{className:"flex items-center gap-3",children:[f.jsx("input",{type:"checkbox",role:"switch",checked:e,disabled:t||i,onChange:l=>{a(l.currentTarget.checked)},className:"size-4 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50"}),f.jsx("span",{className:"text-sm",children:t?"Loading…":e?"Stripping enabled":"Stripping disabled"})]}),r!==null&&f.jsxs("p",{className:"text-xs text-destructive",children:["Failed to save: ",r]})]})}function eT(e){return e.length<=30?e:e.slice(0,12)+"…"+e.slice(-12)}function tT(e){let t=0,n=0;for(const r of e)r.inputTokens!==null&&(t+=r.inputTokens),r.outputTokens!==null&&(n+=r.outputTokens);return{totalIn:t,totalOut:n}}function nT({command:e}){const[t,n]=v.useState(!1),r=v.useCallback(()=>{window.navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})},[e]);return f.jsxs("div",{className:"inline-flex items-center gap-2 bg-muted rounded-md px-3 py-2",children:[f.jsx("pre",{className:"text-blue-500 font-mono text-sm m-0",children:e}),f.jsx("button",{type:"button",onClick:r,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0 cursor-pointer","aria-label":"Copy command",children:t?f.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:f.jsx("path",{d:"M20 6 9 17l-5-5"})}):f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),f.jsx("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})})]})}function rT({logs:e,sessions:t,models:n,selectedSession:r,selectedModel:o,onSessionChange:i,onModelChange:s,onClearAll:a,viewMode:l,onViewModeChange:c,strip:u}){const{totalIn:h,totalOut:p}=tT(e),[d,g]=v.useState(!0),[m,y]=v.useState(!1),x=v.useCallback(async()=>{y(!0);try{await dv(e)}finally{y(!1)}},[e]),b=v.useRef(null),w=v.useMemo(()=>Xk(e),[e]),S=e.length>0&&d&&!(w.length===1&&w[0]?.logs.length===e.length),C=Qc({count:S?w.length:e.length,getScrollElement:()=>b.current,estimateSize:()=>150,measureElement:typeof window<"u"?N=>N.getBoundingClientRect().height:void 0,overscan:5});return f.jsxs("div",{className:"max-w-[1200px] mx-auto flex flex-col h-screen",style:{maxHeight:"100vh"},children:[f.jsxs("div",{className:"flex items-center gap-4 mb-4 px-6 pt-6",children:[f.jsxs("h1",{className:"text-lg font-bold flex-1 flex items-center gap-2",children:[f.jsx(L5,{className:"size-10 text-amber-500 self-center"}),f.jsxs("span",{className:"flex items-baseline gap-2",children:["LLM Inspector",f.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:["v",hv.version]})]})]}),f.jsxs("div",{className:"flex items-center border border-border rounded-md overflow-hidden",children:[f.jsx("button",{type:"button",onClick:()=>c("simple"),className:`px-2 py-1 cursor-pointer transition-colors text-xs ${l==="simple"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:"Simple"}),f.jsx("button",{type:"button",onClick:()=>c("full"),className:`px-2 py-1 cursor-pointer transition-colors text-xs ${l==="full"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:"Full"})]}),f.jsx(X5,{}),f.jsxs("span",{className:"text-muted-foreground text-xs font-mono",children:[e.length," request",e.length!==1?"s":"",h>0||p>0?` · ${h.toLocaleString()} in / ${p.toLocaleString()} out`:""]}),e.length>0&&f.jsx("button",{type:"button",onClick:()=>{x()},disabled:m,className:"text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center gap-1",title:"Export all logs as JSON ZIP",children:m?f.jsx("span",{children:"Exporting..."}):f.jsxs(f.Fragment,{children:[f.jsx(nu,{className:"size-3"}),f.jsx("span",{children:"Export All"})]})}),f.jsx("button",{type:"button",onClick:a,className:"text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Clear all logs",children:"Clear All"})]}),f.jsxs("div",{className:"flex gap-3 px-6 mb-4",children:[f.jsxs(ic,{value:r,onValueChange:i,children:[f.jsx(ac,{className:"flex-1 max-w-[400px] text-xs",children:f.jsx(sc,{placeholder:"All sessions"})}),f.jsxs(lc,{children:[f.jsx(Mr,{value:"__all__",children:"All sessions"}),t.map(N=>f.jsx(Mr,{value:N,children:eT(N)},N))]})]}),f.jsxs(ic,{value:o,onValueChange:s,children:[f.jsx(ac,{className:"text-xs",children:f.jsx(sc,{placeholder:"All models"})}),f.jsxs(lc,{children:[f.jsx(Mr,{value:"__all__",children:"All models"}),n.map(N=>f.jsx(Mr,{value:N,children:N},N))]})]}),f.jsxs("div",{className:"flex items-center border border-border rounded-md overflow-hidden",children:[f.jsx("button",{type:"button",onClick:()=>g(!0),className:`px-2 py-1.5 cursor-pointer transition-colors ${d?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,title:"Grouped view",children:f.jsx(vb,{className:"size-4"})}),f.jsx("button",{type:"button",onClick:()=>g(!1),className:`px-2 py-1.5 cursor-pointer transition-colors ${d?"text-muted-foreground hover:bg-muted/50":"bg-muted text-foreground"}`,title:"Flat view",children:f.jsx(_b,{className:"size-4"})})]})]}),f.jsx("div",{className:"flex-1 min-h-0 px-6 pb-6",children:e.length===0?f.jsxs("div",{className:"text-center text-muted-foreground py-16 space-y-4",children:[f.jsx("p",{className:"text-sm",children:"No requests captured yet."}),f.jsx("p",{className:"text-xs",children:"Route AI coding tools through the proxy:"}),f.jsx(nT,{command:"LLM_BASE_URL=http://localhost:25947/proxy <your-tool>"})]}):f.jsx("div",{ref:b,className:"overflow-y-auto h-full",children:f.jsx("div",{style:{height:`${C.getTotalSize()}px`,width:"100%",position:"relative"},children:C.getVirtualItems().map(N=>{if(S){const z=w[N.index];return z===void 0?null:f.jsx("div",{"data-index":N.index,ref:C.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${N.start}px)`},children:f.jsx(M5,{group:z,viewMode:l,strip:u})},z.id)}else{const z=e[N.index];return z===void 0?null:f.jsx("div",{"data-index":N.index,ref:C.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${N.start}px)`},children:f.jsx($h,{log:z,viewMode:l,strip:u})},z.id)}})})})})]})}de({logs:Be(xi),total:ye(),offset:ye(),limit:ye()});const oT=Yt([de({type:Ne("init"),logs:Be(xi)}),de({type:Ne("update"),log:xi})]);function iT(e){const t=new Set;for(const n of e)n.sessionId!==null&&n.sessionId!==""&&t.add(n.sessionId);return[...t]}function sT(e){const t=new Set;for(const n of e)n.model!==null&&n.model!==""&&t.add(n.model);return[...t]}function aT(){const[e,t]=v.useState([]),[n,r]=v.useState([]),[o,i]=v.useState([]),[s,a]=v.useState("__all__"),[l,c]=v.useState("__all__"),[u,h]=v.useState("simple"),[p,d]=v.useState(null),g=v.useRef(null),m=v.useRef(null),y=v.useCallback(async()=>{try{const[S,C]=await Promise.all([fetch("/api/sessions"),fetch("/api/models")]);if(S.ok&&C.ok){const N=await S.json(),z=await C.json(),A=Be(X()).safeParse(N),O=Be(X()).safeParse(z);A.success&&r(A.data),O.success&&i(O.data)}}catch{}},[]),x=v.useCallback(()=>{g.current&&g.current.close();const S=new URLSearchParams;s!=="__all__"&&S.set("sessionId",s),l!=="__all__"&&S.set("model",l);const C=new EventSource(`/api/logs/stream?${S}`);g.current=C,C.onmessage=N=>{try{const z=String(N.data),A=JSON.parse(z),O=oT.safeParse(A);if(!O.success){d("Failed to parse SSE data");return}const P=O.data;P.type==="init"?(t(P.logs),r(iT(P.logs)),i(sT(P.logs)),d(null)):P.type==="update"&&(t(L=>{const T=s==="__all__"||P.log.sessionId===s,M=l==="__all__"||P.log.model===l;return!T||!M?L:L.findIndex(D=>D.id===P.log.id)>=0?L.map(D=>D.id===P.log.id?P.log:D):[...L,P.log]}),r(L=>{const T=P.log.sessionId;return T!=null&&T!==""?L.includes(T)?L:[...L,T]:L}),i(L=>{const T=P.log.model;return T!=null&&T!==""?L.includes(T)?L:[...L,T]:L}))}catch{d("Failed to parse SSE data")}},C.onerror=()=>{d("SSE connection lost, reconnecting..."),C.close(),m.current!==null&&clearTimeout(m.current),m.current=setTimeout(x,3e3)},y()},[s,l,y]);v.useEffect(()=>(x(),()=>{g.current&&(g.current.close(),g.current=null),m.current!==null&&(clearTimeout(m.current),m.current=null)}),[x]);const b=v.useCallback(()=>{(async()=>{try{if(!(await fetch("/api/logs",{method:"DELETE"})).ok){d("Failed to clear logs");return}t([]),r([]),i([]),d(null)}catch(S){d(S instanceof Error?S.message:"Unknown error clearing logs")}})()},[]),{strip:w}=Yc();return f.jsxs(f.Fragment,{children:[p!==null&&f.jsx("div",{className:"fixed top-4 right-4 bg-destructive text-destructive-foreground px-4 py-2 rounded-md text-sm z-50",children:p}),f.jsx(rT,{logs:e,sessions:n,models:o,selectedSession:s,selectedModel:l,onSessionChange:a,onModelChange:c,onClearAll:b,viewMode:u,onViewModeChange:h,strip:w})]})}const uT=aT;export{uT as component};