@sentry/junior-dashboard 0.208.0 → 0.209.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.js CHANGED
@@ -64,7 +64,7 @@ ${s}`:s:"",d=Function,l=`return (input) => {
64
64
  ${s}
65
65
  }`,p;try{p=new d(...i,l)(...A)}catch(g){throw new Je(`this schema (generated code failed to evaluate: ${g.message})`)}return t?.debug&&(p.code=u),p}function ce(e,t){for(let[r,a]of e.constants)if(a===t)return r;let n=`c${e.constantCounter++}`;return e.constants.set(n,t),n}function ge(e){return`v${e.varCounter++}`}function Nce(e,t){let n=e._zod.run({value:t,issues:[]},{});if(n&&typeof n.then=="function")return po;let r=n;return r.issues.length===0?r.value:po}function gr(e,t,n,r,a=!0){let o=e.content.length,i=t.constants.size,A=t.constantCounter,s=t.varCounter;try{return nn(e,t,n,r,a)}catch(u){if(!(u instanceof Je)||!u.islandable)throw u;if(e.content.length=o,t.constants.size>i){let d=Array.from(t.constants.keys()).slice(i);for(let l of d)t.constants.delete(l)}return t.constantCounter=A,t.varCounter=s,Rce(e,t,n,r)}}function Rce(e,t,n,r){let a=ce(t,n),o=ce(t,Nce),i=ge(t);return e.write(`const ${i} = ${o}(${a}, ${r});`),e.write(`if (${i} === INVALID) return INVALID;`),i}var $ce=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function Mce(e,t,n,r){let a=n._zod.def.checks;if(!a||a.length===0)return r;let o=r;for(let i of a){let A=i._zod.def;if(A.when&&!$ce.has(A.check))throw new Je('check with a custom "when" condition');switch(A.check){case"greater_than":jce(e,t,A,o);break;case"less_than":Pce(e,t,A,o);break;case"multiple_of":Tce(e,t,A,o);break;case"number_format":HP(e,A,o);break;case"min_length":{let s=Pu(A.minimum,"min_length"),u=qD(e,t,o,`${o}.length >= ${s} && ${o}.length < ${A.minimum*2}`);e.write(`if (${u} < ${s}) return INVALID;`);break}case"max_length":{let s=Pu(A.maximum,"max_length"),u=qD(e,t,o,`${o}.length > ${s}`);e.write(`if (${u} > ${s}) return INVALID;`);break}case"length_equals":{let s=Pu(A.length,"length_equals"),u=qD(e,t,o,`${o}.length >= ${s} && ${o}.length <= ${A.length*2}`);e.write(`if (${u} !== ${s}) return INVALID;`);break}case"min_size":e.write(`if (${o}.size < ${Pu(A.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${o}.size > ${Pu(A.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${o}.size !== ${Pu(A.size,"size_equals")}) return INVALID;`);break;case"string_format":o=GP(e,t,A,o);break;case"custom":o=qce(e,t,i,o);break;case"bigint_format":Hce(e,A,o);break;case"mime_type":Gce(e,t,A,o);break;case"property":Uce(e,t,A,o);break;case"overwrite":{let s=ge(t);Oce(e,t,i,o,s),o=s;break}default:throw new Je(`check type ${A.check}`)}}return o}function qD(e,t,n,r){let a=ce(t,Ru),o=ge(t);return e.write(`const ${o} = typeof ${n} === "string" && ${r} ? ${a}(${n}) : ${n}.length;`),o}function Pu(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new Je(`${t} bound of type ${typeof e}`);return`${e}`}function TP(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new Je("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new Je("comparison check with Invalid Date bound");return ce(e,t)}throw new Je(`comparison check bound of type ${typeof t}`)}function jce(e,t,n,r){let a=n.inclusive?"<":"<=";e.write(`if (${r} ${a} ${TP(t,n.value)}) return INVALID;`)}function Pce(e,t,n,r){let a=n.inclusive?">":">=";e.write(`if (${r} ${a} ${TP(t,n.value)}) return INVALID;`)}function Tce(e,t,n,r){if(typeof n.value=="bigint"){if(n.value===BigInt(0))throw new Je("multiple_of check with a zero divisor");e.write(`if (${r} % ${n.value}n !== 0n) return INVALID;`)}else{let a=ce(t,Zm);e.write(`if (${a}(${r}, ${Pu(n.value,"multiple_of")}) !== 0) return INVALID;`)}}function HP(e,t,n){let r=t.format;switch(r){case"safeint":e.write(`if (!Number.isSafeInteger(${n})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${n}) || ${n} < -2147483648 || ${n} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${n}) || ${n} < 0 || ${n} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${n}) || ${n} < -3.4028234663852886e38 || ${n} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${n})) return INVALID;`);break;default:throw new Je(`number format ${r}`)}}function Hce(e,t,n){let r=t.format;if(r)switch(r){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break;default:throw new Je(`bigint format ${r}`)}}function Gce(e,t,n,r){let a=n.mime;if(a&&a.length>0){let o=ce(t,new Set(a));e.write(`if (!${o}.has(${r}.type)) return INVALID;`)}}function Uce(e,t,n,r){let a=`${r}[${JSON.stringify(n.property)}]`;nn(e,t,n.schema,a)}function Oce(e,t,n,r,a){let o=n._zod.def.tx;if(!o)throw new Je("overwrite check without a transform function");if(Gu(o))throw new yi("z.compile: async overwrite transforms are not supported");let i=ce(t,o);e.write(`const ${a} = ${i}(${r});`)}function zD(){throw new Hr}function JD(e){this.issues.push(e)}function qce(e,t,n,r){let a=n._zod.def;if(a.fn){if(Gu(a.fn))throw new yi("z.compile: async .refine() predicates are not supported");let o=ce(t,a.fn),i=ce(t,zD),A=ge(t);return e.write(`const ${A} = ${o}(${r});`),e.write(`if (${A} instanceof Promise) ${i}();`),e.write(`if (!${A}) return INVALID;`),r}if(n._zod.check){if(Gu(n._zod.check))throw new yi("z.compile: async .superRefine() / check functions are not supported");let o=n._zod.check,A=ce(t,u=>{let d={value:u,issues:[],addIssue:JD};return o(d)instanceof Promise&&zD(),d.issues.length===0?d.value:po}),s=ge(t);return e.write(`const ${s} = ${A}(${r});`),e.write(`if (${s} === INVALID) return INVALID;`),s}throw new Je("custom check without a predicate or check function")}var zce=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function GP(e,t,n,r){let a=n.format;if(a==="base64"){let s=ce(t,uf);return e.write(`if (!${s}(${r})) return INVALID;`),r}if(a==="base64url"){let s=ce(t,bC);return e.write(`if (!${s}(${r})) return INVALID;`),r}if(a==="jwt"){let s=ce(t,BC),u=ce(t,n.alg??null);return e.write(`if (!${s}(${r}, ${u})) return INVALID;`),r}if(a==="ipv6"){let s=ce(t,cf);return e.write(`if (!${s}(${r})) return INVALID;`),r}if(a==="cidrv6"){let s=ce(t,fC);return e.write(`if (!${s}(${r})) return INVALID;`),r}if(a==="credit_card"){let s=ce(t,hC);return e.write(`if (!${s}(${r})) return INVALID;`),r}let o=n;if(a==="url"||a==="httpurl"||o.normalize||o.hostname!==void 0||o.protocol!==void 0){let s=ce(t,lC),u=ce(t,n),d=ge(t),l=ge(t);if(e.write(`const ${d} = ${r}.trim();`),e.write(`const ${l} = ${s}(${d}, ${u});`),e.write(`if (typeof ${l} === "number") return INVALID;`),o.hostname!==void 0){let m=ce(t,gC);e.write(`if (!${m}(${l}, ${u}.hostname)) return INVALID;`)}if(o.protocol!==void 0){let m=ce(t,mC);e.write(`if (!${m}(${l}, ${u}.protocol)) return INVALID;`)}let p=ge(t),g=o.normalize?`${l}.href`:`${ce(t,pC)}(${d})`;return e.write(`const ${p} = ${g};`),p}let i=n.fn;if(i){if(Gu(i))throw new Je(`async string format ${a}`);let s=ce(t,i);return e.write(`if (!${s}(${r})) return INVALID;`),r}if(zce.has(a)&&n.pattern){let s=ce(t,n.pattern);return e.write(`${s}.lastIndex = 0;`),e.write(`if (!${s}.test(${r})) return INVALID;`),r}let A=n.format;switch(A){case"regex":throw new Je("regex format without a pattern");case"lowercase":e.write(`if (${r} !== ${r}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${r} !== ${r}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${r}.includes(${jr(n.includes)})) return INVALID;`);break;case"starts_with":{let s=n.prefix;e.write(`if (${r}.slice(0, ${s.length}) !== ${jr(s)}) return INVALID;`);break}case"ends_with":{let s=n.suffix;e.write(`if (${r}.slice(-${s.length}) !== ${jr(s)}) return INVALID;`);break}default:throw new Je(`string format ${A}`)}return r}function nn(e,t,n,r,a=!0){let o=n._zod.def,i=o.type;if(o.coerce)throw new Je(`coercion (z.coerce.${i}())`);let A=a||!!o.checks?.length,s;switch(i){case"string":s=Kce(e,t,n,r);break;case"number":s=Yce(e,n,r);break;case"boolean":s=Jce(e,r);break;case"bigint":s=Wce(e,n,r);break;case"symbol":s=Zce(e,r);break;case"undefined":s=Vce(e,r);break;case"null":s=Xce(e,r);break;case"any":case"unknown":s=r;break;case"never":e.write("return INVALID;"),s=r;break;case"void":s=eue(e,r);break;case"nan":s=tue(e,r);break;case"date":s=nue(e,r);break;case"object":s=aue(e,t,n,r,A);break;case"optional":s=rue(e,t,n,r,A);break;case"nullable":s=Aue(e,t,n,r,A);break;case"array":s=sue(e,t,n,r,A);break;case"literal":s=cue(e,t,n,r);break;case"enum":s=uue(e,t,n,r);break;case"readonly":{let u=jP(e,t,n,r),d=ge(t);e.write(`const ${d} = Object.freeze(${u});`),s=d;break}case"success":jP(e,t,n,r),s="true";break;case"default":case"prefault":s=due(e,t,n,r);break;case"nonoptional":s=lue(e,t,n,r);break;case"tuple":s=pue(e,t,n,r);break;case"union":s=gue(e,t,n,r);break;case"intersection":s=bue(e,t,n,r);break;case"record":s=hue(e,t,n,r);break;case"map":s=yue(e,t,n,r);break;case"set":s=Cue(e,t,n,r);break;case"file":s=wue(e,r);break;case"template_literal":s=Eue(e,t,n,r);break;case"lazy":s=kue(e,t,n,r);break;case"pipe":s=Que(e,t,n,r);break;case"custom":s=Iue(e,t,n,r);break;case"transform":s=xue(e,t,n,r);break;case"catch":s=_ue(e,t,n,r);break;default:throw new Je(`schema type ${i}`)}return s===null?null:Mce(e,t,n,s)}function Kce(e,t,n,r){e.write(`if (typeof ${r} !== "string") return INVALID;`);let a=n._zod.def;return a.format===void 0?r:GP(e,t,a,r)}function Yce(e,t,n){e.write(`if (typeof ${n} !== "number" || !Number.isFinite(${n})) return INVALID;`);let r=t._zod.def;return r.check==="number_format"&&r.format&&HP(e,{format:r.format},n),n}function Jce(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function Wce(e,t,n){e.write(`if (typeof ${n} !== "bigint") return INVALID;`);let r=t._zod.def;if(r.format)switch(r.format){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break}return n}function Zce(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function Vce(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function Xce(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function eue(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function tue(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function nue(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function aue(e,t,n,r,a=!0){let o=n._zod.def;e.write(`if (typeof ${r} !== "object" || ${r} === null || Array.isArray(${r})) return INVALID;`);let i=o.shape,A=Object.keys(i),s=Object.getOwnPropertySymbols(i),u=s.length?[...A,...s]:A,d=f=>typeof f=="symbol"?ce(t,f):jr(f),l=f=>typeof f=="symbol"?`[${d(f)}]`:jr(f),p=i;if(A.includes("__proto__"))throw new Je('object shape key "__proto__"');let g=new Map;for(let f of u){let y=p[f],E=d(f),I=ge(t);if(e.write(`const ${I} = ${r}[${E}];`),y._zod.optin!==void 0){let Q=ge(t);e.write(`let ${Q} = (() => {`),e.indented(_=>{let $=gr(_,t,y,I);_.write(`return ${$};`)}),e.write("})();"),y._zod.optout==="optional"?(e.write(`if (${Q} === INVALID) {`),e.indented(_=>{_.write(`if (${E} in ${r}) return INVALID;`),_.write(`${Q} = undefined;`)}),e.write("}")):e.write(`if (${Q} === INVALID) return INVALID;`),g.set(f,Q)}else{iue(y)&&e.write(`if (!(${E} in ${r})) return INVALID;`);let Q=gr(e,t,y,I,a);Q!==null&&g.set(f,Q)}}let m=o.catchall,b="none";if(m){let f=m._zod.def.type;if(f==="never"){let y=A.map(E=>`k !== ${jr(E)}`).join(" && ")||"true";e.write(`for (const k in ${r}) {`),e.indented(E=>{E.write(`if (${y}) return INVALID;`)}),e.write("}")}else(f==="unknown"||f==="any")&&!m._zod.def.checks?.length?b="passthrough":b="schema"}let B=ge(t),h=u.some(f=>Hu(p[f])||KD(p[f]));if(!a){if(b==="schema"){let f=A.length>0?ce(t,new Set(A)):null;e.write(`for (const k in ${r}) {`),e.indented(y=>{y.write('if (k === "__proto__") continue;'),f&&y.write(`if (${f}.has(k)) continue;`);let E=ge(t);y.write(`const ${E} = ${r}[k];`),gr(y,t,m,E,!1)}),e.write("}")}return null}if(h){e.write(`const ${B} = {};`);for(let f of u){let y=d(f),E=g.get(f);KD(p[f])?e.write(`if (${y} in ${r}) ${B}[${y}] = ${E};`):Hu(p[f])?e.write(`if (${E} !== undefined || ${y} in ${r}) ${B}[${y}] = ${E};`):e.write(`${B}[${y}] = ${E};`)}}else{let f=u.map(y=>`${l(y)}: ${g.get(y)}`).join(", ");e.write(`const ${B} = { ${f} };`)}if(b!=="none"){let f=A.length>0?ce(t,new Set(A)):null;e.write(`for (const k in ${r}) {`),e.indented(y=>{if(y.write('if (k === "__proto__") continue;'),f&&y.write(`if (${f}.has(k)) continue;`),b==="passthrough")y.write(`${B}[k] = ${r}[k];`);else{let E=ge(t);y.write(`const ${E} = ${r}[k];`);let I=gr(y,t,m,E);y.write(`${B}[k] = ${I};`)}}),e.write("}")}return B}function rue(e,t,n,r,a=!0){let o=n._zod.def;if(oue(n))return nn(e,t,o.innerType,r,a);if(o.innerType._zod.optin==="defaulted"){let A=ge(t),s=ge(t);return e.write(`let ${A};`),e.write(`if (${r} === undefined) {`),e.indented(u=>{u.write(`const ${s} = (() => {`),u.indented(d=>{let l=nn(d,t,o.innerType,r);d.write(`return ${l};`)}),u.write("})();"),u.write(`if (${s} !== INVALID) ${A} = ${s};`)}),e.write("} else {"),e.indented(u=>{let d=nn(u,t,o.innerType,r);u.write(`${A} = ${d};`)}),e.write("}"),A}let i=a?ge(t):null;return i&&e.write(`let ${i};`),e.write(`if (${r} !== undefined) {`),e.indented(A=>{let s=nn(A,t,o.innerType,r,a);i&&s!==null&&A.write(`${i} = ${s};`)}),e.write("}"),i}function oue(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function iue(e){return e._zod.optin===void 0&&Tu(e)}function Tu(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?Tu(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?Tu(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(Tu):!0;case"intersection":return!t.left||!t.right?!0:Tu(t.left)&&Tu(t.right);case"pipe":return t.in?Tu(t.in):!0;default:return!0}}function KD(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function Hu(e){let t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?Hu(t.innerType):!0;case"union":return t.options?t.options.some(Hu):!0;case"intersection":return!t.left||!t.right||Hu(t.left)||Hu(t.right);case"pipe":return t.out?Hu(t.out):!0;default:return!0}}function Aue(e,t,n,r,a=!0){let o=n._zod.def,i=a?ge(t):null;return i&&e.write(`let ${i} = null;`),e.write(`if (${r} !== null) {`),e.indented(A=>{let s=nn(A,t,o.innerType,r,a);i&&s!==null&&A.write(`${i} = ${s};`)}),e.write("}"),i}function sue(e,t,n,r,a=!0){let o=n._zod.def;e.write(`if (!Array.isArray(${r})) return INVALID;`);let i=a?ge(t):null,A=ge(t),s=ge(t);return i&&e.write(`const ${i} = new Array(${r}.length);`),e.write(`for (let ${A} = 0; ${A} < ${r}.length; ${A}++) {`),e.indented(u=>{u.write(`const ${s} = ${r}[${A}];`);let d=gr(u,t,o.element,s,a);i&&d!==null&&u.write(`${i}[${A}] = ${d};`)}),e.write("}"),i}function cue(e,t,n,r){let o=n._zod.def.values;if(o.length!==1){let A=ce(t,new Set(o));return e.write(`if (!${A}.has(${r})) return INVALID;`),r}let i=o[0];if(typeof i=="number"&&Number.isNaN(i)){let A=ce(t,new Set(o));return e.write(`if (!${A}.has(${r})) return INVALID;`),r}if(typeof i=="string")e.write(`if (${r} !== ${jr(i)}) return INVALID;`);else if(typeof i=="number"||typeof i=="boolean")e.write(`if (${r} !== ${i}) return INVALID;`);else if(i===null)e.write(`if (${r} !== null) return INVALID;`);else if(i===void 0)e.write(`if (${r} !== undefined) return INVALID;`);else if(typeof i=="bigint")e.write(`if (${r} !== ${i}n) return INVALID;`);else throw new Je(`literal type ${typeof i}`);return r}function uue(e,t,n,r){let a=n._zod.values;if(!a)throw new Je("enum schema without enumerated values");let o=ce(t,a);return e.write(`if (!${o}.has(${r})) return INVALID;`),r}function jP(e,t,n,r){let a=n._zod.def;return nn(e,t,a.innerType,r)}function due(e,t,n,r){let a=n._zod.def,i=Object.getOwnPropertyDescriptor(n._zod.def,"defaultValue")?()=>n._zod.def.defaultValue:void 0;if(n._zod.def.type==="prefault"){if(!i)return nn(e,t,a.innerType,r);let s=ce(t,i),u=ge(t);return e.write(`let ${u} = ${r};`),e.write(`if (${r} === undefined) ${u} = ${s}();`),nn(e,t,a.innerType,u)}let A=ge(t);if(i){let s=ce(t,i),u=ce(t,Vm);e.write(`let ${A};`),e.write(`if (${r} === undefined) {`),e.indented(d=>{d.write(`${A} = ${u}(${s}());`)}),e.write("} else {"),e.indented(d=>{let l=nn(d,t,a.innerType,r);d.write(`${A} = ${l} === undefined ? ${u}(${s}()) : ${l};`)}),e.write("}")}else e.write(`let ${A};`),e.write(`if (${r} !== undefined) {`),e.indented(s=>{let u=nn(s,t,a.innerType,r);s.write(`${A} = ${u};`)}),e.write("}");return A}function lue(e,t,n,r){let a=n._zod.def,o=nn(e,t,a.innerType,r),i=ge(t);return e.write(`const ${i} = ${o};`),e.write(`if (${i} === undefined) return INVALID;`),i}function pue(e,t,n,r){let a=n._zod.def,o=a.items,i=a.rest;e.write(`if (!Array.isArray(${r})) return INVALID;`);let A=PP(o,"optin"),s=PP(o,"optout");i?e.write(`if (${r}.length < ${A}) return INVALID;`):e.write(`if (${r}.length < ${A} || ${r}.length > ${o.length}) return INVALID;`);let u=ge(t);e.write(`const ${u} = [];`);for(let d=0;d<o.length;d++){let l=o[d];if(d>=s)e.write(`if (${u}.length === ${d}) {`),e.indented(p=>{p.write(`if (${d} < ${r}.length) {`),p.indented(g=>{let m=ge(t);g.write(`const ${m} = ${r}[${d}];`);let b=gr(g,t,l,m);g.write(`${u}[${d}] = ${b};`)}),p.write("} else {"),p.indented(g=>{if(KD(l)){g.write(`${u}.length = ${d};`);return}let m=ge(t),b=ge(t);g.write(`const ${m} = undefined;`),g.write(`const ${b} = (() => {`),g.indented(B=>{let h=gr(B,t,l,m);B.write(`return ${h};`)}),g.write("})();"),g.write(`if (${b} === INVALID || ${b} === undefined) ${u}.length = ${d};`),g.write(`else ${u}[${d}] = ${b};`)}),p.write("}")}),e.write("}");else{let p=ge(t);e.write(`const ${p} = ${r}[${d}];`);let g=gr(e,t,l,p);e.write(`${u}[${d}] = ${g};`)}}if(i){let d=ge(t),l=ge(t);e.write(`for (let ${d} = ${o.length}; ${d} < ${r}.length; ${d}++) {`),e.indented(p=>{p.write(`const ${l} = ${r}[${d}];`);let g=gr(p,t,i,l);p.write(`${u}[${d}] = ${g};`)}),e.write("}")}return u}function PP(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function gue(e,t,n,r){let a=n._zod.def,o=a.options;if(a.discriminator)return mue(e,t,a,r);if(a.inclusive===!1)throw new Je("exclusive unions (z.xor)");if(o.length===0)return e.write("return INVALID;"),r;if(o.length===1)return nn(e,t,o[0],r);if(o.every(s=>s._zod.def.type==="literal"&&!s._zod.def.checks?.length)){let s=new Set(o.flatMap(d=>d._zod.def.values)),u=ce(t,s);return e.write(`if (!${u}.has(${r})) return INVALID;`),r}let A=ge(t);e.write(`let ${A};`);for(let s=0;s<o.length;s++){let u=o[s];s===0?e.write(`${A} = (() => {`):e.write(`if (${A} === INVALID) ${A} = (() => {`),e.indented(d=>{let l=nn(d,t,u,r);d.write(`return ${l};`)}),e.write("})();")}return e.write(`if (${A} === INVALID) return INVALID;`),A}function mue(e,t,n,r){if(n.unionFallback)throw new Je("discriminated union with unionFallback");if(n.options.length===0)return e.write("return INVALID;"),r;let a=ge(t),o=ge(t);e.write(`const ${a} = ${r}?.[${jr(n.discriminator)}];`),e.write(`let ${o};`);let i=!0,A=new Set;for(let s of n.options){let u=s._zod.propValues?.[n.discriminator];if(!u||u.size===0)throw new Je("discriminated union option without static discriminator values");for(let p of u){if(A.has(p))throw new Je(`duplicate discriminator value ${String(p)}`);A.add(p)}let d=Array.from(u,p=>fue(t,a,p)),l=i?"if":"else if";e.write(`${l} (${d.join(" || ")}) {`),e.indented(p=>{let g=nn(p,t,s,r);p.write(`${o} = ${g};`)}),e.write("}"),i=!1}return e.write("else { return INVALID; }"),o}function fue(e,t,n){if(typeof n=="string")return`${t} === ${jr(n)}`;if(typeof n=="number")return Number.isNaN(n)?`Number.isNaN(${t})`:`${t} === ${n}`;if(typeof n=="boolean")return`${t} === ${n}`;if(n===null)return`${t} === null`;if(n===void 0)return`${t} === undefined`;if(typeof n=="bigint")return`${t} === ${n}n`;if(typeof n=="symbol"){let r=ce(e,n);return`${t} === ${r}`}throw new Je(`literal discriminator value ${String(n)}`)}function bue(e,t,n,r){let a=n._zod.def,o=gr(e,t,a.left,r),i=gr(e,t,a.right,r),A=ce(t,ap),s=ge(t);return e.write(`const ${s} = ${A}(${o}, ${i});`),e.write(`if (!${s}.valid) return INVALID;`),`${s}.data`}function hue(e,t,n,r){let a=n._zod.def,o=ce(t,To);e.write(`if (!${o}(${r})) return INVALID;`);let i=ge(t),A=ge(t),s=ge(t);e.write(`const ${i} = {};`);let u=a,d=u.partial?void 0:a.keyType._zod.values;if(d){let m=[];for(let B of d){if(!(typeof B=="string"||typeof B=="number"||typeof B=="symbol"))throw new Je(`record key value ${String(B)}`);let h=typeof B=="number"?B.toString():B;if(h==="__proto__")throw new Je('record key "__proto__"');m.push(h);let f=ce(t,B),y=nn(e,t,a.keyType,f),E=ge(t);e.write(`const ${E} = ${r}[${Bue(t,h)}];`);let I=gr(e,t,a.valueType,E);e.write(`${i}[${y}] = ${I};`)}let b=ce(t,new Set(m));return e.write(`for (const ${A} in ${r}) {`),e.indented(B=>{B.write(`if (${b}.has(${A})) continue;`),u.mode==="loose"?B.write(`if (${A} !== "__proto__") ${i}[${A}] = ${r}[${A}];`):B.write("return INVALID;")}),e.write("}"),i}let l=a.keyType._zod.def;if(!(l.type==="string"&&l.format===void 0&&!l.coerce&&(l.checks?.length??0)===0)){let m=a.mode==="loose",b=ce(t,NC(a.keyType)),B=ce(t,Cc),h=ce(t,Object.prototype.propertyIsEnumerable),f=ge(t);return e.write(`for (const ${A} of Reflect.ownKeys(${r})) {`),e.indented(y=>{y.write(`if (${A} === "__proto__") continue;`),y.write(`if (!${h}.call(${r}, ${A})) continue;`),y.write(`let ${f} = ${b}(${A});`),y.write(`if (${f} === INVALID && typeof ${A} === "string" && ${B}.test(${A})) ${f} = ${b}(Number(${A}));`),m?y.write(`if (${f} === INVALID) { ${i}[${A}] = ${r}[${A}]; continue; }`):y.write(`if (${f} === INVALID) return INVALID;`),y.write(`if (${f} === "__proto__") continue;`);let E=ge(t);y.write(`const ${E} = ${r}[${A}];`);let I=gr(y,t,a.valueType,E);y.write(`${i}[${f}] = ${I};`)}),e.write("}"),i}let g=ce(t,Object.prototype.propertyIsEnumerable);return e.write(`for (const ${A} of Reflect.ownKeys(${r})) {`),e.indented(m=>{m.write(`if (${A} === "__proto__") continue;`),m.write(`if (!${g}.call(${r}, ${A})) continue;`),m.write(`if (typeof ${A} !== "string") return INVALID;`),m.write(`const ${s} = ${r}[${A}];`);let b=gr(m,t,a.valueType,s);m.write(`${i}[${A}] = ${b};`)}),e.write("}"),i}function Bue(e,t){return typeof t=="string"?jr(t):ce(e,t)}function yue(e,t,n,r){let a=n._zod.def;e.write(`if (!(${r} instanceof Map)) return INVALID;`);let o=ge(t),i=ge(t),A=ge(t);return e.write(`const ${o} = new Map();`),e.write(`for (const [${i}, ${A}] of ${r}) {`),e.indented(s=>{let u=nn(s,t,a.keyType,i),d=nn(s,t,a.valueType,A);s.write(`${o}.set(${u}, ${d});`)}),e.write("}"),o}function Cue(e,t,n,r){let a=n._zod.def;e.write(`if (!(${r} instanceof Set)) return INVALID;`);let o=ge(t),i=ge(t);return e.write(`const ${o} = new Set();`),e.write(`for (const ${i} of ${r}) {`),e.indented(A=>{let s=nn(A,t,a.valueType,i);A.write(`${o}.add(${s});`)}),e.write("}"),o}function wue(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function Eue(e,t,n,r){e.write(`if (typeof ${r} !== "string") return INVALID;`);let a=n._zod.pattern;if(a){let o=ce(t,a);e.write(`${o}.lastIndex = 0;`),e.write(`if (!${o}.test(${r})) return INVALID;`)}return r}function kue(e,t,n,r){let a=n._zod.def,o=ce(t,a.getter),i=ce(t,{parser:null});e.write(`if (!${i}.parser) {`),e.indented(s=>{s.write(`const inner = ${o}();`),s.write(`${i}.parser = function(input) {`),s.indented(u=>{u.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),u.write("return result.issues.length === 0 ? result.value : INVALID;")}),s.write("};")}),e.write("}");let A=ge(t);return e.write(`const ${A} = ${i}.parser(${r});`),e.write(`if (${A} === INVALID) return INVALID;`),A}function Que(e,t,n,r){let a=n._zod.def,o=nn(e,t,a.in,r);if(a.transform){if(Gu(a.transform))throw new yi("z.compile: async transforms in pipes are not supported");let i=a.transform,s=ce(t,d=>{let l={value:d,issues:[],addIssue:JD},p=i(d,l);return p instanceof Promise?po:l.issues.length===0?p:po}),u=ge(t);return e.write(`const ${u} = ${s}(${o});`),e.write(`if (${u} === INVALID) return INVALID;`),nn(e,t,a.out,u)}else return nn(e,t,a.out,o)}function Gu(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function Iue(e,t,n,r){let a=n._zod.def;if(a.fn){if(Gu(a.fn))throw new yi("z.compile: async custom predicates are not supported");let o=ce(t,a.fn),i=ce(t,zD),A=ge(t);e.write(`const ${A} = ${o}(${r});`),e.write(`if (${A} instanceof Promise) ${i}();`),e.write(`if (!${A}) return INVALID;`)}else throw new Je("custom schema without a predicate function");return r}function vue(e,t,n){let r=e._zod.run({value:n,issues:[]},{});if(r&&typeof r.then=="function")return po;let a=r;return a.issues.length===0?a.value:t()}function _ue(e,t,n,r){let a=n._zod.def;if(!a.catchValue[Uy])throw new Je("catch with a callback (only a constant catch value compiles)",!1);let o=ge(t);e.write(`let ${o} = (() => {`),e.indented(u=>{let d=gr(u,t,a.innerType,r);u.write(`return ${d};`)}),e.write("})();");let i=ce(t,a.innerType),A=ce(t,a.catchValue),s=ce(t,vue);return e.write(`if (${o} === INVALID) {`),e.indented(u=>{u.write(`${o} = ${s}(${i}, ${A}, ${r});`),u.write(`if (${o} === INVALID) return INVALID;`)}),e.write("}"),o}function xue(e,t,n,r){let a=n._zod.def;if(a.transform){if(Gu(a.transform))throw new yi("z.compile: async transforms are not supported");let o=a.transform,A=ce(t,u=>{let d={value:u,issues:[],addIssue:JD},l=o(u,d);return l instanceof Promise?po:d.issues.length===0?l:po}),s=ge(t);return e.write(`const ${s} = ${A}(${r});`),e.write(`if (${s} === INVALID) return INVALID;`),s}return r}function WD(e,t){return new e({type:"string",...K(t)})}function ZD(e,t){return new e({type:"string",coerce:!0,...K(t)})}function RC(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...K(t)})}function $C(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...K(t)})}function MC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...K(t)})}function jC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...K(t)})}function PC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...K(t)})}function TC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...K(t)})}function hf(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...K(t)})}function HC(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...K(t)})}function GC(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...K(t)})}function UC(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...K(t)})}function OC(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...K(t)})}function qC(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...K(t)})}function zC(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...K(t)})}function KC(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...K(t)})}function YC(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...K(t)})}function JC(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...K(t)})}function VD(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...K(t)})}function WC(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...K(t)})}function ZC(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...K(t)})}function VC(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...K(t)})}function XC(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...K(t)})}function ew(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...K(t)})}function XD(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...K(t)})}function tw(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...K(t)})}var e1={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Bf(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...K(t)})}function yf(e,t){return new e({type:"string",format:"date",check:"string_format",...K(t)})}function Cf(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...K(t)})}function wf(e,t){return new e({type:"string",format:"duration",check:"string_format",...K(t)})}function t1(e,t){return new e({type:"number",checks:[],...K(t)})}function n1(e,t){return new e({type:"number",coerce:!0,checks:[],...K(t)})}function a1(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...K(t)})}function r1(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...K(t)})}function o1(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...K(t)})}function i1(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...K(t)})}function A1(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...K(t)})}function s1(e,t){return new e({type:"boolean",...K(t)})}function c1(e,t){return new e({type:"boolean",coerce:!0,...K(t)})}function u1(e,t){return new e({type:"bigint",...K(t)})}function d1(e,t){return new e({type:"bigint",coerce:!0,...K(t)})}function l1(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...K(t)})}function p1(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...K(t)})}function g1(e,t){return new e({type:"symbol",...K(t)})}function m1(e,t){return new e({type:"undefined",...K(t)})}function f1(e,t){return new e({type:"null",...K(t)})}function b1(e){return new e({type:"any"})}function h1(e){return new e({type:"unknown"})}function B1(e,t){return new e({type:"never",...K(t)})}function y1(e,t){return new e({type:"void",...K(t)})}function C1(e,t){return new e({type:"date",...K(t)})}function w1(e,t){return new e({type:"date",coerce:!0,...K(t)})}function E1(e,t){return new e({type:"nan",...K(t)})}function lA(e,t){return new rC({check:"less_than",...K(t),value:e,inclusive:!1})}function go(e,t){return new rC({check:"less_than",...K(t),value:e,inclusive:!0})}function pA(e,t){return new oC({check:"greater_than",...K(t),value:e,inclusive:!1})}function mo(e,t){return new oC({check:"greater_than",...K(t),value:e,inclusive:!0})}function nw(e){return pA(0,e)}function aw(e){return lA(0,e)}function rw(e){return go(0,e)}function ow(e){return mo(0,e)}function wc(e,t){return new cx({check:"multiple_of",...K(t),value:e})}function Ec(e,t){return new lx({check:"max_size",...K(t),maximum:e})}function gA(e,t){return new px({check:"min_size",...K(t),minimum:e})}function Uu(e,t){return new gx({check:"size_equals",...K(t),size:e})}function Ou(e,t){return new mx({check:"max_length",...K(t),maximum:e})}function fs(e,t){return new fx({check:"min_length",...K(t),minimum:e})}function qu(e,t){return new bx({check:"length_equals",...K(t),length:e})}function op(e,t){return new hx({check:"string_format",format:"regex",...K(t),pattern:e})}function ip(e){return new Bx({check:"string_format",format:"lowercase",...K(e)})}function Ap(e){return new yx({check:"string_format",format:"uppercase",...K(e)})}function sp(e,t){return new Cx({check:"string_format",format:"includes",...K(t),includes:e})}function cp(e,t){return new wx({check:"string_format",format:"starts_with",...K(t),prefix:e})}function up(e,t){return new Ex({check:"string_format",format:"ends_with",...K(t),suffix:e})}function iw(e,t,n){return new iC({check:"property",property:e,schema:t,...K(n)})}function Aw(e){return Object.entries(e).map(([t,n])=>new iC({check:"property",property:t,schema:n}))}function dp(e,t){return new kx({check:"mime_type",mime:e,...K(t)})}function Ci(e){return new Qx({check:"overwrite",tx:e})}function lp(e){return Ci(t=>t.normalize(e))}function pp(){return Ci(e=>e.trim())}function gp(){return Ci(e=>e.toLowerCase())}function mp(){return Ci(e=>e.toUpperCase())}function fp(){return Ci(e=>c_(e))}function k1(e,t,n){return new e({type:"array",element:t,...K(n)})}function Due(e,t,n){return new e({type:"union",options:t,...K(n)})}function Fue(e,t,n){return new e({type:"union",options:t,inclusive:!1,...K(n)})}function Sue(e,t,n,r){return new e({type:"union",options:n,discriminator:t,...K(r)})}function Lue(e,t,n){return new e({type:"intersection",left:t,right:n})}function Nue(e,t,n,r){let a=n instanceof Ee,o=a?r:n,i=a?n:null;return new e({type:"tuple",items:t,rest:i,...K(o)})}function Rue(e,t,n,r){return new e({type:"record",keyType:t,valueType:n,...K(r)})}function $ue(e,t,n,r){return new e({type:"map",keyType:t,valueType:n,...K(r)})}function Mue(e,t,n){return new e({type:"set",valueType:t,...K(n)})}function jue(e,t,n){let r=Array.isArray(t)?Object.fromEntries(t.map(a=>[a,a])):t;return new e({type:"enum",entries:r,...K(n)})}function Pue(e,t,n){return new e({type:"enum",entries:t,...K(n)})}function Tue(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...K(n)})}function Q1(e,t){return new e({type:"file",...K(t)})}function Hue(e,t){return new e({type:"transform",transform:t})}function Gue(e,t){return new e({type:"optional",innerType:t})}function Uue(e,t){return new e({type:"nullable",innerType:t})}function Oue(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():Vm(n)}})}function que(e,t,n){return new e({type:"nonoptional",innerType:t,...K(n)})}function zue(e,t){return new e({type:"success",innerType:t})}function Kue(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:h_(n)})}function Yue(e,t,n){return new e({type:"pipe",in:t,out:n})}function Jue(e,t){return new e({type:"readonly",innerType:t})}function Wue(e,t,n){return new e({type:"template_literal",parts:t,...K(n)})}function Zue(e,t){return new e({type:"lazy",getter:t})}function Vue(e,t){return new e({type:"promise",innerType:t})}function I1(e,t,n){let r=K(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function v1(e,t,n){return new e({type:"custom",check:"custom",fn:t,...K(n)})}function _1(e,t){let n=UP(r=>(r.addIssue=a=>{if(typeof a=="string")r.issues.push(Zl(a,r.value,n._zod.def));else{let o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=r.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),r.issues.push(Zl(o))}},e(r.value,r)),t);return n}function UP(e,t){let n=new Nt({check:"custom",...K(t)});return n._zod.check=e,n}function x1(e){let t=new Nt({check:"describe"});return t._zod.onattach=[n=>{let r=La.get(n)??{};La.add(n,{...r,description:e})}],t._zod.check=()=>{},t}function D1(e){let t=new Nt({check:"meta"});return t._zod.onattach=[n=>{let r=La.get(n)??{};La.add(n,{...r,...e})}],t._zod.check=()=>{},t}function F1(e,t){let n=K(t),r=n.truthy??["true","1","yes","on","y","enabled"],a=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(r=r.map(g=>typeof g=="string"?g.toLowerCase():g),a=a.map(g=>typeof g=="string"?g.toLowerCase():g));let o=new Set(r),i=new Set(a),A=e.Codec??pf,s=e.Boolean??df,u=e.String??ju,d=new u({type:"string",error:n.error}),l=new s({type:"boolean",error:n.error}),p=new A({type:"pipe",in:d,out:l,transform:((g,m)=>{let b=g;return n.case!=="sensitive"&&(b=b.toLowerCase()),o.has(b)?!0:i.has(b)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...i],input:m.value,inst:p,continue:!1}),{})}),reverseTransform:((g,m)=>g===!0?r[0]||"true":a[0]||"false"),error:n.error});return p._zod.bag.truthy=r,p._zod.bag.falsy=a,p._zod.bag.case=n.case??"insensitive",p}function bp(e,t,n,r={}){let a=K(r),o={check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:A=>n.test(A),...a};return n instanceof RegExp&&(o.pattern=n),new e(o)}function Ef(e,...t){for(let n of t)for(let r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&sn(e,r,n[r]);return e}function kc(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??La,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function ta(e,t,n,r,a){let o=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:a}):t.unrepresentable;if(o==="any")return!1;if(o===void 0||o==="throw")throw new Error(a);return Object.assign(n,o),!0}function ht(e,t,n={path:[],schemaPath:[]}){var r;let a=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let A=e._zod.toJSONSchema?.();if(A)i.schema=A;else{let d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,d);else{let p=i.schema,g=t.processors[a.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);g(e,t,p,d)}let l=e._zod.parent;l&&(i.ref||(i.ref=l),ht(l,t,d),t.seen.get(l).isParent=!0)}let s=t.metadataRegistry.get(e);return s&&Ef(i.schema,s),t.io==="input"&&mr(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function OP(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Qc(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let i of e.seen.entries()){let A=e.metadataRegistry.get(i[0])?.id;if(A){let s=r.get(A);if(s&&s!==i[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,i[0])}}let a=i=>{let A=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let l=e.external.registry.get(i[0])?.id,p=e.external.uri??(m=>m);if(l)return{ref:p(l)};let g=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=g,{defId:g,ref:`${p("__shared")}#/${A}/${OP(g)}`}}let s="#",u=`${s}/${A}/`;if(i[1]===n&&!i[1].schema.id)return{ref:s};let d=i[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+OP(d)}},o=i=>{if(i[1].schema.$ref)return;let A=i[1],{ref:s,defId:u}=a(i);A.def={...A.schema},u&&(A.defId=u);let d=A.schema;for(let l in d)delete d[l];d.$ref=s};if(e.cycles==="throw")for(let i of e.seen.entries()){let A=i[1];if(A.cycle)throw new Error(`Cycle detected: #/${A.cycle?.join("/")}/<root>
66
66
 
67
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let A=i[1];if(t===i[0]){o(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){o(i);continue}}if(e.metadataRegistry.get(i[0])?.id){o(i);continue}if(A.cycle){o(i);continue}if(A.count>1&&e.reused==="ref"){o(i);continue}}e.external&&(e.sharedDefsExtractedFor=e.external)}function KP(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let r of t){if(!r||typeof r!="object")return;KP(r);let a=Object.keys(r);if(a.length!==1||a[0]!=="type")return;let o=r.type;for(let i of Array.isArray(o)?o:[o]){if(typeof i!="string")return;n.includes(i)||n.push(i)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var YP=new Set(["type","properties","required","additionalProperties"]),qP=["oneOf","anyOf"];function zP(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function S1(e){let t=[];for(let o of e){if(typeof o!="object"||o.type!=="object")return null;for(let i in o)if(!YP.has(i))return null;t.push(o)}let n={},r=new Set;for(let o of t){for(let i in o.properties){if(Object.prototype.hasOwnProperty.call(n,i))continue;let A=[];for(let u of t){let d=u.properties?.[i]??zP(u);d!=null&&(A.some(l=>JSON.stringify(l)===JSON.stringify(d))||A.push(d))}let s=A.length===1?A[0]:S1(A)??{allOf:A};sn(n,i,s)}for(let i of o.required??[])r.add(i)}let a={type:"object",properties:n};if(r.size&&(a.required=[...r]),t.every(o=>o.additionalProperties===!1))a.additionalProperties=!1;else{let o=[];for(let i of t){let A=zP(i);A&&!o.some(s=>JSON.stringify(s)===JSON.stringify(A))&&o.push(A)}o.length===1?a.additionalProperties=o[0]:o.length>1&&(a.additionalProperties={allOf:o})}return a}function Xue(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let a of YP)if(a in e)return;let n=t.filter(a=>qP.some(o=>Array.isArray(a[o]))),r=null;if(!n.length)r=S1(t);else{let a=n[0],o=qP.find(s=>Array.isArray(a[s]));if(Object.keys(a).length!==1)return;let i=t.filter(s=>s!==a),A=a[o].map(s=>S1([...i,s]));if(A.some(s=>!s))return;r={[o]:A}}r&&(delete e.allOf,Ef(e,r))}function Ic(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=A=>{let s=e.seen.get(A);if(s.ref===null)return;let u=s.def??s.schema,d={...u},l=s.ref;if(s.ref=null,l){r(l);let g=e.seen.get(l),m=g.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):Ef(u,m),Ef(u,d),A._zod.parent===l)for(let B in u)B==="$ref"||B==="allOf"||B in d||delete u[B];if(m.$ref&&g.def)for(let B in u)B==="$ref"||B==="allOf"||B in g.def&&JSON.stringify(u[B])===JSON.stringify(g.def[B])&&delete u[B]}let p=A._zod.parent;if(p&&p!==l){r(p);let g=e.seen.get(p);if(g?.schema.$ref&&(u.$ref=g.schema.$ref,g.def))for(let m in u)m==="$ref"||m==="allOf"||m in g.def&&JSON.stringify(u[m])===JSON.stringify(g.def[m])&&delete u[m]}e.override({zodSchema:A,jsonSchema:u,path:s.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let A of[...e.seen.entries()].reverse())r(A[0]);if(e.target!=="openapi-3.0")for(let A of e.seen.entries())KP(A[1].def??A[1].schema);for(let A of e.deferred)A();if(e.intersections.length){let A=new Map;for(let s of e.seen.values())for(let u of[s.schema,s.def]){let d=u?.allOf;if(!Array.isArray(d))continue;let l=A.get(d);l?l.push(u):A.set(d,[u])}for(let s of e.intersections)for(let u of A.get(s)??[])Xue(u)}}let a={};if(e.target==="draft-2020-12"?a.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?a.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?a.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let A=e.external.registry.get(t)?.id;if(!A)throw new Error("Schema is missing an `id` property");a.$id=e.external.uri(A)}Ef(a,n.defId?n.schema:n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;o!==void 0&&a.id===o&&delete a.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let A of e.seen.entries()){let s=A[1];s.def&&s.defId&&(s.def.id===s.defId&&delete s.def.id,sn(i,s.defId,s.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?a.$defs=i:a.definitions=i);try{let A=JSON.parse(JSON.stringify(a));return Object.defineProperty(A,"~standard",{value:{...t["~standard"],jsonSchema:{input:hp(t,"input",e.processors),output:hp(t,"output",e.processors)}},enumerable:!1,writable:!1}),A}catch{throw new Error("Error converting schema to JSON.")}}function mr(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return mr(r.element,n);if(r.type==="set")return mr(r.valueType,n);if(r.type==="lazy")return mr(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return mr(r.innerType,n);if(r.type==="intersection")return mr(r.left,n)||mr(r.right,n);if(r.type==="record"||r.type==="map")return mr(r.keyType,n)||mr(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:mr(r.in,n)||mr(r.out,n);if(r.type==="object"){for(let a in r.shape)if(mr(r.shape[a],n))return!0;return!1}if(r.type==="union"){for(let a of r.options)if(mr(a,n))return!0;return!1}if(r.type==="tuple"){for(let a of r.items)if(mr(a,n))return!0;return!!(r.rest&&mr(r.rest,n))}return!1}var L1=(e,t={})=>n=>{let r=kc({...n,processors:t});return ht(e,r),Qc(r,e),Ic(r,e)},hp=(e,t,n={})=>r=>{let{libraryOptions:a,target:o}=r??{},i=kc({...a??{},target:o,io:t,processors:n});return ht(e,i),Qc(i,e),Ic(i,e)};var ede={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},$1=(e,t,n,r)=>{let a=n;a.type="string";let{minimum:o,maximum:i,format:A,patterns:s,contentEncoding:u,laxFormat:d}=e._zod.bag;if(typeof o=="number"&&(a.minLength=o),typeof i=="number"&&(a.maxLength=i),A&&(a.format=ede[A]??A,a.format===""&&delete a.format,(A==="time"||d)&&delete a.format),u&&(a.contentEncoding=u),s&&s.size>0){let l=[...s];l.length===1?a.pattern=l[0].source:l.length>1&&(a.allOf=[...l.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},M1=(e,t,n,r)=>{let a=n,{minimum:o,maximum:i,format:A,multipleOf:s,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof A=="string"&&A.includes("int")?a.type="integer":a.type="number";let l=typeof d=="number"&&d>=(o??Number.NEGATIVE_INFINITY),p=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),g=t.target==="draft-04"||t.target==="openapi-3.0";l?g?(a.minimum=d,a.exclusiveMinimum=!0):a.exclusiveMinimum=d:typeof o=="number"&&(a.minimum=o),p?g?(a.maximum=u,a.exclusiveMaximum=!0):a.exclusiveMaximum=u:typeof i=="number"&&(a.maximum=i),typeof s=="number"&&(Number.isFinite(s)&&s!==0?a.multipleOf=Math.abs(s):ta(e,t,a,r,`A multipleOf divisor of ${s} cannot be represented in JSON Schema`))},j1=(e,t,n,r)=>{n.type="boolean"},P1=(e,t,n,r)=>{ta(e,t,n,r,"BigInt cannot be represented in JSON Schema")},T1=(e,t,n,r)=>{ta(e,t,n,r,"Symbols cannot be represented in JSON Schema")},H1=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},G1=(e,t,n,r)=>{ta(e,t,n,r,"Undefined cannot be represented in JSON Schema")},U1=(e,t,n,r)=>{ta(e,t,n,r,"Void cannot be represented in JSON Schema")},O1=(e,t,n,r)=>{n.not={}},q1=(e,t,n,r)=>{},z1=(e,t,n,r)=>{},K1=(e,t,n,r)=>{ta(e,t,n,r,"Date cannot be represented in JSON Schema")},Y1=(e,t,n,r)=>{let a=e._zod.def,o=Jm(a.entries);if(o.length===0){n.not={};return}o.every(i=>typeof i=="number")&&(n.type="number"),o.every(i=>typeof i=="string")&&(n.type="string"),n.enum=o},J1=(e,t,n,r)=>{let a=e._zod.def;if(a.values.length===0){n.not={};return}let o=[];for(let i of a.values)if(i===void 0){if(ta(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i=="bigint"){if(ta(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(i))}else o.push(i);if(o.length!==0)if(o.length===1){let i=o[0];n.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[i]:n.const=i}else o.every(i=>typeof i=="number")&&(n.type="number"),o.every(i=>typeof i=="string")&&(n.type="string"),o.every(i=>typeof i=="boolean")&&(n.type="boolean"),o.every(i=>i===null)&&(n.type="null"),n.enum=o},W1=(e,t,n,r)=>{ta(e,t,n,r,"NaN cannot be represented in JSON Schema")},Z1=(e,t,n,r)=>{let a=n,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");a.type="string",a.pattern=o.source},V1=(e,t,n,r)=>{let a=n,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:A,mime:s}=e._zod.bag;i!==void 0&&(o.minLength=i),A!==void 0&&(o.maxLength=A),s?s.length===1?(o.contentMediaType=s[0],Object.assign(a,o)):(Object.assign(a,o),a.anyOf=s.map(u=>({contentMediaType:u}))):Object.assign(a,o)},X1=(e,t,n,r)=>{n.type="boolean"},eF=(e,t,n,r)=>{ta(e,t,n,r,"Custom types cannot be represented in JSON Schema")},tF=(e,t,n,r)=>{ta(e,t,n,r,"Function types cannot be represented in JSON Schema")},nF=(e,t,n,r)=>{ta(e,t,n,r,"Transforms cannot be represented in JSON Schema")},aF=(e,t,n,r)=>{ta(e,t,n,r,"Map cannot be represented in JSON Schema")},rF=(e,t,n,r)=>{ta(e,t,n,r,"Set cannot be represented in JSON Schema")},oF=(e,t,n,r)=>{let a=n,o=e._zod.def,{minimum:i,maximum:A}=e._zod.bag;typeof i=="number"&&(a.minItems=i),typeof A=="number"&&(a.maxItems=A),a.type="array",a.items=ht(o.element,t,{...r,path:[...r.path,"items"]})};function kf(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?kf(t.out):t.type==="catch"?kf(t.innerType):e._zod.optin}var iF=(e,t,n,r)=>{let a=n,o=e._zod.def,i=o.shape;if(Object.getOwnPropertySymbols(i).length&&ta(e,t,a,r,"Symbol keys cannot be represented in JSON Schema"))return;a.type="object",a.properties={};for(let d in i)sn(a.properties,d,ht(i[d],t,{...r,path:[...r.path,"properties",d]}));let s=new Set(Object.keys(i)),u=new Set([...s].filter(d=>{let l=o.shape[d];return t.io==="input"?kf(l)===void 0:l._zod.optout===void 0}));u.size>0&&(a.required=Array.from(u)),o.catchall?._zod.def.type==="never"?a.additionalProperties=!1:o.catchall?o.catchall&&(a.additionalProperties=ht(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(a.additionalProperties=!1)},cw=(e,t,n,r)=>{let a=e._zod.def,o=a.inclusive===!1,i=a.options.map((A,s)=>ht(A,t,{...r,path:[...r.path,o?"oneOf":"anyOf",s]}));o?n.oneOf=i:n.anyOf=i},AF=(e,t,n,r)=>{let a=e._zod.def,o=ht(a.left,t,{...r,path:[...r.path,"allOf",0]}),i=ht(a.right,t,{...r,path:[...r.path,"allOf",1]}),A=u=>"allOf"in u&&Object.keys(u).length===1,s=[...A(o)?o.allOf:[o],...A(i)?i.allOf:[i]];n.allOf=s,t.intersections.push(s)},sF=(e,t,n,r)=>{let a=n,o=e._zod.def;a.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",A=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",s=o.items.map((b,B)=>ht(b,t,{...r,path:[...r.path,i,B]})),u=o.rest?ht(o.rest,t,{...r,path:[...r.path,A,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null,d=o.items.length;for(;d>0;){let b=o.items[d-1];if(!(t.io==="input"?kf(b)!==void 0:b._zod.optout==="optional"))break;d--}let l=o.items.length,p=!o.rest;t.target==="draft-2020-12"?(a.prefixItems=s,p?a.items=!1:u&&(a.items=u),d>0&&(a.minItems=d),p&&(a.maxItems=l)):t.target==="openapi-3.0"?(a.items={anyOf:s},u&&a.items.anyOf.push(u),d>0&&(a.minItems=d),p&&(a.maxItems=l)):(a.items=s,p?a.additionalItems=!1:u&&(a.additionalItems=u),d>0&&(a.minItems=d),p&&(a.maxItems=l));let{minimum:g,maximum:m}=e._zod.bag;typeof g=="number"&&(a.minItems=g),typeof m=="number"&&(a.maxItems=m)};function N1(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let m=e.get(t)?.def;if(!m)return t;let b=N1(e,m,n);return b===m?t:b}for(let m of["anyOf","oneOf"]){let b=t[m];if(!Array.isArray(b))continue;let B=b.map(h=>N1(e,h,n));B.some((h,f)=>h!==b[f])&&(t={...t,[m]:B})}let r=Array.isArray(t.type)?t.type:[t.type],a=!r.includes("string")&&r.some(m=>m==="number"||m==="integer"),o=t.enum??(t.const!==void 0?[t.const]:void 0);if(!a&&!o?.some(m=>typeof m=="number"))return t;let{minimum:i,maximum:A,exclusiveMinimum:s,exclusiveMaximum:u,multipleOf:d,format:l,id:p,...g}=t;return g.enum?g.enum=g.enum.map(m=>typeof m=="number"?String(m):m):typeof g.const=="number"&&(g.const=String(g.const)),a&&(g.type="string",o||(g.pattern=(r.includes("number")?Cc:of).source)),g}var R1=new WeakMap;function tde(e){let t=new Map;for(let r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);let n=new Map;for(let r of R1.get(e)??[]){let a=e.seen.get(r),o=(a?.def??a?.schema)?.propertyNames;if(!o||o===!0||n.has(o))continue;let i=N1(t,o,new Set);i!==o&&n.set(o,i)}if(n.size)for(let r of e.seen.values())for(let a of[r.schema,r.def]){let o=a&&n.get(a.propertyNames);o&&(a.propertyNames=o)}}var cF=(e,t,n,r)=>{let a=n,o=e._zod.def;a.type="object";let i=o.keyType,s=i._zod.bag?.patterns;if(o.mode==="loose"&&s&&s.size>0){let l=ht(o.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});a.patternProperties={};for(let p of s)sn(a.patternProperties,p.source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){a.propertyNames=ht(o.keyType,t,{...r,path:[...r.path,"propertyNames"]});let l=R1.get(t);l||(l=[],R1.set(t,l),t.deferred.push(()=>tde(t))),l.push(e)}a.additionalProperties=ht(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let u=i._zod.values,d=t.io==="input"&&kf(o.valueType)!==void 0;if(u&&!o.partial&&!d){let l=[...u].filter(p=>typeof p=="string"||typeof p=="number");l.length>0&&(a.required=l.map(String))}},uF=(e,t,n,r)=>{let a=e._zod.def,o=ht(a.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=a.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},dF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},lF=Symbol();function JP(e,t,n,r,a){let o=!1,i=JSON.stringify(e,(A,s)=>typeof s!="bigint"?s:(o=!0,null));return o?(ta(t,n,r,a,"BigInt defaults cannot be represented in JSON Schema"),lF):JSON.parse(i)}var pF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType;let i=JP(a.defaultValue,e,t,n,r);i!==lF&&(n.default=i)},gF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);if(o.ref=a.innerType,t.io!=="input")return;let i=JP(a.defaultValue,e,t,n,r);i!==lF&&(n._prefault=i)},mF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType;let i;try{i=a.catchValue(void 0)}catch{ta(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=i},fF=(e,t,n,r)=>{let a=e._zod.def,o=a.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?o?a.out:a.in:a.out;ht(i,t,r);let A=t.seen.get(e);A.ref=i},bF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType,n.readOnly=!0},hF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},uw=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},BF=(e,t,n,r)=>{let a=e._zod.innerType;ht(a,t,r);let o=t.seen.get(e);o.ref=a},sw={string:$1,number:M1,boolean:j1,bigint:P1,symbol:T1,null:H1,undefined:G1,void:U1,never:O1,any:q1,unknown:z1,date:K1,enum:Y1,literal:J1,nan:W1,template_literal:Z1,file:V1,success:X1,custom:eF,function:tF,transform:nF,map:aF,set:rF,array:oF,object:iF,union:cw,intersection:AF,tuple:sF,record:cF,nullable:uF,nonoptional:dF,default:pF,prefault:gF,catch:mF,pipe:fF,readonly:bF,promise:hF,optional:uw,lazy:BF};function dw(e,t){if("_idmap"in e){let r=e,a=kc({...t,processors:sw}),o={};for(let s of r._idmap.entries()){let[u,d]=s;ht(d,a)}let i={},A={registry:r,uri:t?.uri,defs:o};a.external=A;for(let s of r._idmap.entries()){let[u,d]=s;Qc(a,d),sn(i,u,Ic(a,d))}if(Object.keys(o).length>0){let s=a.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[s]:o}}return{schemas:i}}let n=kc({...t,processors:sw});return ht(e,n),Qc(n,e),Ic(n,e)}var lw=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=kc({processors:sw,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return ht(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Qc(this.ctx,t);let r=Ic(this.ctx,t),{"~standard":a,...o}=r;return o}};var WP={};var vp={};L(vp,{ZodAny:()=>TF,ZodArray:()=>OF,ZodBase64:()=>Fw,ZodBase64URL:()=>Sw,ZodBigInt:()=>Qp,ZodBigIntFormat:()=>Rw,ZodBoolean:()=>kp,ZodCIDRv4:()=>xw,ZodCIDRv6:()=>Dw,ZodCUID:()=>ww,ZodCUID2:()=>Ew,ZodCatch:()=>d8,ZodCodec:()=>Nf,ZodCreditCard:()=>LF,ZodCustom:()=>Rf,ZodCustomStringFormat:()=>wp,ZodDate:()=>_f,ZodDefault:()=>o8,ZodDiscriminatedUnion:()=>zF,ZodE164:()=>Lw,ZodEmail:()=>hw,ZodEmoji:()=>yw,ZodEnum:()=>yp,ZodExactOptional:()=>Pw,ZodFile:()=>t8,ZodFunction:()=>C8,ZodGUID:()=>Bw,ZodIPv4:()=>vw,ZodIPv6:()=>_w,ZodISODate:()=>_c,ZodISODateTime:()=>vc,ZodISODuration:()=>Dc,ZodISOTime:()=>xc,ZodIntersection:()=>KF,ZodJWT:()=>Nw,ZodKSUID:()=>Iw,ZodLazy:()=>h8,ZodLiteral:()=>e8,ZodMAC:()=>SF,ZodMap:()=>VF,ZodNaN:()=>p8,ZodNanoID:()=>Cw,ZodNever:()=>GF,ZodNonOptional:()=>Tw,ZodNull:()=>jF,ZodNullable:()=>r8,ZodNumber:()=>Ep,ZodNumberFormat:()=>Ju,ZodObject:()=>Df,ZodOptional:()=>Sf,ZodPipe:()=>Lf,ZodPrefault:()=>A8,ZodPreprocess:()=>g8,ZodPromise:()=>y8,ZodReadonly:()=>m8,ZodRecord:()=>Bp,ZodSet:()=>XF,ZodString:()=>Cp,ZodStringFormat:()=>xt,ZodSuccess:()=>u8,ZodSymbol:()=>$F,ZodTemplateLiteral:()=>b8,ZodTransform:()=>n8,ZodTuple:()=>JF,ZodType:()=>xe,ZodULID:()=>kw,ZodURL:()=>vf,ZodUUID:()=>mA,ZodUndefined:()=>MF,ZodUnion:()=>Ff,ZodUnknown:()=>HF,ZodVoid:()=>UF,ZodXID:()=>Qw,ZodXor:()=>qF,_ZodString:()=>bw,_default:()=>i8,_function:()=>iH,any:()=>MT,array:()=>xf,base64:()=>BT,base64url:()=>yT,bigint:()=>ST,boolean:()=>RF,catch:()=>l8,check:()=>AH,cidrv4:()=>bT,cidrv6:()=>hT,codec:()=>nH,creditCard:()=>wT,cuid:()=>cT,cuid2:()=>uT,custom:()=>sH,date:()=>PT,describe:()=>cH,discriminatedUnion:()=>qT,e164:()=>CT,email:()=>XP,emoji:()=>AT,enum:()=>Mw,exactOptional:()=>a8,file:()=>VT,float32:()=>_T,float64:()=>xT,function:()=>iH,guid:()=>eT,hash:()=>vT,hex:()=>IT,hostname:()=>QT,httpUrl:()=>iT,instanceof:()=>dH,int:()=>mw,int32:()=>DT,int64:()=>LT,intersection:()=>YF,invertCodec:()=>aH,ipv4:()=>gT,ipv6:()=>fT,json:()=>pH,jwt:()=>ET,keyof:()=>TT,ksuid:()=>pT,lazy:()=>B8,literal:()=>ZT,looseObject:()=>UT,looseRecord:()=>KT,mac:()=>mT,map:()=>YT,meta:()=>uH,nan:()=>tH,nanoid:()=>sT,nativeEnum:()=>WT,never:()=>$w,nonoptional:()=>c8,null:()=>PF,nullable:()=>If,nullish:()=>XT,number:()=>NF,object:()=>HT,optional:()=>Ku,partialRecord:()=>zT,pipe:()=>fw,prefault:()=>s8,preprocess:()=>gH,promise:()=>oH,readonly:()=>f8,record:()=>ZF,refine:()=>w8,set:()=>JT,strictObject:()=>GT,string:()=>Qf,stringFormat:()=>kT,stringbool:()=>lH,success:()=>eH,superRefine:()=>E8,symbol:()=>RT,templateLiteral:()=>rH,transform:()=>jw,tuple:()=>WF,uint32:()=>FT,uint64:()=>NT,ulid:()=>dT,undefined:()=>$T,union:()=>Ip,unknown:()=>zu,url:()=>oT,uuid:()=>tT,uuidv4:()=>nT,uuidv6:()=>aT,uuidv7:()=>rT,void:()=>jT,xid:()=>lT,xor:()=>OT});var pw={};L(pw,{endsWith:()=>up,gt:()=>pA,gte:()=>mo,includes:()=>sp,length:()=>qu,lowercase:()=>ip,lt:()=>lA,lte:()=>go,maxLength:()=>Ou,maxSize:()=>Ec,mime:()=>dp,minLength:()=>fs,minSize:()=>gA,multipleOf:()=>wc,negative:()=>aw,nonnegative:()=>ow,nonpositive:()=>rw,normalize:()=>lp,overwrite:()=>Ci,positive:()=>nw,properties:()=>Aw,property:()=>iw,regex:()=>op,size:()=>Uu,slugify:()=>fp,startsWith:()=>cp,toLowerCase:()=>gp,toUpperCase:()=>mp,trim:()=>pp,uppercase:()=>Ap});var ZP=new WeakSet([Object.prototype,Error.prototype]);function gw(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}var VP=(e,t)=>{nf.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);ZP.has(n)||(ZP.add(n),gw(n,"format",r=>a=>rf(r,a)),gw(n,"flatten",r=>a=>af(r,a)),gw(n,"addIssue",r=>a=>{r.issues.push(a),r.message=JSON.stringify(r.issues,Jl,2)}),gw(n,"addIssues",r=>a=>{r.issues.push(...a),r.message=JSON.stringify(r.issues,Jl,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},ade=v("ZodError",VP),Ur=v("ZodError",VP,void 0,{Parent:Error});var yF=Vl(Ur),CF=Xl(Ur),wF=ep(Ur),EF=tp(Ur),kF=Ky(Ur),QF=Yy(Ur),IF=Jy(Ur),vF=Wy(Ur),_F=Zy(Ur),xF=Vy(Ur),DF=Xy(Ur),FF=eC(Ur);function ode(){ha.localeError||hn(xC())}function Yu(){ha.memoizer||hn({memoizer:mf()})}var xe=v("ZodType",(e,t)=>(ode(),Ee.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(G.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return bt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(w8(e,t))},superRefine(e,t){return this.check(E8(e,t))},overwrite(e){return this.check(Ci(e))},optional(){return Ku(this)},exactOptional(){return a8(this)},nullable(){return If(this)},nullish(){return Ku(If(this))},nonoptional(e){return c8(this,e)},array(){return xf(this)},or(e){return Ip([this,e])},and(e){return YF(this,e)},transform(e){return fw(this,jw(e))},default(e){return i8(this,e)},prefault(e){return s8(this,e)},catch(e){return l8(this,e)},pipe(e){return fw(this,e)},readonly(){return f8(this)},describe(e){let t=this.clone();return La.add(t,{description:e}),t},meta(...e){if(e.length===0)return La.get(this);let t=this.clone();return La.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return G.hide(this,"~standard",{...dC(this),jsonSchema:{input:hp(this,"input"),output:hp(this,"output")}})},set"~standard"(e){G.own(this,"~standard",e)},parse:function e(t,n){return yF(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await CF(this,t,n,{callee:e})},safeParse(e,t){return wF(this,e,t)},async safeParseAsync(e,t){return EF(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){G.own(this,"spa",e)},encode:function e(t,n){return kF(this,t,n,{callee:e})},decode:function e(t,n){return QF(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await IF(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await vF(this,t,n,{callee:e})},safeEncode(e,t){return _F(this,e,t)},safeDecode(e,t){return xF(this,e,t)},async safeEncodeAsync(e,t){return DF(this,e,t)},async safeDecodeAsync(e,t){return FF(this,e,t)},toJSONSchema(e){return L1(this,{})(e)},get description(){return La.get(this)?.description},get _def(){return this._zod.def}}),bw=v("_ZodString",(e,t)=>{ju.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>$1(e,r,a,o);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null},{regex(...e){return this.check(op(...e))},includes(...e){return this.check(sp(...e))},startsWith(...e){return this.check(cp(...e))},endsWith(...e){return this.check(up(...e))},min(...e){return this.check(fs(...e))},max(...e){return this.check(Ou(...e))},length(...e){return this.check(qu(...e))},nonempty(...e){return this.check(fs(1,...e))},lowercase(e){return this.check(ip(e))},uppercase(e){return this.check(Ap(e))},trim(){return this.check(pp())},normalize(...e){return this.check(lp(...e))},toLowerCase(){return this.check(gp())},toUpperCase(){return this.check(mp())},slugify(){return this.check(fp())}}),Cp=v("ZodString",(e,t)=>{ju.init(e,t),bw.init(e,t)},{email(e){return this.check(RC(hw,e))},url(e){return this.check(hf(vf,e))},jwt(e){return this.check(tw(Nw,e))},emoji(e){return this.check(HC(yw,e))},guid(e){return this.check($C(Bw,e))},uuid(e){return this.check(MC(mA,e))},uuidv4(e){return this.check(jC(mA,e))},uuidv6(e){return this.check(PC(mA,e))},uuidv7(e){return this.check(TC(mA,e))},nanoid(e){return this.check(GC(Cw,e))},cuid(e){return this.check(UC(ww,e))},cuid2(e){return this.check(OC(Ew,e))},ulid(e){return this.check(qC(kw,e))},base64(e){return this.check(VC(Fw,e))},base64url(e){return this.check(XC(Sw,e))},xid(e){return this.check(zC(Qw,e))},ksuid(e){return this.check(KC(Iw,e))},ipv4(e){return this.check(YC(vw,e))},ipv6(e){return this.check(JC(_w,e))},cidrv4(e){return this.check(WC(xw,e))},cidrv6(e){return this.check(ZC(Dw,e))},e164(e){return this.check(ew(Lw,e))},datetime(e){return this.check(Bf(vc,e))},date(e){return this.check(yf(_c,e))},time(e){return this.check(Cf(xc,e))},duration(e){return this.check(wf(Dc,e))}});function Qf(e){return WD(Cp,e)}var xt=v("ZodStringFormat",(e,t)=>{Ct.init(e,t),bw.init(e,t)}),vc=v("ZodISODateTime",(e,t)=>{Hx.init(e,t),xt.init(e,t)}),_c=v("ZodISODate",(e,t)=>{Gx.init(e,t),xt.init(e,t)}),xc=v("ZodISOTime",(e,t)=>{Ux.init(e,t),xt.init(e,t)}),Dc=v("ZodISODuration",(e,t)=>{Ox.init(e,t),xt.init(e,t)}),hw=v("ZodEmail",(e,t)=>{Dx.init(e,t),xt.init(e,t)});function XP(e){return RC(hw,e)}var Bw=v("ZodGUID",(e,t)=>{_x.init(e,t),xt.init(e,t)});function eT(e){return $C(Bw,e)}var mA=v("ZodUUID",(e,t)=>{xx.init(e,t),xt.init(e,t)});function tT(e){return MC(mA,e)}function nT(e){return jC(mA,e)}function aT(e){return PC(mA,e)}function rT(e){return TC(mA,e)}var vf=v("ZodURL",(e,t)=>{Lx.init(e,t),xt.init(e,t)});function oT(e){return hf(vf,e)}function iT(e){return hf(vf,{protocol:pr.httpProtocol,hostname:pr.domain,...G.normalizeParams(e)})}var yw=v("ZodEmoji",(e,t)=>{Nx.init(e,t),xt.init(e,t)});function AT(e){return HC(yw,e)}var Cw=v("ZodNanoID",(e,t)=>{Rx.init(e,t),xt.init(e,t)});function sT(e){return GC(Cw,e)}var ww=v("ZodCUID",(e,t)=>{$x.init(e,t),xt.init(e,t)});function cT(e){return UC(ww,e)}var Ew=v("ZodCUID2",(e,t)=>{Mx.init(e,t),xt.init(e,t)});function uT(e){return OC(Ew,e)}var kw=v("ZodULID",(e,t)=>{jx.init(e,t),xt.init(e,t)});function dT(e){return qC(kw,e)}var Qw=v("ZodXID",(e,t)=>{Px.init(e,t),xt.init(e,t)});function lT(e){return zC(Qw,e)}var Iw=v("ZodKSUID",(e,t)=>{Tx.init(e,t),xt.init(e,t)});function pT(e){return KC(Iw,e)}var vw=v("ZodIPv4",(e,t)=>{qx.init(e,t),xt.init(e,t)});function gT(e){return YC(vw,e)}var SF=v("ZodMAC",(e,t)=>{Kx.init(e,t),xt.init(e,t)});function mT(e){return VD(SF,e)}var _w=v("ZodIPv6",(e,t)=>{zx.init(e,t),xt.init(e,t)});function fT(e){return JC(_w,e)}var xw=v("ZodCIDRv4",(e,t)=>{Yx.init(e,t),xt.init(e,t)});function bT(e){return WC(xw,e)}var Dw=v("ZodCIDRv6",(e,t)=>{Jx.init(e,t),xt.init(e,t)});function hT(e){return ZC(Dw,e)}var Fw=v("ZodBase64",(e,t)=>{Wx.init(e,t),xt.init(e,t)});function BT(e){return VC(Fw,e)}var Sw=v("ZodBase64URL",(e,t)=>{Zx.init(e,t),xt.init(e,t)});function yT(e){return XC(Sw,e)}var Lw=v("ZodE164",(e,t)=>{Vx.init(e,t),xt.init(e,t)});function CT(e){return ew(Lw,e)}var LF=v("ZodCreditCard",(e,t)=>{Xx.init(e,t),xt.init(e,t)});function wT(e){return XD(LF,e)}var Nw=v("ZodJWT",(e,t)=>{eD.init(e,t),xt.init(e,t)});function ET(e){return tw(Nw,e)}var wp=v("ZodCustomStringFormat",(e,t)=>{tD.init(e,t),xt.init(e,t)});function kT(e,t,n={}){return bp(wp,e,t,n)}function QT(e){return bp(wp,"hostname",pr.hostname,e)}function IT(e){return bp(wp,"hex",pr.hex,e)}function vT(e,t){let n=t?.enc??"hex",r=`${e}_${n}`,a=pr[r];if(!a)throw new Error(`Unrecognized hash format: ${r}`);return bp(wp,r,a,t)}var Ep=v("ZodNumber",(e,t)=>{yC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>M1(e,r,a,o);let 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},{gt(e,t){return this.check(pA(e,t))},gte(e,t){return this.check(mo(e,t))},min(e,t){return this.check(mo(e,t))},lt(e,t){return this.check(lA(e,t))},lte(e,t){return this.check(go(e,t))},max(e,t){return this.check(go(e,t))},int(e){return this.check(mw(e))},safe(e){return this.check(mw(e))},positive(e){return this.check(pA(0,e))},nonnegative(e){return this.check(mo(0,e))},negative(e){return this.check(lA(0,e))},nonpositive(e){return this.check(go(0,e))},multipleOf(e,t){return this.check(wc(e,t))},step(e,t){return this.check(wc(e,t))},finite(){return this}});function NF(e){return t1(Ep,e)}var Ju=v("ZodNumberFormat",(e,t)=>{nD.init(e,t),Ep.init(e,t)});function mw(e){return a1(Ju,e)}function _T(e){return r1(Ju,e)}function xT(e){return o1(Ju,e)}function DT(e){return i1(Ju,e)}function FT(e){return A1(Ju,e)}var kp=v("ZodBoolean",(e,t)=>{df.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>j1(e,n,r,a)});function RF(e){return s1(kp,e)}var Qp=v("ZodBigInt",(e,t)=>{CC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>P1(e,r,a,o);let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null},{gte(e,t){return this.check(mo(e,t))},min(e,t){return this.check(mo(e,t))},gt(e,t){return this.check(pA(e,t))},lt(e,t){return this.check(lA(e,t))},lte(e,t){return this.check(go(e,t))},max(e,t){return this.check(go(e,t))},positive(e){return this.check(pA(BigInt(0),e))},negative(e){return this.check(lA(BigInt(0),e))},nonpositive(e){return this.check(go(BigInt(0),e))},nonnegative(e){return this.check(mo(BigInt(0),e))},multipleOf(e,t){return this.check(wc(e,t))}});function ST(e){return u1(Qp,e)}var Rw=v("ZodBigIntFormat",(e,t)=>{aD.init(e,t),Qp.init(e,t)});function LT(e){return l1(Rw,e)}function NT(e){return p1(Rw,e)}var $F=v("ZodSymbol",(e,t)=>{rD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>T1(e,n,r,a)});function RT(e){return g1($F,e)}var MF=v("ZodUndefined",(e,t)=>{oD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>G1(e,n,r,a)});function $T(e){return m1(MF,e)}var jF=v("ZodNull",(e,t)=>{iD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>H1(e,n,r,a)});function PF(e){return f1(jF,e)}var TF=v("ZodAny",(e,t)=>{AD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>q1(e,n,r,a)});function MT(){return b1(TF)}var HF=v("ZodUnknown",(e,t)=>{sD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>z1(e,n,r,a)});function zu(){return h1(HF)}var GF=v("ZodNever",(e,t)=>{cD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>O1(e,n,r,a)});function $w(e){return B1(GF,e)}var UF=v("ZodVoid",(e,t)=>{uD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>U1(e,n,r,a)});function jT(e){return y1(UF,e)}var _f=v("ZodDate",(e,t)=>{dD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>K1(e,r,a,o),e.min=(r,a)=>e.check(mo(r,a)),e.max=(r,a)=>e.check(go(r,a));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function PT(e){return C1(_f,e)}var OF=v("ZodArray",(e,t)=>{Yu(),lD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>oF(e,n,r,a),e.element=t.element},{min(e,t){return this.check(fs(e,t))},nonempty(e){return this.check(fs(1,e))},max(e,t){return this.check(Ou(e,t))},length(e,t){return this.check(qu(e,t))},unwrap(){return this.element}});function xf(e,t){return k1(OF,e,t)}function TT(e){let t=e._zod.def.shape;return Mw(Object.keys(t))}var Df=v("ZodObject",(e,t)=>{Yu(),pD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>iF(e,n,r,a),G.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Mw(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:zu()})},loose(){return this.clone({...this._zod.def,catchall:zu()})},strict(){return this.clone({...this._zod.def,catchall:$w()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return G.extend(this,e)},safeExtend(e){return G.safeExtend(this,e)},merge(e){return G.merge(this,e)},pick(e){return G.pick(this,e)},omit(e){return G.omit(this,e)},partial(...e){return G.partial(Sf,this,e[0])},exactPartial(...e){return G.partial(Pw,this,e[0],"exactPartial")},required(...e){return G.required(Tw,this,e[0])}});function HT(e,t){let n={type:"object",shape:e??{},...G.normalizeParams(t)};return new Df(n)}function GT(e,t){return new Df({type:"object",shape:e,catchall:$w(),...G.normalizeParams(t)})}function UT(e,t){return new Df({type:"object",shape:e,catchall:zu(),...G.normalizeParams(t)})}var Ff=v("ZodUnion",(e,t)=>{lf.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>cw(e,n,r,a),e.options=t.options});function Ip(e,t){return new Ff({type:"union",options:e,...G.normalizeParams(t)})}var qF=v("ZodXor",(e,t)=>{Ff.init(e,t),gD.init(e,t),e._zod.processJSONSchema=(n,r,a)=>cw(e,n,r,a),e.options=t.options});function OT(e,t){return new qF({type:"union",options:e,inclusive:!1,...G.normalizeParams(t)})}var zF=v("ZodDiscriminatedUnion",(e,t)=>{Ff.init(e,t),fD.init(e,t)});function qT(e,t,n){return new zF({type:"union",options:t,discriminator:e,...G.normalizeParams(n)})}var KF=v("ZodIntersection",(e,t)=>{bD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>AF(e,n,r,a)});function YF(e,t){return new KF({type:"intersection",left:e,right:t})}var JF=v("ZodTuple",(e,t)=>{Yu(),wC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>sF(e,n,r,a)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new Sf({type:"optional",innerType:t}))})}});function WF(e,t,n){let r=t instanceof Ee,a=r?n:t,o=r?t:null;return new JF({type:"tuple",items:e,rest:o,...G.normalizeParams(a)})}var Bp=v("ZodRecord",(e,t)=>{Yu(),hD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>cF(e,n,r,a),e.keyType=t.keyType,e.valueType=t.valueType});function ZF(e,t,n){return!t||!t._zod?new Bp({type:"record",keyType:Qf(),valueType:e,...G.normalizeParams(t)}):new Bp({type:"record",keyType:e,valueType:t,...G.normalizeParams(n)})}function zT(e,t,n){return new Bp({type:"record",keyType:e,valueType:t,...G.normalizeParams(n),partial:!0})}function KT(e,t,n){return new Bp({type:"record",keyType:e,valueType:t,mode:"loose",...G.normalizeParams(n)})}var VF=v("ZodMap",(e,t)=>{Yu(),BD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>aF(e,n,r,a),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(gA(...n)),e.nonempty=n=>e.check(gA(1,n)),e.max=(...n)=>e.check(Ec(...n)),e.size=(...n)=>e.check(Uu(...n))});function YT(e,t,n){return new VF({type:"map",keyType:e,valueType:t,...G.normalizeParams(n)})}var XF=v("ZodSet",(e,t)=>{Yu(),yD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>rF(e,n,r,a),e.min=(...n)=>e.check(gA(...n)),e.nonempty=n=>e.check(gA(1,n)),e.max=(...n)=>e.check(Ec(...n)),e.size=(...n)=>e.check(Uu(...n))});function JT(e,t){return new XF({type:"set",valueType:e,...G.normalizeParams(t)})}var yp=v("ZodEnum",(e,t)=>{CD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>Y1(e,r,a,o),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(r,a)=>{let o={};for(let i of r)if(n.has(i))o[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new yp({...t,checks:[],...G.normalizeParams(a),entries:o})},e.exclude=(r,a)=>{let o={...t.entries};for(let i of r)if(n.has(i))delete o[i];else throw new Error(`Key ${i} not found in enum`);return new yp({...t,checks:[],...G.normalizeParams(a),entries:o})}});function Mw(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new yp({type:"enum",entries:n,...G.normalizeParams(t)})}function WT(e,t){return new yp({type:"enum",entries:e,...G.normalizeParams(t)})}var e8=v("ZodLiteral",(e,t)=>{wD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>J1(e,n,r,a),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 ZT(e,t){return new e8({type:"literal",values:Array.isArray(e)?e:[e],...G.normalizeParams(t)})}var t8=v("ZodFile",(e,t)=>{ED.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>V1(e,n,r,a),e.min=(n,r)=>e.check(gA(n,r)),e.max=(n,r)=>e.check(Ec(n,r)),e.mime=(n,r)=>e.check(dp(Array.isArray(n)?n:[n],r))});function VT(e){return Q1(t8,e)}var n8=v("ZodTransform",(e,t)=>{Yu(),kD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>nF(e,n,r,a),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new yc(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(G.issue(o,n.value,t));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=e),n.issues.push(G.issue(i))}};let a=t.transform(n.value,n);return a instanceof Promise?a.then(o=>(n.value=o,n)):(n.value=a,n)}});function jw(e){return new n8({type:"transform",transform:e})}var Sf=v("ZodOptional",(e,t)=>{EC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>uw(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function Ku(e){return new Sf({type:"optional",innerType:e})}var Pw=v("ZodExactOptional",(e,t)=>{QD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>uw(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function a8(e){return new Pw({type:"optional",innerType:e})}var r8=v("ZodNullable",(e,t)=>{ID.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>uF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function If(e){return new r8({type:"nullable",innerType:e})}function XT(e){return Ku(If(e))}var o8=v("ZodDefault",(e,t)=>{vD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>pF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function i8(e,t){return new o8({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var A8=v("ZodPrefault",(e,t)=>{_D.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>gF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function s8(e,t){return new A8({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var Tw=v("ZodNonOptional",(e,t)=>{xD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>dF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function c8(e,t){return new Tw({type:"nonoptional",innerType:e,...G.normalizeParams(t)})}var u8=v("ZodSuccess",(e,t)=>{DD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>X1(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function eH(e){return new u8({type:"success",innerType:e})}var d8=v("ZodCatch",(e,t)=>{FD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>mF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function l8(e,t){return new d8({type:"catch",innerType:e,catchValue:typeof t=="function"?t:G.constantCatch(t)})}var p8=v("ZodNaN",(e,t)=>{SD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>W1(e,n,r,a)});function tH(e){return E1(p8,e)}var Lf=v("ZodPipe",(e,t)=>{kC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>fF(e,n,r,a),e.in=t.in,e.out=t.out});function fw(e,t){return new Lf({type:"pipe",in:e,out:t})}var Nf=v("ZodCodec",(e,t)=>{Lf.init(e,t),pf.init(e,t)});function nH(e,t,n){return new Nf({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function aH(e){let t=e._zod.def;return new Nf({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var g8=v("ZodPreprocess",(e,t)=>{Lf.init(e,t),LD.init(e,t)}),m8=v("ZodReadonly",(e,t)=>{ND.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>bF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function f8(e){return new m8({type:"readonly",innerType:e})}var b8=v("ZodTemplateLiteral",(e,t)=>{RD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>Z1(e,n,r,a)});function rH(e,t){return new b8({type:"template_literal",parts:e,...G.normalizeParams(t)})}var h8=v("ZodLazy",(e,t)=>{gf.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>BF(e,n,r,a),e.unwrap=()=>e._zod.def.getter()});function B8(e){return new h8({type:"lazy",getter:e})}var y8=v("ZodPromise",(e,t)=>{MD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>hF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function oH(e){return new y8({type:"promise",innerType:e})}var C8=v("ZodFunction",(e,t)=>{$D.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>tF(e,n,r,a)});function iH(e){return new C8({type:"function",input:Array.isArray(e?.input)?WF(e?.input):e?.input??xf(zu()),output:e?.output??zu()})}var Rf=v("ZodCustom",(e,t)=>{jD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>eF(e,n,r,a)});function AH(e){let t=new Nt({check:"custom"});return t._zod.check=e,t}function sH(e,t){return I1(Rf,e??(()=>!0),t)}function w8(e,t={}){return v1(Rf,e,t)}function E8(e,t){return _1(e,t)}var cH=x1,uH=D1;function dH(e,t={}){let n=new Rf({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...G.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}var lH=(...e)=>F1({Codec:Nf,Boolean:kp,String:Cp},...e);function pH(e){let t=B8(()=>Ip([Qf(e),NF(),RF(),PF(),xf(t),ZF(Qf(),t)]));return t}function gH(e,t){return new g8({type:"pipe",in:jw(e),out:t})}var ide={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Ade(e){hn({customError:e})}function sde(){return hn().customError}var k8;k8||(k8={});var $f={};L($f,{ZodISODate:()=>_c,ZodISODateTime:()=>vc,ZodISODuration:()=>Dc,ZodISOTime:()=>xc,date:()=>ude,datetime:()=>cde,duration:()=>lde,time:()=>dde});function cde(e){return Bf(vc,e)}function ude(e){return yf(_c,e)}function dde(e){return Cf(xc,e)}function lde(e){return wf(Dc,e)}var X={...vp,...pw,iso:$f},pde=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function gde(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function mH(e,t){return e.map((n,r)=>r<t?n:n.optional())}function mde(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function fde(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===r){let a=n[1]===void 0?void 0:mde(n[1]);if(!a||!t.defs[a])throw new Error(`Reference not found: ${e}`);return t.defs[a]}throw new Error(`Reference not found: ${e}`)}function bde(e,t){return X.transform(r=>r).check(r=>{let a=r.value;if(!(typeof a!="object"||a===null||Array.isArray(a)))for(let o of Object.getOwnPropertyNames(a)){let i=t.safeParse(o);i.success||r.issues.push({code:"invalid_key",origin:"record",issues:i.error.issues,input:o,path:[o],continue:!0})}}).pipe(e)}function fH(e,t){if(e!==!1)return e===void 0||e===!0?X.any():Or(e,t)}var hde=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function bH(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return X.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let a=e.$ref;if(t.refs.has(a))return t.refs.get(a);if(t.processing.has(a))return X.lazy(()=>{if(!t.refs.has(a))throw new Error(`Circular reference not resolved: ${a}`);return t.refs.get(a)});t.processing.add(a);let o=fde(a,t),i=Or(o,t);return t.refs.set(a,i),t.processing.delete(a),i}if(e.enum!==void 0){let a=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&a.length===1&&a[0]===null)return X.null();if(a.length===0)return X.never();if(a.length===1)return X.literal(a[0]);if(a.every(i=>typeof i=="string"))return X.enum(a);let o=a.map(i=>X.literal(i));return o.length<2?o[0]:X.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return X.literal(e.const);let n=e.type;if(Array.isArray(n)){let a=n.map(o=>{let i={...e,type:o};return bH(i,t)});return a.length===0?X.never():a.length===1?a[0]:X.union(a)}if(!n)return X.any();let r;switch(n){case"string":{let a=X.string();if(e.format){let o=e.format;o==="email"?a=a.check(X.email()):o==="uri"||o==="uri-reference"?a=a.check(X.url()):o==="uuid"||o==="guid"?a=a.check(X.uuid()):o==="date-time"?a=a.check(X.iso.datetime({offset:!0})):o==="date"?a=a.check(X.iso.date()):o==="time"?a=a.check(X.regex(hde)):o==="duration"?a=a.check(X.iso.duration()):o==="hostname"?a=a.check(X.hostname()):o==="ipv4"?a=a.check(X.ipv4()):o==="ipv6"?a=a.check(X.ipv6()):o==="mac"?a=a.check(X.mac()):o==="cidr"?a=a.check(X.cidrv4()):o==="cidr-v6"?a=a.check(X.cidrv6()):o==="base64"?a=a.check(X.base64()):o==="base64url"?a=a.check(X.base64url()):o==="e164"?a=a.check(X.e164()):o==="credit_card"?a=a.check(X.creditCard()):o==="jwt"?a=a.check(X.jwt()):o==="emoji"?a=a.check(X.emoji()):o==="nanoid"?a=a.check(X.nanoid()):o==="cuid"?a=a.check(X.cuid()):o==="cuid2"?a=a.check(X.cuid2()):o==="ulid"?a=a.check(X.ulid()):o==="xid"?a=a.check(X.xid()):o==="ksuid"&&(a=a.check(X.ksuid()))}typeof e.minLength=="number"&&(a=a.min(e.minLength)),typeof e.maxLength=="number"&&(a=a.max(e.maxLength)),e.pattern&&(a=a.regex(new RegExp(e.pattern))),r=a;break}case"number":case"integer":{let a=n==="integer"?X.number().int():X.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(a=a.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(a=a.max(e.maximum)),typeof e.exclusiveMinimum=="number"?a=a.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(a=a.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?a=a.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(a=a.lt(e.maximum)),typeof e.multipleOf=="number"&&(a=a.multipleOf(e.multipleOf)),r=a;break}case"boolean":{r=X.boolean();break}case"null":{r=X.null();break}case"object":{let a={},o=e.properties||{},i=new Set(e.required||[]),A=typeof e.additionalProperties=="object"?Or(e.additionalProperties,t):void 0;for(let[s,u]of Object.entries(o)){let d=Or(u,t);sn(a,s,i.has(s)?d:d.optional())}if(e.patternProperties){let s=e.patternProperties,u=Object.keys(s),d=[];for(let p of u){let g=Or(s[p],t),m=X.string().regex(new RegExp(p));d.push(X.looseRecord(m,g))}let l=[];if(Object.keys(a).length>0&&l.push(X.object(a).passthrough()),l.push(...d),l.length===0)r=X.object({}).passthrough();else if(l.length===1)r=l[0];else{let p=X.intersection(l[0],l[1]);for(let g=2;g<l.length;g++)p=X.intersection(p,l[g]);r=p}if(e.additionalProperties===!1){let p=Object.keys(a),g=u.map(b=>new RegExp(b)),m=r;r=r.check(b=>{if(!To(b.value))return;let B=[];for(let h of Object.keys(b.value))p.includes(h)||g.some(f=>f.test(h))||B.push(h);B.length&&b.issues.push({code:"unrecognized_keys",keys:B,input:b.value,inst:m})})}}else{let s=X.object(a);e.additionalProperties===!1?r=s.strict():A?r=s.catchall(A):r=s.passthrough()}if(e.propertyNames!==void 0&&e.propertyNames!==!0){let s=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;r=bde(r,Or(s,t))}break}case"array":{let a=e.prefixItems,o=e.items;if(a&&Array.isArray(a)){let i=typeof e.minItems=="number"?e.minItems:0,A=a.map(l=>Or(l,t)),s=mH(A,i),u=Array.isArray(o)?void 0:fH(o,t),d=X.tuple(s);r=u?d.rest(u):d,typeof e.minItems=="number"&&(r=r.check(X.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(X.maxLength(e.maxItems)))}else if(Array.isArray(o)){let i=typeof e.minItems=="number"?e.minItems:0,A=o.map(l=>Or(l,t)),s=mH(A,i),u=fH(e.additionalItems,t),d=X.tuple(s);r=u?d.rest(u):d,typeof e.minItems=="number"&&(r=r.check(X.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(X.maxLength(e.maxItems)))}else if(o!==void 0){let i=Or(o,t),A=X.array(i);typeof e.minItems=="number"&&(A=A.min(e.minItems)),typeof e.maxItems=="number"&&(A=A.max(e.maxItems)),r=A}else r=X.array(X.any());break}default:throw new Error(`Unsupported type: ${n}`)}return r}function Or(e,t){if(typeof e=="boolean")return e?X.any():X.never();let n=bH(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let A=e.anyOf.map(u=>Or(u,t)),s=X.union(A);n=r?X.intersection(n,s):s}if(e.oneOf&&Array.isArray(e.oneOf)){let A=e.oneOf.map(u=>Or(u,t)),s=X.xor(A);n=r?X.intersection(n,s):s}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:X.any();else{let A=r?n:Or(e.allOf[0],t),s=r?0:1;for(let u=s;u<e.allOf.length;u++)A=X.intersection(A,Or(e.allOf[u],t));n=A}e.nullable===!0&&t.version==="openapi-3.0"&&(n=X.nullable(n)),e.readOnly===!0&&(n=X.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let a={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let A of o)A in e&&(a[A]=e[A]);let i=["contentEncoding","contentMediaType","contentSchema"];for(let A of i)A in e&&(a[A]=e[A]);e.propertyNames!==void 0&&e.type==="object"&&e.$ref===void 0&&(a.propertyNames=e.propertyNames);for(let A of Object.keys(e))pde.has(A)||sn(a,A,e[A]);return Object.keys(a).length>0&&t.registry.add(n,a),e.description&&(n=n.describe(e.description)),n}function hH(e,t){if(typeof e=="boolean")return e?X.any():X.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let r=gde(n,t?.defaultTarget),a=n.$defs||n.definitions||{},o={version:r,defs:a,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??La};return Or(n,o)}var BH=Symbol("z.visit/resolving");function Mf(e,t){let n=typeof t=="function"?t:(i,A)=>{let s=t[i._zod.def.type];return s?s(i,A):i},r=new Map;function a(i){let A=r.get(i);if(A===BH)return new gf({type:"lazy",getter:()=>r.get(i)});if(A!==void 0)return A;r.set(i,BH);let s=o(i),u=n(s,s!==i);return r.set(i,u),u}function o(i){let A=i._zod.def,s=A.type;switch(s){case"object":{let u=A.shape,d=Object.keys(u),l=!1,p={};for(let m of d){let b=a(u[m]);b!==u[m]&&(l=!0),p[m]=b}let g=A.catchall;return A.catchall&&(g=a(A.catchall),g!==A.catchall&&(l=!0)),l?bt(i,{...A,shape:p,catchall:g}):i}case"array":{let u=a(A.element);return u===A.element?i:bt(i,{...A,element:u})}case"tuple":{let u=A.items,d=!1,l=[];for(let g of u){let m=a(g);m!==g&&(d=!0),l.push(m)}let p=A.rest;return A.rest&&(p=a(A.rest),p!==A.rest&&(d=!0)),d?bt(i,{...A,items:l,rest:p}):i}case"record":case"map":{let u=a(A.keyType),d=a(A.valueType);return u===A.keyType&&d===A.valueType?i:bt(i,{...A,keyType:u,valueType:d})}case"set":{let u=a(A.valueType);return u===A.valueType?i:bt(i,{...A,valueType:u})}case"union":{let u=A.options,d=!1,l=[];for(let p of u){let g=a(p);g!==p&&(d=!0),l.push(g)}return d?bt(i,{...A,options:l}):i}case"intersection":{let u=a(A.left),d=a(A.right);return u===A.left&&d===A.right?i:bt(i,{...A,left:u,right:d})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let u=a(A.innerType);return u===A.innerType?i:bt(i,{...A,innerType:u})}case"pipe":{let u=a(A.in),d=a(A.out);return u===A.in&&d===A.out?i:bt(i,{...A,in:u,out:d})}case"function":{let u=a(A.input),d=a(A.output);return u===A.input&&d===A.output?i:bt(i,{...A,input:u,output:d})}case"lazy":{let u=A.getter,{_cachedInner:d,...l}=A;return bt(i,{...l,getter:()=>a(u())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return i;default:return i}}return a(e)}function yH(e){return Mf(e,{object:t=>t.partial(),union:t=>{let n=t._zod.def;return n.discriminator===void 0?t:Ip(n.options)}})}function Bde(e,t){if(!t?.length)return e;let n=e._zod.def;return bt(e,Bi(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function CH(e){return Bde(e.out,e.checks)}function yde(e){return e.in._zod.traits.has("$ZodTransform")?CH(e):e.in}function wH(e){return Mf(e,{pipe:t=>yde(t._zod.def),default:(t,n)=>n?Ku(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function EH(e){return Mf(e,{pipe:t=>CH(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var Q8={};L(Q8,{bigint:()=>kde,boolean:()=>Ede,date:()=>Qde,number:()=>wde,string:()=>Cde});function Cde(e){return ZD(Cp,e)}function wde(e){return n1(Ep,e)}function Ede(e){return c1(kp,e)}function kde(e){return d1(Qp,e)}function Qde(e){return w1(_f,e)}var kH=["none","low","medium","high","xhigh"];var Hw=c.string().regex(/^[a-z][a-z0-9_-]*$/);function Ide(e){try{let t=new URL(e).protocol;return t==="http:"||t==="https:"}catch{return!1}}var vde=c.object({kind:c.literal("resource_link"),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256),url:c.string().url().max(2048).refine(Ide,"URL must use HTTP or HTTPS."),description:c.string().trim().min(1).max(512).optional(),status:c.enum(["open","draft","closed","merged","warning"]).optional()}).strict(),IH=c.discriminatedUnion("kind",[vde]),_de=c.enum(["circle-dot","circle-dashed","circle-x","git-merge","git-pull-request","triangle-alert"]),vH=c.object({icon:_de.optional(),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256)}).strict(),Pf=c.enum(["closed","merged","open"]),B9e=c.object({closedAt:c.date().optional(),conversationIds:c.array(c.string().min(1)).default([]),mergedAt:c.date().optional(),number:c.number().int().positive(),openedAt:c.date(),providerId:c.string().min(1),repository:c.object({name:c.string().min(1),providerId:c.string().min(1),url:c.string().url().optional()}).strict(),state:Pf,title:c.string().min(1).optional(),updatedAt:c.date(),url:c.string().url().optional()}).strict(),C9e=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/),xde=c.enum(["activity","brain","calendar","check","database","info","key","link","sparkles","warning"]),Dde=c.object({content:c.string().min(1).max(32*1024).optional(),description:c.string().trim().min(1).max(2e3).optional(),metadata:c.array(c.string().trim().min(1).max(120)).max(8).optional(),title:c.string().trim().min(1).max(4e3)}).strict(),_H=c.object({details:c.array(Dde).max(100).optional(),icon:xde.optional(),preview:c.string().trim().min(1).max(500).optional(),title:c.string().trim().min(1).max(120)}).strict();var Uw=c.string().regex(/^T[A-Z0-9]+$/),I8=c.string().regex(/^(C|G|D)[A-Z0-9]+$/),xH=c.string().regex(/^local:[a-z0-9_-]+:[a-z0-9][a-z0-9_-]*$/),Fde=c.string().min(1).refine(e=>e===e.trim()&&e.toLowerCase()!=="unknown"),Gw=Fde,he=c.string().refine(e=>e.trim().length>0),Wa=he.refine(e=>e===e.trim()),Sde=c.object({id:he,provider:Wa}).strict(),Lde=Sde.extend({provider:c.literal("slack"),teamId:Uw,channelId:I8,threadTs:Wa.optional()}).strict(),E9e=c.discriminatedUnion("provider",[Lde]),k9e=c.enum(["slack","local"]),DH=c.enum(["public","private"]),Nde=c.enum(["public","private"]),Rde=c.object({platform:c.literal("slack"),teamId:Uw,channelId:I8,threadTs:Wa.optional()}).strict(),v8=Rde,$de=c.object({platform:c.literal("local"),conversationId:xH}).strict(),Mde=c.discriminatedUnion("platform",[v8,$de]),FH=c.object({action:c.literal("send_message"),destination:v8}).strict(),jde=c.object({kind:c.literal("slack"),teamId:Uw,channelId:I8,visibility:DH,messageTs:he.optional(),threadTs:he.optional()}).strict(),Pde=c.object({kind:c.literal("local"),visibility:c.literal("private"),conversationId:xH}).strict(),Tde=c.object({kind:c.literal("web"),visibility:DH,conversationId:Wa}).strict(),Hde=c.object({kind:c.literal("event"),eventKey:Wa,eventType:Wa,identifier:Wa,namespace:Wa}).strict(),Gde=c.object({kind:c.literal("scheduled_automation")}).strict(),Ude=c.object({kind:c.literal("event_automation")}).strict(),Ode=c.object({kind:c.literal("plugin_dispatch")}).strict(),qde=c.object({kind:c.literal("agent_invocation")}).strict(),zde=c.discriminatedUnion("kind",[jde,Pde,Tde,Hde,Gde,Ude,Ode,qde]);function Kde(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if("kind"in t){let o={event_task:"event_automation",resource_event:"event",scheduled_task:"scheduled_automation"},i=typeof t.kind=="string"?o[t.kind]:void 0;return i?{...t,kind:i}:e}if(t.platform!=="slack"&&t.platform!=="local"&&t.platform!=="web")return e;let{location:n,platform:r,...a}=t;return{...a,kind:r}}var Yde=c.preprocess(Kde,zde),Jde=c.discriminatedUnion("allowedWhen",[c.object({type:c.literal("user"),userId:Gw,allowedWhen:c.literal("private-direct-conversation")}).strict(),c.object({type:c.literal("user"),userId:Gw,allowedWhen:c.literal("scheduled-automation"),taskId:Wa}).strict()]),_8={email:he.optional(),fullName:he.optional(),userId:Gw,userName:he.optional()},Wde=c.object({..._8,platform:c.literal("slack"),teamId:Uw}).strict(),Zde=c.object({..._8,platform:c.literal("local")}).strict(),Vde=c.object({..._8,platform:c.literal("web")}).strict(),Xde=c.object({platform:c.literal("system"),name:Gw}).strict(),jf=c.discriminatedUnion("platform",[Wde,Zde,Vde,Xde]),ele=c.object({displayName:he.optional(),handle:he.optional(),id:Wa,provider:Wa,providerSubjectId:Wa,providerTenantId:Wa.optional()}).strict(),Q9e=c.object({displayName:he.optional(),email:he.max(320),id:Wa,identities:c.array(ele).max(100)}).strict(),tle=c.record(c.string(),c.string()).superRefine((e,t)=>{let n=Object.entries(e);if(n.length>20){t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata has too many keys"});return}for(let[r,a]of n){if(!r.trim()){t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata values must be strings",path:[r]});continue}r.length>128&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata key exceeds the maximum length",path:[r]}),/[\r\n]/.test(r)&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata keys must be single-line strings",path:[r]}),/[\r\n]/.test(a)&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata values must be single-line strings",path:[r]}),a.length>512&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata value exceeds the maximum length",path:[r]})}}),nle=c.object({label:Wa.pipe(c.string().max(48)).refine(e=>!/[\r\n]/.test(e)),detail:Wa.pipe(c.string().max(128)).refine(e=>!/[\r\n]/.test(e)).optional()}).strict(),I9e=c.object({idempotencyKey:he.pipe(c.string().max(512)),credentialSubject:Jde.optional(),destination:v8,destinationVisibility:Nde,input:he.pipe(c.string().max(32e3)),metadata:tle.optional(),replyAttribution:nle.optional()}).strict();var ale=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/),_9e=c.object({text:c.string().trim().min(1).max(8e3)}).strict(),x9e=c.object({kind:ale,version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict();var rle=4e3,ole=8e3,_p=32,QH=4e3,ile=1e3,Ale=c.record(c.string(),c.unknown()).superRefine((e,t)=>{Object.keys(e).length>_p&&t.addIssue({code:"custom",message:`Event data may include at most ${_p} keys.`}),new TextEncoder().encode(JSON.stringify(e)).byteLength>QH&&t.addIssue({code:"custom",message:`Event data may be at most ${QH} JSON bytes.`})}),Wu=c.string().regex(/^[a-z][a-z0-9_-]*(?:\.[a-z][a-z0-9_-]*)+$/).describe("Canonical dotted event type, such as issue.closed or pull_request.review.changes_requested."),SH=c.string().regex(/^[a-z][a-z0-9_]*$/).describe("Canonical plugin-defined resource type, such as issue or pull_request."),LH=/^[a-z][a-zA-Z0-9]*$/,sle=c.object({kind:c.enum(["boolean","string","number"]),description:c.string().trim().min(1).max(200),enum:c.array(c.string().min(1)).min(1).optional()}).strict().superRefine((e,t)=>{e.enum&&e.kind!=="string"&&t.addIssue({code:"custom",message:'Event match field enum requires kind "string".',path:["enum"]})}),cle=c.record(c.string().regex(LH),sle).superRefine((e,t)=>{Object.keys(e).length>_p&&t.addIssue({code:"custom",message:`Event match keys may include at most ${_p} keys.`})}),F9e=c.record(c.string().regex(LH),c.union([c.boolean(),c.number().finite(),c.string().min(1),c.array(c.union([c.number().finite(),c.string().min(1)])).min(1)])).superRefine((e,t)=>{Object.keys(e).length>_p&&t.addIssue({code:"custom",message:`Event match may include at most ${_p} keys.`});for(let[n,r]of Object.entries(e))Array.isArray(r)&&r.some(a=>typeof a=="boolean")&&t.addIssue({code:"custom",message:`Event match field "${n}" cannot use a boolean list.`,path:[n]})});var ule=c.object({type:SH,supportedEvents:c.array(Wu).min(1),suggestedEvents:c.array(Wu).optional(),matchFields:cle.optional(),guidance:c.record(Wu,c.string().trim().min(1).max(ile)).optional()}).strict().superRefine((e,t)=>{let n=new Set;e.supportedEvents.forEach((a,o)=>{n.has(a)&&t.addIssue({code:"custom",message:`Duplicate supported event type "${a}".`,path:["supportedEvents",o]}),n.add(a)});for(let a of Object.keys(e.guidance??{}))n.has(a)||t.addIssue({code:"custom",message:`Guidance event type "${a}" is not supported.`,path:["guidance",a]});let r=new Set;e.suggestedEvents?.forEach((a,o)=>{r.has(a)&&t.addIssue({code:"custom",message:`Duplicate suggested event type "${a}".`,path:["suggestedEvents",o]}),n.has(a)||t.addIssue({code:"custom",message:`Suggested event type "${a}" is not supported.`,path:["suggestedEvents",o]}),r.add(a)})}),S9e=c.object({resourceTypes:c.array(ule).min(1),isEnabled:c.function({input:[],output:c.boolean()}).optional(),normalizeIdentifier:c.function({input:[c.string()],output:c.string()}).optional()}).strict().superRefine((e,t)=>{let n=new Set;e.resourceTypes.forEach((r,a)=>{n.has(r.type)&&t.addIssue({code:"custom",message:`Duplicate resource type "${r.type}".`,path:["resourceTypes",a,"type"]}),n.add(r.type)})});var L9e=c.object({identifier:c.string().min(1),label:c.string().min(1),namespace:c.string().min(1),suggestedEvents:c.array(Wu).optional(),supportedEvents:c.array(Wu),type:SH}).strict(),N9e=c.object({events:c.array(Wu).min(1),id:c.string().min(1)}).strict(),dle=c.object({eventKey:c.string().min(1),eventType:Wu,identifier:c.string().min(1),occurredAtMs:c.number().finite(),terminal:c.boolean().optional(),trustedSummary:c.string().min(1).transform(e=>e.slice(0,rle)),data:Ale.optional(),untrustedText:c.string().transform(e=>e.slice(0,ole)).optional()}).strict(),R9e=dle.extend({namespace:c.string().min(1)}),lle=c.object({authority:c.enum(["instruction","context"]),actor:jf.optional()}).strict(),ple=c.discriminatedUnion("type",[c.object({type:c.literal("message"),role:c.enum(["user","assistant"]),text:c.string().min(1),provenance:lle.optional(),isRunActor:c.boolean().optional()}).strict(),c.object({type:c.literal("toolResult"),toolName:c.string().min(1),isError:c.boolean(),text:c.string().min(1).optional()}).strict()]),M9e=c.object({actorUserId:c.string().min(1).optional(),completedAtMs:c.number().finite(),conversationId:c.string().min(1),destination:Mde,locationId:c.string().min(1).optional(),actors:c.array(jf),actor:jf.optional(),runId:c.string().min(1),source:Yde,transcript:c.array(ple)}).strict();var P9e=c.discriminatedUnion("type",[c.object({type:c.literal("text"),text:c.string()}).strict(),c.object({type:c.literal("image"),data:c.string(),mimeType:c.string()}).strict()]),gle=c.object({arguments:c.record(c.string(),c.unknown()),reason:c.string().min(1).optional()}).strict(),T9e=c.object({target:c.string().min(1).optional(),truncated:c.boolean().optional(),continuation:gle.optional()}).passthrough(),H9e=c.enum(["auto","review","approve"]);var U9e=c.object({auth:c.object({user:c.object({email:c.string().nullable().optional(),emailVerified:c.boolean().optional(),name:c.string().nullable().optional()}).strict()}).strict(),pluginName:he}).strict(),mle=c.string().regex(/^[a-z][a-z0-9-]*$/),fle=c.string().regex(/^[a-z][a-z0-9.-]*$/),ble=c.union([c.literal("read"),c.literal("write")]),NH=c.object({provider:mle,scope:he.optional(),type:c.literal("oauth")}).strict(),RH=c.object({displayName:he.optional(),handle:he.optional(),id:he,label:he.optional(),url:he.optional()}).strict(),q9e=c.object({account:RH.optional(),accessToken:he,expiresAt:c.number().finite().optional(),refreshToken:he,refreshTokenExpiresAt:c.number().finite().optional(),scope:he.optional()}).strict(),z9e=c.object({access:ble,leaseScope:he.optional(),name:fle,reason:he.optional(),requirements:c.array(he).min(1).optional()}).strict(),hle=c.object({domain:c.string().min(1),headers:c.record(c.string(),c.string()).refine(e=>Object.keys(e).length>0)}).strict(),Ble=c.object({account:RH.optional(),authorization:NH.optional(),expiresAt:c.string().refine(e=>Number.isFinite(Date.parse(e))),headerTransforms:c.array(hle).min(1)}).strict(),K9e=c.discriminatedUnion("type",[c.object({lease:Ble,type:c.literal("lease")}).strict(),c.object({authorization:NH.optional(),message:he,type:c.literal("needed")}).strict(),c.object({message:he,type:c.literal("unavailable")}).strict()]);var yle=he.max(64).regex(/^[a-z][a-z0-9-]*$/),Cle=he.max(80),wle=he.max(500),Ele=c.enum(["primary","profile"]),kle=c.object({detail:he.max(500).optional(),label:he.max(80),tone:c.enum(["good","neutral","warning"]).optional(),value:he.max(120)}).strict(),Qle=c.object({label:he.max(80),value:he.max(500)}).strict(),Ile=c.object({confirmation:he.max(500).optional(),href:he.max(500).regex(/^\/api\/plugins\/[a-z][a-z0-9-]*(?:\/|$)/),label:he.max(80),method:c.literal("DELETE"),tone:c.enum(["danger","neutral"]).optional()}).strict(),vle=c.object({actions:c.array(Ile).max(4).optional(),description:he.max(1e3).optional(),id:he.max(128),metadata:c.array(Qle).max(8).optional(),title:he.max(4e3)}).strict(),J9e=c.object({emptyText:he.max(500).optional(),metrics:c.array(kle).max(6).optional(),nextCursor:he.max(1e3).optional(),records:c.array(vle).max(100),searchPlaceholder:he.max(120).optional(),type:c.literal("list")}).strict(),_le=c.object({description:wle,id:yle,label:Cle,navigation:Ele,pluginDisplayName:he.max(200),pluginName:he.max(100)}).strict(),W9e=c.array(_le),xle=he.max(1e3).optional(),Dle=he.max(64).optional(),Fle=c.string().trim().max(200).optional(),Z9e=c.object({cursor:xle,filter:Dle,limit:c.number().int().min(1).max(50),query:Fle}).strict();var Sle=c.union([c.literal("instruction"),c.literal("context")]),Lle=c.object({authority:Sle,actor:jf.optional()}).strict();var Nle=c.object({type:c.literal("user_message"),role:c.never().optional(),provenance:Lle}).passthrough(),Rle=c.object({type:c.literal("assistant_message"),role:c.never().optional()}).passthrough(),$le=c.object({type:c.literal("tool_result"),role:c.never().optional()}).passthrough(),MH=c.discriminatedUnion("type",[Nle,Rle,$le]),Mle=c.object({item:MH,sourceEventSeq:c.number().int().nonnegative().optional()}).strict(),$H=c.array(Mle),jle=c.object({reason:c.literal("capacity"),estimatedInputTokens:c.number().int().nonnegative(),replacementInputTokens:c.number().int().nonnegative().optional(),triggerTokens:c.number().int().nonnegative(),inputLimitTokens:c.number().int().positive(),inputMessageCount:c.number().int().nonnegative(),retainedMessageCount:c.number().int().nonnegative(),summaryChars:c.number().int().nonnegative()}).strict(),jH=c.discriminatedUnion("type",[c.object({type:c.literal("handoff"),modelProfile:Hw,modelId:c.string().min(1),reasoningLevel:c.string().min(1).optional(),triggeringToolCallId:c.string().min(1).optional(),summary:c.string().min(1).optional(),replacementHistory:$H}).strict(),c.object({type:c.literal("compaction"),modelProfile:Hw,modelId:c.string().min(1),details:jle.optional(),summary:c.string().min(1).optional(),replacementHistory:$H}).strict()]),n6e=c.object({data:jH,createdAtMs:c.number().finite()}).strict(),Ple=c.object({type:c.literal("mcp_provider_connected"),provider:c.string().min(1),credentialSubjectId:c.string().min(1)}).strict(),Tle=c.object({type:c.literal("mcp_provider_connected_unowned"),provider:c.string().min(1)}).strict(),PH=c.union([c.literal("plugin"),c.literal("mcp")]),Hle=c.object({type:c.literal("authorization_requested"),kind:PH,provider:c.string().min(1),actorId:c.string().min(1),authorizationId:c.string().min(1),delivery:c.union([c.literal("private_link_sent"),c.literal("private_link_reused")])}).strict(),Gle=c.object({type:c.literal("authorization_completed"),kind:PH,provider:c.string().min(1),actorId:c.string().min(1),authorizationId:c.string().min(1)}).strict(),Ule=c.object({type:c.literal("tool_execution_started"),toolCallId:c.string().min(1),toolName:c.string().min(1)}).strict(),Ole=c.object({type:c.literal("guardian_action_reviewed"),turnId:c.string().min(1),toolCallId:c.string().min(1),toolName:c.string().min(1),costUsd:c.number().finite().nonnegative().optional(),decision:c.enum(["allow","ask","deny"]),riskLevel:c.enum(["low","medium","high","critical"]),userAuthorization:c.enum(["high","medium","low","unknown"])}).strict(),qle=c.union([c.literal("user"),c.literal("assistant"),c.literal("system")]),TH=c.object({type:c.literal("message"),messageId:c.string().min(1),role:qle,text:c.string(),authorIdentityId:c.string().min(1).optional(),meta:c.record(c.string(),c.unknown()).optional()}).strict(),zle=TH.extend({type:c.literal("message_updated")}),Kle=c.object({type:c.literal("message_handled"),messageId:c.string().min(1)}).strict(),Yle=c.object({type:c.literal("messages_summarized"),historyFromSeq:c.number().int().nonnegative(),compactions:c.array(c.object({coveredMessageCount:c.number().int().nonnegative(),createdAtMs:c.number(),id:c.string().min(1),summary:c.string()}).strict())}).strict(),Jle=c.enum(["slack","api","scheduler","internal"]),S8=c.enum(["agent_run_failed","delivery_failed","model_execution_failed","persistence_failed"]),L8=c.enum(["auth","permission","rate_limit","capacity","timeout","network","server","invalid_request","invalid_response","quota","content_policy","unknown","empty_output","tool_errors","suppressed_output"]),Wle=c.object({type:c.literal("turn_started"),turnId:c.string().min(1),inputMessageIds:c.array(c.string().min(1)).min(1),surface:Jle}).strict().refine(e=>new Set(e.inputMessageIds).size===e.inputMessageIds.length,"turn input message ids must be unique"),Zle=c.object({type:c.literal("turn_routed"),turnId:c.string().min(1),modelProfile:Hw,modelId:c.string().min(1),costUsd:c.number().finite().nonnegative().optional(),reasoningLevel:c.enum(kH),confidence:c.number().min(0).max(1).optional(),source:c.enum(["configured","inherited","router"])}).strict(),Vle=c.object({type:c.literal("turn_context"),turnId:c.string().min(1),pluginName:c.string().min(1),kind:c.string().min(1).max(64),version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict(),Xle=c.object({type:c.literal("structured_event"),namespace:c.string().regex(/^[a-z][a-z0-9-]*$/),name:c.string().regex(/^[a-z][a-z0-9_]*$/),version:c.number().int().positive(),turnId:c.string().min(1).optional(),content:c.record(c.string(),c.unknown())}).strict(),epe=c.object({id:c.string().min(1),filename:c.string().min(1),contentType:c.string().min(1),bytes:c.number().int().nonnegative()}).strict(),tpe=c.object({type:c.literal("attachments_delivered"),attachments:c.array(epe).min(1),toolCallId:c.string().min(1).optional(),turnId:c.string().min(1).optional()}).strict(),npe=c.object({type:c.literal("turn_completed"),turnId:c.string().min(1),outcome:c.enum(["success","no_reply","cancelled"])}).strict(),ape=c.object({type:c.literal("turn_failed"),turnId:c.string().min(1),failureCode:S8,failureReason:L8.optional(),eventId:c.string().regex(/^[a-f0-9]{32}$/i).optional()}).strict(),rpe=c.object({type:c.literal("subagent_started"),subagentInvocationId:c.string().min(1),subagentKind:c.string().min(1),modelId:c.string().min(1).optional(),parentToolCallId:c.string().min(1).optional(),reasoningLevel:c.string().min(1).optional(),childConversationId:c.string().min(1)}).strict(),ope=c.object({type:c.literal("subagent_ended"),subagentInvocationId:c.string().min(1),outcome:c.union([c.literal("success"),c.literal("error"),c.literal("aborted")]),errorCode:c.string().min(1).optional()}).strict(),HH=c.union([TH,zle,MH,Ple,Hle,Gle,Ule,Ole,Kle,Yle,Wle,Vle,Xle,tpe,Zle,npe,ape,rpe,ope]),ipe=c.union([HH,jH,Tle]),Ape=["message","message_updated","user_message","assistant_message","tool_result","mcp_provider_connected","mcp_provider_connected_unowned","authorization_requested","authorization_completed","tool_execution_started","guardian_action_reviewed","message_handled","messages_summarized","turn_started","turn_context","structured_event","attachments_delivered","turn_routed","turn_completed","turn_failed","subagent_started","subagent_ended","handoff","compaction"],a6e=c.enum(Ape),spe=c.object({type:c.literal("unknown"),originalType:c.string().min(1),payload:c.unknown()}).strict(),F8=c.object({schemaVersion:c.number().int().nonnegative(),seq:c.number().int().nonnegative(),historyVersion:c.number().int().nonnegative(),idempotencyKey:c.string().min(1).optional(),createdAtMs:c.number().finite()}).strict(),r6e=c.union([F8.extend({schemaVersion:c.literal(1),data:ipe}),F8.extend({data:spe})]),o6e=F8.extend({type:c.string().min(1),payload:c.unknown()});var i6e=c.object({data:HH,idempotencyKey:c.string().min(1).optional(),createdAtMs:c.number().finite()}).strict(),cpe=c.object({input:c.number().finite().nonnegative().optional(),output:c.number().finite().nonnegative().optional(),cacheRead:c.number().finite().nonnegative().optional(),cacheWrite:c.number().finite().nonnegative().optional(),total:c.number().finite().nonnegative().optional()}).strict(),upe=c.object({inputTokens:c.number().int().nonnegative().optional(),outputTokens:c.number().int().nonnegative().optional(),cachedInputTokens:c.number().int().nonnegative().optional(),cacheCreationTokens:c.number().int().nonnegative().optional(),reasoningTokens:c.number().int().nonnegative().optional(),totalTokens:c.number().int().nonnegative().optional(),cost:cpe.optional()}).strict(),Za=c.string().trim().min(1).max(400),N8=c.string().url().max(2048),Tf=c.string().datetime(),GH=c.object({provider:c.string().trim().min(1).max(100),channelName:Za.optional()}).strict(),dpe=c.enum(["in_progress","answered","done","partial","blocked","abandoned"]),UH=c.object({repository:Za,number:c.number().int().positive(),title:Za.optional(),url:N8,state:Pf,openedAt:Tf.optional(),mergedAt:Tf.optional(),closedAt:Tf.optional()}).strict(),lpe=c.object({kind:c.enum(["code_change","resource","url"]),label:Za,url:N8,status:Za.optional()}).strict(),ppe=c.object({startedAt:Tf,lastActivityAt:Tf,durationMs:c.number().int().nonnegative(),participants:c.array(c.object({name:Za,messages:c.number().int().positive()}).strict()),userMessages:c.number().int().nonnegative(),assistantMessages:c.number().int().nonnegative(),toolResults:c.number().int().nonnegative(),events:c.number().int().nonnegative(),turns:c.number().int().positive().optional(),location:GH.optional(),codeChanges:c.array(UH)}).strict(),gpe=c.object({schemaVersion:c.literal(1),record:ppe,summary:c.string().trim().min(1).max(600),intent:Za,outcome:c.object({status:dpe,text:c.string().trim().min(1).max(600)}).strict(),decisions:c.array(c.object({text:Za,by:Za.optional(),kind:c.enum(["stated","confirmed","assumed"])}).strict()).max(20),openDecisions:c.array(c.object({text:Za,owner:Za.optional()}).strict()).max(20),facts:c.array(Za).max(30),links:c.array(lpe).max(40),keywords:c.array(c.string().trim().toLowerCase().min(1).max(400)).max(12)}).strict(),mpe=c.object({index:c.number().int().nonnegative(),role:c.enum(["user","assistant","tool","event"]),author:Za.optional(),text:c.string().min(1),createdAtMs:c.number().int().nonnegative(),turnId:c.string().min(1).optional()}).strict(),fpe=c.object({label:Za,url:N8,status:Za.optional()}).strict(),A6e=c.object({conversationId:c.string().min(1),title:Za.optional(),visibility:c.enum(["private","public"]),location:GH.optional(),entries:c.array(mpe),codeChanges:c.array(UH),resources:c.array(fpe)}).strict();var bpe=c.enum(["active","completed","failed"]),hpe=c.enum(["api","internal","scheduler","slack"]),OH=upe,Bpe=c.object({conversationId:c.string().min(1)}).strict(),s6e=c.object({attachmentId:c.string().min(1),conversationId:c.string().min(1)}).strict(),ype=c.object({limit:c.coerce.number().int().min(1).max(1e3).default(500)}).strict(),Cpe=c.object({before:c.string().min(1),limit:c.coerce.number().int().min(1).max(1e3).default(500)}).strict(),wpe=c.object({actorEmail:c.string().trim().email().transform(e=>e.toLowerCase()).optional(),q:c.string().trim().max(200).optional(),status:c.enum(["active","archived"]).default("active")}).strict(),Epe=c.object({archived:c.boolean(),lastSeenAt:c.string().datetime()}).strict(),R8=c.object({archivedAt:c.string().datetime().nullable()}).strict(),kpe=c.object({idempotencyKey:c.string().trim().min(1).max(200),message:c.string().trim().min(1).max(32e3),visibility:c.enum(["private","public"]).optional()}).strict(),Qpe=c.object({idempotencyKey:c.string().trim().min(1).max(200),message:c.string().trim().min(1).max(32e3)}).strict(),Ow=c.object({conversationId:c.string().min(1),messageId:c.string().min(1),status:c.enum(["accepted","duplicate"])}).strict(),xp=c.object({email:c.string().optional(),fullName:c.string().optional(),slackUserId:c.string().optional(),slackUserName:c.string().optional()}).strict(),qH=c.enum(["defer","interrupt"]),zH=c.object({actorIdentity:xp.optional(),createdAt:c.string().datetime(),delivery:qH,inboundMessageId:c.string().min(1),messageId:c.string().min(1),receivedAt:c.string().datetime(),role:c.literal("user"),source:c.enum(["slack","web"]),text:c.string().optional(),redacted:c.literal(!0).optional()}).strict().superRefine((e,t)=>{e.text===void 0==(e.redacted!==!0)&&t.addIssue({code:"custom",message:"pending message content must be text or explicitly redacted"}),e.redacted&&e.actorIdentity&&t.addIssue({code:"custom",message:"redacted pending messages must not expose actor identity"})}),KH=c.object({authorizationUrl:c.string().url(),completionText:c.string().min(1),label:c.string().min(1)}).strict(),$8=c.object({authorization:KH.optional(),conversationId:c.string().min(1),generatedAt:c.string().datetime(),messages:c.array(zH)}).strict(),Ipe=c.object({inboundMessageIds:c.array(c.string().min(1)).min(1).optional(),receivedBefore:c.string().datetime().optional()}).strict(),M8=c.object({cancelledCount:c.number().int().nonnegative(),cancelledInboundMessageIds:c.array(c.string().min(1)),conversationId:c.string().min(1)}).strict(),YH=c.object({costUsd:c.number().finite().nonnegative(),operations:c.array(c.object({costUsd:c.number().finite().nonnegative(),events:c.number().int().positive(),name:c.string().min(1),namespace:c.string().min(1)}).strict()).min(1)}).strict(),vpe=c.object({id:c.string().min(1).optional(),kind:c.enum(["scheduled","event"]),label:c.string().min(1).optional(),title:c.string().min(1).optional()}).strict().superRefine((e,t)=>{!!e.id!=!!e.label&&t.addIssue({code:"custom",message:"sourceTask id and label must both be set or both omitted"})}),_pe=IH.and(c.object({plugin:c.string().min(1),createdAt:c.string().datetime(),updatedAt:c.string().datetime()})),JH=c.object({createdAt:c.string().datetime(),role:c.enum(["assistant","user"]),text:c.string().min(1)}).strict(),Dp=c.object({displayTitle:c.string(),activityPreview:JH.optional(),cumulativeDurationMs:c.number(),cumulativeUsage:OH.optional(),auxiliaryCosts:YH.optional(),conversationId:c.string(),isParticipant:c.boolean(),visibility:c.enum(["private","public"]).optional(),status:bpe,startedAt:c.string(),lastSeenAt:c.string(),lastProgressAt:c.string(),surface:hpe,actorIdentity:xp.optional(),archivedAt:c.string().datetime().nullable().optional(),channel:c.string().optional(),channelName:c.string().optional(),channelNameRedacted:c.boolean().optional(),locationId:c.string().optional(),sentryTraceUrl:c.string().optional(),locationUrl:c.string().url().optional(),traceId:c.string().optional(),annotations:c.array(_pe).optional(),sidebarAnnotations:c.array(vH).optional(),assignedWork:c.boolean().optional(),finishedWorkAt:c.string().datetime().optional(),isPriority:c.boolean().optional(),unfinishedWork:c.boolean().optional()}).strict(),xpe=c.object({type:c.literal("message"),messageId:c.string().min(1),role:c.enum(["assistant","system","user"]),source:c.enum(["slack","web"]).optional(),actorIdentity:xp.optional(),eventType:c.string().min(1).optional(),explicitMention:c.boolean().optional(),trustedSummary:c.string().min(1).optional(),text:c.string().optional(),redacted:c.literal(!0).optional()}).strict().superRefine((e,t)=>{e.text===void 0==(e.redacted!==!0)&&t.addIssue({code:"custom",message:"message content must be text or explicitly redacted"}),e.redacted&&e.actorIdentity&&t.addIssue({code:"custom",message:"redacted messages must not expose actor identity"})}),Dpe=c.object({type:c.literal("message_handled"),messageId:c.string().min(1)}).strict(),Fpe=c.object({toolCallId:c.string().min(1),name:c.string().min(1),status:c.enum(["running","completed","error"]),startedAt:c.string().datetime().optional(),startedSeq:c.number().int().nonnegative().optional(),input:c.unknown().optional(),output:c.unknown().optional()}).strict().superRefine((e,t)=>{e.startedAt===void 0!=(e.startedSeq===void 0)&&t.addIssue({code:"custom",message:"tool start sequence and timestamp must be provided together"})}),WH=c.object({type:c.literal("reasoning"),text:c.string().min(1).optional(),redacted:c.literal(!0).optional()}).strict().superRefine((e,t)=>{e.text===void 0==(e.redacted!==!0)&&t.addIssue({code:"custom",message:"reasoning content must be text or explicitly redacted"})}),Spe=c.object({type:c.literal("tool_call"),toolCallId:c.string().min(1)}).strict(),Lpe=c.object({parts:c.array(c.discriminatedUnion("type",[WH,Spe])).min(1)}).strict(),Npe=c.object({type:c.literal("tool_calls"),calls:c.array(Fpe).min(1),assistant:Lpe.optional()}).strict().superRefine((e,t)=>{if(!e.assistant)return;let n=new Map;for(let a of e.calls)n.set(a.toolCallId,(n.get(a.toolCallId)??0)+1);let r=new Map;for(let a of e.assistant.parts)a.type==="tool_call"&&r.set(a.toolCallId,(r.get(a.toolCallId)??0)+1);(n.size!==r.size||[...n].some(([a,o])=>r.get(a)!==o))&&t.addIssue({code:"custom",path:["assistant","parts"],message:"assistant tool parts must reference every call exactly once"})}),Rpe=c.object({type:c.literal("assistant_message"),parts:c.array(WH).min(1)}).strict(),$pe=c.discriminatedUnion("state",[c.object({type:c.literal("turn_lifecycle"),turnId:c.string().min(1),state:c.enum(["succeeded","no_reply"])}).strict(),c.object({type:c.literal("turn_lifecycle"),turnId:c.string().min(1),state:c.literal("started"),inputMessageIds:c.array(c.string().min(1)).min(1).optional()}).strict(),c.object({type:c.literal("turn_lifecycle"),turnId:c.string().min(1),state:c.literal("failed"),failureCode:S8,failureReason:L8.optional(),eventId:c.string().regex(/^[a-f0-9]{32}$/i).optional(),sentryEventUrl:c.string().url().optional()}).strict()]),Mpe=c.object({type:c.literal("turn_routed"),turnId:c.string().min(1),modelProfile:c.string().min(1),modelId:c.string().min(1),costUsd:c.number().finite().nonnegative().optional(),reasoningLevel:c.string().min(1),confidence:c.number().min(0).max(1).optional(),source:c.enum(["configured","inherited","router"])}).strict(),jpe=c.object({type:c.literal("guardian_action_reviewed"),turnId:c.string().min(1),toolCallId:c.string().min(1),toolName:c.string().min(1),decision:c.enum(["allow","ask","deny"]),riskLevel:c.enum(["low","medium","high","critical"]),userAuthorization:c.enum(["high","medium","low","unknown"])}).strict(),Ppe=c.object({type:c.literal("turn_context"),turnId:c.string().min(1),pluginName:c.string().min(1),kind:c.string().min(1),version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict(),Tpe=c.object({type:c.literal("structured_event"),namespace:c.string().min(1),name:c.string().min(1),version:c.number().int().positive(),turnId:c.string().min(1).optional(),presentation:_H}).strict(),Hpe=c.object({id:c.string().min(1),filename:c.string().min(1),contentType:c.string().min(1),bytes:c.number().int().nonnegative()}).strict(),Gpe=c.object({type:c.literal("attachments_delivered"),attachments:c.array(Hpe).min(1)}).strict(),Upe=c.object({type:c.literal("compaction"),modelProfile:c.string().min(1).optional(),modelId:c.string().min(1).optional(),summary:c.string().min(1).optional(),details:c.object({reason:c.literal("capacity"),estimatedInputTokens:c.number().int().nonnegative(),replacementInputTokens:c.number().int().nonnegative().optional(),triggerTokens:c.number().int().nonnegative(),inputLimitTokens:c.number().int().positive(),inputMessageCount:c.number().int().nonnegative(),retainedMessageCount:c.number().int().nonnegative(),summaryChars:c.number().int().nonnegative()}).strict().optional()}).strict(),Ope=c.object({type:c.literal("handoff"),modelProfile:c.string().min(1),modelId:c.string().min(1),reasoningLevel:c.string().min(1).optional(),triggeringToolCallId:c.string().min(1).optional(),summary:c.string().min(1).optional()}).strict(),qpe=c.object({type:c.literal("subagent"),startedSeq:c.number().int().nonnegative(),startedAt:c.string().datetime(),childConversationId:c.string().min(1),subagentKind:c.string().min(1),parentToolCallId:c.string().min(1).optional(),status:c.enum(["running","completed","error","aborted"])}).strict(),ZH=c.discriminatedUnion("type",[xpe,Dpe,Rpe,Npe,$pe,Ppe,Tpe,Gpe,Mpe,jpe,Upe,Ope,qpe]),j8=c.object({seq:c.number().int().nonnegative(),createdAt:c.string().datetime(),data:ZH}).strict(),P8=c.discriminatedUnion("status",[c.object({status:c.literal("available")}).strict(),c.object({status:c.literal("redacted"),reason:c.literal("non_public_conversation")}).strict(),c.object({status:c.literal("expired"),expiredAt:c.string().datetime()}).strict()]),zpe=c.object({modelId:c.string(),usage:OH}).strict();function VH(e,t){e.eventHistory.status==="expired"&&e.events.length>0&&t.addIssue({code:"custom",path:["events"],message:"expired event history must not contain events"});for(let n=1;n<e.events.length;n+=1)e.events[n].seq<=e.events[n-1].seq&&t.addIssue({code:"custom",path:["events",n,"seq"],message:"report event sequences must be strictly increasing"});for(let[n,r]of e.events.entries())r.data.type==="message"&&(e.eventHistory.status==="redacted"&&r.data.redacted!==!0&&t.addIssue({code:"custom",path:["events",n,"data"],message:"redacted event history must redact messages"}),e.eventHistory.status==="available"&&r.data.redacted===!0&&t.addIssue({code:"custom",path:["events",n,"data"],message:"available event history must expose messages"})),e.eventHistory.status==="redacted"&&r.data.type==="tool_calls"&&r.data.calls.some(a=>a.input!==void 0||a.output!==void 0)&&t.addIssue({code:"custom",path:["events",n,"data"],message:"redacted event history must redact tool payloads"}),e.eventHistory.status==="redacted"&&r.data.type==="assistant_message"&&r.data.parts.some(a=>a.text!==void 0)&&t.addIssue({code:"custom",path:["events",n,"data"],message:"redacted event history must redact assistant messages"}),e.eventHistory.status==="available"&&r.data.type==="assistant_message"&&r.data.parts.some(a=>a.redacted===!0)&&t.addIssue({code:"custom",path:["events",n,"data"],message:"available event history must expose reasoning"}),r.data.type==="tool_calls"&&(e.eventHistory.status==="redacted"&&r.data.assistant?.parts.some(a=>a.type==="reasoning"&&a.text!==void 0)||e.eventHistory.status==="available"&&r.data.assistant?.parts.some(a=>a.type==="reasoning"&&a.redacted===!0))&&t.addIssue({code:"custom",path:["events",n,"data","assistant"],message:"assistant reasoning must match event history visibility"})}var T8=Dp.extend({brief:c.object({content:gpe,updatedAt:c.string().datetime(),version:c.number().int().positive()}).strict().optional(),modelUsage:c.array(zpe).optional(),events:c.array(j8),eventHistory:P8,previousCursor:c.string().min(1).optional(),generatedAt:c.string(),sentryConversationUrl:c.string().optional(),sourceTask:vpe.optional()}).strict().superRefine(VH),H8=c.object({events:c.array(j8),eventHistory:P8,previousCursor:c.string().min(1).optional(),generatedAt:c.string()}).strict().superRefine(VH),G8=c.object({conversations:c.array(Dp),source:c.literal("conversation_index"),generatedAt:c.string()}).strict(),Zu=c.object({active:c.number(),conversations:c.number(),durationMs:c.number(),failed:c.number(),label:c.string(),costUsd:c.number().optional(),tokens:c.number().optional()}).strict(),XH=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),x8=c.object({cachedInputTokens:c.number().optional(),conversations:c.number(),costUsd:c.number().optional(),date:XH,durationMs:c.number(),inputTokens:c.number().optional(),tokens:c.number().optional()}).strict(),D8=c.object({allow:c.number(),ask:c.number(),costUsd:c.number().optional(),date:XH,deny:c.number(),requests:c.number()}).strict(),Kpe=c.object({allow:c.number(),ask:c.number(),costUsd:c.number().optional(),deny:c.number(),metricDays:c.array(D8),metricHours:c.array(D8).optional(),metricSixHours:c.array(D8).optional(),requests:c.number()}).strict(),U8=c.object({active:c.number(),cachedInputTokens:c.number().optional(),conversations:c.number(),durationMs:c.number(),failed:c.number(),generatedAt:c.string(),guardian:Kpe,metricDays:c.array(x8),metricHours:c.array(x8).optional(),metricSixHours:c.array(x8).optional(),locations:c.array(Zu),actors:c.array(Zu),source:c.literal("conversation_index"),costUsd:c.number().optional(),inputTokens:c.number().optional(),tokens:c.number().optional(),windowEnd:c.string(),windowStart:c.string()}).strict();var Ype=c.object({status:c.literal("ok"),service:c.string(),timestamp:c.string()}).strict(),eG=c.object({configKeys:c.array(c.string()),description:c.string(),displayName:c.string(),name:c.string()}).strict(),O8=c.array(eG),q8=c.object({name:c.string(),pluginProvider:c.string().optional()}).strict(),z8=c.array(q8),tG=c.object({dir:c.string(),hasMigrationsDir:c.boolean(),hasSkillsDir:c.boolean(),packageName:c.string()}).strict(),nG=c.object({packageNames:c.array(c.string()),packages:c.array(tG),manifestRoots:c.array(c.string()),skillRoots:c.array(c.string()),tracingIncludes:c.array(c.string())}).strict(),Jpe=c.object({cwd:c.string(),homeDir:c.string(),descriptionText:c.string().optional(),providers:c.array(c.string()),skills:c.array(q8),packagedContent:nG}).strict(),K8=c.enum(["danger","good","neutral","warning"]),Wpe=c.object({label:c.string(),tone:K8.optional(),value:c.string()}).strict(),Zpe=c.object({key:c.string(),label:c.string()}).strict(),Vpe=c.object({id:c.string(),tone:K8.optional(),values:c.record(c.string(),c.string())}).strict(),Xpe=c.object({fields:c.array(Zpe).optional(),emptyText:c.string().optional(),records:c.array(Vpe).optional(),title:c.string()}).strict(),ege=c.object({categories:c.array(c.object({id:c.string().min(1),label:c.string().min(1),values:c.record(c.string(),c.number().finite())}).strict()).max(100),description:c.string().optional(),emptyText:c.string().optional(),id:c.string().min(1),series:c.array(c.object({format:c.literal("usd").optional(),key:c.string().min(1),label:c.string().min(1),tone:K8.optional()}).strict()).min(1).max(8),timeRangeDays:c.array(c.union([c.literal(1),c.literal(7),c.literal(30),c.literal(90)])).min(1).max(4).optional(),title:c.string().min(1),type:c.literal("bar_chart")}).strict(),aG=c.object({generatedAt:c.string().optional(),metrics:c.array(Wpe).optional(),recordSets:c.array(Xpe).optional(),title:c.string().optional(),pluginName:c.string(),widgets:c.array(ege).max(12).optional()}).strict(),qw=c.object({generatedAt:c.string(),reports:c.array(aG),source:c.literal("plugins")}).strict();var D=Symbol.for("drizzle:entityKind");function Un(e,t){if(!e||typeof e!="object")return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,D))throw new Error(`Class "${t.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let n=Object.getPrototypeOf(e).constructor;if(n)for(;n;){if(D in n&&n[D]===t[D])return!0;n=Object.getPrototypeOf(n)}return!1}var Vu=class{constructor(t,n){this.table=t,this.config=n,this.name=n.name,this.keyAsName=n.keyAsName,this.notNull=n.notNull,this.default=n.default,this.defaultFn=n.defaultFn,this.onUpdateFn=n.onUpdateFn,this.hasDefault=n.hasDefault,this.primary=n.primaryKey,this.isUnique=n.isUnique,this.uniqueName=n.uniqueName,this.uniqueType=n.uniqueType,this.dataType=n.dataType,this.columnType=n.columnType,this.generated=n.generated,this.generatedIdentity=n.generatedIdentity}static[D]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(t){return t}mapToDriverValue(t){return t}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}};var zw=class{static[D]="ColumnBuilder";config;constructor(t,n,r){this.config={name:t,keyAsName:t==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:n,columnType:r,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(t){return this.config.default=t,this.config.hasDefault=!0,this}$defaultFn(t){return this.config.defaultFn=t,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(t){return this.config.onUpdateFn=t,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(t){this.config.name===""&&(this.config.name=t)}};var hs=Symbol.for("drizzle:Name");var Kw=class{static[D]="PgForeignKeyBuilder";reference;_onUpdate="no action";_onDelete="no action";constructor(t,n){this.reference=()=>{let{name:r,columns:a,foreignColumns:o}=t();return{name:r,columns:a,foreignTable:o[0].table,foreignColumns:o}},n&&(this._onUpdate=n.onUpdate,this._onDelete=n.onDelete)}onUpdate(t){return this._onUpdate=t===void 0?"no action":t,this}onDelete(t){return this._onDelete=t===void 0?"no action":t,this}build(t){return new Y8(t,this)}},Y8=class{constructor(t,n){this.table=t,this.reference=n.reference,this.onUpdate=n._onUpdate,this.onDelete=n._onDelete}static[D]="PgForeignKey";reference;onUpdate;onDelete;getName(){let{name:t,columns:n,foreignColumns:r}=this.reference(),a=n.map(A=>A.name),o=r.map(A=>A.name),i=[this.table[hs],...a,r[0].table[hs],...o];return t??`${i.join("_")}_fk`}};function Yw(e,...t){return e(...t)}function Z8(e,t){return`${e[hs]}_${t.join("_")}_unique`}var J8=class{constructor(t,n){this.name=n,this.columns=t}static[D]="PgUniqueConstraintBuilder";columns;nullsNotDistinctConfig=!1;nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(t){return new W8(t,this.columns,this.nullsNotDistinctConfig,this.name)}},rG=class{static[D]="PgUniqueOnConstraintBuilder";name;constructor(t){this.name=t}on(...t){return new J8(t,this.name)}},W8=class{constructor(t,n,r,a){this.table=t,this.columns=n,this.name=a??Z8(this.table,this.columns.map(o=>o.name)),this.nullsNotDistinct=r}static[D]="PgUniqueConstraint";columns;name;nullsNotDistinct=!1;getName(){return this.name}};function oG(e,t,n){for(let r=t;r<e.length;r++){let a=e[r];if(a==="\\"){r++;continue}if(a==='"')return[e.slice(t,r).replace(/\\/g,""),r+1];if(!n&&(a===","||a==="}"))return[e.slice(t,r).replace(/\\/g,""),r]}return[e.slice(t).replace(/\\/g,""),e.length]}function iG(e,t=0){let n=[],r=t,a=!1;for(;r<e.length;){let o=e[r];if(o===","){(a||r===t)&&n.push(""),a=!0,r++;continue}if(a=!1,o==="\\"){r+=2;continue}if(o==='"'){let[s,u]=oG(e,r+1,!0);n.push(s),r=u;continue}if(o==="}")return[n,r+1];if(o==="{"){let[s,u]=iG(e,r+1);n.push(s),r=u;continue}let[i,A]=oG(e,r,!1);n.push(i),r=A}return[n,r]}function AG(e){let[t]=iG(e,1);return t}function V8(e){return`{${e.map(t=>Array.isArray(t)?V8(t):typeof t=="string"?`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:`${t}`).join(",")}}`}var ee=class extends zw{foreignKeyConfigs=[];static[D]="PgColumnBuilder";array(t){return new e2(this.config.name,this,t)}references(t,n={}){return this.foreignKeyConfigs.push({ref:t,actions:n}),this}unique(t,n){return this.config.isUnique=!0,this.config.uniqueName=t,this.config.uniqueType=n?.nulls,this}generatedAlwaysAs(t){return this.config.generated={as:t,type:"always",mode:"stored"},this}buildForeignKeys(t,n){return this.foreignKeyConfigs.map(({ref:r,actions:a})=>Yw((o,i)=>{let A=new Kw(()=>{let s=o();return{columns:[t],foreignColumns:[s]}});return i.onUpdate&&A.onUpdate(i.onUpdate),i.onDelete&&A.onDelete(i.onDelete),A.build(n)},r,a))}buildExtraConfigColumn(t){return new X8(t,this.config)}},W=class extends Vu{constructor(t,n){n.uniqueName||(n.uniqueName=Z8(t,[n.name])),super(t,n),this.table=t}static[D]="PgColumn"},X8=class extends W{static[D]="ExtraConfigColumn";getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass};defaultConfig={order:"asc",nulls:"last",opClass:void 0};asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op(t){return this.indexConfig.opClass=t,this}},Fp=class{static[D]="IndexedColumn";constructor(t,n,r,a){this.name=t,this.keyAsName=n,this.type=r,this.indexConfig=a}name;keyAsName;type;indexConfig},e2=class extends ee{static[D]="PgArrayBuilder";constructor(t,n,r){super(t,"array","PgArray"),this.config.baseBuilder=n,this.config.size=r}build(t){let n=this.config.baseBuilder.build(t);return new t2(t,this.config,n)}},t2=class e extends W{constructor(t,n,r,a){super(t,n),this.baseColumn=r,this.range=a,this.size=n.size}size;static[D]="PgArray";getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size=="number"?this.size:""}]`}mapFromDriverValue(t){return typeof t=="string"&&(t=AG(t)),t.map(n=>this.baseColumn.mapFromDriverValue(n))}mapToDriverValue(t,n=!1){let r=t.map(a=>a===null?null:Un(this.baseColumn,e)?this.baseColumn.mapToDriverValue(a,!0):this.baseColumn.mapToDriverValue(a));return n?r:V8(r)}};var sG=class extends ee{static[D]="PgEnumObjectColumnBuilder";constructor(t,n){super(t,"string","PgEnumObjectColumn"),this.config.enum=n}build(t){return new n2(t,this.config)}},n2=class extends W{static[D]="PgEnumObjectColumn";enum;enumValues=this.config.enum.enumValues;constructor(t,n){super(t,n),this.enum=n.enum}getSQLType(){return this.enum.enumName}},cG=Symbol.for("drizzle:isPgEnum");function dG(e){return!!e&&typeof e=="function"&&cG in e&&e[cG]===!0}var uG=class extends ee{static[D]="PgEnumColumnBuilder";constructor(t,n){super(t,"string","PgEnumColumn"),this.config.enum=n}build(t){return new a2(t,this.config)}},a2=class extends W{static[D]="PgEnumColumn";enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(t,n){super(t,n),this.enum=n.enum}getSQLType(){return this.enum.enumName}};var Sp=class{static[D]="Subquery";constructor(t,n,r,a=!1,o=[]){this._={brand:"Subquery",sql:t,selectedFields:n,alias:r,isWith:a,usedTables:o}}},lG=class extends Sp{static[D]="WithSubquery"};var pG="0.45.2";var r2,o2,gG={startActiveSpan(e,t){return r2?(o2||(o2=r2.trace.getTracer("drizzle-orm",pG)),Yw((n,r)=>r.startActiveSpan(e,a=>{try{return t(a)}catch(o){throw a.setStatus({code:n.SpanStatusCode.ERROR,message:o instanceof Error?o.message:"Unknown error"}),o}finally{a.end()}}),r2,o2)):t()}};var Lp=Symbol.for("drizzle:ViewBaseConfig");var i2=Symbol.for("drizzle:Schema"),mG=Symbol.for("drizzle:Columns"),fG=Symbol.for("drizzle:ExtraConfigColumns"),A2=Symbol.for("drizzle:OriginalName"),s2=Symbol.for("drizzle:BaseName"),Hf=Symbol.for("drizzle:IsAlias"),bG=Symbol.for("drizzle:ExtraConfigBuilder"),tge=Symbol.for("drizzle:IsDrizzleTable"),vn=class{static[D]="Table";static Symbol={Name:hs,Schema:i2,OriginalName:A2,Columns:mG,ExtraConfigColumns:fG,BaseName:s2,IsAlias:Hf,ExtraConfigBuilder:bG};[hs];[A2];[i2];[mG];[fG];[s2];[Hf]=!1;[tge]=!0;[bG]=void 0;constructor(t,n,r){this[hs]=this[A2]=t,this[i2]=n,this[s2]=r}};var hG=class{static[D]="FakePrimitiveParam"};function nge(e){return e!=null&&typeof e.getSQL=="function"}function age(e){let t={sql:"",params:[]};for(let n of e)t.sql+=n.sql,t.params.push(...n.params),n.typings?.length&&(t.typings||(t.typings=[]),t.typings.push(...n.typings));return t}var fo=class{static[D]="StringChunk";value;constructor(t){this.value=Array.isArray(t)?t:[t]}getSQL(){return new _n([this])}},_n=class e{constructor(t){this.queryChunks=t;for(let n of t)if(Un(n,vn)){let r=n[vn.Symbol.Schema];this.usedTables.push(r===void 0?n[vn.Symbol.Name]:r+"."+n[vn.Symbol.Name])}}static[D]="SQL";decoder=BG;shouldInlineParams=!1;usedTables=[];append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return gG.startActiveSpan("drizzle.buildSQL",n=>{let r=this.buildQueryFromSourceParams(this.queryChunks,t);return n?.setAttributes({"drizzle.query.text":r.sql,"drizzle.query.params":JSON.stringify(r.params)}),r})}buildQueryFromSourceParams(t,n){let r=Object.assign({},n,{inlineParams:n.inlineParams||this.shouldInlineParams,paramStartIndex:n.paramStartIndex||{value:0}}),{casing:a,escapeName:o,escapeParam:i,prepareTyping:A,inlineParams:s,paramStartIndex:u}=r;return age(t.map(d=>{if(Un(d,fo))return{sql:d.value.join(""),params:[]};if(Un(d,Gf))return{sql:o(d.value),params:[]};if(d===void 0)return{sql:"",params:[]};if(Array.isArray(d)){let l=[new fo("(")];for(let[p,g]of d.entries())l.push(g),p<d.length-1&&l.push(new fo(", "));return l.push(new fo(")")),this.buildQueryFromSourceParams(l,r)}if(Un(d,e))return this.buildQueryFromSourceParams(d.queryChunks,{...r,inlineParams:s||d.shouldInlineParams});if(Un(d,vn)){let l=d[vn.Symbol.Schema],p=d[vn.Symbol.Name];return{sql:l===void 0||d[Hf]?o(p):o(l)+"."+o(p),params:[]}}if(Un(d,Vu)){let l=a.getColumnCasing(d);if(n.invokeSource==="indexes")return{sql:o(l),params:[]};let p=d.table[vn.Symbol.Schema];return{sql:d.table[Hf]||p===void 0?o(d.table[vn.Symbol.Name])+"."+o(l):o(p)+"."+o(d.table[vn.Symbol.Name])+"."+o(l),params:[]}}if(Un(d,c2)){let l=d[Lp].schema,p=d[Lp].name;return{sql:l===void 0||d[Lp].isAlias?o(p):o(l)+"."+o(p),params:[]}}if(Un(d,Jw)){if(Un(d.value,Uf))return{sql:i(u.value++,d),params:[d],typings:["none"]};let l=d.value===null?null:d.encoder.mapToDriverValue(d.value);if(Un(l,e))return this.buildQueryFromSourceParams([l],r);if(s)return{sql:this.mapInlineParam(l,r),params:[]};let p=["none"];return A&&(p=[A(d.encoder)]),{sql:i(u.value++,l),params:[l],typings:p}}return Un(d,Uf)?{sql:i(u.value++,d),params:[d],typings:["none"]}:Un(d,e.Aliased)&&d.fieldAlias!==void 0?{sql:o(d.fieldAlias),params:[]}:Un(d,Sp)?d._.isWith?{sql:o(d._.alias),params:[]}:this.buildQueryFromSourceParams([new fo("("),d._.sql,new fo(") "),new Gf(d._.alias)],r):dG(d)?d.schema?{sql:o(d.schema)+"."+o(d.enumName),params:[]}:{sql:o(d.enumName),params:[]}:nge(d)?d.shouldOmitSQLParens?.()?this.buildQueryFromSourceParams([d.getSQL()],r):this.buildQueryFromSourceParams([new fo("("),d.getSQL(),new fo(")")],r):s?{sql:this.mapInlineParam(d,r),params:[]}:{sql:i(u.value++,d),params:[d],typings:["none"]}}))}mapInlineParam(t,{escapeString:n}){if(t===null)return"null";if(typeof t=="number"||typeof t=="boolean")return t.toString();if(typeof t=="string")return n(t);if(typeof t=="object"){let r=t.toString();return n(r==="[object Object]"?JSON.stringify(t):r)}throw new Error("Unexpected param value: "+t)}getSQL(){return this}as(t){return t===void 0?this:new e.Aliased(this,t)}mapWith(t){return this.decoder=typeof t=="function"?{mapFromDriverValue:t}:t,this}inlineParams(){return this.shouldInlineParams=!0,this}if(t){return t?this:void 0}},Gf=class{constructor(t){this.value=t}static[D]="Name";brand;getSQL(){return new _n([this])}};var BG={mapFromDriverValue:e=>e},yG={mapToDriverValue:e=>e},eLe={...BG,...yG},Jw=class{constructor(t,n=yG){this.value=t,this.encoder=n}static[D]="Param";brand;getSQL(){return new _n([this])}};function Np(e,...t){let n=[];(t.length>0||e.length>0&&e[0]!=="")&&n.push(new fo(e[0]));for(let[r,a]of t.entries())n.push(a,new fo(e[r+1]));return new _n(n)}(e=>{function t(){return new _n([])}e.empty=t;function n(s){return new _n(s)}e.fromList=n;function r(s){return new _n([new fo(s)])}e.raw=r;function a(s,u){let d=[];for(let[l,p]of s.entries())l>0&&u!==void 0&&d.push(u),d.push(p);return new _n(d)}e.join=a;function o(s){return new Gf(s)}e.identifier=o;function i(s){return new Uf(s)}e.placeholder=i;function A(s,u){return new Jw(s,u)}e.param=A})(Np||(Np={}));(e=>{class t{constructor(r,a){this.sql=r,this.fieldAlias=a}static[D]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new t(this.sql,this.fieldAlias)}}e.Aliased=t})(_n||(_n={}));var Uf=class{constructor(t){this.name=t}static[D]="Placeholder";getSQL(){return new _n([this])}};var rge=Symbol.for("drizzle:IsDrizzleView"),c2=class{static[D]="View";[Lp];[rge]=!0;constructor({name:t,schema:n,selectedFields:r,query:a}){this[Lp]={name:t,originalName:t,schema:n,selectedFields:r,query:a,isExisting:!a,isAlias:!1}}getSQL(){return new _n([this])}};Vu.prototype.getSQL=function(){return new _n([this])};vn.prototype.getSQL=function(){return new _n([this])};Sp.prototype.getSQL=function(){return new _n([this])};function We(e,t){return{name:typeof e=="string"&&e.length>0?e:"",config:typeof e=="object"?e:t}}var nLe=typeof TextDecoder>"u"?null:new TextDecoder;var Bs=class extends ee{static[D]="PgIntColumnBaseBuilder";generatedAlwaysAsIdentity(t){if(t){let{name:n,...r}=t;this.config.generatedIdentity={type:"always",sequenceName:n,sequenceOptions:r}}else this.config.generatedIdentity={type:"always"};return this.config.hasDefault=!0,this.config.notNull=!0,this}generatedByDefaultAsIdentity(t){if(t){let{name:n,...r}=t;this.config.generatedIdentity={type:"byDefault",sequenceName:n,sequenceOptions:r}}else this.config.generatedIdentity={type:"byDefault"};return this.config.hasDefault=!0,this.config.notNull=!0,this}};var u2=class extends Bs{static[D]="PgBigInt53Builder";constructor(t){super(t,"number","PgBigInt53")}build(t){return new d2(t,this.config)}},d2=class extends W{static[D]="PgBigInt53";getSQLType(){return"bigint"}mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}},l2=class extends Bs{static[D]="PgBigInt64Builder";constructor(t){super(t,"bigint","PgBigInt64")}build(t){return new p2(t,this.config)}},p2=class extends W{static[D]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(t){return BigInt(t)}};function CG(e,t){let{name:n,config:r}=We(e,t);return r.mode==="number"?new u2(n):new l2(n)}var g2=class extends ee{static[D]="PgBigSerial53Builder";constructor(t){super(t,"number","PgBigSerial53"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new m2(t,this.config)}},m2=class extends W{static[D]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}},f2=class extends ee{static[D]="PgBigSerial64Builder";constructor(t){super(t,"bigint","PgBigSerial64"),this.config.hasDefault=!0}build(t){return new b2(t,this.config)}},b2=class extends W{static[D]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(t){return BigInt(t)}};function wG(e,t){let{name:n,config:r}=We(e,t);return r.mode==="number"?new g2(n):new f2(n)}var h2=class extends ee{static[D]="PgBooleanBuilder";constructor(t){super(t,"boolean","PgBoolean")}build(t){return new B2(t,this.config)}},B2=class extends W{static[D]="PgBoolean";getSQLType(){return"boolean"}};function EG(e){return new h2(e??"")}var y2=class extends ee{static[D]="PgCharBuilder";constructor(t,n){super(t,"string","PgChar"),this.config.length=n.length,this.config.enumValues=n.enum}build(t){return new C2(t,this.config)}},C2=class extends W{static[D]="PgChar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"char":`char(${this.length})`}};function kG(e,t={}){let{name:n,config:r}=We(e,t);return new y2(n,r)}var w2=class extends ee{static[D]="PgCidrBuilder";constructor(t){super(t,"string","PgCidr")}build(t){return new E2(t,this.config)}},E2=class extends W{static[D]="PgCidr";getSQLType(){return"cidr"}};function QG(e){return new w2(e??"")}var k2=class extends ee{static[D]="PgCustomColumnBuilder";constructor(t,n,r){super(t,"custom","PgCustomColumn"),this.config.fieldConfig=n,this.config.customTypeParams=r}build(t){return new Q2(t,this.config)}},Q2=class extends W{static[D]="PgCustomColumn";sqlName;mapTo;mapFrom;constructor(t,n){super(t,n),this.sqlName=n.customTypeParams.dataType(n.fieldConfig),this.mapTo=n.customTypeParams.toDriver,this.mapFrom=n.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(t){return typeof this.mapFrom=="function"?this.mapFrom(t):t}mapToDriverValue(t){return typeof this.mapTo=="function"?this.mapTo(t):t}};function IG(e){return(t,n)=>{let{name:r,config:a}=We(t,n);return new k2(r,a,e)}}var fA=class extends ee{static[D]="PgDateColumnBaseBuilder";defaultNow(){return this.default(Np`now()`)}};var I2=class extends fA{static[D]="PgDateBuilder";constructor(t){super(t,"date","PgDate")}build(t){return new v2(t,this.config)}},v2=class extends W{static[D]="PgDate";getSQLType(){return"date"}mapFromDriverValue(t){return typeof t=="string"?new Date(t):t}mapToDriverValue(t){return t.toISOString()}},_2=class extends fA{static[D]="PgDateStringBuilder";constructor(t){super(t,"string","PgDateString")}build(t){return new x2(t,this.config)}},x2=class extends W{static[D]="PgDateString";getSQLType(){return"date"}mapFromDriverValue(t){return typeof t=="string"?t:t.toISOString().slice(0,-14)}};function vG(e,t){let{name:n,config:r}=We(e,t);return r?.mode==="date"?new I2(n):new _2(n)}var D2=class extends ee{static[D]="PgDoublePrecisionBuilder";constructor(t){super(t,"number","PgDoublePrecision")}build(t){return new F2(t,this.config)}},F2=class extends W{static[D]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(t){return typeof t=="string"?Number.parseFloat(t):t}};function _G(e){return new D2(e??"")}var S2=class extends ee{static[D]="PgInetBuilder";constructor(t){super(t,"string","PgInet")}build(t){return new L2(t,this.config)}},L2=class extends W{static[D]="PgInet";getSQLType(){return"inet"}};function xG(e){return new S2(e??"")}var N2=class extends Bs{static[D]="PgIntegerBuilder";constructor(t){super(t,"number","PgInteger")}build(t){return new R2(t,this.config)}},R2=class extends W{static[D]="PgInteger";getSQLType(){return"integer"}mapFromDriverValue(t){return typeof t=="string"?Number.parseInt(t):t}};function DG(e){return new N2(e??"")}var $2=class extends ee{static[D]="PgIntervalBuilder";constructor(t,n){super(t,"string","PgInterval"),this.config.intervalConfig=n}build(t){return new M2(t,this.config)}},M2=class extends W{static[D]="PgInterval";fields=this.config.intervalConfig.fields;precision=this.config.intervalConfig.precision;getSQLType(){let t=this.fields?` ${this.fields}`:"",n=this.precision?`(${this.precision})`:"";return`interval${t}${n}`}};function FG(e,t={}){let{name:n,config:r}=We(e,t);return new $2(n,r)}var j2=class extends ee{static[D]="PgJsonBuilder";constructor(t){super(t,"json","PgJson")}build(t){return new P2(t,this.config)}},P2=class extends W{static[D]="PgJson";constructor(t,n){super(t,n)}getSQLType(){return"json"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}};function SG(e){return new j2(e??"")}var T2=class extends ee{static[D]="PgJsonbBuilder";constructor(t){super(t,"json","PgJsonb")}build(t){return new H2(t,this.config)}},H2=class extends W{static[D]="PgJsonb";constructor(t,n){super(t,n)}getSQLType(){return"jsonb"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}};function Ww(e){return new T2(e??"")}var G2=class extends ee{static[D]="PgLineBuilder";constructor(t){super(t,"array","PgLine")}build(t){return new U2(t,this.config)}},U2=class extends W{static[D]="PgLine";getSQLType(){return"line"}mapFromDriverValue(t){let[n,r,a]=t.slice(1,-1).split(",");return[Number.parseFloat(n),Number.parseFloat(r),Number.parseFloat(a)]}mapToDriverValue(t){return`{${t[0]},${t[1]},${t[2]}}`}},O2=class extends ee{static[D]="PgLineABCBuilder";constructor(t){super(t,"json","PgLineABC")}build(t){return new q2(t,this.config)}},q2=class extends W{static[D]="PgLineABC";getSQLType(){return"line"}mapFromDriverValue(t){let[n,r,a]=t.slice(1,-1).split(",");return{a:Number.parseFloat(n),b:Number.parseFloat(r),c:Number.parseFloat(a)}}mapToDriverValue(t){return`{${t.a},${t.b},${t.c}}`}};function LG(e,t){let{name:n,config:r}=We(e,t);return!r?.mode||r.mode==="tuple"?new G2(n):new O2(n)}var z2=class extends ee{static[D]="PgMacaddrBuilder";constructor(t){super(t,"string","PgMacaddr")}build(t){return new K2(t,this.config)}},K2=class extends W{static[D]="PgMacaddr";getSQLType(){return"macaddr"}};function NG(e){return new z2(e??"")}var Y2=class extends ee{static[D]="PgMacaddr8Builder";constructor(t){super(t,"string","PgMacaddr8")}build(t){return new J2(t,this.config)}},J2=class extends W{static[D]="PgMacaddr8";getSQLType(){return"macaddr8"}};function RG(e){return new Y2(e??"")}var W2=class extends ee{static[D]="PgNumericBuilder";constructor(t,n,r){super(t,"string","PgNumeric"),this.config.precision=n,this.config.scale=r}build(t){return new Z2(t,this.config)}},Z2=class extends W{static[D]="PgNumeric";precision;scale;constructor(t,n){super(t,n),this.precision=n.precision,this.scale=n.scale}mapFromDriverValue(t){return typeof t=="string"?t:String(t)}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}},V2=class extends ee{static[D]="PgNumericNumberBuilder";constructor(t,n,r){super(t,"number","PgNumericNumber"),this.config.precision=n,this.config.scale=r}build(t){return new X2(t,this.config)}},X2=class extends W{static[D]="PgNumericNumber";precision;scale;constructor(t,n){super(t,n),this.precision=n.precision,this.scale=n.scale}mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}},eS=class extends ee{static[D]="PgNumericBigIntBuilder";constructor(t,n,r){super(t,"bigint","PgNumericBigInt"),this.config.precision=n,this.config.scale=r}build(t){return new tS(t,this.config)}},tS=class extends W{static[D]="PgNumericBigInt";precision;scale;constructor(t,n){super(t,n),this.precision=n.precision,this.scale=n.scale}mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}};function $G(e,t){let{name:n,config:r}=We(e,t),a=r?.mode;return a==="number"?new V2(n,r?.precision,r?.scale):a==="bigint"?new eS(n,r?.precision,r?.scale):new W2(n,r?.precision,r?.scale)}var nS=class extends ee{static[D]="PgPointTupleBuilder";constructor(t){super(t,"array","PgPointTuple")}build(t){return new aS(t,this.config)}},aS=class extends W{static[D]="PgPointTuple";getSQLType(){return"point"}mapFromDriverValue(t){if(typeof t=="string"){let[n,r]=t.slice(1,-1).split(",");return[Number.parseFloat(n),Number.parseFloat(r)]}return[t.x,t.y]}mapToDriverValue(t){return`(${t[0]},${t[1]})`}},rS=class extends ee{static[D]="PgPointObjectBuilder";constructor(t){super(t,"json","PgPointObject")}build(t){return new oS(t,this.config)}},oS=class extends W{static[D]="PgPointObject";getSQLType(){return"point"}mapFromDriverValue(t){if(typeof t=="string"){let[n,r]=t.slice(1,-1).split(",");return{x:Number.parseFloat(n),y:Number.parseFloat(r)}}return t}mapToDriverValue(t){return`(${t.x},${t.y})`}};function MG(e,t){let{name:n,config:r}=We(e,t);return!r?.mode||r.mode==="tuple"?new nS(n):new rS(n)}function oge(e){let t=[];for(let n=0;n<e.length;n+=2)t.push(Number.parseInt(e.slice(n,n+2),16));return new Uint8Array(t)}function jG(e,t){let n=new ArrayBuffer(8),r=new DataView(n);for(let a=0;a<8;a++)r.setUint8(a,e[t+a]);return r.getFloat64(0,!0)}function iS(e){let t=oge(e),n=0,r=t[n];n+=1;let a=new DataView(t.buffer),o=a.getUint32(n,r===1);n+=4;let i;if(o&536870912&&(i=a.getUint32(n,r===1),n+=4),(o&65535)===1){let A=jG(t,n);n+=8;let s=jG(t,n);return n+=8,[A,s]}throw new Error("Unsupported geometry type")}var AS=class extends ee{static[D]="PgGeometryBuilder";constructor(t){super(t,"array","PgGeometry")}build(t){return new sS(t,this.config)}},sS=class extends W{static[D]="PgGeometry";getSQLType(){return"geometry(point)"}mapFromDriverValue(t){return iS(t)}mapToDriverValue(t){return`point(${t[0]} ${t[1]})`}},cS=class extends ee{static[D]="PgGeometryObjectBuilder";constructor(t){super(t,"json","PgGeometryObject")}build(t){return new uS(t,this.config)}},uS=class extends W{static[D]="PgGeometryObject";getSQLType(){return"geometry(point)"}mapFromDriverValue(t){let n=iS(t);return{x:n[0],y:n[1]}}mapToDriverValue(t){return`point(${t.x} ${t.y})`}};function PG(e,t){let{name:n,config:r}=We(e,t);return!r?.mode||r.mode==="tuple"?new AS(n):new cS(n)}var dS=class extends ee{static[D]="PgRealBuilder";constructor(t,n){super(t,"number","PgReal"),this.config.length=n}build(t){return new lS(t,this.config)}},lS=class extends W{static[D]="PgReal";constructor(t,n){super(t,n)}getSQLType(){return"real"}mapFromDriverValue=t=>typeof t=="string"?Number.parseFloat(t):t};function TG(e){return new dS(e??"")}var pS=class extends ee{static[D]="PgSerialBuilder";constructor(t){super(t,"number","PgSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new gS(t,this.config)}},gS=class extends W{static[D]="PgSerial";getSQLType(){return"serial"}};function HG(e){return new pS(e??"")}var mS=class extends Bs{static[D]="PgSmallIntBuilder";constructor(t){super(t,"number","PgSmallInt")}build(t){return new fS(t,this.config)}},fS=class extends W{static[D]="PgSmallInt";getSQLType(){return"smallint"}mapFromDriverValue=t=>typeof t=="string"?Number(t):t};function GG(e){return new mS(e??"")}var bS=class extends ee{static[D]="PgSmallSerialBuilder";constructor(t){super(t,"number","PgSmallSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new hS(t,this.config)}},hS=class extends W{static[D]="PgSmallSerial";getSQLType(){return"smallserial"}};function UG(e){return new bS(e??"")}var BS=class extends ee{static[D]="PgTextBuilder";constructor(t,n){super(t,"string","PgText"),this.config.enumValues=n.enum}build(t){return new yS(t,this.config)}},yS=class extends W{static[D]="PgText";enumValues=this.config.enumValues;getSQLType(){return"text"}};function wi(e,t={}){let{name:n,config:r}=We(e,t);return new BS(n,r)}var CS=class extends fA{constructor(t,n,r){super(t,"string","PgTime"),this.withTimezone=n,this.precision=r,this.config.withTimezone=n,this.config.precision=r}static[D]="PgTimeBuilder";build(t){return new wS(t,this.config)}},wS=class extends W{static[D]="PgTime";withTimezone;precision;constructor(t,n){super(t,n),this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}};function OG(e,t={}){let{name:n,config:r}=We(e,t);return new CS(n,r.withTimezone??!1,r.precision)}var ES=class extends fA{static[D]="PgTimestampBuilder";constructor(t,n,r){super(t,"date","PgTimestamp"),this.config.withTimezone=n,this.config.precision=r}build(t){return new kS(t,this.config)}},kS=class extends W{static[D]="PgTimestamp";withTimezone;precision;constructor(t,n){super(t,n),this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue(t){return typeof t=="string"?new Date(this.withTimezone?t:t+"+0000"):t}mapToDriverValue=t=>t.toISOString()},QS=class extends fA{static[D]="PgTimestampStringBuilder";constructor(t,n,r){super(t,"string","PgTimestampString"),this.config.withTimezone=n,this.config.precision=r}build(t){return new IS(t,this.config)}},IS=class extends W{static[D]="PgTimestampString";withTimezone;precision;constructor(t,n){super(t,n),this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue(t){if(typeof t=="string")return t;let n=t.toISOString().slice(0,-1).replace("T"," ");if(this.withTimezone){let r=t.getTimezoneOffset(),a=r<=0?"+":"-";return`${n}${a}${Math.floor(Math.abs(r)/60).toString().padStart(2,"0")}`}return n}};function Zw(e,t={}){let{name:n,config:r}=We(e,t);return r?.mode==="string"?new QS(n,r.withTimezone??!1,r.precision):new ES(n,r?.withTimezone??!1,r?.precision)}var vS=class extends ee{static[D]="PgUUIDBuilder";constructor(t){super(t,"string","PgUUID")}defaultRandom(){return this.default(Np`gen_random_uuid()`)}build(t){return new _S(t,this.config)}},_S=class extends W{static[D]="PgUUID";getSQLType(){return"uuid"}};function qG(e){return new vS(e??"")}var xS=class extends ee{static[D]="PgVarcharBuilder";constructor(t,n){super(t,"string","PgVarchar"),this.config.length=n.length,this.config.enumValues=n.enum}build(t){return new DS(t,this.config)}},DS=class extends W{static[D]="PgVarchar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"varchar":`varchar(${this.length})`}};function zG(e,t={}){let{name:n,config:r}=We(e,t);return new xS(n,r)}var FS=class extends ee{static[D]="PgBinaryVectorBuilder";constructor(t,n){super(t,"string","PgBinaryVector"),this.config.dimensions=n.dimensions}build(t){return new SS(t,this.config)}},SS=class extends W{static[D]="PgBinaryVector";dimensions=this.config.dimensions;getSQLType(){return`bit(${this.dimensions})`}};function KG(e,t){let{name:n,config:r}=We(e,t);return new FS(n,r)}var LS=class extends ee{static[D]="PgHalfVectorBuilder";constructor(t,n){super(t,"array","PgHalfVector"),this.config.dimensions=n.dimensions}build(t){return new NS(t,this.config)}},NS=class extends W{static[D]="PgHalfVector";dimensions=this.config.dimensions;getSQLType(){return`halfvec(${this.dimensions})`}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){return t.slice(1,-1).split(",").map(n=>Number.parseFloat(n))}};function YG(e,t){let{name:n,config:r}=We(e,t);return new LS(n,r)}var RS=class extends ee{static[D]="PgSparseVectorBuilder";constructor(t,n){super(t,"string","PgSparseVector"),this.config.dimensions=n.dimensions}build(t){return new $S(t,this.config)}},$S=class extends W{static[D]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}};function JG(e,t){let{name:n,config:r}=We(e,t);return new RS(n,r)}var MS=class extends ee{static[D]="PgVectorBuilder";constructor(t,n){super(t,"array","PgVector"),this.config.dimensions=n.dimensions}build(t){return new jS(t,this.config)}},jS=class extends W{static[D]="PgVector";dimensions=this.config.dimensions;getSQLType(){return`vector(${this.dimensions})`}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){return t.slice(1,-1).split(",").map(n=>Number.parseFloat(n))}};function WG(e,t){let{name:n,config:r}=We(e,t);return new MS(n,r)}function ZG(){return{bigint:CG,bigserial:wG,boolean:EG,char:kG,cidr:QG,customType:IG,date:vG,doublePrecision:_G,inet:xG,integer:DG,interval:FG,json:SG,jsonb:Ww,line:LG,macaddr:NG,macaddr8:RG,numeric:$G,point:MG,geometry:PG,real:TG,serial:HG,smallint:GG,smallserial:UG,text:wi,time:OG,timestamp:Zw,uuid:qG,varchar:zG,bit:KG,halfvec:YG,sparsevec:JG,vector:WG}}var PS=Symbol.for("drizzle:PgInlineForeignKeys"),VG=Symbol.for("drizzle:EnableRLS"),Of=class extends vn{static[D]="PgTable";static Symbol=Object.assign({},vn.Symbol,{InlineForeignKeys:PS,EnableRLS:VG});[PS]=[];[VG]=!1;[vn.Symbol.ExtraConfigBuilder]=void 0;[vn.Symbol.ExtraConfigColumns]={}};function ige(e,t,n,r,a=e){let o=new Of(e,r,a),i=typeof t=="function"?t(ZG()):t,A=Object.fromEntries(Object.entries(i).map(([d,l])=>{let p=l;p.setName(d);let g=p.build(o);return o[PS].push(...p.buildForeignKeys(g,o)),[d,g]})),s=Object.fromEntries(Object.entries(i).map(([d,l])=>{let p=l;p.setName(d);let g=p.buildExtraConfigColumn(o);return[d,g]})),u=Object.assign(o,A);return u[vn.Symbol.Columns]=A,u[vn.Symbol.ExtraConfigColumns]=s,n&&(u[Of.Symbol.ExtraConfigBuilder]=n),Object.assign(u,{enableRLS:()=>(u[Of.Symbol.EnableRLS]=!0,u)})}var XG=(e,t,n)=>ige(e,t,n,void 0);var Vw=class{constructor(t,n){this.unique=t,this.name=n}static[D]="PgIndexBuilderOn";on(...t){return new qf(t.map(n=>{if(Un(n,_n))return n;n=n;let r=new Fp(n.name,!!n.keyAsName,n.columnType,n.indexConfig);return n.indexConfig=JSON.parse(JSON.stringify(n.defaultConfig)),r}),this.unique,!1,this.name)}onOnly(...t){return new qf(t.map(n=>{if(Un(n,_n))return n;n=n;let r=new Fp(n.name,!!n.keyAsName,n.columnType,n.indexConfig);return n.indexConfig=n.defaultConfig,r}),this.unique,!0,this.name)}using(t,...n){return new qf(n.map(r=>{if(Un(r,_n))return r;r=r;let a=new Fp(r.name,!!r.keyAsName,r.columnType,r.indexConfig);return r.indexConfig=JSON.parse(JSON.stringify(r.defaultConfig)),a}),this.unique,!0,this.name,t)}},qf=class{static[D]="PgIndexBuilder";config;constructor(t,n,r,a,o="btree"){this.config={name:a,columns:t,unique:n,only:r,method:o}}concurrently(){return this.config.concurrently=!0,this}with(t){return this.config.with=t,this}where(t){return this.config.where=t,this}build(t){return new TS(this.config,t)}},TS=class{static[D]="PgIndex";config;constructor(t,n){this.config={...t,table:n}}};function e5(e){return new Vw(!1,e)}function t5(e){return new Vw(!0,e)}var n5=e=>Zw(e,{withTimezone:!0}),a5=c.enum(["channel","dm","group","local_conversation","thread","web_session"]),mRe=XG("junior_destinations",{id:wi("id").primaryKey(),provider:wi("provider").notNull(),providerTenantId:wi("provider_tenant_id").notNull().default(""),providerDestinationId:wi("provider_destination_id").notNull(),kind:wi("kind").$type().notNull(),parentDestinationId:wi("parent_destination_id"),displayName:wi("display_name"),visibility:wi("visibility").$type().notNull().default("unknown"),metadata:Ww("metadata_json"),createdAt:n5("created_at").notNull(),updatedAt:n5("updated_at").notNull()},e=>[t5("junior_destinations_provider_destination_uidx").on(e.provider,e.providerTenantId,e.providerDestinationId),e5("junior_destinations_provider_kind_idx").on(e.provider,e.kind)]);var Age=c.object({error:c.string().min(1)}).strict(),o5=36e5,wRe=6*o5,ERe=24*o5;var OS=c.object({closed:c.number().int().nonnegative(),costUsd:c.number().nonnegative().optional(),created:c.number().int().nonnegative(),medianCostUsd:c.number().nonnegative().optional(),medianMergeTimeMs:c.number().nonnegative().optional(),merged:c.number().int().nonnegative(),mergeRate:c.number().min(0).max(1).optional(),open:c.number().int().nonnegative()}).strict(),sge=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),Xu=c.object({closed:c.number().int().nonnegative(),created:c.number().int().nonnegative(),date:sge,merged:c.number().int().nonnegative()}).strict(),i5=c.object({closed:c.number().int().nonnegative(),created:c.number().int().nonnegative(),id:c.string().uuid(),medianCostUsd:c.number().nonnegative().optional(),merged:c.number().int().nonnegative(),mergeRate:c.number().min(0).max(1).optional(),name:c.string().min(1),open:c.number().int().nonnegative(),provider:c.string().min(1),url:c.string().url().optional()}).strict(),A5=c.object({closedAt:c.string().optional(),id:c.string().uuid(),mergedAt:c.string().optional(),number:c.number().int().positive(),openedAt:c.string(),provider:c.string().min(1),repository:c.string().min(1),state:Pf,title:c.string().optional(),url:c.string().url().optional()}).strict(),qS=c.object({activityDays:c.array(Xu),activityHours:c.array(Xu).optional(),activitySixHours:c.array(Xu).optional(),changes:c.array(A5),generatedAt:c.string(),repositories:c.array(i5),summary:OS,windowEnd:c.string(),windowStart:c.string()}).strict(),zS=c.object({activityDays:c.array(Xu),activityHours:c.array(Xu).optional(),activitySixHours:c.array(Xu).optional(),generatedAt:c.string(),summary:OS,windowEnd:c.string(),windowStart:c.string()}).strict(),eE=c.object({active:c.number(),conversations:c.number(),date:c.string(),durationMs:c.number(),failed:c.number(),tokens:c.number().optional()}).strict();var cge=c.object({locationId:c.string().min(1)}).strict(),s5=Zu.extend({id:c.string(),firstSeenAt:c.string(),kind:a5,lastSeenAt:c.string(),provider:c.string(),providerDestinationId:c.string(),visibility:c.literal("public")}).strict(),uge=Zu.extend({actor:xp}).strict(),dge=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),tE=c.object({date:dge,privateConversations:c.number(),publicConversations:c.number()}).strict(),KS=c.object({activityDays:c.array(tE),activityHours:c.array(tE).optional(),activitySixHours:c.array(tE).optional(),generatedAt:c.string(),locations:c.array(s5),privateActivity:Zu,source:c.literal("conversation_index"),windowEnd:c.string(),windowStart:c.string()}).strict(),YS=s5.extend({activityDays:c.array(eE),activityHours:c.array(eE).optional(),activitySixHours:c.array(eE).optional(),actors:c.array(uge),generatedAt:c.string(),recentConversations:c.array(Dp),source:c.literal("conversation_index"),windowEnd:c.string(),windowStart:c.string()}).strict(),lge=c.object({email:c.string().trim().min(1)}).strict(),r5=Zu.omit({costUsd:!0}),c5=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),HS=c.object({active:c.number(),conversations:c.number(),costUsd:c.number().optional(),date:c5,durationMs:c.number(),failed:c.number(),tokens:c.number().optional()}).strict(),GS=c.object({activePeople:c.number(),conversations:c.number(),date:c5}).strict(),u5=c.object({active:c.number(),activeDays:c.number(),conversations:c.number(),durationMs:c.number(),failed:c.number(),tokens:c.number().optional()}).strict(),Xw=c.object({conversations:c.number().int().nonnegative(),costUsd:c.number().finite().nonnegative(),durationMs:c.number().finite().nonnegative(),priorCostUsd:c.number().finite().nonnegative()}).strict(),pge=c.object({1:Xw,7:Xw,30:Xw,90:Xw}).strict(),d5=xp.extend({email:c.string().min(1)}).strict(),gge=u5.extend({firstSeenAt:c.string(),lastSeenAt:c.string(),actor:d5,windows:pge}).strict(),JS=c.object({activityDays:c.array(GS),activityHours:c.array(GS).optional(),activitySixHours:c.array(GS).optional(),generatedAt:c.string(),people:c.array(gge),source:c.literal("conversation_index"),windowEnd:c.string(),windowStart:c.string()}).strict(),WS=c.object({activityDays:c.array(HS),activityHours:c.array(HS).optional(),activitySixHours:c.array(HS).optional(),generatedAt:c.string(),locations:c.array(r5),recentConversations:c.array(Dp),actor:d5,source:c.literal("conversation_index"),surfaces:c.array(r5),totals:u5,windowEnd:c.string(),windowStart:c.string()}).strict(),ZS=c.object({generatedAt:c.string(),sevenDaysUsd:c.number().finite().nonnegative(),source:c.literal("conversation_index"),thirtyDaysUsd:c.number().finite().nonnegative(),windowEnd:c.string(),windowStart:c.string()}).strict(),VS=c.object({id:c.string().uuid(),name:c.string(),tokenSuffix:c.string(),createdAt:c.string().datetime(),expiresAt:c.string().datetime(),lastUsedAt:c.string().datetime().nullable()}).strict(),XS=c.object({tokens:c.array(VS)}).strict(),mge=c.object({name:c.string().trim().min(1).max(80)}).strict(),e4=VS.extend({token:c.string().startsWith("jr_pat_")}).strict(),fge=c.object({id:c.string().uuid()}).strict(),bge=c.object({revoked:c.literal(!0)}).strict(),hge=c.object({channelId:c.string().min(1),label:c.string().min(1),teamId:c.string().min(1),visibility:c.enum(["private","public"])}).strict(),l5=c.object({1:c.number().int().nonnegative(),7:c.number().int().nonnegative(),30:c.number().int().nonnegative(),90:c.number().int().nonnegative()}).strict(),p5=c.object({createdAt:c.string().datetime(),createdBy:c.string().min(1),createdByEmail:c.string().trim().email().optional(),destination:hge,id:c.string().min(1),instruction:c.string().min(1),lastConversationId:c.string().min(1).optional(),lastRunAt:c.string().datetime().optional(),ownedByViewer:c.boolean(),runs:l5,outcomes:c.array(FH).max(5),title:c.string().min(1),totalRuns:c.number().int().nonnegative()}),g5=p5.extend({kind:c.literal("scheduled"),nextRunAt:c.string().datetime().optional(),schedule:c.string().min(1),status:c.enum(["active","blocked","completed"])}).strict(),m5=p5.extend({events:c.array(c.string().min(1)).min(1),kind:c.literal("event"),resource:c.string().min(1),source:c.string().min(1),triggerAvailable:c.boolean()}).strict(),t4=c.discriminatedUnion("kind",[g5,m5]),f5=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),US=c.object({costUsd:c.number().finite().nonnegative(),date:f5,event:c.number().int().nonnegative(),scheduled:c.number().int().nonnegative()}).strict(),Bge=c.object({q:c.string().trim().max(200).optional()}).strict(),n4=c.object({executionDays:c.array(US),executionHours:c.array(US).optional(),executionSixHours:c.array(US).optional(),automations:c.array(t4),truncated:c.boolean()}).strict(),yge=c.object({id:c.string().min(1),kind:c.enum(["scheduled","event"])}).strict(),b5=c.enum(["blocked","completed","failed"]),a4=c.object({conversationId:c.string().min(1).optional(),costUsd:c.number().finite().nonnegative().optional(),durationMs:c.number().finite().nonnegative().optional(),executedAt:c.string().datetime(),executionId:c.string().min(1),status:b5,title:c.string().min(1).optional(),totalTokens:c.number().int().nonnegative().optional()}).strict(),nE=c.object({blocked:c.number().int().nonnegative(),completed:c.number().int().nonnegative(),date:f5,failed:c.number().int().nonnegative()}).strict(),r4=c.object({executionDays:c.array(nE),executionHours:c.array(nE).optional(),executionSixHours:c.array(nE).optional(),executions:c.array(a4),automation:t4,truncated:c.boolean()}).strict(),h5=a4.extend({kind:c.enum(["scheduled","event"]),automationId:c.string().min(1),automationTitle:c.string().min(1)}).strict(),o4=c.object({runs:c.array(h5),truncated:c.boolean()}).strict(),Cge=c.object({provider:c.string(),repo:c.string()}).strict(),B5=c.object({provider:c.string(),repo:c.string(),checkoutPath:c.string()}).strict(),wge=c.object({id:c.string(),generatedAt:c.iso.datetime(),buildDurationMs:c.number().int().nonnegative(),sizeBytes:c.number().int().nonnegative().nullable()}).strict(),y5=c.object({id:c.string(),generatedAt:c.iso.datetime(),buildDurationMs:c.number().int().nonnegative(),dependencyCount:c.number().int().nonnegative()}).strict(),Rp=c.object({id:c.string().uuid(),name:c.string(),setupScript:c.string(),repos:c.array(B5),snapshot:wge.nullable()}).strict(),i4=c.object({baselineSnapshot:y5.nullable(),workspaces:c.array(Rp)}).strict(),Ege=c.object({name:c.string(),setupScript:c.string().optional(),repos:c.array(Cge)}).strict(),kge=c.object({id:c.string().uuid()}).strict(),Qge=c.object({deleted:c.literal(!0)}).strict(),C5=c.object({count:c.number().int().nonnegative(),date:c.string(),metric:c.string().min(1),name:c.string().min(1),namespace:c.string().min(1)}).strict(),A4=c.object({generatedAt:c.string().datetime(),stats:c.array(C5),windowEnd:c.string(),windowStart:c.string()}).strict();function Ige(e){try{let t=new URL(e).protocol;return t==="http:"||t==="https:"}catch{return!1}}var vge=c.object({kind:c.literal("resource_link"),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256),url:c.string().url().max(2048).refine(Ige,"URL must use HTTP or HTTPS."),description:c.string().trim().min(1).max(512).optional(),status:c.enum(["open","draft","closed","merged","warning"]).optional()}).strict(),DRe=c.discriminatedUnion("kind",[vge]),_ge=c.enum(["circle-dot","circle-dashed","circle-x","git-merge","git-pull-request","triangle-alert"]),FRe=c.object({icon:_ge.optional(),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256)}).strict(),xge=c.enum(["closed","merged","open"]),LRe=c.object({closedAt:c.date().optional(),conversationIds:c.array(c.string().min(1)).default([]),mergedAt:c.date().optional(),number:c.number().int().positive(),openedAt:c.date(),providerId:c.string().min(1),repository:c.object({name:c.string().min(1),providerId:c.string().min(1),url:c.string().url().optional()}).strict(),state:xge,title:c.string().min(1).optional(),updatedAt:c.date(),url:c.string().url().optional()}).strict(),RRe=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/),Dge=c.enum(["activity","brain","calendar","check","database","info","key","link","sparkles","warning"]),Fge=c.object({content:c.string().min(1).max(32*1024).optional(),description:c.string().trim().min(1).max(2e3).optional(),metadata:c.array(c.string().trim().min(1).max(120)).max(8).optional(),title:c.string().trim().min(1).max(4e3)}).strict(),$Re=c.object({details:c.array(Fge).max(100).optional(),icon:Dge.optional(),preview:c.string().trim().min(1).max(500).optional(),title:c.string().trim().min(1).max(120)}).strict();var rE=c.string().regex(/^T[A-Z0-9]+$/),c4=c.string().regex(/^(C|G|D)[A-Z0-9]+$/),E5=c.string().regex(/^local:[a-z0-9_-]+:[a-z0-9][a-z0-9_-]*$/),Sge=c.string().min(1).refine(e=>e===e.trim()&&e.toLowerCase()!=="unknown"),aE=Sge,Be=c.string().refine(e=>e.trim().length>0),Va=Be.refine(e=>e===e.trim()),Lge=c.object({id:Be,provider:Va}).strict(),Nge=Lge.extend({provider:c.literal("slack"),teamId:rE,channelId:c4,threadTs:Va.optional()}).strict(),jRe=c.discriminatedUnion("provider",[Nge]),PRe=c.enum(["slack","local"]),k5=c.enum(["public","private"]),Rge=c.enum(["public","private"]),$ge=c.object({platform:c.literal("slack"),teamId:rE,channelId:c4,threadTs:Va.optional()}).strict(),u4=$ge,Mge=c.object({platform:c.literal("local"),conversationId:E5}).strict(),jge=c.discriminatedUnion("platform",[u4,Mge]),TRe=c.object({action:c.literal("send_message"),destination:u4}).strict(),Pge=c.object({kind:c.literal("slack"),teamId:rE,channelId:c4,visibility:k5,messageTs:Be.optional(),threadTs:Be.optional()}).strict(),Tge=c.object({kind:c.literal("local"),visibility:c.literal("private"),conversationId:E5}).strict(),Hge=c.object({kind:c.literal("web"),visibility:k5,conversationId:Va}).strict(),Gge=c.object({kind:c.literal("event"),eventKey:Va,eventType:Va,identifier:Va,namespace:Va}).strict(),Uge=c.object({kind:c.literal("scheduled_automation")}).strict(),Oge=c.object({kind:c.literal("event_automation")}).strict(),qge=c.object({kind:c.literal("plugin_dispatch")}).strict(),zge=c.object({kind:c.literal("agent_invocation")}).strict(),Kge=c.discriminatedUnion("kind",[Pge,Tge,Hge,Gge,Uge,Oge,qge,zge]);function Yge(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if("kind"in t){let o={event_task:"event_automation",resource_event:"event",scheduled_task:"scheduled_automation"},i=typeof t.kind=="string"?o[t.kind]:void 0;return i?{...t,kind:i}:e}if(t.platform!=="slack"&&t.platform!=="local"&&t.platform!=="web")return e;let{location:n,platform:r,...a}=t;return{...a,kind:r}}var Jge=c.preprocess(Yge,Kge),Wge=c.discriminatedUnion("allowedWhen",[c.object({type:c.literal("user"),userId:aE,allowedWhen:c.literal("private-direct-conversation")}).strict(),c.object({type:c.literal("user"),userId:aE,allowedWhen:c.literal("scheduled-automation"),taskId:Va}).strict()]),d4={email:Be.optional(),fullName:Be.optional(),userId:aE,userName:Be.optional()},Zge=c.object({...d4,platform:c.literal("slack"),teamId:rE}).strict(),Vge=c.object({...d4,platform:c.literal("local")}).strict(),Xge=c.object({...d4,platform:c.literal("web")}).strict(),eme=c.object({platform:c.literal("system"),name:aE}).strict(),s4=c.discriminatedUnion("platform",[Zge,Vge,Xge,eme]),tme=c.object({displayName:Be.optional(),handle:Be.optional(),id:Va,provider:Va,providerSubjectId:Va,providerTenantId:Va.optional()}).strict(),HRe=c.object({displayName:Be.optional(),email:Be.max(320),id:Va,identities:c.array(tme).max(100)}).strict(),nme=c.record(c.string(),c.string()).superRefine((e,t)=>{let n=Object.entries(e);if(n.length>20){t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata has too many keys"});return}for(let[r,a]of n){if(!r.trim()){t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata values must be strings",path:[r]});continue}r.length>128&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata key exceeds the maximum length",path:[r]}),/[\r\n]/.test(r)&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata keys must be single-line strings",path:[r]}),/[\r\n]/.test(a)&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata values must be single-line strings",path:[r]}),a.length>512&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata value exceeds the maximum length",path:[r]})}}),ame=c.object({label:Va.pipe(c.string().max(48)).refine(e=>!/[\r\n]/.test(e)),detail:Va.pipe(c.string().max(128)).refine(e=>!/[\r\n]/.test(e)).optional()}).strict(),GRe=c.object({idempotencyKey:Be.pipe(c.string().max(512)),credentialSubject:Wge.optional(),destination:u4,destinationVisibility:Rge,input:Be.pipe(c.string().max(32e3)),metadata:nme.optional(),replyAttribution:ame.optional()}).strict();var rme=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/),ORe=c.object({text:c.string().trim().min(1).max(8e3)}).strict(),qRe=c.object({kind:rme,version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict();var ome=4e3,ime=8e3,$p=32,w5=4e3,Ame=1e3,sme=c.record(c.string(),c.unknown()).superRefine((e,t)=>{Object.keys(e).length>$p&&t.addIssue({code:"custom",message:`Event data may include at most ${$p} keys.`}),new TextEncoder().encode(JSON.stringify(e)).byteLength>w5&&t.addIssue({code:"custom",message:`Event data may be at most ${w5} JSON bytes.`})}),ed=c.string().regex(/^[a-z][a-z0-9_-]*(?:\.[a-z][a-z0-9_-]*)+$/).describe("Canonical dotted event type, such as issue.closed or pull_request.review.changes_requested."),Q5=c.string().regex(/^[a-z][a-z0-9_]*$/).describe("Canonical plugin-defined resource type, such as issue or pull_request."),I5=/^[a-z][a-zA-Z0-9]*$/,cme=c.object({kind:c.enum(["boolean","string","number"]),description:c.string().trim().min(1).max(200),enum:c.array(c.string().min(1)).min(1).optional()}).strict().superRefine((e,t)=>{e.enum&&e.kind!=="string"&&t.addIssue({code:"custom",message:'Event match field enum requires kind "string".',path:["enum"]})}),ume=c.record(c.string().regex(I5),cme).superRefine((e,t)=>{Object.keys(e).length>$p&&t.addIssue({code:"custom",message:`Event match keys may include at most ${$p} keys.`})}),KRe=c.record(c.string().regex(I5),c.union([c.boolean(),c.number().finite(),c.string().min(1),c.array(c.union([c.number().finite(),c.string().min(1)])).min(1)])).superRefine((e,t)=>{Object.keys(e).length>$p&&t.addIssue({code:"custom",message:`Event match may include at most ${$p} keys.`});for(let[n,r]of Object.entries(e))Array.isArray(r)&&r.some(a=>typeof a=="boolean")&&t.addIssue({code:"custom",message:`Event match field "${n}" cannot use a boolean list.`,path:[n]})});var dme=c.object({type:Q5,supportedEvents:c.array(ed).min(1),suggestedEvents:c.array(ed).optional(),matchFields:ume.optional(),guidance:c.record(ed,c.string().trim().min(1).max(Ame)).optional()}).strict().superRefine((e,t)=>{let n=new Set;e.supportedEvents.forEach((a,o)=>{n.has(a)&&t.addIssue({code:"custom",message:`Duplicate supported event type "${a}".`,path:["supportedEvents",o]}),n.add(a)});for(let a of Object.keys(e.guidance??{}))n.has(a)||t.addIssue({code:"custom",message:`Guidance event type "${a}" is not supported.`,path:["guidance",a]});let r=new Set;e.suggestedEvents?.forEach((a,o)=>{r.has(a)&&t.addIssue({code:"custom",message:`Duplicate suggested event type "${a}".`,path:["suggestedEvents",o]}),n.has(a)||t.addIssue({code:"custom",message:`Suggested event type "${a}" is not supported.`,path:["suggestedEvents",o]}),r.add(a)})}),YRe=c.object({resourceTypes:c.array(dme).min(1),isEnabled:c.function({input:[],output:c.boolean()}).optional(),normalizeIdentifier:c.function({input:[c.string()],output:c.string()}).optional()}).strict().superRefine((e,t)=>{let n=new Set;e.resourceTypes.forEach((r,a)=>{n.has(r.type)&&t.addIssue({code:"custom",message:`Duplicate resource type "${r.type}".`,path:["resourceTypes",a,"type"]}),n.add(r.type)})});var JRe=c.object({identifier:c.string().min(1),label:c.string().min(1),namespace:c.string().min(1),suggestedEvents:c.array(ed).optional(),supportedEvents:c.array(ed),type:Q5}).strict(),WRe=c.object({events:c.array(ed).min(1),id:c.string().min(1)}).strict(),lme=c.object({eventKey:c.string().min(1),eventType:ed,identifier:c.string().min(1),occurredAtMs:c.number().finite(),terminal:c.boolean().optional(),trustedSummary:c.string().min(1).transform(e=>e.slice(0,ome)),data:sme.optional(),untrustedText:c.string().transform(e=>e.slice(0,ime)).optional()}).strict(),ZRe=lme.extend({namespace:c.string().min(1)}),pme=c.object({authority:c.enum(["instruction","context"]),actor:s4.optional()}).strict(),gme=c.discriminatedUnion("type",[c.object({type:c.literal("message"),role:c.enum(["user","assistant"]),text:c.string().min(1),provenance:pme.optional(),isRunActor:c.boolean().optional()}).strict(),c.object({type:c.literal("toolResult"),toolName:c.string().min(1),isError:c.boolean(),text:c.string().min(1).optional()}).strict()]),XRe=c.object({actorUserId:c.string().min(1).optional(),completedAtMs:c.number().finite(),conversationId:c.string().min(1),destination:jge,locationId:c.string().min(1).optional(),actors:c.array(s4),actor:s4.optional(),runId:c.string().min(1),source:Jge,transcript:c.array(gme)}).strict();var t$e=c.discriminatedUnion("type",[c.object({type:c.literal("text"),text:c.string()}).strict(),c.object({type:c.literal("image"),data:c.string(),mimeType:c.string()}).strict()]),mme=c.object({arguments:c.record(c.string(),c.unknown()),reason:c.string().min(1).optional()}).strict(),n$e=c.object({target:c.string().min(1).optional(),truncated:c.boolean().optional(),continuation:mme.optional()}).passthrough(),a$e=c.enum(["auto","review","approve"]);var o$e=c.object({auth:c.object({user:c.object({email:c.string().nullable().optional(),emailVerified:c.boolean().optional(),name:c.string().nullable().optional()}).strict()}).strict(),pluginName:Be}).strict(),fme=c.string().regex(/^[a-z][a-z0-9-]*$/),bme=c.string().regex(/^[a-z][a-z0-9.-]*$/),hme=c.union([c.literal("read"),c.literal("write")]),v5=c.object({provider:fme,scope:Be.optional(),type:c.literal("oauth")}).strict(),_5=c.object({displayName:Be.optional(),handle:Be.optional(),id:Be,label:Be.optional(),url:Be.optional()}).strict(),A$e=c.object({account:_5.optional(),accessToken:Be,expiresAt:c.number().finite().optional(),refreshToken:Be,refreshTokenExpiresAt:c.number().finite().optional(),scope:Be.optional()}).strict(),s$e=c.object({access:hme,leaseScope:Be.optional(),name:bme,reason:Be.optional(),requirements:c.array(Be).min(1).optional()}).strict(),Bme=c.object({domain:c.string().min(1),headers:c.record(c.string(),c.string()).refine(e=>Object.keys(e).length>0)}).strict(),yme=c.object({account:_5.optional(),authorization:v5.optional(),expiresAt:c.string().refine(e=>Number.isFinite(Date.parse(e))),headerTransforms:c.array(Bme).min(1)}).strict(),c$e=c.discriminatedUnion("type",[c.object({lease:yme,type:c.literal("lease")}).strict(),c.object({authorization:v5.optional(),message:Be,type:c.literal("needed")}).strict(),c.object({message:Be,type:c.literal("unavailable")}).strict()]);var Cme=Be.max(64).regex(/^[a-z][a-z0-9-]*$/),wme=Be.max(80),Eme=Be.max(500),kme=c.enum(["primary","profile"]),Qme=c.object({detail:Be.max(500).optional(),label:Be.max(80),tone:c.enum(["good","neutral","warning"]).optional(),value:Be.max(120)}).strict(),Ime=c.object({label:Be.max(80),value:Be.max(500)}).strict(),vme=c.object({confirmation:Be.max(500).optional(),href:Be.max(500).regex(/^\/api\/plugins\/[a-z][a-z0-9-]*(?:\/|$)/),label:Be.max(80),method:c.literal("DELETE"),tone:c.enum(["danger","neutral"]).optional()}).strict(),_me=c.object({actions:c.array(vme).max(4).optional(),description:Be.max(1e3).optional(),id:Be.max(128),metadata:c.array(Ime).max(8).optional(),title:Be.max(4e3)}).strict(),x5=c.object({emptyText:Be.max(500).optional(),metrics:c.array(Qme).max(6).optional(),nextCursor:Be.max(1e3).optional(),records:c.array(_me).max(100),searchPlaceholder:Be.max(120).optional(),type:c.literal("list")}).strict(),xme=c.object({description:Eme,id:Cme,label:wme,navigation:kme,pluginDisplayName:Be.max(200),pluginName:Be.max(100)}).strict(),D5=c.array(xme),Dme=Be.max(1e3).optional(),Fme=Be.max(64).optional(),Sme=c.string().trim().max(200).optional(),d$e=c.object({cursor:Dme,filter:Fme,limit:c.number().int().min(1).max(50),query:Sme}).strict();var oE=c.object({user:c.object({email:c.string().trim().email(),emailVerified:c.boolean().optional(),name:c.string().nullable().optional()}).strict()}).strict(),g$e=c.object({displayName:c.string().trim().min(1).max(80)}).strict(),F5=c.object({allowedEmailCount:c.number(),allowedGoogleDomainCount:c.number(),authRequired:c.boolean(),authPath:c.string(),basePath:c.string(),componentGallery:c.boolean(),sentryConversationLinks:c.boolean(),timeZone:c.string(),version:c.string().min(1)}).strict();var zf=C(z(),1);var S5="x-junior-version";var l4="junior:dashboard-version";function L5(e){let t=e.headers.get(S5)?.trim();!t||typeof window>"u"||window.dispatchEvent(new CustomEvent(l4,{detail:t}))}function N5(e){let[t,n]=(0,zf.useState)(e);return(0,zf.useEffect)(()=>{e&&n(e)},[e]),(0,zf.useEffect)(()=>{let r=a=>{n(a.detail)};return window.addEventListener(l4,r),()=>window.removeEventListener(l4,r)},[]),t}var ys=class extends Error{status;apiError;constructor(t,n,r){super(`${t} returned ${n}`),this.status=n,r?.trim()&&(this.apiError=r.trim())}};async function td(e,t){let n;try{let r=await t.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new ys(e,t.status,n)}function Mp(){if(typeof window>"u")return;let e=window.__JUNIOR_DASHBOARD_BASE_PATH__??"/",t=e==="/"?"/auth/login":`${e}/auth/login`;if(window.location.pathname!==t){let n=`${window.location.pathname}${window.location.search||""}`,r=new URLSearchParams;n!=="/"&&r.set("next",n);let a=r.toString();window.location.assign(a?`${t}?${a}`:t)}}async function iE(e,t,n){let r=await jp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"PATCH"});return r.status===401&&Mp(),r.ok||await td(t,r),e.parse(await r.json())}async function nd(e,t,n){let r=await jp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"POST"});return r.status===401&&Mp(),r.ok||await td(t,r),e.parse(await r.json())}async function R5(e,t,n){let r=await jp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"PUT"});return r.status===401&&Mp(),r.ok||await td(t,r),e.parse(await r.json())}async function Fc(e){let t=await jp(e,{credentials:"same-origin",method:"DELETE"});t.status===401&&Mp(),t.ok||await td(e,t)}async function $5(e,t,n={}){let r=await jp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"DELETE"});return r.status===401&&Mp(),r.ok||await td(t,r),e.parse(await r.json())}async function jp(e,t){let n=await fetch(e,t);return L5(n),n}async function je(e,t,n){let r=await jp(t,{credentials:"same-origin",...n?{signal:n}:void 0});return r.status===401&&(Mp(),await td(t,r)),r.ok||await td(t,r),e.parse(await r.json())}var AE=5*6e4,p4=5*6e4,Lme=1e3;function Nme(e,t=Date.now()){if(!e)return p4;let n=Date.parse(e);if(!Number.isFinite(n))return p4;let r=Math.max(0,t-n);return Math.max(Lme,p4-r)}function M5(){return Re({queryKey:["dashboard","core"],queryFn:async({signal:e})=>{let[t,n]=await Promise.all([je(oE,"/api/me",e),je(F5,"/api/config",e)]);return{config:n,me:t}},retry:!1,staleTime:AE})}function Rme(){return Re({queryKey:["dashboard","plugins"],queryFn:({signal:e})=>je(O8,"/api/plugins",e),retry:!1,staleTime:AE})}function j5(){return Re({queryKey:["dashboard","plugin-user-pages"],queryFn:({signal:e})=>je(D5,"/api/user-pages",e),retry:!1,staleTime:AE})}function sE(e=""){return Re({queryKey:["dashboard","conversations","viewer",{search:e}],queryFn:({signal:t})=>je(G8,`/api/conversations${e?`?q=${encodeURIComponent(e)}`:""}`,t),placeholderData:qh,retry:!1})}function P5(){return Re({queryKey:["dashboard","code"],queryFn:({signal:e})=>je(qS,"/api/code",e),retry:!1})}function T5(e,t){return Re({enabled:e,queryKey:["dashboard","automations",t],queryFn:({signal:n})=>je(n4,`/api/automations${t?`?q=${encodeURIComponent(t)}`:""}`,n),placeholderData:qh,retry:!1})}function H5(e){return Re({enabled:e,queryKey:["dashboard","automations","runs"],queryFn:({signal:t})=>je(o4,"/api/automations/runs",t),retry:!1})}function G5(e,t,n){return Re({enabled:e&&!!(t&&n),queryKey:["dashboard","automations",t,n,"executions"],queryFn:({signal:r})=>je(r4,`/api/automations/${t}/${encodeURIComponent(n)}/executions`,r),retry:!1})}function U5(){return Re({queryKey:["dashboard","people"],queryFn:({signal:e})=>je(JS,"/api/people",e),retry:!1})}function O5(e){return Re({enabled:!!e,queryKey:["dashboard","people",e],queryFn:async({signal:t})=>je(WS,`/api/people/${encodeURIComponent(e)}`,t),retry:!1})}function q5(e){return Re({enabled:!!e,queryKey:["dashboard","people",e,"plugin-reports"],queryFn:({signal:t})=>je(qw,`/api/people/${encodeURIComponent(e)}/plugin-reports`,t),retry:!1})}function z5(e){return Re({enabled:!!e,queryKey:["dashboard","people",e,"code"],queryFn:({signal:t})=>je(zS,`/api/people/${encodeURIComponent(e)}/code`,t),retry:!1})}function K5(e){return Re({enabled:e,queryKey:["dashboard","personal-spend"],queryFn:({signal:t})=>je(ZS,"/api/people/me/spend",t),refetchInterval:t=>Nme(t.state.data?.generatedAt),retry:!1,staleTime:0})}function Y5(){return Re({queryKey:["dashboard","locations"],queryFn:({signal:e})=>je(KS,"/api/locations",e),retry:!1})}function J5(e){return Re({enabled:!!e,queryKey:["dashboard","locations",e],queryFn:async({signal:t})=>je(YS,`/api/locations/${encodeURIComponent(e)}`,t),retry:!1})}function $me(){return Re({queryKey:["dashboard","skills"],queryFn:({signal:e})=>je(z8,"/api/skills",e),retry:!1,staleTime:AE})}function Mme(){return Re({queryKey:["dashboard","plugin-reports"],queryFn:({signal:e})=>je(qw,"/api/plugin-reports",e),retry:!1})}function W5(){return Re({queryKey:["dashboard","stats"],queryFn:({signal:e})=>je(A4,"/api/stats",e),retry:!1})}function Z5(e){let t=Rme(),n=Re({queryKey:["dashboard","conversation-stats"],queryFn:({signal:i})=>je(U8,"/api/conversations/stats",i),retry:!1}),r=$me(),a=Mme();return{data:t.data&&r.data?{...e,conversationStatsError:!!n.error,...n.data?{conversationStats:n.data}:void 0,conversationStatsLoading:n.isPending,pluginReportsError:!!a.error,...a.data?{pluginReports:a.data}:void 0,pluginReportsLoading:a.isPending,plugins:t.data,skills:r.data}:void 0,error:t.error??r.error,isPending:t.isPending||r.isPending}}var V5=C(z(),1);function cE(){return(0,V5.useSyncExternalStore)(e=>aA.subscribe(e),()=>aA.isOnline(),()=>!0)}var eU=C(w(),1);function X5(){return cE()?null:(0,eU.jsx)("div",{"aria-live":"polite",className:"border-t border-amber-300/15 bg-amber-300/[0.07] px-3 py-1.5 text-center font-sans text-xs text-amber-100/80",role:"status",children:"You\u2019re offline. Drafts stay on this device."})}var g4=C(w(),1);function uE(){return(0,g4.jsx)("div",{className:"relative grid size-10 shrink-0 select-none place-items-center overflow-visible",children:(0,g4.jsx)("img",{alt:"",className:"relative size-11 max-w-none -translate-y-0.5 object-contain opacity-90 drop-shadow-[0_0_7px_rgba(255,255,255,0.16)]",draggable:!1,src:"/_junior/dashboard/avatar.png"})})}var tU=["relative","overflow-hidden","bg-white/15","before:absolute","before:inset-0","before:content-['']","before:bg-[linear-gradient(90deg,#ff4d6d,#ffb703,#56f39a,#4cc9f0,#9b5de5,#ff4d6d)]","before:bg-[length:200%_100%]","before:animate-[junior-rainbow-flow_1.2s_linear_infinite]","motion-reduce:before:animate-none"].join(" ");function k(...e){return e.filter(Boolean).join(" ")}var Bn="mx-auto w-full min-w-0 max-w-screen-xl",bA="text-dashboard-text-muted hover:text-dashboard-text",nU="rounded-2xl bg-dashboard-fill-soft shadow-[inset_0_0_0_1px_var(--color-dashboard-border-subtle)]",aU="dashboard-shell-bg";var Sc=C(w(),1);function On(e){return(0,Sc.jsx)("div",{className:k(Bn,"grid min-h-[calc(100dvh-5rem)] place-items-center px-4 py-8 md:px-8"),children:(0,Sc.jsxs)("section",{className:"grid w-full max-w-lg grid-cols-[auto_minmax(0,1fr)] items-center gap-3 rounded-lg border border-dashboard-border-emphasis bg-dashboard-surface-raised p-4",children:[(0,Sc.jsx)(uE,{}),(0,Sc.jsxs)("div",{children:[(0,Sc.jsx)("div",{className:"font-bold",children:e.label}),(0,Sc.jsx)("div",{"aria-label":e.label,className:`${tU} mt-3 h-1.5 w-full`,role:"progressbar"})]})]})})}var m4="0.208.0",dE=typeof m4=="string"&&m4.trim()?m4:"unknown";var Kf=C(w(),1);function rU(e){return jme(e.serverVersion)?(0,Kf.jsxs)("div",{"aria-live":"polite",className:"flex flex-wrap items-center justify-center gap-x-3 gap-y-1 border-t border-cyan-300/15 bg-cyan-300/[0.07] px-3 py-1.5 text-center font-sans text-xs text-cyan-100/80",role:"status",children:[(0,Kf.jsx)("span",{children:"The dashboard changed. Refresh to load the latest version."}),(0,Kf.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0 font-mono font-semibold text-cyan-100 underline decoration-cyan-300/40 underline-offset-2 hover:text-dashboard-text-solid",onClick:()=>window.location.reload(),type:"button",children:"Refresh"})]}):null}function jme(e){return!!e&&dE!=="unknown"&&e!=="unknown"&&e!==dE}var oU=C(w(),1);function T(e){let t=e.as??"div",n={none:"",sm:"p-4",md:"p-5 sm:p-6"}[e.padding??"none"],r=e.variant==="section"?"mb-4 border-dashboard-border-subtle bg-dashboard-fill-faint shadow-[0_24px_80px_rgba(0,0,0,0.18)]":e.variant==="raised"?"border-dashboard-border-emphasis bg-dashboard-surface-raised":"border-dashboard-border-subtle bg-dashboard-fill-faint";return(0,oU.jsx)(t,{className:k("min-w-0 overflow-hidden rounded-lg border",r,n,e.className),children:e.children})}var iU=C(w(),1);function De(e){let t=e.as??"div";return(0,iU.jsx)(t,{"aria-hidden":"true",className:k("animate-pulse rounded bg-dashboard-fill-soft motion-reduce:animate-none",e.className)})}var Fe=C(w(),1);function Na(e){let t=e.variant??"panel";return(0,Fe.jsxs)("div",{"aria-busy":"true","aria-live":"polite",className:k("grid gap-4",e.className),role:"status",children:[(0,Fe.jsx)("span",{className:"sr-only",children:e.label}),Pme(t)]})}function Pme(e){switch(e){case"stats":return(0,Fe.jsx)(Tme,{});case"overview":return(0,Fe.jsx)(Hme,{});case"list":return(0,Fe.jsx)(Gme,{});case"library":return(0,Fe.jsx)(Ume,{});case"panel":return(0,Fe.jsx)(hA,{className:"min-h-64"})}}function Tme(){return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:Array.from({length:4},(e,t)=>(0,Fe.jsx)(hA,{className:"min-h-[7.5rem] p-4 sm:min-h-32 sm:p-5"},t))}),(0,Fe.jsx)(hA,{className:"min-h-[17rem]"})]})}function Hme(){return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)("div",{className:"grid gap-4 xl:grid-cols-2",children:[(0,Fe.jsx)(hA,{className:"min-h-[17rem]"}),(0,Fe.jsx)(hA,{className:"min-h-[17rem]"})]}),(0,Fe.jsx)(Pp,{className:"h-24 border-y border-dashboard-border-subtle bg-dashboard-fill-faint"}),(0,Fe.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,Fe.jsx)(hA,{className:"min-h-56"}),(0,Fe.jsx)(hA,{className:"min-h-56"})]})]})}function Gme(){return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(hA,{className:"min-h-20 p-4"}),(0,Fe.jsx)(Pp,{className:"h-10 border-b border-dashboard-border-subtle"}),(0,Fe.jsx)(hA,{className:"min-h-80"})]})}function Ume(){return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[(0,Fe.jsx)(Pp,{className:"h-7 w-56 rounded bg-dashboard-fill-soft"}),(0,Fe.jsx)(Pp,{className:"h-10 w-full max-w-md rounded-lg border border-dashboard-border-subtle bg-dashboard-fill-faint sm:w-72"})]}),(0,Fe.jsx)("div",{"aria-hidden":"true",className:"grid min-w-0 grid-cols-3 gap-1 border-b border-dashboard-border-subtle sm:flex",children:Array.from({length:3},(e,t)=>(0,Fe.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 sm:justify-start",children:[(0,Fe.jsx)(Pp,{className:"h-3 w-12 rounded bg-dashboard-fill-soft"}),(0,Fe.jsx)(Pp,{className:"h-5 w-8 rounded-sm border border-dashboard-border-subtle bg-dashboard-fill-faint"})]},t))}),(0,Fe.jsx)(hA,{className:"min-h-80"})]})}function hA(e){return(0,Fe.jsx)(T,{className:k("animate-pulse motion-reduce:animate-none",e.className),children:(0,Fe.jsx)("span",{"aria-hidden":"true"})})}function Pp(e){return(0,Fe.jsx)(De,{className:e.className})}var lE=C(w(),1),AU="inline-flex h-9 max-w-full items-center gap-2 rounded border border-dashboard-border-emphasis bg-dashboard-surface-raised px-3 font-mono text-sm font-semibold leading-none text-dashboard-text transition-colors hover:border-dashboard-border-heavy hover:bg-dashboard-surface-hover hover:text-dashboard-text",Ome="inline-flex h-9 max-w-full items-center justify-center gap-1.5 rounded border border-dashboard-border-strong bg-transparent px-3 font-mono text-xs font-semibold text-dashboard-text-muted transition-colors hover:border-rose-300/40 hover:text-rose-300";function Ze({className:e,size:t="default",tone:n="default",type:r="button",...a}){let o=n==="danger";return(0,lE.jsx)("button",{...a,className:k("font-mono transition-colors disabled:cursor-not-allowed disabled:opacity-50",t==="icon"?k("grid size-9 place-items-center rounded-md border-0 bg-transparent p-0 focus-visible:outline focus-visible:outline-1 disabled:hover:!bg-transparent",o?"text-dashboard-text-muted hover:!bg-rose-300/10 hover:!text-rose-300 focus-visible:outline-rose-300/55 disabled:hover:!text-dashboard-text-muted":"text-dashboard-text-muted hover:!bg-dashboard-fill-strong hover:!text-dashboard-text focus-visible:outline-cyan-300/55 disabled:hover:!text-dashboard-text-muted"):o?k(Ome,"disabled:hover:border-dashboard-border-strong disabled:hover:text-dashboard-text-muted"):k(AU,"disabled:hover:border-dashboard-border-emphasis disabled:hover:bg-dashboard-surface-raised disabled:hover:text-dashboard-text"),a.disabled?"":"cursor-pointer",e),type:r})}function sU({className:e,...t}){return(0,lE.jsx)(pe,{...t,className:k(AU,"no-underline",e)})}function na({className:e,pressed:t,type:n="button",variant:r,...a}){return(0,lE.jsx)("button",{...a,"aria-pressed":t,className:k(qme[r],t?zme[r]:Kme[r],e),type:n})}var qme={pill:"cursor-pointer rounded border px-2 py-1 font-mono text-xs font-semibold uppercase leading-tight transition-colors focus-visible:outline focus-visible:outline-1 focus-visible:outline-cyan-300/55",segment:"h-7 min-w-10 cursor-pointer rounded border px-2 font-mono text-xs transition-colors focus-visible:outline focus-visible:outline-1 focus-visible:outline-cyan-300/55",text:"cursor-pointer border-0 bg-transparent px-1.5 py-1 font-mono uppercase tracking-normal underline-offset-4 transition-colors focus-visible:outline focus-visible:outline-1 focus-visible:outline-cyan-300/55"},zme={pill:"border-dashboard-border-heavy bg-dashboard-text-solid text-dashboard-text-inverse",segment:"border-amber-500/30 bg-amber-500/20 text-amber-400",text:"text-dashboard-text underline decoration-dashboard-text-solid"},Kme={pill:"border-dashboard-border-strong bg-dashboard-surface-raised text-dashboard-text-muted hover:border-dashboard-border-interactive hover:bg-dashboard-surface-hover hover:text-dashboard-text",segment:"border-dashboard-border-strong bg-dashboard-fill-faint text-dashboard-text-muted hover:bg-dashboard-fill-strong hover:text-dashboard-text",text:"text-dashboard-text-muted hover:text-dashboard-text"};var f4=C(w(),1),Yme=[1,7,30,90];function b4(e){return e===1?"24h":`${e}d`}function Tp(e){return e===1?"last 24 hours":`last ${e} days`}function yn(e){return e===1?"hour":e===7?"6hour":"day"}function cU(e){return e===1}function Jme(e){return e===7}function Xa(e){return e==="hour"?"hour":e==="6hour"?"6h":"day"}function pE(e){return e==="hour"?"hour":e==="6hour"?"6 hours":"day"}function Yf(e){return e==="hour"?"Hourly":e==="6hour"?"6-hour":"Daily"}function xn(e){return cU(e.range)&&e.hours?.length?e.hours.slice(-24):cU(e.range)?e.days.slice(-1):Jme(e.range)?e.sixHours?.length?[...e.sixHours]:e.hours?.length&&e.emptySixHour?Wme({empty:e.emptySixHour,hours:e.hours}):e.days.slice(-e.range):e.days.slice(-e.range)}function Wme(e){let t=new Map;for(let n of e.hours){let r=Date.parse(`${n.date}:00:00.000Z`);if(Number.isNaN(r))continue;let a=new Date(r);a.setUTCMinutes(0,0,0),a.setUTCHours(Math.floor(a.getUTCHours()/6)*6,0,0,0);let o=a.toISOString().slice(0,13),A={...t.get(o)??e.empty(o),date:o};for(let[s,u]of Object.entries(n))if(s!=="date"&&typeof u=="number"){let d=A[s];A[s]=(typeof d=="number"?d:0)+u}t.set(o,A)}if(e.hours.length>=24){let n=e.hours[e.hours.length-1]?.date,r=n?Date.parse(`${n}:00:00.000Z`):Date.now(),a=new Date(r);a.setUTCMinutes(0,0,0),a.setUTCHours(Math.floor(a.getUTCHours()/6)*6,0,0,0);let o=new Date(a.getTime()-9720*60*1e3),i=[];for(let A=new Date(o);A.getTime()<=a.getTime();A.setTime(A.getTime()+360*60*1e3)){let s=A.toISOString().slice(0,13);i.push(t.get(s)??e.empty(s))}return i}return[...t.values()].sort((n,r)=>n.date.localeCompare(r.date))}function gE(e){return(0,f4.jsx)("div",{"aria-label":"Reporting period",className:"flex items-center gap-1",role:"group",children:(e.options??Yme).map(t=>(0,f4.jsx)(na,{onClick:()=>e.onChange(t),pressed:e.value===t,variant:"segment",children:b4(t)},t))})}var Lc=C(w(),1);function He(e){let t=e.range!==void 0&&e.onRangeChange?(0,Lc.jsx)(gE,{onChange:e.onRangeChange,...e.rangeOptions?{options:e.rangeOptions}:{},value:e.range}):void 0,n=e.actions??t;return(0,Lc.jsxs)("header",{className:"flex min-w-0 items-center justify-between gap-6 border-b border-white/[0.05] pb-4 sm:pb-6 max-md:flex-col max-md:items-stretch",children:[(0,Lc.jsxs)("div",{className:"min-w-0",children:[(0,Lc.jsx)("h2",{className:"m-0 font-display text-3xl font-light leading-none tracking-[-0.03em] text-dashboard-text sm:text-4xl",children:e.title}),(0,Lc.jsx)("div",{className:"mt-2 max-w-2xl font-mono text-xs leading-relaxed text-dashboard-text-muted sm:text-sm",children:e.description})]}),n?(0,Lc.jsx)("div",{className:"shrink-0",children:n}):null]})}var uU=C(w(),1);function Go(e){return(0,uU.jsx)("div",{className:k(Bn,"grid min-w-0 content-start gap-4 px-4 py-4 pb-[max(1rem,env(safe-area-inset-bottom))] sm:gap-6 sm:px-8 sm:py-8 sm:pb-8",e.className),children:e.children})}var Jf=C(w(),1);function ad(e){return(0,Jf.jsxs)(Go,{children:[(0,Jf.jsx)(He,{description:e.description,title:e.title}),(0,Jf.jsx)(Na,{label:e.label,variant:e.variant})]})}var bE=C(z(),1);var mE=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var dU=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var lU=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());var h4=e=>{let t=lU(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Wf=C(z(),1);var fE={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"};var pU=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var Hp=C(z(),1);var Zme=(0,Hp.createContext)({});var gU=()=>(0,Hp.useContext)(Zme);var mU=(0,Wf.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:a="",children:o,iconNode:i,...A},s)=>{let{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:l=!1,color:p="currentColor",className:g=""}=gU()??{},m=r??l?Number(n??d)*24/Number(t??u):n??d;return(0,Wf.createElement)("svg",{ref:s,...fE,width:t??u??fE.width,height:t??u??fE.height,stroke:e??p,strokeWidth:m,className:mE("lucide",g,a),...!o&&!pU(A)&&{"aria-hidden":"true"},...A},[...i.map(([b,B])=>(0,Wf.createElement)(b,B)),...Array.isArray(o)?o:[o]])});var F=(e,t)=>{let n=(0,bE.forwardRef)(({className:r,...a},o)=>(0,bE.createElement)(mU,{ref:o,iconNode:t,className:mE(`lucide-${dU(h4(e))}`,`lucide-${e}`,r),...a}));return n.displayName=h4(e),n};var Vme=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Ei=F("activity",Vme);var Xme=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],Uo=F("archive-restore",Xme);var efe=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Cs=F("archive",efe);var tfe=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],Zf=F("arrow-down-to-line",tfe);var nfe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],BA=F("arrow-left",nfe);var afe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Vf=F("arrow-right",afe);var rfe=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],Xf=F("bookmark",rfe);var ofe=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],yA=F("bot",ofe);var ife=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],bo=F("boxes",ife);var Afe=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],CA=F("braces",Afe);var sfe=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],Nc=F("brain-circuit",sfe);var cfe=[["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"}]],ws=F("brain",cfe);var ufe=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],Es=F("calendar-clock",ufe);var dfe=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],eb=F("calendar",dfe);var lfe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],rd=F("check",lfe);var pfe=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],tb=F("chevron-down",pfe);var gfe=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],nb=F("chevron-left",gfe);var mfe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],aa=F("chevron-right",mfe);var ffe=[["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"}]],Ra=F("circle-alert",ffe);var bfe=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],ab=F("circle-dashed",bfe);var hfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]],od=F("circle-dollar-sign",hfe);var Bfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],rb=F("circle-dot",Bfe);var yfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Rc=F("circle-x",yfe);var Cfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],ki=F("clock-3",Cfe);var wfe=[["path",{d:"M13.744 17.736a6 6 0 1 1-7.48-7.48",key:"bq4yh3"}],["path",{d:"M15 6h1v4",key:"11y1tn"}],["path",{d:"m6.134 14.768.866-.5 2 3.464",key:"17snzx"}],["circle",{cx:"16",cy:"8",r:"6",key:"14bfc9"}]],Qi=F("coins",wfe);var Efe=[["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"}]],id=F("copy",Efe);var kfe=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],$c=F("database",kfe);var Qfe=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],fr=F("earth",Qfe);var Ife=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Mc=F("ellipsis",Ife);var vfe=[["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"}]],Ad=F("external-link",vfe);var _fe=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ob=F("file-text",_fe);var xfe=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],jc=F("fingerprint-pattern",xfe);var Dfe=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],ib=F("folder-git-2",Dfe);var Ffe=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Ab=F("gauge",Ffe);var Sfe=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],sb=F("git-merge",Sfe);var Lfe=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]],ks=F("git-pull-request",Lfe);var Nfe=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],cb=F("hash",Nfe);var Rfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Pc=F("info",Rfe);var $fe=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Ii=F("key-round",$fe);var Mfe=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Tc=F("layers",Mfe);var jfe=[["rect",{width:"8",height:"18",x:"3",y:"3",rx:"1",key:"oynpb5"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z",key:"1qboyk"}]],sd=F("library-big",jfe);var Pfe=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],ub=F("lightbulb",Pfe);var Tfe=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],db=F("list-checks",Tfe);var Hfe=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],lb=F("link",Hfe);var Gfe=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Qs=F("loader-circle",Gfe);var Ufe=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],$a=F("lock-keyhole",Ufe);var Ofe=[["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"}]],pb=F("lock",Ofe);var qfe=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],gb=F("log-out",qfe);var zfe=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],cd=F("map-pin",zfe);var Kfe=[["path",{d:"M18 8c0 3.613-3.869 7.429-5.393 8.795a1 1 0 0 1-1.214 0C9.87 15.429 6 11.613 6 8a6 6 0 0 1 12 0",key:"11u0oz"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["path",{d:"M8.714 14h-3.71a1 1 0 0 0-.948.683l-2.004 6A1 1 0 0 0 3 22h18a1 1 0 0 0 .948-1.316l-2-6a1 1 0 0 0-.949-.684h-3.712",key:"q8zwxj"}]],mb=F("map-pinned",Kfe);var Yfe=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],ud=F("menu",Yfe);var Jfe=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],fb=F("message-square-text",Jfe);var Wfe=[["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"}]],ho=F("message-square",Wfe);var Zfe=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],Gp=F("messages-square",Zfe);var Vfe=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],bb=F("minimize-2",Vfe);var Xfe=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],hb=F("paperclip",Xfe);var ebe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],dd=F("plus",ebe);var tbe=[["path",{d:"M4.9 16.1C1 12.2 1 5.8 4.9 1.9",key:"s0qx1y"}],["path",{d:"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5",key:"1idnkw"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}],["path",{d:"M16.2 4.8c2 2 2.26 5.11.8 7.47",key:"ojru2q"}],["path",{d:"M19.1 1.9a9.96 9.96 0 0 1 0 14.1",key:"rhi7fg"}],["path",{d:"M9.5 18h5",key:"mfy3pd"}],["path",{d:"m8 22 4-11 4 11",key:"25yftu"}]],Bb=F("radio-tower",tbe);var nbe=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],Up=F("scroll-text",nbe);var abe=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Hc=F("search",abe);var rbe=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],ld=F("send",rbe);var obe=[["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"}]],yb=F("settings",obe);var ibe=[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]],Cb=F("sigma",ibe);var Abe=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],wb=F("skip-forward",Abe);var sbe=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],er=F("sparkles",sbe);var cbe=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],qr=F("square-pen",cbe);var ube=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],vi=F("timer",ube);var dbe=[["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"}]],Ba=F("trash-2",dbe);var lbe=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Eb=F("trending-up",lbe);var pbe=[["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"}]],zr=F("triangle-alert",pbe);var gbe=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],br=F("user-round",gbe);var mbe=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],pd=F("users",mbe);var fbe=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],kb=F("webhook",fbe);var bbe=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],tr=F("x",bbe);var hbe=[["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"}]],Qb=F("zap",hbe);var MA=C(z(),1);var B4=Object.defineProperty,Bbe=Object.getOwnPropertyDescriptor,ybe=Object.getOwnPropertyNames,Cbe=Object.prototype.hasOwnProperty,bU=(e,t)=>{let n={};for(var r in e)B4(n,r,{get:e[r],enumerable:!0});return t||B4(n,Symbol.toStringTag,{value:"Module"}),n},fU=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=ybe(t),o=0,i=a.length,A;o<i;o++)A=a[o],!Cbe.call(e,A)&&A!==n&&B4(e,A,{get:(s=>t[s]).bind(null,A),enumerable:!(r=Bbe(t,A))||r.enumerable});return e},hU=(e,t,n)=>(fU(e,t,"default"),n&&fU(n,t,"default"));var E4={};L(E4,{createOnigurumaEngine:()=>jbe,getDefaultWasmLoader:()=>Mbe,loadWasm:()=>yU,setDefaultWasmLoader:()=>$be});var w4=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function wbe(){return 2147483648}function Ebe(){return typeof performance<"u"?performance.now():Date.now()}var kbe=(e,t)=>e+(t-e%t)%t;async function Qbe(e){let t,n,r={};function a(g){n=g,r.HEAPU8=new Uint8Array(g),r.HEAPU32=new Uint32Array(g)}function o(g,m,b){r.HEAPU8.copyWithin(g,m,m+b)}function i(g){try{return t.grow(g-n.byteLength+65535>>>16),a(t.buffer),1}catch{}}function A(g){let m=r.HEAPU8.length;g=g>>>0;let b=wbe();if(g>b)return!1;for(let B=1;B<=4;B*=2){let h=m*(1+.2/B);h=Math.min(h,g+100663296);let f=Math.min(b,kbe(Math.max(g,h),65536));if(i(f))return!0}return!1}let s=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(g,m,b=1024){let B=m+b,h=m;for(;g[h]&&!(h>=B);)++h;if(h-m>16&&g.buffer&&s)return s.decode(g.subarray(m,h));let f="";for(;m<h;){let y=g[m++];if(!(y&128)){f+=String.fromCharCode(y);continue}let E=g[m++]&63;if((y&224)===192){f+=String.fromCharCode((y&31)<<6|E);continue}let I=g[m++]&63;if((y&240)===224?y=(y&15)<<12|E<<6|I:y=(y&7)<<18|E<<12|I<<6|g[m++]&63,y<65536)f+=String.fromCharCode(y);else{let Q=y-65536;f+=String.fromCharCode(55296|Q>>10,56320|Q&1023)}}return f}function d(g,m){return g?u(r.HEAPU8,g,m):""}let l={emscripten_get_now:Ebe,emscripten_memcpy_big:o,emscripten_resize_heap:A,fd_write:()=>0};async function p(){let m=await e({env:l,wasi_snapshot_preview1:l});t=m.memory,a(t.buffer),Object.assign(r,m),r.UTF8ToString=d}return await p(),r}var Ibe=Object.defineProperty,vbe=(e,t,n)=>t in e?Ibe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ra=(e,t,n)=>vbe(e,typeof t!="symbol"?t+"":t,n),ya=null;function _be(e){throw new w4(e.UTF8ToString(e.getLastOnigError()))}var BE=class e{constructor(t){ra(this,"utf16Length"),ra(this,"utf8Length"),ra(this,"utf16Value"),ra(this,"utf8Value"),ra(this,"utf16OffsetToUtf8"),ra(this,"utf8OffsetToUtf16");let n=t.length,r=e._utf8ByteLength(t),a=r!==n,o=a?new Uint32Array(n+1):null;a&&(o[n]=r);let i=a?new Uint32Array(r+1):null;a&&(i[r]=n);let A=new Uint8Array(r),s=0;for(let u=0;u<n;u++){let d=t.charCodeAt(u),l=d,p=!1;if(d>=55296&&d<=56319&&u+1<n){let g=t.charCodeAt(u+1);g>=56320&&g<=57343&&(l=(d-55296<<10)+65536|g-56320,p=!0)}a&&(o[u]=s,p&&(o[u+1]=s),l<=127?i[s+0]=u:l<=2047?(i[s+0]=u,i[s+1]=u):l<=65535?(i[s+0]=u,i[s+1]=u,i[s+2]=u):(i[s+0]=u,i[s+1]=u,i[s+2]=u,i[s+3]=u)),l<=127?A[s++]=l:l<=2047?(A[s++]=192|(l&1984)>>>6,A[s++]=128|(l&63)>>>0):l<=65535?(A[s++]=224|(l&61440)>>>12,A[s++]=128|(l&4032)>>>6,A[s++]=128|(l&63)>>>0):(A[s++]=240|(l&1835008)>>>18,A[s++]=128|(l&258048)>>>12,A[s++]=128|(l&4032)>>>6,A[s++]=128|(l&63)>>>0),p&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=A,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=i}static _utf8ByteLength(t){let n=0;for(let r=0,a=t.length;r<a;r++){let o=t.charCodeAt(r),i=o,A=!1;if(o>=55296&&o<=56319&&r+1<a){let s=t.charCodeAt(r+1);s>=56320&&s<=57343&&(i=(o-55296<<10)+65536|s-56320,A=!0)}i<=127?n+=1:i<=2047?n+=2:i<=65535?n+=3:n+=4,A&&r++}return n}createString(t){let n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}},yE=class wA{constructor(t){if(ra(this,"id",++wA.LAST_ID),ra(this,"_onigBinding"),ra(this,"content"),ra(this,"utf16Length"),ra(this,"utf8Length"),ra(this,"utf16OffsetToUtf8"),ra(this,"utf8OffsetToUtf16"),ra(this,"ptr"),!ya)throw new w4("Must invoke loadWasm first.");this._onigBinding=ya,this.content=t;let n=new BE(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!wA._sharedPtrInUse?(wA._sharedPtr||(wA._sharedPtr=ya.omalloc(1e4)),wA._sharedPtrInUse=!0,ya.HEAPU8.set(n.utf8Value,wA._sharedPtr),this.ptr=wA._sharedPtr):this.ptr=n.createString(ya)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===wA._sharedPtr?wA._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};ra(yE,"LAST_ID",0);ra(yE,"_sharedPtr",0);ra(yE,"_sharedPtrInUse",!1);var BU=yE,C4=class{constructor(t){if(ra(this,"_onigBinding"),ra(this,"_ptr"),!ya)throw new w4("Must invoke loadWasm first.");let n=[],r=[];for(let A=0,s=t.length;A<s;A++){let u=new BE(t[A]);n[A]=u.createString(ya),r[A]=u.utf8Length}let a=ya.omalloc(4*t.length);ya.HEAPU32.set(n,a/4);let o=ya.omalloc(4*t.length);ya.HEAPU32.set(r,o/4);let i=ya.createOnigScanner(a,o,t.length);for(let A=0,s=t.length;A<s;A++)ya.ofree(n[A]);ya.ofree(o),ya.ofree(a),i===0&&_be(ya),this._onigBinding=ya,this._ptr=i}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,r){let a=0;if(typeof r=="number"&&(a=r),typeof t=="string"){t=new BU(t);let o=this._findNextMatchSync(t,n,!1,a);return t.dispose(),o}return this._findNextMatchSync(t,n,!1,a)}_findNextMatchSync(t,n,r,a){let o=this._onigBinding,i=o.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),a);if(i===0)return null;let A=o.HEAPU32,s=i/4,u=A[s++],d=A[s++],l=[];for(let p=0;p<d;p++){let g=t.convertUtf8OffsetToUtf16(A[s++]),m=t.convertUtf8OffsetToUtf16(A[s++]);l[p]={start:g,end:m,length:m-g}}return{index:u,captureIndices:l}}};function xbe(e){return typeof e.instantiator=="function"}function Dbe(e){return typeof e.default=="function"}function Fbe(e){return typeof e.data<"u"}function Sbe(e){return typeof Response<"u"&&e instanceof Response}function Lbe(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}var hE;function yU(e){if(hE)return hE;async function t(){ya=await Qbe(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),xbe(r)?r=await r.instantiator(n):Dbe(r)?r=await r.default(n):(Fbe(r)&&(r=r.data),Sbe(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await Nbe(r)(n):r=await Rbe(r)(n):Lbe(r)?r=await y4(r)(n):r instanceof WebAssembly.Module?r=await y4(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await y4(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return hE=t(),hE}function y4(e){return t=>WebAssembly.instantiate(e,t)}function Nbe(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Rbe(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var CU;function $be(e){CU=e}function Mbe(){return CU}async function jbe(e){return e&&await yU(e),{createScanner(t){return new C4(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new BU(t)}}}var k4=bU({});hU(k4,E4);var Oq=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>Promise.resolve().then(()=>(EU(),wU)))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>Promise.resolve().then(()=>(QU(),kU)))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(vU(),IU)))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>Promise.resolve().then(()=>(xU(),_U)))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>Promise.resolve().then(()=>(FU(),DU)))},{id:"catppuccin-frappe",displayName:"Catppuccin Frapp\xE9",type:"dark",import:(()=>Promise.resolve().then(()=>(LU(),SU)))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>Promise.resolve().then(()=>(RU(),NU)))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>Promise.resolve().then(()=>(MU(),$U)))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>Promise.resolve().then(()=>(PU(),jU)))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>Promise.resolve().then(()=>(HU(),TU)))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>Promise.resolve().then(()=>(UU(),GU)))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>Promise.resolve().then(()=>(qU(),OU)))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(KU(),zU)))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>Promise.resolve().then(()=>(JU(),YU)))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(ZU(),WU)))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>Promise.resolve().then(()=>(XU(),VU)))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>Promise.resolve().then(()=>(tO(),eO)))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>Promise.resolve().then(()=>(aO(),nO)))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>Promise.resolve().then(()=>(oO(),rO)))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>Promise.resolve().then(()=>(AO(),iO)))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>Promise.resolve().then(()=>(cO(),sO)))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>Promise.resolve().then(()=>(dO(),uO)))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>Promise.resolve().then(()=>(pO(),lO)))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>Promise.resolve().then(()=>(mO(),gO)))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>Promise.resolve().then(()=>(bO(),fO)))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>Promise.resolve().then(()=>(BO(),hO)))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>Promise.resolve().then(()=>(CO(),yO)))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>Promise.resolve().then(()=>(EO(),wO)))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>Promise.resolve().then(()=>(QO(),kO)))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>Promise.resolve().then(()=>(vO(),IO)))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>Promise.resolve().then(()=>(xO(),_O)))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>Promise.resolve().then(()=>(FO(),DO)))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>Promise.resolve().then(()=>(LO(),SO)))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>Promise.resolve().then(()=>(RO(),NO)))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>Promise.resolve().then(()=>(MO(),$O)))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>Promise.resolve().then(()=>(PO(),jO)))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>Promise.resolve().then(()=>(HO(),TO)))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>Promise.resolve().then(()=>(UO(),GO)))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>Promise.resolve().then(()=>(qO(),OO)))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>Promise.resolve().then(()=>(KO(),zO)))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(JO(),YO)))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>Promise.resolve().then(()=>(ZO(),WO)))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>Promise.resolve().then(()=>(XO(),VO)))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>Promise.resolve().then(()=>(tq(),eq)))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>Promise.resolve().then(()=>(aq(),nq)))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>Promise.resolve().then(()=>(oq(),rq)))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>Promise.resolve().then(()=>(Aq(),iq)))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>Promise.resolve().then(()=>(cq(),sq)))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>Promise.resolve().then(()=>(dq(),uq)))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>Promise.resolve().then(()=>(pq(),lq)))},{id:"red",displayName:"Red",type:"dark",import:(()=>Promise.resolve().then(()=>(mq(),gq)))},{id:"rose-pine",displayName:"Ros\xE9 Pine",type:"dark",import:(()=>Promise.resolve().then(()=>(bq(),fq)))},{id:"rose-pine-dawn",displayName:"Ros\xE9 Pine Dawn",type:"light",import:(()=>Promise.resolve().then(()=>(Bq(),hq)))},{id:"rose-pine-moon",displayName:"Ros\xE9 Pine Moon",type:"dark",import:(()=>Promise.resolve().then(()=>(Cq(),yq)))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(Eq(),wq)))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>Promise.resolve().then(()=>(Qq(),kq)))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>Promise.resolve().then(()=>(vq(),Iq)))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(xq(),_q)))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>Promise.resolve().then(()=>(Fq(),Dq)))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>Promise.resolve().then(()=>(Lq(),Sq)))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>Promise.resolve().then(()=>(Rq(),Nq)))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>Promise.resolve().then(()=>(Mq(),$q)))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>Promise.resolve().then(()=>(Pq(),jq)))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(Hq(),Tq)))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>Promise.resolve().then(()=>(Uq(),Gq)))}],qq=Object.fromEntries(Oq.map(e=>[e.id,e.import]));var wt=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Whe(e){return N4(e)}function N4(e){return Array.isArray(e)?Zhe(e):e instanceof RegExp?e:typeof e=="object"?Vhe(e):e}function Zhe(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=N4(e[n]);return t}function Vhe(e){let t={};for(let n in e)t[n]=N4(e[n]);return t}function ez(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function tz(e){let t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?tz(e.substring(0,e.length-1)):e.substr(~t+1)}var Q4=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,CE=class{static hasCaptures(e){return e===null?!1:(Q4.lastIndex=0,Q4.test(e))}static replaceCaptures(e,t,n){return e.replace(Q4,(r,a,o,i)=>{let A=n[parseInt(a||o,10)];if(A){let s=t.substring(A.start,A.end);for(;s[0]===".";)s=s.substring(1);switch(i){case"downcase":return s.toLowerCase();case"upcase":return s.toUpperCase();default:return s}}else return r})}};function nz(e,t){return e<t?-1:e>t?1:0}function az(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let a=0;a<n;a++){let o=nz(e[a],t[a]);if(o!==0)return o}return 0}return n-r}function zq(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function rz(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var oz=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},_b=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(tBe(e),t)}static createFromParsedTheme(e,t){return aBe(e,t)}_cachedMatchRoot=new oz(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,r=this._cachedMatchRoot.get(t).find(a=>Xhe(e.parent,a.parentScopes));return r?new iz(r.fontStyle,r.foreground,r.background):null}},I4=class wE{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(let r of n)t=new wE(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new wE(n,t[r]);return n}push(t){return new wE(this,t)}getSegments(){let t=this,n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){let n=[],r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function Xhe(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],a=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],a=!0}for(;e&&!eBe(e.scopeName,r);){if(a)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function eBe(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var iz=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function tBe(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let a=0,o=t.length;a<o;a++){let i=t[a];if(!i.settings)continue;let A;if(typeof i.scope=="string"){let l=i.scope;l=l.replace(/^[,]+/,""),l=l.replace(/[,]+$/,""),A=l.split(",")}else Array.isArray(i.scope)?A=i.scope:A=[""];let s=-1;if(typeof i.settings.fontStyle=="string"){s=0;let l=i.settings.fontStyle.split(" ");for(let p=0,g=l.length;p<g;p++)switch(l[p]){case"italic":s=s|1;break;case"bold":s=s|2;break;case"underline":s=s|4;break;case"strikethrough":s=s|8;break}}let u=null;typeof i.settings.foreground=="string"&&zq(i.settings.foreground)&&(u=i.settings.foreground);let d=null;typeof i.settings.background=="string"&&zq(i.settings.background)&&(d=i.settings.background);for(let l=0,p=A.length;l<p;l++){let m=A[l].trim().split(" "),b=m[m.length-1],B=null;m.length>1&&(B=m.slice(0,m.length-1),B.reverse()),n[r++]=new nBe(b,B,a,s,u,d)}}return n}var nBe=class{constructor(e,t,n,r,a,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=a,this.background=o}},Ma=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Ma||{});function aBe(e,t){e.sort((s,u)=>{let d=nz(s.scope,u.scope);return d!==0||(d=az(s.parentScopes,u.parentScopes),d!==0)?d:s.index-u.index});let n=0,r="#000000",a="#ffffff";for(;e.length>=1&&e[0].scope==="";){let s=e.shift();s.fontStyle!==-1&&(n=s.fontStyle),s.foreground!==null&&(r=s.foreground),s.background!==null&&(a=s.background)}let o=new rBe(t),i=new iz(n,o.getId(r),o.getId(a)),A=new iBe(new _4(0,null,-1,0,0),[]);for(let s=0,u=e.length;s<u;s++){let d=e[s];A.insert(0,d.scope,d.parentScopes,d.fontStyle,o.getId(d.foreground),o.getId(d.background))}return new _b(o,i,A)}var rBe=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},oBe=Object.freeze([]),_4=class Az{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,a,o){this.scopeDepth=t,this.parentScopes=n||oBe,this.fontStyle=r,this.foreground=a,this.background=o}clone(){return new Az(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,a=t.length;r<a;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,a){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),a!==0&&(this.background=a)}},iBe=class x4{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,a=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[a]===">"&&a++,!(r>=t.parentScopes.length||a>=n.parentScopes.length);){let o=n.parentScopes[a].length-t.parentScopes[r].length;if(o!==0)return o;r++,a++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),a,o;if(r===-1?(a=t,o=""):(a=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(a))return this._children[a].match(o)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(x4._cmpBySpecificity),n}insert(t,n,r,a,o,i){if(n===""){this._doInsertHere(t,r,a,o,i);return}let A=n.indexOf("."),s,u;A===-1?(s=n,u=""):(s=n.substring(0,A),u=n.substring(A+1));let d;this._children.hasOwnProperty(s)?d=this._children[s]:(d=new x4(this._mainRule.clone(),_4.cloneArr(this._rulesWithParentScopes)),this._children[s]=d),d.insert(t+1,u,r,a,o,i)}_doInsertHere(t,n,r,a,o){if(n===null){this._mainRule.acceptOverwrite(t,r,a,o);return}for(let i=0,A=this._rulesWithParentScopes.length;i<A;i++){let s=this._rulesWithParentScopes[i];if(az(s.parentScopes,n)===0){s.acceptOverwrite(t,r,a,o);return}}r===-1&&(r=this._mainRule.fontStyle),a===0&&(a=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new _4(t,n,r,a,o))}},md=class Oo{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){let n=Oo.getLanguageId(t),r=Oo.getTokenType(t),a=Oo.getFontStyle(t),o=Oo.getForeground(t),i=Oo.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:a,foreground:o,background:i})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,a,o,i,A){let s=Oo.getLanguageId(t),u=Oo.getTokenType(t),d=Oo.containsBalancedBrackets(t)?1:0,l=Oo.getFontStyle(t),p=Oo.getForeground(t),g=Oo.getBackground(t);return n!==0&&(s=n),r!==8&&(u=r),a!==null&&(d=a?1:0),o!==-1&&(l=o),i!==0&&(p=i),A!==0&&(g=A),(s<<0|u<<8|d<<10|l<<11|p<<15|g<<24)>>>0}};function kE(e,t){let n=[],r=ABe(e),a=r.next();for(;a!==null;){let s=0;if(a.length===2&&a.charAt(1)===":"){switch(a.charAt(0)){case"R":s=1;break;case"L":s=-1;break;default:console.log(`Unknown priority ${a} in scope selector`)}a=r.next()}let u=i();if(n.push({matcher:u,priority:s}),a!==",")break;a=r.next()}return n;function o(){if(a==="-"){a=r.next();let s=o();return u=>!!s&&!s(u)}if(a==="("){a=r.next();let s=A();return a===")"&&(a=r.next()),s}if(Kq(a)){let s=[];do s.push(a),a=r.next();while(Kq(a));return u=>t(s,u)}return null}function i(){let s=[],u=o();for(;u;)s.push(u),u=o();return d=>s.every(l=>l(d))}function A(){let s=[],u=i();for(;u&&(s.push(u),a==="|"||a===",");){do a=r.next();while(a==="|"||a===",");u=i()}return d=>s.some(l=>l(d))}}function Kq(e){return!!e&&!!e.match(/[\w\.:]+/)}function ABe(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function sz(e){typeof e.dispose=="function"&&e.dispose()}var xb=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},sBe=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},cBe=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},uBe=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new xb(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new cBe;for(let n of e)dBe(n,this.initialScopeName,this.repo,t);for(let n of t.references)if(n instanceof xb){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function dBe(e,t,n,r){let a=n.lookup(e.scopeName);if(!a){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}let o=n.lookup(t);e instanceof xb?EE({baseGrammar:o,selfGrammar:a},r):D4(e.ruleName,{baseGrammar:o,selfGrammar:a,repository:a.repository},r);let i=n.injections(e.scopeName);if(i)for(let A of i)r.add(new xb(A))}function D4(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];QE([r],t,n)}}function EE(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&QE(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&QE(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function QE(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let a=r.repository?ez({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&QE(r.patterns,{...t,repository:a},n);let o=r.include;if(!o)continue;let i=cz(o);switch(i.kind){case 0:EE({...t,selfGrammar:t.baseGrammar},n);break;case 1:EE(t,n);break;case 2:D4(i.ruleName,{...t,repository:a},n);break;case 3:case 4:let A=i.scopeName===t.selfGrammar.scopeName?t.selfGrammar:i.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(A){let s={baseGrammar:t.baseGrammar,selfGrammar:A,repository:a};i.kind===4?D4(i.ruleName,s,n):EE(s,n)}else i.kind===4?n.add(new sBe(i.scopeName,i.ruleName)):n.add(new xb(i.scopeName));break}}}var lBe=class{kind=0},pBe=class{kind=1},gBe=class{constructor(e){this.ruleName=e}kind=2},mBe=class{constructor(e){this.scopeName=e}kind=3},fBe=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function cz(e){if(e==="$base")return new lBe;if(e==="$self")return new pBe;let t=e.indexOf("#");if(t===-1)return new mBe(e);if(t===0)return new gBe(e.substring(1));{let n=e.substring(0,t),r=e.substring(t+1);return new fBe(n,r)}}var bBe=/\\(\d+)/,Yq=/\\(\d+)/g;var hBe=-1,uz=-2;var Sb=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=CE.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=CE.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${tz(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:CE.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:CE.replaceCaptures(this._contentName,e,t)}},BBe=class extends Sb{retokenizeCapturedWithRuleId;constructor(e,t,n,r,a){super(e,t,n,r),this.retokenizeCapturedWithRuleId=a}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},yBe=class extends Sb{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,a){super(e,t,n,null),this._match=new Db(r,this.id),this.captures=a,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Fb,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Jq=class extends Sb{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,a){super(e,t,n,r),this.patterns=a.patterns,this.hasMissingPatterns=a.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Fb,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},F4=class extends Sb{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,a,o,i,A,s,u){super(e,t,n,r),this._begin=new Db(a,this.id),this.beginCaptures=o,this._end=new Db(i||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=A,this.applyEndPatternLast=s||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Fb;for(let n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},IE=class extends Sb{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,a,o,i,A,s){super(e,t,n,r),this._begin=new Db(a,this.id),this.beginCaptures=o,this.whileCaptures=A,this._while=new Db(i,uz),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Fb;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Fb,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"\uFFFF"),this._cachedCompiledWhilePatterns}},dz=class nr{static createCaptureRule(t,n,r,a,o){return t.registerRule(i=>new BBe(n,i,r,a,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(a=>{if(t.id=a,t.match)return new yBe(t.$vscodeTextmateLocation,t.id,t.name,t.match,nr._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=ez({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new Jq(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,nr._compilePatterns(o,n,r))}return t.while?new IE(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,nr._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,nr._compileCaptures(t.whileCaptures||t.captures,n,r),nr._compilePatterns(t.patterns,n,r)):new F4(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,nr._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,nr._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,nr._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let a=[];if(t){let o=0;for(let i in t){if(i==="$vscodeTextmateLocation")continue;let A=parseInt(i,10);A>o&&(o=A)}for(let i=0;i<=o;i++)a[i]=null;for(let i in t){if(i==="$vscodeTextmateLocation")continue;let A=parseInt(i,10),s=0;t[i].patterns&&(s=nr.getCompiledRuleId(t[i],n,r)),a[A]=nr.createCaptureRule(n,t[i].$vscodeTextmateLocation,t[i].name,t[i].contentName,s)}}return a}static _compilePatterns(t,n,r){let a=[];if(t)for(let o=0,i=t.length;o<i;o++){let A=t[o],s=-1;if(A.include){let u=cz(A.include);switch(u.kind){case 0:case 1:s=nr.getCompiledRuleId(r[A.include],n,r);break;case 2:let d=r[u.ruleName];d&&(s=nr.getCompiledRuleId(d,n,r));break;case 3:case 4:let l=u.scopeName,p=u.kind===4?u.ruleName:null,g=n.getExternalGrammar(l,r);if(g)if(p){let m=g.repository[p];m&&(s=nr.getCompiledRuleId(m,n,g.repository))}else s=nr.getCompiledRuleId(g.repository.$self,n,g.repository);break}}else s=nr.getCompiledRuleId(A,n,r);if(s!==-1){let u=n.getRule(s),d=!1;if((u instanceof Jq||u instanceof F4||u instanceof IE)&&u.hasMissingPatterns&&u.patterns.length===0&&(d=!0),d)continue;a.push(s)}}return{patterns:a,hasMissingPatterns:(t?t.length:0)!==a.length}}},Db=class lz{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){let r=t.length,a=0,o=[],i=!1;for(let A=0;A<r;A++)if(t.charAt(A)==="\\"&&A+1<r){let u=t.charAt(A+1);u==="z"?(o.push(t.substring(a,A)),o.push("$(?!\\n)(?<!\\n)"),a=A+2):(u==="A"||u==="G")&&(i=!0),A++}this.hasAnchor=i,a===0?this.source=t:(o.push(t.substring(a,r)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=bBe.test(this.source):this.hasBackReferences=!1}clone(){return new lz(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(a=>t.substring(a.start,a.end));return Yq.lastIndex=0,this.source.replace(Yq,(a,o)=>rz(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],a=[],o,i,A,s;for(o=0,i=this.source.length;o<i;o++)A=this.source.charAt(o),t[o]=A,n[o]=A,r[o]=A,a[o]=A,A==="\\"&&o+1<i&&(s=this.source.charAt(o+1),s==="A"?(t[o+1]="\uFFFF",n[o+1]="\uFFFF",r[o+1]="A",a[o+1]="A"):s==="G"?(t[o+1]="\uFFFF",n[o+1]="G",r[o+1]="\uFFFF",a[o+1]="G"):(t[o+1]=s,n[o+1]=s,r[o+1]=s,a[o+1]=s),o++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:a.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Fb=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new Wq(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(a=>a.resolveAnchors(t,n));return new Wq(e,r,this._items.map(a=>a.ruleId))}},Wq=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
67
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let A=i[1];if(t===i[0]){o(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){o(i);continue}}if(e.metadataRegistry.get(i[0])?.id){o(i);continue}if(A.cycle){o(i);continue}if(A.count>1&&e.reused==="ref"){o(i);continue}}e.external&&(e.sharedDefsExtractedFor=e.external)}function KP(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let r of t){if(!r||typeof r!="object")return;KP(r);let a=Object.keys(r);if(a.length!==1||a[0]!=="type")return;let o=r.type;for(let i of Array.isArray(o)?o:[o]){if(typeof i!="string")return;n.includes(i)||n.push(i)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var YP=new Set(["type","properties","required","additionalProperties"]),qP=["oneOf","anyOf"];function zP(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function S1(e){let t=[];for(let o of e){if(typeof o!="object"||o.type!=="object")return null;for(let i in o)if(!YP.has(i))return null;t.push(o)}let n={},r=new Set;for(let o of t){for(let i in o.properties){if(Object.prototype.hasOwnProperty.call(n,i))continue;let A=[];for(let u of t){let d=u.properties?.[i]??zP(u);d!=null&&(A.some(l=>JSON.stringify(l)===JSON.stringify(d))||A.push(d))}let s=A.length===1?A[0]:S1(A)??{allOf:A};sn(n,i,s)}for(let i of o.required??[])r.add(i)}let a={type:"object",properties:n};if(r.size&&(a.required=[...r]),t.every(o=>o.additionalProperties===!1))a.additionalProperties=!1;else{let o=[];for(let i of t){let A=zP(i);A&&!o.some(s=>JSON.stringify(s)===JSON.stringify(A))&&o.push(A)}o.length===1?a.additionalProperties=o[0]:o.length>1&&(a.additionalProperties={allOf:o})}return a}function Xue(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let a of YP)if(a in e)return;let n=t.filter(a=>qP.some(o=>Array.isArray(a[o]))),r=null;if(!n.length)r=S1(t);else{let a=n[0],o=qP.find(s=>Array.isArray(a[s]));if(Object.keys(a).length!==1)return;let i=t.filter(s=>s!==a),A=a[o].map(s=>S1([...i,s]));if(A.some(s=>!s))return;r={[o]:A}}r&&(delete e.allOf,Ef(e,r))}function Ic(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=A=>{let s=e.seen.get(A);if(s.ref===null)return;let u=s.def??s.schema,d={...u},l=s.ref;if(s.ref=null,l){r(l);let g=e.seen.get(l),m=g.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):Ef(u,m),Ef(u,d),A._zod.parent===l)for(let B in u)B==="$ref"||B==="allOf"||B in d||delete u[B];if(m.$ref&&g.def)for(let B in u)B==="$ref"||B==="allOf"||B in g.def&&JSON.stringify(u[B])===JSON.stringify(g.def[B])&&delete u[B]}let p=A._zod.parent;if(p&&p!==l){r(p);let g=e.seen.get(p);if(g?.schema.$ref&&(u.$ref=g.schema.$ref,g.def))for(let m in u)m==="$ref"||m==="allOf"||m in g.def&&JSON.stringify(u[m])===JSON.stringify(g.def[m])&&delete u[m]}e.override({zodSchema:A,jsonSchema:u,path:s.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let A of[...e.seen.entries()].reverse())r(A[0]);if(e.target!=="openapi-3.0")for(let A of e.seen.entries())KP(A[1].def??A[1].schema);for(let A of e.deferred)A();if(e.intersections.length){let A=new Map;for(let s of e.seen.values())for(let u of[s.schema,s.def]){let d=u?.allOf;if(!Array.isArray(d))continue;let l=A.get(d);l?l.push(u):A.set(d,[u])}for(let s of e.intersections)for(let u of A.get(s)??[])Xue(u)}}let a={};if(e.target==="draft-2020-12"?a.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?a.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?a.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let A=e.external.registry.get(t)?.id;if(!A)throw new Error("Schema is missing an `id` property");a.$id=e.external.uri(A)}Ef(a,n.defId?n.schema:n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;o!==void 0&&a.id===o&&delete a.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let A of e.seen.entries()){let s=A[1];s.def&&s.defId&&(s.def.id===s.defId&&delete s.def.id,sn(i,s.defId,s.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?a.$defs=i:a.definitions=i);try{let A=JSON.parse(JSON.stringify(a));return Object.defineProperty(A,"~standard",{value:{...t["~standard"],jsonSchema:{input:hp(t,"input",e.processors),output:hp(t,"output",e.processors)}},enumerable:!1,writable:!1}),A}catch{throw new Error("Error converting schema to JSON.")}}function mr(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return mr(r.element,n);if(r.type==="set")return mr(r.valueType,n);if(r.type==="lazy")return mr(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return mr(r.innerType,n);if(r.type==="intersection")return mr(r.left,n)||mr(r.right,n);if(r.type==="record"||r.type==="map")return mr(r.keyType,n)||mr(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:mr(r.in,n)||mr(r.out,n);if(r.type==="object"){for(let a in r.shape)if(mr(r.shape[a],n))return!0;return!1}if(r.type==="union"){for(let a of r.options)if(mr(a,n))return!0;return!1}if(r.type==="tuple"){for(let a of r.items)if(mr(a,n))return!0;return!!(r.rest&&mr(r.rest,n))}return!1}var L1=(e,t={})=>n=>{let r=kc({...n,processors:t});return ht(e,r),Qc(r,e),Ic(r,e)},hp=(e,t,n={})=>r=>{let{libraryOptions:a,target:o}=r??{},i=kc({...a??{},target:o,io:t,processors:n});return ht(e,i),Qc(i,e),Ic(i,e)};var ede={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},$1=(e,t,n,r)=>{let a=n;a.type="string";let{minimum:o,maximum:i,format:A,patterns:s,contentEncoding:u,laxFormat:d}=e._zod.bag;if(typeof o=="number"&&(a.minLength=o),typeof i=="number"&&(a.maxLength=i),A&&(a.format=ede[A]??A,a.format===""&&delete a.format,(A==="time"||d)&&delete a.format),u&&(a.contentEncoding=u),s&&s.size>0){let l=[...s];l.length===1?a.pattern=l[0].source:l.length>1&&(a.allOf=[...l.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},M1=(e,t,n,r)=>{let a=n,{minimum:o,maximum:i,format:A,multipleOf:s,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof A=="string"&&A.includes("int")?a.type="integer":a.type="number";let l=typeof d=="number"&&d>=(o??Number.NEGATIVE_INFINITY),p=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),g=t.target==="draft-04"||t.target==="openapi-3.0";l?g?(a.minimum=d,a.exclusiveMinimum=!0):a.exclusiveMinimum=d:typeof o=="number"&&(a.minimum=o),p?g?(a.maximum=u,a.exclusiveMaximum=!0):a.exclusiveMaximum=u:typeof i=="number"&&(a.maximum=i),typeof s=="number"&&(Number.isFinite(s)&&s!==0?a.multipleOf=Math.abs(s):ta(e,t,a,r,`A multipleOf divisor of ${s} cannot be represented in JSON Schema`))},j1=(e,t,n,r)=>{n.type="boolean"},P1=(e,t,n,r)=>{ta(e,t,n,r,"BigInt cannot be represented in JSON Schema")},T1=(e,t,n,r)=>{ta(e,t,n,r,"Symbols cannot be represented in JSON Schema")},H1=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},G1=(e,t,n,r)=>{ta(e,t,n,r,"Undefined cannot be represented in JSON Schema")},U1=(e,t,n,r)=>{ta(e,t,n,r,"Void cannot be represented in JSON Schema")},O1=(e,t,n,r)=>{n.not={}},q1=(e,t,n,r)=>{},z1=(e,t,n,r)=>{},K1=(e,t,n,r)=>{ta(e,t,n,r,"Date cannot be represented in JSON Schema")},Y1=(e,t,n,r)=>{let a=e._zod.def,o=Jm(a.entries);if(o.length===0){n.not={};return}o.every(i=>typeof i=="number")&&(n.type="number"),o.every(i=>typeof i=="string")&&(n.type="string"),n.enum=o},J1=(e,t,n,r)=>{let a=e._zod.def;if(a.values.length===0){n.not={};return}let o=[];for(let i of a.values)if(i===void 0){if(ta(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i=="bigint"){if(ta(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(i))}else o.push(i);if(o.length!==0)if(o.length===1){let i=o[0];n.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[i]:n.const=i}else o.every(i=>typeof i=="number")&&(n.type="number"),o.every(i=>typeof i=="string")&&(n.type="string"),o.every(i=>typeof i=="boolean")&&(n.type="boolean"),o.every(i=>i===null)&&(n.type="null"),n.enum=o},W1=(e,t,n,r)=>{ta(e,t,n,r,"NaN cannot be represented in JSON Schema")},Z1=(e,t,n,r)=>{let a=n,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");a.type="string",a.pattern=o.source},V1=(e,t,n,r)=>{let a=n,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:A,mime:s}=e._zod.bag;i!==void 0&&(o.minLength=i),A!==void 0&&(o.maxLength=A),s?s.length===1?(o.contentMediaType=s[0],Object.assign(a,o)):(Object.assign(a,o),a.anyOf=s.map(u=>({contentMediaType:u}))):Object.assign(a,o)},X1=(e,t,n,r)=>{n.type="boolean"},eF=(e,t,n,r)=>{ta(e,t,n,r,"Custom types cannot be represented in JSON Schema")},tF=(e,t,n,r)=>{ta(e,t,n,r,"Function types cannot be represented in JSON Schema")},nF=(e,t,n,r)=>{ta(e,t,n,r,"Transforms cannot be represented in JSON Schema")},aF=(e,t,n,r)=>{ta(e,t,n,r,"Map cannot be represented in JSON Schema")},rF=(e,t,n,r)=>{ta(e,t,n,r,"Set cannot be represented in JSON Schema")},oF=(e,t,n,r)=>{let a=n,o=e._zod.def,{minimum:i,maximum:A}=e._zod.bag;typeof i=="number"&&(a.minItems=i),typeof A=="number"&&(a.maxItems=A),a.type="array",a.items=ht(o.element,t,{...r,path:[...r.path,"items"]})};function kf(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?kf(t.out):t.type==="catch"?kf(t.innerType):e._zod.optin}var iF=(e,t,n,r)=>{let a=n,o=e._zod.def,i=o.shape;if(Object.getOwnPropertySymbols(i).length&&ta(e,t,a,r,"Symbol keys cannot be represented in JSON Schema"))return;a.type="object",a.properties={};for(let d in i)sn(a.properties,d,ht(i[d],t,{...r,path:[...r.path,"properties",d]}));let s=new Set(Object.keys(i)),u=new Set([...s].filter(d=>{let l=o.shape[d];return t.io==="input"?kf(l)===void 0:l._zod.optout===void 0}));u.size>0&&(a.required=Array.from(u)),o.catchall?._zod.def.type==="never"?a.additionalProperties=!1:o.catchall?o.catchall&&(a.additionalProperties=ht(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(a.additionalProperties=!1)},cw=(e,t,n,r)=>{let a=e._zod.def,o=a.inclusive===!1,i=a.options.map((A,s)=>ht(A,t,{...r,path:[...r.path,o?"oneOf":"anyOf",s]}));o?n.oneOf=i:n.anyOf=i},AF=(e,t,n,r)=>{let a=e._zod.def,o=ht(a.left,t,{...r,path:[...r.path,"allOf",0]}),i=ht(a.right,t,{...r,path:[...r.path,"allOf",1]}),A=u=>"allOf"in u&&Object.keys(u).length===1,s=[...A(o)?o.allOf:[o],...A(i)?i.allOf:[i]];n.allOf=s,t.intersections.push(s)},sF=(e,t,n,r)=>{let a=n,o=e._zod.def;a.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",A=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",s=o.items.map((b,B)=>ht(b,t,{...r,path:[...r.path,i,B]})),u=o.rest?ht(o.rest,t,{...r,path:[...r.path,A,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null,d=o.items.length;for(;d>0;){let b=o.items[d-1];if(!(t.io==="input"?kf(b)!==void 0:b._zod.optout==="optional"))break;d--}let l=o.items.length,p=!o.rest;t.target==="draft-2020-12"?(a.prefixItems=s,p?a.items=!1:u&&(a.items=u),d>0&&(a.minItems=d),p&&(a.maxItems=l)):t.target==="openapi-3.0"?(a.items={anyOf:s},u&&a.items.anyOf.push(u),d>0&&(a.minItems=d),p&&(a.maxItems=l)):(a.items=s,p?a.additionalItems=!1:u&&(a.additionalItems=u),d>0&&(a.minItems=d),p&&(a.maxItems=l));let{minimum:g,maximum:m}=e._zod.bag;typeof g=="number"&&(a.minItems=g),typeof m=="number"&&(a.maxItems=m)};function N1(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let m=e.get(t)?.def;if(!m)return t;let b=N1(e,m,n);return b===m?t:b}for(let m of["anyOf","oneOf"]){let b=t[m];if(!Array.isArray(b))continue;let B=b.map(h=>N1(e,h,n));B.some((h,f)=>h!==b[f])&&(t={...t,[m]:B})}let r=Array.isArray(t.type)?t.type:[t.type],a=!r.includes("string")&&r.some(m=>m==="number"||m==="integer"),o=t.enum??(t.const!==void 0?[t.const]:void 0);if(!a&&!o?.some(m=>typeof m=="number"))return t;let{minimum:i,maximum:A,exclusiveMinimum:s,exclusiveMaximum:u,multipleOf:d,format:l,id:p,...g}=t;return g.enum?g.enum=g.enum.map(m=>typeof m=="number"?String(m):m):typeof g.const=="number"&&(g.const=String(g.const)),a&&(g.type="string",o||(g.pattern=(r.includes("number")?Cc:of).source)),g}var R1=new WeakMap;function tde(e){let t=new Map;for(let r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);let n=new Map;for(let r of R1.get(e)??[]){let a=e.seen.get(r),o=(a?.def??a?.schema)?.propertyNames;if(!o||o===!0||n.has(o))continue;let i=N1(t,o,new Set);i!==o&&n.set(o,i)}if(n.size)for(let r of e.seen.values())for(let a of[r.schema,r.def]){let o=a&&n.get(a.propertyNames);o&&(a.propertyNames=o)}}var cF=(e,t,n,r)=>{let a=n,o=e._zod.def;a.type="object";let i=o.keyType,s=i._zod.bag?.patterns;if(o.mode==="loose"&&s&&s.size>0){let l=ht(o.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});a.patternProperties={};for(let p of s)sn(a.patternProperties,p.source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){a.propertyNames=ht(o.keyType,t,{...r,path:[...r.path,"propertyNames"]});let l=R1.get(t);l||(l=[],R1.set(t,l),t.deferred.push(()=>tde(t))),l.push(e)}a.additionalProperties=ht(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let u=i._zod.values,d=t.io==="input"&&kf(o.valueType)!==void 0;if(u&&!o.partial&&!d){let l=[...u].filter(p=>typeof p=="string"||typeof p=="number");l.length>0&&(a.required=l.map(String))}},uF=(e,t,n,r)=>{let a=e._zod.def,o=ht(a.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=a.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},dF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},lF=Symbol();function JP(e,t,n,r,a){let o=!1,i=JSON.stringify(e,(A,s)=>typeof s!="bigint"?s:(o=!0,null));return o?(ta(t,n,r,a,"BigInt defaults cannot be represented in JSON Schema"),lF):JSON.parse(i)}var pF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType;let i=JP(a.defaultValue,e,t,n,r);i!==lF&&(n.default=i)},gF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);if(o.ref=a.innerType,t.io!=="input")return;let i=JP(a.defaultValue,e,t,n,r);i!==lF&&(n._prefault=i)},mF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType;let i;try{i=a.catchValue(void 0)}catch{ta(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=i},fF=(e,t,n,r)=>{let a=e._zod.def,o=a.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?o?a.out:a.in:a.out;ht(i,t,r);let A=t.seen.get(e);A.ref=i},bF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType,n.readOnly=!0},hF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},uw=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},BF=(e,t,n,r)=>{let a=e._zod.innerType;ht(a,t,r);let o=t.seen.get(e);o.ref=a},sw={string:$1,number:M1,boolean:j1,bigint:P1,symbol:T1,null:H1,undefined:G1,void:U1,never:O1,any:q1,unknown:z1,date:K1,enum:Y1,literal:J1,nan:W1,template_literal:Z1,file:V1,success:X1,custom:eF,function:tF,transform:nF,map:aF,set:rF,array:oF,object:iF,union:cw,intersection:AF,tuple:sF,record:cF,nullable:uF,nonoptional:dF,default:pF,prefault:gF,catch:mF,pipe:fF,readonly:bF,promise:hF,optional:uw,lazy:BF};function dw(e,t){if("_idmap"in e){let r=e,a=kc({...t,processors:sw}),o={};for(let s of r._idmap.entries()){let[u,d]=s;ht(d,a)}let i={},A={registry:r,uri:t?.uri,defs:o};a.external=A;for(let s of r._idmap.entries()){let[u,d]=s;Qc(a,d),sn(i,u,Ic(a,d))}if(Object.keys(o).length>0){let s=a.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[s]:o}}return{schemas:i}}let n=kc({...t,processors:sw});return ht(e,n),Qc(n,e),Ic(n,e)}var lw=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=kc({processors:sw,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return ht(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Qc(this.ctx,t);let r=Ic(this.ctx,t),{"~standard":a,...o}=r;return o}};var WP={};var vp={};L(vp,{ZodAny:()=>TF,ZodArray:()=>OF,ZodBase64:()=>Fw,ZodBase64URL:()=>Sw,ZodBigInt:()=>Qp,ZodBigIntFormat:()=>Rw,ZodBoolean:()=>kp,ZodCIDRv4:()=>xw,ZodCIDRv6:()=>Dw,ZodCUID:()=>ww,ZodCUID2:()=>Ew,ZodCatch:()=>d8,ZodCodec:()=>Nf,ZodCreditCard:()=>LF,ZodCustom:()=>Rf,ZodCustomStringFormat:()=>wp,ZodDate:()=>_f,ZodDefault:()=>o8,ZodDiscriminatedUnion:()=>zF,ZodE164:()=>Lw,ZodEmail:()=>hw,ZodEmoji:()=>yw,ZodEnum:()=>yp,ZodExactOptional:()=>Pw,ZodFile:()=>t8,ZodFunction:()=>C8,ZodGUID:()=>Bw,ZodIPv4:()=>vw,ZodIPv6:()=>_w,ZodISODate:()=>_c,ZodISODateTime:()=>vc,ZodISODuration:()=>Dc,ZodISOTime:()=>xc,ZodIntersection:()=>KF,ZodJWT:()=>Nw,ZodKSUID:()=>Iw,ZodLazy:()=>h8,ZodLiteral:()=>e8,ZodMAC:()=>SF,ZodMap:()=>VF,ZodNaN:()=>p8,ZodNanoID:()=>Cw,ZodNever:()=>GF,ZodNonOptional:()=>Tw,ZodNull:()=>jF,ZodNullable:()=>r8,ZodNumber:()=>Ep,ZodNumberFormat:()=>Ju,ZodObject:()=>Df,ZodOptional:()=>Sf,ZodPipe:()=>Lf,ZodPrefault:()=>A8,ZodPreprocess:()=>g8,ZodPromise:()=>y8,ZodReadonly:()=>m8,ZodRecord:()=>Bp,ZodSet:()=>XF,ZodString:()=>Cp,ZodStringFormat:()=>xt,ZodSuccess:()=>u8,ZodSymbol:()=>$F,ZodTemplateLiteral:()=>b8,ZodTransform:()=>n8,ZodTuple:()=>JF,ZodType:()=>xe,ZodULID:()=>kw,ZodURL:()=>vf,ZodUUID:()=>mA,ZodUndefined:()=>MF,ZodUnion:()=>Ff,ZodUnknown:()=>HF,ZodVoid:()=>UF,ZodXID:()=>Qw,ZodXor:()=>qF,_ZodString:()=>bw,_default:()=>i8,_function:()=>iH,any:()=>MT,array:()=>xf,base64:()=>BT,base64url:()=>yT,bigint:()=>ST,boolean:()=>RF,catch:()=>l8,check:()=>AH,cidrv4:()=>bT,cidrv6:()=>hT,codec:()=>nH,creditCard:()=>wT,cuid:()=>cT,cuid2:()=>uT,custom:()=>sH,date:()=>PT,describe:()=>cH,discriminatedUnion:()=>qT,e164:()=>CT,email:()=>XP,emoji:()=>AT,enum:()=>Mw,exactOptional:()=>a8,file:()=>VT,float32:()=>_T,float64:()=>xT,function:()=>iH,guid:()=>eT,hash:()=>vT,hex:()=>IT,hostname:()=>QT,httpUrl:()=>iT,instanceof:()=>dH,int:()=>mw,int32:()=>DT,int64:()=>LT,intersection:()=>YF,invertCodec:()=>aH,ipv4:()=>gT,ipv6:()=>fT,json:()=>pH,jwt:()=>ET,keyof:()=>TT,ksuid:()=>pT,lazy:()=>B8,literal:()=>ZT,looseObject:()=>UT,looseRecord:()=>KT,mac:()=>mT,map:()=>YT,meta:()=>uH,nan:()=>tH,nanoid:()=>sT,nativeEnum:()=>WT,never:()=>$w,nonoptional:()=>c8,null:()=>PF,nullable:()=>If,nullish:()=>XT,number:()=>NF,object:()=>HT,optional:()=>Ku,partialRecord:()=>zT,pipe:()=>fw,prefault:()=>s8,preprocess:()=>gH,promise:()=>oH,readonly:()=>f8,record:()=>ZF,refine:()=>w8,set:()=>JT,strictObject:()=>GT,string:()=>Qf,stringFormat:()=>kT,stringbool:()=>lH,success:()=>eH,superRefine:()=>E8,symbol:()=>RT,templateLiteral:()=>rH,transform:()=>jw,tuple:()=>WF,uint32:()=>FT,uint64:()=>NT,ulid:()=>dT,undefined:()=>$T,union:()=>Ip,unknown:()=>zu,url:()=>oT,uuid:()=>tT,uuidv4:()=>nT,uuidv6:()=>aT,uuidv7:()=>rT,void:()=>jT,xid:()=>lT,xor:()=>OT});var pw={};L(pw,{endsWith:()=>up,gt:()=>pA,gte:()=>mo,includes:()=>sp,length:()=>qu,lowercase:()=>ip,lt:()=>lA,lte:()=>go,maxLength:()=>Ou,maxSize:()=>Ec,mime:()=>dp,minLength:()=>fs,minSize:()=>gA,multipleOf:()=>wc,negative:()=>aw,nonnegative:()=>ow,nonpositive:()=>rw,normalize:()=>lp,overwrite:()=>Ci,positive:()=>nw,properties:()=>Aw,property:()=>iw,regex:()=>op,size:()=>Uu,slugify:()=>fp,startsWith:()=>cp,toLowerCase:()=>gp,toUpperCase:()=>mp,trim:()=>pp,uppercase:()=>Ap});var ZP=new WeakSet([Object.prototype,Error.prototype]);function gw(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}var VP=(e,t)=>{nf.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);ZP.has(n)||(ZP.add(n),gw(n,"format",r=>a=>rf(r,a)),gw(n,"flatten",r=>a=>af(r,a)),gw(n,"addIssue",r=>a=>{r.issues.push(a),r.message=JSON.stringify(r.issues,Jl,2)}),gw(n,"addIssues",r=>a=>{r.issues.push(...a),r.message=JSON.stringify(r.issues,Jl,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},ade=v("ZodError",VP),Ur=v("ZodError",VP,void 0,{Parent:Error});var yF=Vl(Ur),CF=Xl(Ur),wF=ep(Ur),EF=tp(Ur),kF=Ky(Ur),QF=Yy(Ur),IF=Jy(Ur),vF=Wy(Ur),_F=Zy(Ur),xF=Vy(Ur),DF=Xy(Ur),FF=eC(Ur);function ode(){ha.localeError||hn(xC())}function Yu(){ha.memoizer||hn({memoizer:mf()})}var xe=v("ZodType",(e,t)=>(ode(),Ee.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(G.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return bt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(w8(e,t))},superRefine(e,t){return this.check(E8(e,t))},overwrite(e){return this.check(Ci(e))},optional(){return Ku(this)},exactOptional(){return a8(this)},nullable(){return If(this)},nullish(){return Ku(If(this))},nonoptional(e){return c8(this,e)},array(){return xf(this)},or(e){return Ip([this,e])},and(e){return YF(this,e)},transform(e){return fw(this,jw(e))},default(e){return i8(this,e)},prefault(e){return s8(this,e)},catch(e){return l8(this,e)},pipe(e){return fw(this,e)},readonly(){return f8(this)},describe(e){let t=this.clone();return La.add(t,{description:e}),t},meta(...e){if(e.length===0)return La.get(this);let t=this.clone();return La.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return G.hide(this,"~standard",{...dC(this),jsonSchema:{input:hp(this,"input"),output:hp(this,"output")}})},set"~standard"(e){G.own(this,"~standard",e)},parse:function e(t,n){return yF(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await CF(this,t,n,{callee:e})},safeParse(e,t){return wF(this,e,t)},async safeParseAsync(e,t){return EF(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){G.own(this,"spa",e)},encode:function e(t,n){return kF(this,t,n,{callee:e})},decode:function e(t,n){return QF(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await IF(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await vF(this,t,n,{callee:e})},safeEncode(e,t){return _F(this,e,t)},safeDecode(e,t){return xF(this,e,t)},async safeEncodeAsync(e,t){return DF(this,e,t)},async safeDecodeAsync(e,t){return FF(this,e,t)},toJSONSchema(e){return L1(this,{})(e)},get description(){return La.get(this)?.description},get _def(){return this._zod.def}}),bw=v("_ZodString",(e,t)=>{ju.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>$1(e,r,a,o);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null},{regex(...e){return this.check(op(...e))},includes(...e){return this.check(sp(...e))},startsWith(...e){return this.check(cp(...e))},endsWith(...e){return this.check(up(...e))},min(...e){return this.check(fs(...e))},max(...e){return this.check(Ou(...e))},length(...e){return this.check(qu(...e))},nonempty(...e){return this.check(fs(1,...e))},lowercase(e){return this.check(ip(e))},uppercase(e){return this.check(Ap(e))},trim(){return this.check(pp())},normalize(...e){return this.check(lp(...e))},toLowerCase(){return this.check(gp())},toUpperCase(){return this.check(mp())},slugify(){return this.check(fp())}}),Cp=v("ZodString",(e,t)=>{ju.init(e,t),bw.init(e,t)},{email(e){return this.check(RC(hw,e))},url(e){return this.check(hf(vf,e))},jwt(e){return this.check(tw(Nw,e))},emoji(e){return this.check(HC(yw,e))},guid(e){return this.check($C(Bw,e))},uuid(e){return this.check(MC(mA,e))},uuidv4(e){return this.check(jC(mA,e))},uuidv6(e){return this.check(PC(mA,e))},uuidv7(e){return this.check(TC(mA,e))},nanoid(e){return this.check(GC(Cw,e))},cuid(e){return this.check(UC(ww,e))},cuid2(e){return this.check(OC(Ew,e))},ulid(e){return this.check(qC(kw,e))},base64(e){return this.check(VC(Fw,e))},base64url(e){return this.check(XC(Sw,e))},xid(e){return this.check(zC(Qw,e))},ksuid(e){return this.check(KC(Iw,e))},ipv4(e){return this.check(YC(vw,e))},ipv6(e){return this.check(JC(_w,e))},cidrv4(e){return this.check(WC(xw,e))},cidrv6(e){return this.check(ZC(Dw,e))},e164(e){return this.check(ew(Lw,e))},datetime(e){return this.check(Bf(vc,e))},date(e){return this.check(yf(_c,e))},time(e){return this.check(Cf(xc,e))},duration(e){return this.check(wf(Dc,e))}});function Qf(e){return WD(Cp,e)}var xt=v("ZodStringFormat",(e,t)=>{Ct.init(e,t),bw.init(e,t)}),vc=v("ZodISODateTime",(e,t)=>{Hx.init(e,t),xt.init(e,t)}),_c=v("ZodISODate",(e,t)=>{Gx.init(e,t),xt.init(e,t)}),xc=v("ZodISOTime",(e,t)=>{Ux.init(e,t),xt.init(e,t)}),Dc=v("ZodISODuration",(e,t)=>{Ox.init(e,t),xt.init(e,t)}),hw=v("ZodEmail",(e,t)=>{Dx.init(e,t),xt.init(e,t)});function XP(e){return RC(hw,e)}var Bw=v("ZodGUID",(e,t)=>{_x.init(e,t),xt.init(e,t)});function eT(e){return $C(Bw,e)}var mA=v("ZodUUID",(e,t)=>{xx.init(e,t),xt.init(e,t)});function tT(e){return MC(mA,e)}function nT(e){return jC(mA,e)}function aT(e){return PC(mA,e)}function rT(e){return TC(mA,e)}var vf=v("ZodURL",(e,t)=>{Lx.init(e,t),xt.init(e,t)});function oT(e){return hf(vf,e)}function iT(e){return hf(vf,{protocol:pr.httpProtocol,hostname:pr.domain,...G.normalizeParams(e)})}var yw=v("ZodEmoji",(e,t)=>{Nx.init(e,t),xt.init(e,t)});function AT(e){return HC(yw,e)}var Cw=v("ZodNanoID",(e,t)=>{Rx.init(e,t),xt.init(e,t)});function sT(e){return GC(Cw,e)}var ww=v("ZodCUID",(e,t)=>{$x.init(e,t),xt.init(e,t)});function cT(e){return UC(ww,e)}var Ew=v("ZodCUID2",(e,t)=>{Mx.init(e,t),xt.init(e,t)});function uT(e){return OC(Ew,e)}var kw=v("ZodULID",(e,t)=>{jx.init(e,t),xt.init(e,t)});function dT(e){return qC(kw,e)}var Qw=v("ZodXID",(e,t)=>{Px.init(e,t),xt.init(e,t)});function lT(e){return zC(Qw,e)}var Iw=v("ZodKSUID",(e,t)=>{Tx.init(e,t),xt.init(e,t)});function pT(e){return KC(Iw,e)}var vw=v("ZodIPv4",(e,t)=>{qx.init(e,t),xt.init(e,t)});function gT(e){return YC(vw,e)}var SF=v("ZodMAC",(e,t)=>{Kx.init(e,t),xt.init(e,t)});function mT(e){return VD(SF,e)}var _w=v("ZodIPv6",(e,t)=>{zx.init(e,t),xt.init(e,t)});function fT(e){return JC(_w,e)}var xw=v("ZodCIDRv4",(e,t)=>{Yx.init(e,t),xt.init(e,t)});function bT(e){return WC(xw,e)}var Dw=v("ZodCIDRv6",(e,t)=>{Jx.init(e,t),xt.init(e,t)});function hT(e){return ZC(Dw,e)}var Fw=v("ZodBase64",(e,t)=>{Wx.init(e,t),xt.init(e,t)});function BT(e){return VC(Fw,e)}var Sw=v("ZodBase64URL",(e,t)=>{Zx.init(e,t),xt.init(e,t)});function yT(e){return XC(Sw,e)}var Lw=v("ZodE164",(e,t)=>{Vx.init(e,t),xt.init(e,t)});function CT(e){return ew(Lw,e)}var LF=v("ZodCreditCard",(e,t)=>{Xx.init(e,t),xt.init(e,t)});function wT(e){return XD(LF,e)}var Nw=v("ZodJWT",(e,t)=>{eD.init(e,t),xt.init(e,t)});function ET(e){return tw(Nw,e)}var wp=v("ZodCustomStringFormat",(e,t)=>{tD.init(e,t),xt.init(e,t)});function kT(e,t,n={}){return bp(wp,e,t,n)}function QT(e){return bp(wp,"hostname",pr.hostname,e)}function IT(e){return bp(wp,"hex",pr.hex,e)}function vT(e,t){let n=t?.enc??"hex",r=`${e}_${n}`,a=pr[r];if(!a)throw new Error(`Unrecognized hash format: ${r}`);return bp(wp,r,a,t)}var Ep=v("ZodNumber",(e,t)=>{yC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>M1(e,r,a,o);let 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},{gt(e,t){return this.check(pA(e,t))},gte(e,t){return this.check(mo(e,t))},min(e,t){return this.check(mo(e,t))},lt(e,t){return this.check(lA(e,t))},lte(e,t){return this.check(go(e,t))},max(e,t){return this.check(go(e,t))},int(e){return this.check(mw(e))},safe(e){return this.check(mw(e))},positive(e){return this.check(pA(0,e))},nonnegative(e){return this.check(mo(0,e))},negative(e){return this.check(lA(0,e))},nonpositive(e){return this.check(go(0,e))},multipleOf(e,t){return this.check(wc(e,t))},step(e,t){return this.check(wc(e,t))},finite(){return this}});function NF(e){return t1(Ep,e)}var Ju=v("ZodNumberFormat",(e,t)=>{nD.init(e,t),Ep.init(e,t)});function mw(e){return a1(Ju,e)}function _T(e){return r1(Ju,e)}function xT(e){return o1(Ju,e)}function DT(e){return i1(Ju,e)}function FT(e){return A1(Ju,e)}var kp=v("ZodBoolean",(e,t)=>{df.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>j1(e,n,r,a)});function RF(e){return s1(kp,e)}var Qp=v("ZodBigInt",(e,t)=>{CC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>P1(e,r,a,o);let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null},{gte(e,t){return this.check(mo(e,t))},min(e,t){return this.check(mo(e,t))},gt(e,t){return this.check(pA(e,t))},lt(e,t){return this.check(lA(e,t))},lte(e,t){return this.check(go(e,t))},max(e,t){return this.check(go(e,t))},positive(e){return this.check(pA(BigInt(0),e))},negative(e){return this.check(lA(BigInt(0),e))},nonpositive(e){return this.check(go(BigInt(0),e))},nonnegative(e){return this.check(mo(BigInt(0),e))},multipleOf(e,t){return this.check(wc(e,t))}});function ST(e){return u1(Qp,e)}var Rw=v("ZodBigIntFormat",(e,t)=>{aD.init(e,t),Qp.init(e,t)});function LT(e){return l1(Rw,e)}function NT(e){return p1(Rw,e)}var $F=v("ZodSymbol",(e,t)=>{rD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>T1(e,n,r,a)});function RT(e){return g1($F,e)}var MF=v("ZodUndefined",(e,t)=>{oD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>G1(e,n,r,a)});function $T(e){return m1(MF,e)}var jF=v("ZodNull",(e,t)=>{iD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>H1(e,n,r,a)});function PF(e){return f1(jF,e)}var TF=v("ZodAny",(e,t)=>{AD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>q1(e,n,r,a)});function MT(){return b1(TF)}var HF=v("ZodUnknown",(e,t)=>{sD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>z1(e,n,r,a)});function zu(){return h1(HF)}var GF=v("ZodNever",(e,t)=>{cD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>O1(e,n,r,a)});function $w(e){return B1(GF,e)}var UF=v("ZodVoid",(e,t)=>{uD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>U1(e,n,r,a)});function jT(e){return y1(UF,e)}var _f=v("ZodDate",(e,t)=>{dD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>K1(e,r,a,o),e.min=(r,a)=>e.check(mo(r,a)),e.max=(r,a)=>e.check(go(r,a));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function PT(e){return C1(_f,e)}var OF=v("ZodArray",(e,t)=>{Yu(),lD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>oF(e,n,r,a),e.element=t.element},{min(e,t){return this.check(fs(e,t))},nonempty(e){return this.check(fs(1,e))},max(e,t){return this.check(Ou(e,t))},length(e,t){return this.check(qu(e,t))},unwrap(){return this.element}});function xf(e,t){return k1(OF,e,t)}function TT(e){let t=e._zod.def.shape;return Mw(Object.keys(t))}var Df=v("ZodObject",(e,t)=>{Yu(),pD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>iF(e,n,r,a),G.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Mw(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:zu()})},loose(){return this.clone({...this._zod.def,catchall:zu()})},strict(){return this.clone({...this._zod.def,catchall:$w()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return G.extend(this,e)},safeExtend(e){return G.safeExtend(this,e)},merge(e){return G.merge(this,e)},pick(e){return G.pick(this,e)},omit(e){return G.omit(this,e)},partial(...e){return G.partial(Sf,this,e[0])},exactPartial(...e){return G.partial(Pw,this,e[0],"exactPartial")},required(...e){return G.required(Tw,this,e[0])}});function HT(e,t){let n={type:"object",shape:e??{},...G.normalizeParams(t)};return new Df(n)}function GT(e,t){return new Df({type:"object",shape:e,catchall:$w(),...G.normalizeParams(t)})}function UT(e,t){return new Df({type:"object",shape:e,catchall:zu(),...G.normalizeParams(t)})}var Ff=v("ZodUnion",(e,t)=>{lf.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>cw(e,n,r,a),e.options=t.options});function Ip(e,t){return new Ff({type:"union",options:e,...G.normalizeParams(t)})}var qF=v("ZodXor",(e,t)=>{Ff.init(e,t),gD.init(e,t),e._zod.processJSONSchema=(n,r,a)=>cw(e,n,r,a),e.options=t.options});function OT(e,t){return new qF({type:"union",options:e,inclusive:!1,...G.normalizeParams(t)})}var zF=v("ZodDiscriminatedUnion",(e,t)=>{Ff.init(e,t),fD.init(e,t)});function qT(e,t,n){return new zF({type:"union",options:t,discriminator:e,...G.normalizeParams(n)})}var KF=v("ZodIntersection",(e,t)=>{bD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>AF(e,n,r,a)});function YF(e,t){return new KF({type:"intersection",left:e,right:t})}var JF=v("ZodTuple",(e,t)=>{Yu(),wC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>sF(e,n,r,a)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new Sf({type:"optional",innerType:t}))})}});function WF(e,t,n){let r=t instanceof Ee,a=r?n:t,o=r?t:null;return new JF({type:"tuple",items:e,rest:o,...G.normalizeParams(a)})}var Bp=v("ZodRecord",(e,t)=>{Yu(),hD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>cF(e,n,r,a),e.keyType=t.keyType,e.valueType=t.valueType});function ZF(e,t,n){return!t||!t._zod?new Bp({type:"record",keyType:Qf(),valueType:e,...G.normalizeParams(t)}):new Bp({type:"record",keyType:e,valueType:t,...G.normalizeParams(n)})}function zT(e,t,n){return new Bp({type:"record",keyType:e,valueType:t,...G.normalizeParams(n),partial:!0})}function KT(e,t,n){return new Bp({type:"record",keyType:e,valueType:t,mode:"loose",...G.normalizeParams(n)})}var VF=v("ZodMap",(e,t)=>{Yu(),BD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>aF(e,n,r,a),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(gA(...n)),e.nonempty=n=>e.check(gA(1,n)),e.max=(...n)=>e.check(Ec(...n)),e.size=(...n)=>e.check(Uu(...n))});function YT(e,t,n){return new VF({type:"map",keyType:e,valueType:t,...G.normalizeParams(n)})}var XF=v("ZodSet",(e,t)=>{Yu(),yD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>rF(e,n,r,a),e.min=(...n)=>e.check(gA(...n)),e.nonempty=n=>e.check(gA(1,n)),e.max=(...n)=>e.check(Ec(...n)),e.size=(...n)=>e.check(Uu(...n))});function JT(e,t){return new XF({type:"set",valueType:e,...G.normalizeParams(t)})}var yp=v("ZodEnum",(e,t)=>{CD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>Y1(e,r,a,o),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(r,a)=>{let o={};for(let i of r)if(n.has(i))o[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new yp({...t,checks:[],...G.normalizeParams(a),entries:o})},e.exclude=(r,a)=>{let o={...t.entries};for(let i of r)if(n.has(i))delete o[i];else throw new Error(`Key ${i} not found in enum`);return new yp({...t,checks:[],...G.normalizeParams(a),entries:o})}});function Mw(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new yp({type:"enum",entries:n,...G.normalizeParams(t)})}function WT(e,t){return new yp({type:"enum",entries:e,...G.normalizeParams(t)})}var e8=v("ZodLiteral",(e,t)=>{wD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>J1(e,n,r,a),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 ZT(e,t){return new e8({type:"literal",values:Array.isArray(e)?e:[e],...G.normalizeParams(t)})}var t8=v("ZodFile",(e,t)=>{ED.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>V1(e,n,r,a),e.min=(n,r)=>e.check(gA(n,r)),e.max=(n,r)=>e.check(Ec(n,r)),e.mime=(n,r)=>e.check(dp(Array.isArray(n)?n:[n],r))});function VT(e){return Q1(t8,e)}var n8=v("ZodTransform",(e,t)=>{Yu(),kD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>nF(e,n,r,a),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new yc(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(G.issue(o,n.value,t));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=e),n.issues.push(G.issue(i))}};let a=t.transform(n.value,n);return a instanceof Promise?a.then(o=>(n.value=o,n)):(n.value=a,n)}});function jw(e){return new n8({type:"transform",transform:e})}var Sf=v("ZodOptional",(e,t)=>{EC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>uw(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function Ku(e){return new Sf({type:"optional",innerType:e})}var Pw=v("ZodExactOptional",(e,t)=>{QD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>uw(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function a8(e){return new Pw({type:"optional",innerType:e})}var r8=v("ZodNullable",(e,t)=>{ID.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>uF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function If(e){return new r8({type:"nullable",innerType:e})}function XT(e){return Ku(If(e))}var o8=v("ZodDefault",(e,t)=>{vD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>pF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function i8(e,t){return new o8({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var A8=v("ZodPrefault",(e,t)=>{_D.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>gF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function s8(e,t){return new A8({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var Tw=v("ZodNonOptional",(e,t)=>{xD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>dF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function c8(e,t){return new Tw({type:"nonoptional",innerType:e,...G.normalizeParams(t)})}var u8=v("ZodSuccess",(e,t)=>{DD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>X1(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function eH(e){return new u8({type:"success",innerType:e})}var d8=v("ZodCatch",(e,t)=>{FD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>mF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function l8(e,t){return new d8({type:"catch",innerType:e,catchValue:typeof t=="function"?t:G.constantCatch(t)})}var p8=v("ZodNaN",(e,t)=>{SD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>W1(e,n,r,a)});function tH(e){return E1(p8,e)}var Lf=v("ZodPipe",(e,t)=>{kC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>fF(e,n,r,a),e.in=t.in,e.out=t.out});function fw(e,t){return new Lf({type:"pipe",in:e,out:t})}var Nf=v("ZodCodec",(e,t)=>{Lf.init(e,t),pf.init(e,t)});function nH(e,t,n){return new Nf({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function aH(e){let t=e._zod.def;return new Nf({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var g8=v("ZodPreprocess",(e,t)=>{Lf.init(e,t),LD.init(e,t)}),m8=v("ZodReadonly",(e,t)=>{ND.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>bF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function f8(e){return new m8({type:"readonly",innerType:e})}var b8=v("ZodTemplateLiteral",(e,t)=>{RD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>Z1(e,n,r,a)});function rH(e,t){return new b8({type:"template_literal",parts:e,...G.normalizeParams(t)})}var h8=v("ZodLazy",(e,t)=>{gf.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>BF(e,n,r,a),e.unwrap=()=>e._zod.def.getter()});function B8(e){return new h8({type:"lazy",getter:e})}var y8=v("ZodPromise",(e,t)=>{MD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>hF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function oH(e){return new y8({type:"promise",innerType:e})}var C8=v("ZodFunction",(e,t)=>{$D.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>tF(e,n,r,a)});function iH(e){return new C8({type:"function",input:Array.isArray(e?.input)?WF(e?.input):e?.input??xf(zu()),output:e?.output??zu()})}var Rf=v("ZodCustom",(e,t)=>{jD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>eF(e,n,r,a)});function AH(e){let t=new Nt({check:"custom"});return t._zod.check=e,t}function sH(e,t){return I1(Rf,e??(()=>!0),t)}function w8(e,t={}){return v1(Rf,e,t)}function E8(e,t){return _1(e,t)}var cH=x1,uH=D1;function dH(e,t={}){let n=new Rf({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...G.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}var lH=(...e)=>F1({Codec:Nf,Boolean:kp,String:Cp},...e);function pH(e){let t=B8(()=>Ip([Qf(e),NF(),RF(),PF(),xf(t),ZF(Qf(),t)]));return t}function gH(e,t){return new g8({type:"pipe",in:jw(e),out:t})}var ide={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Ade(e){hn({customError:e})}function sde(){return hn().customError}var k8;k8||(k8={});var $f={};L($f,{ZodISODate:()=>_c,ZodISODateTime:()=>vc,ZodISODuration:()=>Dc,ZodISOTime:()=>xc,date:()=>ude,datetime:()=>cde,duration:()=>lde,time:()=>dde});function cde(e){return Bf(vc,e)}function ude(e){return yf(_c,e)}function dde(e){return Cf(xc,e)}function lde(e){return wf(Dc,e)}var X={...vp,...pw,iso:$f},pde=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function gde(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function mH(e,t){return e.map((n,r)=>r<t?n:n.optional())}function mde(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function fde(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===r){let a=n[1]===void 0?void 0:mde(n[1]);if(!a||!t.defs[a])throw new Error(`Reference not found: ${e}`);return t.defs[a]}throw new Error(`Reference not found: ${e}`)}function bde(e,t){return X.transform(r=>r).check(r=>{let a=r.value;if(!(typeof a!="object"||a===null||Array.isArray(a)))for(let o of Object.getOwnPropertyNames(a)){let i=t.safeParse(o);i.success||r.issues.push({code:"invalid_key",origin:"record",issues:i.error.issues,input:o,path:[o],continue:!0})}}).pipe(e)}function fH(e,t){if(e!==!1)return e===void 0||e===!0?X.any():Or(e,t)}var hde=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function bH(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return X.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let a=e.$ref;if(t.refs.has(a))return t.refs.get(a);if(t.processing.has(a))return X.lazy(()=>{if(!t.refs.has(a))throw new Error(`Circular reference not resolved: ${a}`);return t.refs.get(a)});t.processing.add(a);let o=fde(a,t),i=Or(o,t);return t.refs.set(a,i),t.processing.delete(a),i}if(e.enum!==void 0){let a=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&a.length===1&&a[0]===null)return X.null();if(a.length===0)return X.never();if(a.length===1)return X.literal(a[0]);if(a.every(i=>typeof i=="string"))return X.enum(a);let o=a.map(i=>X.literal(i));return o.length<2?o[0]:X.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return X.literal(e.const);let n=e.type;if(Array.isArray(n)){let a=n.map(o=>{let i={...e,type:o};return bH(i,t)});return a.length===0?X.never():a.length===1?a[0]:X.union(a)}if(!n)return X.any();let r;switch(n){case"string":{let a=X.string();if(e.format){let o=e.format;o==="email"?a=a.check(X.email()):o==="uri"||o==="uri-reference"?a=a.check(X.url()):o==="uuid"||o==="guid"?a=a.check(X.uuid()):o==="date-time"?a=a.check(X.iso.datetime({offset:!0})):o==="date"?a=a.check(X.iso.date()):o==="time"?a=a.check(X.regex(hde)):o==="duration"?a=a.check(X.iso.duration()):o==="hostname"?a=a.check(X.hostname()):o==="ipv4"?a=a.check(X.ipv4()):o==="ipv6"?a=a.check(X.ipv6()):o==="mac"?a=a.check(X.mac()):o==="cidr"?a=a.check(X.cidrv4()):o==="cidr-v6"?a=a.check(X.cidrv6()):o==="base64"?a=a.check(X.base64()):o==="base64url"?a=a.check(X.base64url()):o==="e164"?a=a.check(X.e164()):o==="credit_card"?a=a.check(X.creditCard()):o==="jwt"?a=a.check(X.jwt()):o==="emoji"?a=a.check(X.emoji()):o==="nanoid"?a=a.check(X.nanoid()):o==="cuid"?a=a.check(X.cuid()):o==="cuid2"?a=a.check(X.cuid2()):o==="ulid"?a=a.check(X.ulid()):o==="xid"?a=a.check(X.xid()):o==="ksuid"&&(a=a.check(X.ksuid()))}typeof e.minLength=="number"&&(a=a.min(e.minLength)),typeof e.maxLength=="number"&&(a=a.max(e.maxLength)),e.pattern&&(a=a.regex(new RegExp(e.pattern))),r=a;break}case"number":case"integer":{let a=n==="integer"?X.number().int():X.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(a=a.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(a=a.max(e.maximum)),typeof e.exclusiveMinimum=="number"?a=a.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(a=a.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?a=a.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(a=a.lt(e.maximum)),typeof e.multipleOf=="number"&&(a=a.multipleOf(e.multipleOf)),r=a;break}case"boolean":{r=X.boolean();break}case"null":{r=X.null();break}case"object":{let a={},o=e.properties||{},i=new Set(e.required||[]),A=typeof e.additionalProperties=="object"?Or(e.additionalProperties,t):void 0;for(let[s,u]of Object.entries(o)){let d=Or(u,t);sn(a,s,i.has(s)?d:d.optional())}if(e.patternProperties){let s=e.patternProperties,u=Object.keys(s),d=[];for(let p of u){let g=Or(s[p],t),m=X.string().regex(new RegExp(p));d.push(X.looseRecord(m,g))}let l=[];if(Object.keys(a).length>0&&l.push(X.object(a).passthrough()),l.push(...d),l.length===0)r=X.object({}).passthrough();else if(l.length===1)r=l[0];else{let p=X.intersection(l[0],l[1]);for(let g=2;g<l.length;g++)p=X.intersection(p,l[g]);r=p}if(e.additionalProperties===!1){let p=Object.keys(a),g=u.map(b=>new RegExp(b)),m=r;r=r.check(b=>{if(!To(b.value))return;let B=[];for(let h of Object.keys(b.value))p.includes(h)||g.some(f=>f.test(h))||B.push(h);B.length&&b.issues.push({code:"unrecognized_keys",keys:B,input:b.value,inst:m})})}}else{let s=X.object(a);e.additionalProperties===!1?r=s.strict():A?r=s.catchall(A):r=s.passthrough()}if(e.propertyNames!==void 0&&e.propertyNames!==!0){let s=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;r=bde(r,Or(s,t))}break}case"array":{let a=e.prefixItems,o=e.items;if(a&&Array.isArray(a)){let i=typeof e.minItems=="number"?e.minItems:0,A=a.map(l=>Or(l,t)),s=mH(A,i),u=Array.isArray(o)?void 0:fH(o,t),d=X.tuple(s);r=u?d.rest(u):d,typeof e.minItems=="number"&&(r=r.check(X.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(X.maxLength(e.maxItems)))}else if(Array.isArray(o)){let i=typeof e.minItems=="number"?e.minItems:0,A=o.map(l=>Or(l,t)),s=mH(A,i),u=fH(e.additionalItems,t),d=X.tuple(s);r=u?d.rest(u):d,typeof e.minItems=="number"&&(r=r.check(X.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(X.maxLength(e.maxItems)))}else if(o!==void 0){let i=Or(o,t),A=X.array(i);typeof e.minItems=="number"&&(A=A.min(e.minItems)),typeof e.maxItems=="number"&&(A=A.max(e.maxItems)),r=A}else r=X.array(X.any());break}default:throw new Error(`Unsupported type: ${n}`)}return r}function Or(e,t){if(typeof e=="boolean")return e?X.any():X.never();let n=bH(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let A=e.anyOf.map(u=>Or(u,t)),s=X.union(A);n=r?X.intersection(n,s):s}if(e.oneOf&&Array.isArray(e.oneOf)){let A=e.oneOf.map(u=>Or(u,t)),s=X.xor(A);n=r?X.intersection(n,s):s}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:X.any();else{let A=r?n:Or(e.allOf[0],t),s=r?0:1;for(let u=s;u<e.allOf.length;u++)A=X.intersection(A,Or(e.allOf[u],t));n=A}e.nullable===!0&&t.version==="openapi-3.0"&&(n=X.nullable(n)),e.readOnly===!0&&(n=X.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let a={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let A of o)A in e&&(a[A]=e[A]);let i=["contentEncoding","contentMediaType","contentSchema"];for(let A of i)A in e&&(a[A]=e[A]);e.propertyNames!==void 0&&e.type==="object"&&e.$ref===void 0&&(a.propertyNames=e.propertyNames);for(let A of Object.keys(e))pde.has(A)||sn(a,A,e[A]);return Object.keys(a).length>0&&t.registry.add(n,a),e.description&&(n=n.describe(e.description)),n}function hH(e,t){if(typeof e=="boolean")return e?X.any():X.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let r=gde(n,t?.defaultTarget),a=n.$defs||n.definitions||{},o={version:r,defs:a,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??La};return Or(n,o)}var BH=Symbol("z.visit/resolving");function Mf(e,t){let n=typeof t=="function"?t:(i,A)=>{let s=t[i._zod.def.type];return s?s(i,A):i},r=new Map;function a(i){let A=r.get(i);if(A===BH)return new gf({type:"lazy",getter:()=>r.get(i)});if(A!==void 0)return A;r.set(i,BH);let s=o(i),u=n(s,s!==i);return r.set(i,u),u}function o(i){let A=i._zod.def,s=A.type;switch(s){case"object":{let u=A.shape,d=Object.keys(u),l=!1,p={};for(let m of d){let b=a(u[m]);b!==u[m]&&(l=!0),p[m]=b}let g=A.catchall;return A.catchall&&(g=a(A.catchall),g!==A.catchall&&(l=!0)),l?bt(i,{...A,shape:p,catchall:g}):i}case"array":{let u=a(A.element);return u===A.element?i:bt(i,{...A,element:u})}case"tuple":{let u=A.items,d=!1,l=[];for(let g of u){let m=a(g);m!==g&&(d=!0),l.push(m)}let p=A.rest;return A.rest&&(p=a(A.rest),p!==A.rest&&(d=!0)),d?bt(i,{...A,items:l,rest:p}):i}case"record":case"map":{let u=a(A.keyType),d=a(A.valueType);return u===A.keyType&&d===A.valueType?i:bt(i,{...A,keyType:u,valueType:d})}case"set":{let u=a(A.valueType);return u===A.valueType?i:bt(i,{...A,valueType:u})}case"union":{let u=A.options,d=!1,l=[];for(let p of u){let g=a(p);g!==p&&(d=!0),l.push(g)}return d?bt(i,{...A,options:l}):i}case"intersection":{let u=a(A.left),d=a(A.right);return u===A.left&&d===A.right?i:bt(i,{...A,left:u,right:d})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let u=a(A.innerType);return u===A.innerType?i:bt(i,{...A,innerType:u})}case"pipe":{let u=a(A.in),d=a(A.out);return u===A.in&&d===A.out?i:bt(i,{...A,in:u,out:d})}case"function":{let u=a(A.input),d=a(A.output);return u===A.input&&d===A.output?i:bt(i,{...A,input:u,output:d})}case"lazy":{let u=A.getter,{_cachedInner:d,...l}=A;return bt(i,{...l,getter:()=>a(u())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return i;default:return i}}return a(e)}function yH(e){return Mf(e,{object:t=>t.partial(),union:t=>{let n=t._zod.def;return n.discriminator===void 0?t:Ip(n.options)}})}function Bde(e,t){if(!t?.length)return e;let n=e._zod.def;return bt(e,Bi(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function CH(e){return Bde(e.out,e.checks)}function yde(e){return e.in._zod.traits.has("$ZodTransform")?CH(e):e.in}function wH(e){return Mf(e,{pipe:t=>yde(t._zod.def),default:(t,n)=>n?Ku(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function EH(e){return Mf(e,{pipe:t=>CH(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var Q8={};L(Q8,{bigint:()=>kde,boolean:()=>Ede,date:()=>Qde,number:()=>wde,string:()=>Cde});function Cde(e){return ZD(Cp,e)}function wde(e){return n1(Ep,e)}function Ede(e){return c1(kp,e)}function kde(e){return d1(Qp,e)}function Qde(e){return w1(_f,e)}var kH=["none","low","medium","high","xhigh"];var Hw=c.string().regex(/^[a-z][a-z0-9_-]*$/);function Ide(e){try{let t=new URL(e).protocol;return t==="http:"||t==="https:"}catch{return!1}}var vde=c.object({kind:c.literal("resource_link"),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256),url:c.string().url().max(2048).refine(Ide,"URL must use HTTP or HTTPS."),description:c.string().trim().min(1).max(512).optional(),status:c.enum(["open","draft","closed","merged","warning"]).optional()}).strict(),IH=c.discriminatedUnion("kind",[vde]),_de=c.enum(["circle-dot","circle-dashed","circle-x","git-merge","git-pull-request","triangle-alert"]),vH=c.object({icon:_de.optional(),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256)}).strict(),Pf=c.enum(["closed","merged","open"]),B9e=c.object({closedAt:c.date().optional(),conversationIds:c.array(c.string().min(1)).default([]),mergedAt:c.date().optional(),number:c.number().int().positive(),openedAt:c.date(),providerId:c.string().min(1),repository:c.object({name:c.string().min(1),providerId:c.string().min(1),url:c.string().url().optional()}).strict(),state:Pf,title:c.string().min(1).optional(),updatedAt:c.date(),url:c.string().url().optional()}).strict(),C9e=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/),xde=c.enum(["activity","brain","calendar","check","database","info","key","link","sparkles","warning"]),Dde=c.object({content:c.string().min(1).max(32*1024).optional(),description:c.string().trim().min(1).max(2e3).optional(),metadata:c.array(c.string().trim().min(1).max(120)).max(8).optional(),title:c.string().trim().min(1).max(4e3)}).strict(),_H=c.object({details:c.array(Dde).max(100).optional(),icon:xde.optional(),preview:c.string().trim().min(1).max(500).optional(),title:c.string().trim().min(1).max(120)}).strict();var Uw=c.string().regex(/^T[A-Z0-9]+$/),I8=c.string().regex(/^(C|G|D)[A-Z0-9]+$/),xH=c.string().regex(/^local:[a-z0-9_-]+:[a-z0-9][a-z0-9_-]*$/),Fde=c.string().min(1).refine(e=>e===e.trim()&&e.toLowerCase()!=="unknown"),Gw=Fde,he=c.string().refine(e=>e.trim().length>0),Wa=he.refine(e=>e===e.trim()),Sde=c.object({id:he,provider:Wa}).strict(),Lde=Sde.extend({provider:c.literal("slack"),teamId:Uw,channelId:I8,threadTs:Wa.optional()}).strict(),E9e=c.discriminatedUnion("provider",[Lde]),k9e=c.enum(["slack","local"]),DH=c.enum(["public","private"]),Nde=c.enum(["public","private"]),Rde=c.object({platform:c.literal("slack"),teamId:Uw,channelId:I8,threadTs:Wa.optional()}).strict(),v8=Rde,$de=c.object({platform:c.literal("local"),conversationId:xH}).strict(),Mde=c.discriminatedUnion("platform",[v8,$de]),FH=c.object({action:c.literal("send_message"),destination:v8}).strict(),jde=c.object({kind:c.literal("slack"),teamId:Uw,channelId:I8,visibility:DH,messageTs:he.optional(),threadTs:he.optional()}).strict(),Pde=c.object({kind:c.literal("local"),visibility:c.literal("private"),conversationId:xH}).strict(),Tde=c.object({kind:c.literal("web"),visibility:DH,conversationId:Wa}).strict(),Hde=c.object({kind:c.literal("event"),eventKey:Wa,eventType:Wa,identifier:Wa,namespace:Wa}).strict(),Gde=c.object({kind:c.literal("scheduled_automation")}).strict(),Ude=c.object({kind:c.literal("event_automation")}).strict(),Ode=c.object({kind:c.literal("plugin_dispatch")}).strict(),qde=c.object({kind:c.literal("agent_invocation")}).strict(),zde=c.discriminatedUnion("kind",[jde,Pde,Tde,Hde,Gde,Ude,Ode,qde]);function Kde(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if("kind"in t){let o={event_task:"event_automation",resource_event:"event",scheduled_task:"scheduled_automation"},i=typeof t.kind=="string"?o[t.kind]:void 0;return i?{...t,kind:i}:e}if(t.platform!=="slack"&&t.platform!=="local"&&t.platform!=="web")return e;let{location:n,platform:r,...a}=t;return{...a,kind:r}}var Yde=c.preprocess(Kde,zde),Jde=c.discriminatedUnion("allowedWhen",[c.object({type:c.literal("user"),userId:Gw,allowedWhen:c.literal("private-direct-conversation")}).strict(),c.object({type:c.literal("user"),userId:Gw,allowedWhen:c.literal("scheduled-automation"),taskId:Wa}).strict()]),_8={email:he.optional(),fullName:he.optional(),userId:Gw,userName:he.optional()},Wde=c.object({..._8,platform:c.literal("slack"),teamId:Uw}).strict(),Zde=c.object({..._8,platform:c.literal("local")}).strict(),Vde=c.object({..._8,platform:c.literal("web")}).strict(),Xde=c.object({platform:c.literal("system"),name:Gw}).strict(),jf=c.discriminatedUnion("platform",[Wde,Zde,Vde,Xde]),ele=c.object({displayName:he.optional(),handle:he.optional(),id:Wa,provider:Wa,providerSubjectId:Wa,providerTenantId:Wa.optional()}).strict(),Q9e=c.object({displayName:he.optional(),email:he.max(320),id:Wa,identities:c.array(ele).max(100)}).strict(),tle=c.record(c.string(),c.string()).superRefine((e,t)=>{let n=Object.entries(e);if(n.length>20){t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata has too many keys"});return}for(let[r,a]of n){if(!r.trim()){t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata values must be strings",path:[r]});continue}r.length>128&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata key exceeds the maximum length",path:[r]}),/[\r\n]/.test(r)&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata keys must be single-line strings",path:[r]}),/[\r\n]/.test(a)&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata values must be single-line strings",path:[r]}),a.length>512&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata value exceeds the maximum length",path:[r]})}}),nle=c.object({label:Wa.pipe(c.string().max(48)).refine(e=>!/[\r\n]/.test(e)),detail:Wa.pipe(c.string().max(128)).refine(e=>!/[\r\n]/.test(e)).optional()}).strict(),I9e=c.object({idempotencyKey:he.pipe(c.string().max(512)),credentialSubject:Jde.optional(),destination:v8,destinationVisibility:Nde,input:he.pipe(c.string().max(32e3)),metadata:tle.optional(),replyAttribution:nle.optional()}).strict();var ale=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/),_9e=c.object({text:c.string().trim().min(1).max(8e3)}).strict(),x9e=c.object({kind:ale,version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict();var rle=4e3,ole=8e3,_p=32,QH=4e3,ile=1e3,Ale=c.record(c.string(),c.unknown()).superRefine((e,t)=>{Object.keys(e).length>_p&&t.addIssue({code:"custom",message:`Event data may include at most ${_p} keys.`}),new TextEncoder().encode(JSON.stringify(e)).byteLength>QH&&t.addIssue({code:"custom",message:`Event data may be at most ${QH} JSON bytes.`})}),Wu=c.string().regex(/^[a-z][a-z0-9_-]*(?:\.[a-z][a-z0-9_-]*)+$/).describe("Canonical dotted event type, such as issue.closed or pull_request.review.changes_requested."),SH=c.string().regex(/^[a-z][a-z0-9_]*$/).describe("Canonical plugin-defined resource type, such as issue or pull_request."),LH=/^[a-z][a-zA-Z0-9]*$/,sle=c.object({kind:c.enum(["boolean","string","number"]),description:c.string().trim().min(1).max(200),enum:c.array(c.string().min(1)).min(1).optional()}).strict().superRefine((e,t)=>{e.enum&&e.kind!=="string"&&t.addIssue({code:"custom",message:'Event match field enum requires kind "string".',path:["enum"]})}),cle=c.record(c.string().regex(LH),sle).superRefine((e,t)=>{Object.keys(e).length>_p&&t.addIssue({code:"custom",message:`Event match keys may include at most ${_p} keys.`})}),F9e=c.record(c.string().regex(LH),c.union([c.boolean(),c.number().finite(),c.string().min(1),c.array(c.union([c.number().finite(),c.string().min(1)])).min(1)])).superRefine((e,t)=>{Object.keys(e).length>_p&&t.addIssue({code:"custom",message:`Event match may include at most ${_p} keys.`});for(let[n,r]of Object.entries(e))Array.isArray(r)&&r.some(a=>typeof a=="boolean")&&t.addIssue({code:"custom",message:`Event match field "${n}" cannot use a boolean list.`,path:[n]})});var ule=c.object({type:SH,supportedEvents:c.array(Wu).min(1),suggestedEvents:c.array(Wu).optional(),matchFields:cle.optional(),guidance:c.record(Wu,c.string().trim().min(1).max(ile)).optional()}).strict().superRefine((e,t)=>{let n=new Set;e.supportedEvents.forEach((a,o)=>{n.has(a)&&t.addIssue({code:"custom",message:`Duplicate supported event type "${a}".`,path:["supportedEvents",o]}),n.add(a)});for(let a of Object.keys(e.guidance??{}))n.has(a)||t.addIssue({code:"custom",message:`Guidance event type "${a}" is not supported.`,path:["guidance",a]});let r=new Set;e.suggestedEvents?.forEach((a,o)=>{r.has(a)&&t.addIssue({code:"custom",message:`Duplicate suggested event type "${a}".`,path:["suggestedEvents",o]}),n.has(a)||t.addIssue({code:"custom",message:`Suggested event type "${a}" is not supported.`,path:["suggestedEvents",o]}),r.add(a)})}),S9e=c.object({resourceTypes:c.array(ule).min(1),isEnabled:c.function({input:[],output:c.boolean()}).optional(),normalizeIdentifier:c.function({input:[c.string()],output:c.string()}).optional()}).strict().superRefine((e,t)=>{let n=new Set;e.resourceTypes.forEach((r,a)=>{n.has(r.type)&&t.addIssue({code:"custom",message:`Duplicate resource type "${r.type}".`,path:["resourceTypes",a,"type"]}),n.add(r.type)})});var L9e=c.object({identifier:c.string().min(1),label:c.string().min(1),namespace:c.string().min(1),suggestedEvents:c.array(Wu).optional(),supportedEvents:c.array(Wu),type:SH}).strict(),N9e=c.object({events:c.array(Wu).min(1),id:c.string().min(1)}).strict(),dle=c.object({eventKey:c.string().min(1),eventType:Wu,identifier:c.string().min(1),occurredAtMs:c.number().finite(),terminal:c.boolean().optional(),trustedSummary:c.string().min(1).transform(e=>e.slice(0,rle)),data:Ale.optional(),untrustedText:c.string().transform(e=>e.slice(0,ole)).optional()}).strict(),R9e=dle.extend({namespace:c.string().min(1)}),lle=c.object({authority:c.enum(["instruction","context"]),actor:jf.optional()}).strict(),ple=c.discriminatedUnion("type",[c.object({type:c.literal("message"),role:c.enum(["user","assistant"]),text:c.string().min(1),provenance:lle.optional(),isRunActor:c.boolean().optional()}).strict(),c.object({type:c.literal("toolResult"),toolName:c.string().min(1),isError:c.boolean(),text:c.string().min(1).optional()}).strict()]),M9e=c.object({actorUserId:c.string().min(1).optional(),completedAtMs:c.number().finite(),conversationId:c.string().min(1),destination:Mde,locationId:c.string().min(1).optional(),actors:c.array(jf),actor:jf.optional(),runId:c.string().min(1),source:Yde,transcript:c.array(ple)}).strict();var P9e=c.discriminatedUnion("type",[c.object({type:c.literal("text"),text:c.string()}).strict(),c.object({type:c.literal("image"),data:c.string(),mimeType:c.string()}).strict()]),gle=c.object({arguments:c.record(c.string(),c.unknown()),reason:c.string().min(1).optional()}).strict(),T9e=c.object({target:c.string().min(1).optional(),truncated:c.boolean().optional(),continuation:gle.optional()}).passthrough(),H9e=c.enum(["auto","review","approve"]);var U9e=c.object({auth:c.object({user:c.object({email:c.string().nullable().optional(),emailVerified:c.boolean().optional(),name:c.string().nullable().optional()}).strict()}).strict(),pluginName:he}).strict(),mle=c.string().regex(/^[a-z][a-z0-9-]*$/),fle=c.string().regex(/^[a-z][a-z0-9.-]*$/),ble=c.union([c.literal("read"),c.literal("write")]),NH=c.object({provider:mle,scope:he.optional(),type:c.literal("oauth")}).strict(),RH=c.object({displayName:he.optional(),handle:he.optional(),id:he,label:he.optional(),url:he.optional()}).strict(),q9e=c.object({account:RH.optional(),accessToken:he,expiresAt:c.number().finite().optional(),refreshToken:he,refreshTokenExpiresAt:c.number().finite().optional(),scope:he.optional()}).strict(),z9e=c.object({access:ble,leaseScope:he.optional(),name:fle,reason:he.optional(),requirements:c.array(he).min(1).optional()}).strict(),hle=c.object({domain:c.string().min(1),headers:c.record(c.string(),c.string()).refine(e=>Object.keys(e).length>0)}).strict(),Ble=c.object({account:RH.optional(),authorization:NH.optional(),expiresAt:c.string().refine(e=>Number.isFinite(Date.parse(e))),headerTransforms:c.array(hle).min(1)}).strict(),K9e=c.discriminatedUnion("type",[c.object({lease:Ble,type:c.literal("lease")}).strict(),c.object({authorization:NH.optional(),message:he,type:c.literal("needed")}).strict(),c.object({message:he,type:c.literal("unavailable")}).strict()]);var yle=he.max(64).regex(/^[a-z][a-z0-9-]*$/),Cle=he.max(80),wle=he.max(500),Ele=c.enum(["primary","profile"]),kle=c.object({detail:he.max(500).optional(),label:he.max(80),tone:c.enum(["good","neutral","warning"]).optional(),value:he.max(120)}).strict(),Qle=c.object({label:he.max(80),value:he.max(500)}).strict(),Ile=c.object({confirmation:he.max(500).optional(),href:he.max(500).regex(/^\/api\/plugins\/[a-z][a-z0-9-]*(?:\/|$)/),label:he.max(80),method:c.literal("DELETE"),tone:c.enum(["danger","neutral"]).optional()}).strict(),vle=c.object({actions:c.array(Ile).max(4).optional(),description:he.max(1e3).optional(),id:he.max(128),metadata:c.array(Qle).max(8).optional(),title:he.max(4e3)}).strict(),J9e=c.object({emptyText:he.max(500).optional(),metrics:c.array(kle).max(6).optional(),nextCursor:he.max(1e3).optional(),records:c.array(vle).max(100),searchPlaceholder:he.max(120).optional(),type:c.literal("list")}).strict(),_le=c.object({description:wle,id:yle,label:Cle,navigation:Ele,pluginDisplayName:he.max(200),pluginName:he.max(100)}).strict(),W9e=c.array(_le),xle=he.max(1e3).optional(),Dle=he.max(64).optional(),Fle=c.string().trim().max(200).optional(),Z9e=c.object({cursor:xle,filter:Dle,limit:c.number().int().min(1).max(50),query:Fle}).strict();var Sle=c.union([c.literal("instruction"),c.literal("context")]),Lle=c.object({authority:Sle,actor:jf.optional()}).strict();var Nle=c.object({type:c.literal("user_message"),role:c.never().optional(),provenance:Lle}).passthrough(),Rle=c.object({type:c.literal("assistant_message"),role:c.never().optional()}).passthrough(),$le=c.object({type:c.literal("tool_result"),role:c.never().optional()}).passthrough(),MH=c.discriminatedUnion("type",[Nle,Rle,$le]),Mle=c.object({item:MH,sourceEventSeq:c.number().int().nonnegative().optional()}).strict(),$H=c.array(Mle),jle=c.object({reason:c.literal("capacity"),estimatedInputTokens:c.number().int().nonnegative(),replacementInputTokens:c.number().int().nonnegative().optional(),triggerTokens:c.number().int().nonnegative(),inputLimitTokens:c.number().int().positive(),inputMessageCount:c.number().int().nonnegative(),retainedMessageCount:c.number().int().nonnegative(),summaryChars:c.number().int().nonnegative()}).strict(),jH=c.discriminatedUnion("type",[c.object({type:c.literal("handoff"),modelProfile:Hw,modelId:c.string().min(1),reasoningLevel:c.string().min(1).optional(),triggeringToolCallId:c.string().min(1).optional(),summary:c.string().min(1).optional(),replacementHistory:$H}).strict(),c.object({type:c.literal("compaction"),modelProfile:Hw,modelId:c.string().min(1),details:jle.optional(),summary:c.string().min(1).optional(),replacementHistory:$H}).strict()]),n6e=c.object({data:jH,createdAtMs:c.number().finite()}).strict(),Ple=c.object({type:c.literal("mcp_provider_connected"),provider:c.string().min(1),credentialSubjectId:c.string().min(1)}).strict(),Tle=c.object({type:c.literal("mcp_provider_connected_unowned"),provider:c.string().min(1)}).strict(),PH=c.union([c.literal("plugin"),c.literal("mcp")]),Hle=c.object({type:c.literal("authorization_requested"),kind:PH,provider:c.string().min(1),actorId:c.string().min(1),authorizationId:c.string().min(1),delivery:c.union([c.literal("private_link_sent"),c.literal("private_link_reused")])}).strict(),Gle=c.object({type:c.literal("authorization_completed"),kind:PH,provider:c.string().min(1),actorId:c.string().min(1),authorizationId:c.string().min(1)}).strict(),Ule=c.object({type:c.literal("tool_execution_started"),toolCallId:c.string().min(1),toolName:c.string().min(1)}).strict(),Ole=c.object({type:c.literal("guardian_action_reviewed"),turnId:c.string().min(1),toolCallId:c.string().min(1),toolName:c.string().min(1),costUsd:c.number().finite().nonnegative().optional(),decision:c.enum(["allow","ask","deny"]),riskLevel:c.enum(["low","medium","high","critical"]),userAuthorization:c.enum(["high","medium","low","unknown"])}).strict(),qle=c.union([c.literal("user"),c.literal("assistant"),c.literal("system")]),TH=c.object({type:c.literal("message"),messageId:c.string().min(1),role:qle,text:c.string(),authorIdentityId:c.string().min(1).optional(),meta:c.record(c.string(),c.unknown()).optional()}).strict(),zle=TH.extend({type:c.literal("message_updated")}),Kle=c.object({type:c.literal("message_handled"),messageId:c.string().min(1)}).strict(),Yle=c.object({type:c.literal("messages_summarized"),historyFromSeq:c.number().int().nonnegative(),compactions:c.array(c.object({coveredMessageCount:c.number().int().nonnegative(),createdAtMs:c.number(),id:c.string().min(1),summary:c.string()}).strict())}).strict(),Jle=c.enum(["slack","api","scheduler","internal"]),S8=c.enum(["agent_run_failed","delivery_failed","model_execution_failed","persistence_failed"]),L8=c.enum(["auth","permission","rate_limit","capacity","timeout","network","server","invalid_request","invalid_response","quota","content_policy","unknown","empty_output","tool_errors","suppressed_output"]),Wle=c.object({type:c.literal("turn_started"),turnId:c.string().min(1),inputMessageIds:c.array(c.string().min(1)).min(1),surface:Jle}).strict().refine(e=>new Set(e.inputMessageIds).size===e.inputMessageIds.length,"turn input message ids must be unique"),Zle=c.object({type:c.literal("turn_routed"),turnId:c.string().min(1),modelProfile:Hw,modelId:c.string().min(1),costUsd:c.number().finite().nonnegative().optional(),reasoningLevel:c.enum(kH),confidence:c.number().min(0).max(1).optional(),source:c.enum(["configured","inherited","router"])}).strict(),Vle=c.object({type:c.literal("turn_context"),turnId:c.string().min(1),pluginName:c.string().min(1),kind:c.string().min(1).max(64),version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict(),Xle=c.object({type:c.literal("structured_event"),namespace:c.string().regex(/^[a-z][a-z0-9-]*$/),name:c.string().regex(/^[a-z][a-z0-9_]*$/),version:c.number().int().positive(),turnId:c.string().min(1).optional(),content:c.record(c.string(),c.unknown())}).strict(),epe=c.object({id:c.string().min(1),filename:c.string().min(1),contentType:c.string().min(1),bytes:c.number().int().nonnegative()}).strict(),tpe=c.object({type:c.literal("attachments_delivered"),attachments:c.array(epe).min(1),toolCallId:c.string().min(1).optional(),turnId:c.string().min(1).optional()}).strict(),npe=c.object({type:c.literal("turn_completed"),turnId:c.string().min(1),outcome:c.enum(["success","no_reply","cancelled"])}).strict(),ape=c.object({type:c.literal("turn_failed"),turnId:c.string().min(1),failureCode:S8,failureReason:L8.optional(),eventId:c.string().regex(/^[a-f0-9]{32}$/i).optional()}).strict(),rpe=c.object({type:c.literal("subagent_started"),subagentInvocationId:c.string().min(1),subagentKind:c.string().min(1),modelId:c.string().min(1).optional(),parentToolCallId:c.string().min(1).optional(),reasoningLevel:c.string().min(1).optional(),childConversationId:c.string().min(1)}).strict(),ope=c.object({type:c.literal("subagent_ended"),subagentInvocationId:c.string().min(1),outcome:c.union([c.literal("success"),c.literal("error"),c.literal("aborted")]),errorCode:c.string().min(1).optional()}).strict(),HH=c.union([TH,zle,MH,Ple,Hle,Gle,Ule,Ole,Kle,Yle,Wle,Vle,Xle,tpe,Zle,npe,ape,rpe,ope]),ipe=c.union([HH,jH,Tle]),Ape=["message","message_updated","user_message","assistant_message","tool_result","mcp_provider_connected","mcp_provider_connected_unowned","authorization_requested","authorization_completed","tool_execution_started","guardian_action_reviewed","message_handled","messages_summarized","turn_started","turn_context","structured_event","attachments_delivered","turn_routed","turn_completed","turn_failed","subagent_started","subagent_ended","handoff","compaction"],a6e=c.enum(Ape),spe=c.object({type:c.literal("unknown"),originalType:c.string().min(1),payload:c.unknown()}).strict(),F8=c.object({schemaVersion:c.number().int().nonnegative(),seq:c.number().int().nonnegative(),historyVersion:c.number().int().nonnegative(),idempotencyKey:c.string().min(1).optional(),createdAtMs:c.number().finite()}).strict(),r6e=c.union([F8.extend({schemaVersion:c.literal(1),data:ipe}),F8.extend({data:spe})]),o6e=F8.extend({type:c.string().min(1),payload:c.unknown()});var i6e=c.object({data:HH,idempotencyKey:c.string().min(1).optional(),createdAtMs:c.number().finite()}).strict(),cpe=c.object({input:c.number().finite().nonnegative().optional(),output:c.number().finite().nonnegative().optional(),cacheRead:c.number().finite().nonnegative().optional(),cacheWrite:c.number().finite().nonnegative().optional(),total:c.number().finite().nonnegative().optional()}).strict(),upe=c.object({inputTokens:c.number().int().nonnegative().optional(),outputTokens:c.number().int().nonnegative().optional(),cachedInputTokens:c.number().int().nonnegative().optional(),cacheCreationTokens:c.number().int().nonnegative().optional(),reasoningTokens:c.number().int().nonnegative().optional(),totalTokens:c.number().int().nonnegative().optional(),cost:cpe.optional()}).strict(),Za=c.string().trim().min(1).max(400),N8=c.string().url().max(2048),Tf=c.string().datetime(),GH=c.object({provider:c.string().trim().min(1).max(100),channelName:Za.optional()}).strict(),dpe=c.enum(["in_progress","answered","done","partial","blocked","abandoned"]),UH=c.object({repository:Za,number:c.number().int().positive(),title:Za.optional(),url:N8,state:Pf,openedAt:Tf.optional(),mergedAt:Tf.optional(),closedAt:Tf.optional()}).strict(),lpe=c.object({kind:c.enum(["code_change","resource","url"]),label:Za,url:N8,status:Za.optional()}).strict(),ppe=c.object({startedAt:Tf,lastActivityAt:Tf,durationMs:c.number().int().nonnegative(),participants:c.array(c.object({name:Za,messages:c.number().int().positive()}).strict()),userMessages:c.number().int().nonnegative(),assistantMessages:c.number().int().nonnegative(),toolResults:c.number().int().nonnegative(),events:c.number().int().nonnegative(),turns:c.number().int().positive().optional(),location:GH.optional(),codeChanges:c.array(UH)}).strict(),gpe=c.object({schemaVersion:c.literal(1),record:ppe,summary:c.string().trim().min(1).max(600),intent:Za,outcome:c.object({status:dpe,text:c.string().trim().min(1).max(600)}).strict(),decisions:c.array(c.object({text:Za,by:Za.optional(),kind:c.enum(["stated","confirmed","assumed"])}).strict()).max(20),openDecisions:c.array(c.object({text:Za,owner:Za.optional()}).strict()).max(20),facts:c.array(Za).max(30),links:c.array(lpe).max(40),keywords:c.array(c.string().trim().toLowerCase().min(1).max(400)).max(12)}).strict(),mpe=c.object({index:c.number().int().nonnegative(),role:c.enum(["user","assistant","tool","event"]),author:Za.optional(),text:c.string().min(1),createdAtMs:c.number().int().nonnegative(),turnId:c.string().min(1).optional()}).strict(),fpe=c.object({label:Za,url:N8,status:Za.optional()}).strict(),A6e=c.object({conversationId:c.string().min(1),title:Za.optional(),visibility:c.enum(["private","public"]),location:GH.optional(),entries:c.array(mpe),codeChanges:c.array(UH),resources:c.array(fpe)}).strict();var bpe=c.enum(["active","completed","failed"]),hpe=c.enum(["api","internal","scheduler","slack"]),OH=upe,Bpe=c.object({conversationId:c.string().min(1)}).strict(),s6e=c.object({attachmentId:c.string().min(1),conversationId:c.string().min(1)}).strict(),ype=c.object({limit:c.coerce.number().int().min(1).max(1e3).default(500)}).strict(),Cpe=c.object({before:c.string().min(1),limit:c.coerce.number().int().min(1).max(1e3).default(500)}).strict(),wpe=c.object({actorEmail:c.string().trim().email().transform(e=>e.toLowerCase()).optional(),q:c.string().trim().max(200).optional(),status:c.enum(["active","archived"]).default("active")}).strict(),Epe=c.object({archived:c.boolean(),lastSeenAt:c.string().datetime()}).strict(),R8=c.object({archivedAt:c.string().datetime().nullable()}).strict(),kpe=c.object({idempotencyKey:c.string().trim().min(1).max(200),message:c.string().trim().min(1).max(32e3),visibility:c.enum(["private","public"]).optional()}).strict(),Qpe=c.object({idempotencyKey:c.string().trim().min(1).max(200),message:c.string().trim().min(1).max(32e3)}).strict(),Ow=c.object({conversationId:c.string().min(1),messageId:c.string().min(1),status:c.enum(["accepted","duplicate"])}).strict(),xp=c.object({email:c.string().optional(),fullName:c.string().optional(),slackUserId:c.string().optional(),slackUserName:c.string().optional()}).strict(),qH=c.enum(["defer","interrupt"]),zH=c.object({actorIdentity:xp.optional(),createdAt:c.string().datetime(),delivery:qH,inboundMessageId:c.string().min(1),messageId:c.string().min(1),receivedAt:c.string().datetime(),role:c.literal("user"),source:c.enum(["slack","web"]),text:c.string().optional(),redacted:c.literal(!0).optional()}).strict().superRefine((e,t)=>{e.text===void 0==(e.redacted!==!0)&&t.addIssue({code:"custom",message:"pending message content must be text or explicitly redacted"}),e.redacted&&e.actorIdentity&&t.addIssue({code:"custom",message:"redacted pending messages must not expose actor identity"})}),KH=c.object({authorizationUrl:c.string().url(),completionText:c.string().min(1),label:c.string().min(1)}).strict(),$8=c.object({authorization:KH.optional(),conversationId:c.string().min(1),generatedAt:c.string().datetime(),messages:c.array(zH)}).strict(),Ipe=c.object({inboundMessageIds:c.array(c.string().min(1)).min(1).optional(),receivedBefore:c.string().datetime().optional()}).strict(),M8=c.object({cancelledCount:c.number().int().nonnegative(),cancelledInboundMessageIds:c.array(c.string().min(1)),conversationId:c.string().min(1)}).strict(),YH=c.object({costUsd:c.number().finite().nonnegative(),operations:c.array(c.object({costUsd:c.number().finite().nonnegative(),events:c.number().int().positive(),name:c.string().min(1),namespace:c.string().min(1)}).strict()).min(1)}).strict(),vpe=c.object({id:c.string().min(1).optional(),kind:c.enum(["scheduled","event"]),label:c.string().min(1).optional(),title:c.string().min(1).optional()}).strict().superRefine((e,t)=>{!!e.id!=!!e.label&&t.addIssue({code:"custom",message:"sourceTask id and label must both be set or both omitted"})}),_pe=IH.and(c.object({plugin:c.string().min(1),createdAt:c.string().datetime(),updatedAt:c.string().datetime()})),JH=c.object({createdAt:c.string().datetime(),role:c.enum(["assistant","user"]),text:c.string().min(1)}).strict(),Dp=c.object({displayTitle:c.string(),activityPreview:JH.optional(),cumulativeDurationMs:c.number(),cumulativeUsage:OH.optional(),auxiliaryCosts:YH.optional(),conversationId:c.string(),isParticipant:c.boolean(),visibility:c.enum(["private","public"]).optional(),status:bpe,startedAt:c.string(),lastSeenAt:c.string(),lastProgressAt:c.string(),surface:hpe,actorIdentity:xp.optional(),archivedAt:c.string().datetime().nullable().optional(),channel:c.string().optional(),channelName:c.string().optional(),channelNameRedacted:c.boolean().optional(),locationId:c.string().optional(),sentryTraceUrl:c.string().optional(),locationUrl:c.string().url().optional(),traceId:c.string().optional(),annotations:c.array(_pe).optional(),sidebarAnnotations:c.array(vH).optional(),assignedWork:c.boolean().optional(),finishedWorkAt:c.string().datetime().optional(),isPriority:c.boolean().optional(),unfinishedWork:c.boolean().optional()}).strict(),xpe=c.object({type:c.literal("message"),messageId:c.string().min(1),role:c.enum(["assistant","system","user"]),source:c.enum(["slack","web"]).optional(),actorIdentity:xp.optional(),eventType:c.string().min(1).optional(),explicitMention:c.boolean().optional(),trustedSummary:c.string().min(1).optional(),text:c.string().optional(),redacted:c.literal(!0).optional()}).strict().superRefine((e,t)=>{e.text===void 0==(e.redacted!==!0)&&t.addIssue({code:"custom",message:"message content must be text or explicitly redacted"}),e.redacted&&e.actorIdentity&&t.addIssue({code:"custom",message:"redacted messages must not expose actor identity"})}),Dpe=c.object({type:c.literal("message_handled"),messageId:c.string().min(1)}).strict(),Fpe=c.object({toolCallId:c.string().min(1),name:c.string().min(1),status:c.enum(["running","completed","error"]),startedAt:c.string().datetime().optional(),startedSeq:c.number().int().nonnegative().optional(),input:c.unknown().optional(),output:c.unknown().optional()}).strict().superRefine((e,t)=>{e.startedAt===void 0!=(e.startedSeq===void 0)&&t.addIssue({code:"custom",message:"tool start sequence and timestamp must be provided together"})}),WH=c.object({type:c.literal("reasoning"),text:c.string().min(1).optional(),redacted:c.literal(!0).optional()}).strict().superRefine((e,t)=>{e.text===void 0==(e.redacted!==!0)&&t.addIssue({code:"custom",message:"reasoning content must be text or explicitly redacted"})}),Spe=c.object({type:c.literal("tool_call"),toolCallId:c.string().min(1)}).strict(),Lpe=c.object({parts:c.array(c.discriminatedUnion("type",[WH,Spe])).min(1)}).strict(),Npe=c.object({type:c.literal("tool_calls"),calls:c.array(Fpe).min(1),assistant:Lpe.optional()}).strict().superRefine((e,t)=>{if(!e.assistant)return;let n=new Map;for(let a of e.calls)n.set(a.toolCallId,(n.get(a.toolCallId)??0)+1);let r=new Map;for(let a of e.assistant.parts)a.type==="tool_call"&&r.set(a.toolCallId,(r.get(a.toolCallId)??0)+1);(n.size!==r.size||[...n].some(([a,o])=>r.get(a)!==o))&&t.addIssue({code:"custom",path:["assistant","parts"],message:"assistant tool parts must reference every call exactly once"})}),Rpe=c.object({type:c.literal("assistant_message"),parts:c.array(WH).min(1)}).strict(),$pe=c.discriminatedUnion("state",[c.object({type:c.literal("turn_lifecycle"),turnId:c.string().min(1),state:c.enum(["succeeded","no_reply"])}).strict(),c.object({type:c.literal("turn_lifecycle"),turnId:c.string().min(1),state:c.literal("started"),inputMessageIds:c.array(c.string().min(1)).min(1).optional()}).strict(),c.object({type:c.literal("turn_lifecycle"),turnId:c.string().min(1),state:c.literal("failed"),failureCode:S8,failureReason:L8.optional(),eventId:c.string().regex(/^[a-f0-9]{32}$/i).optional(),sentryEventUrl:c.string().url().optional()}).strict()]),Mpe=c.object({type:c.literal("turn_routed"),turnId:c.string().min(1),modelProfile:c.string().min(1),modelId:c.string().min(1),costUsd:c.number().finite().nonnegative().optional(),reasoningLevel:c.string().min(1),confidence:c.number().min(0).max(1).optional(),source:c.enum(["configured","inherited","router"])}).strict(),jpe=c.object({type:c.literal("guardian_action_reviewed"),turnId:c.string().min(1),toolCallId:c.string().min(1),toolName:c.string().min(1),decision:c.enum(["allow","ask","deny"]),riskLevel:c.enum(["low","medium","high","critical"]),userAuthorization:c.enum(["high","medium","low","unknown"])}).strict(),Ppe=c.object({type:c.literal("turn_context"),turnId:c.string().min(1),pluginName:c.string().min(1),kind:c.string().min(1),version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict(),Tpe=c.object({type:c.literal("structured_event"),namespace:c.string().min(1),name:c.string().min(1),version:c.number().int().positive(),turnId:c.string().min(1).optional(),presentation:_H}).strict(),Hpe=c.object({id:c.string().min(1),filename:c.string().min(1),contentType:c.string().min(1),bytes:c.number().int().nonnegative()}).strict(),Gpe=c.object({type:c.literal("attachments_delivered"),attachments:c.array(Hpe).min(1)}).strict(),Upe=c.object({type:c.literal("compaction"),modelProfile:c.string().min(1).optional(),modelId:c.string().min(1).optional(),summary:c.string().min(1).optional(),details:c.object({reason:c.literal("capacity"),estimatedInputTokens:c.number().int().nonnegative(),replacementInputTokens:c.number().int().nonnegative().optional(),triggerTokens:c.number().int().nonnegative(),inputLimitTokens:c.number().int().positive(),inputMessageCount:c.number().int().nonnegative(),retainedMessageCount:c.number().int().nonnegative(),summaryChars:c.number().int().nonnegative()}).strict().optional()}).strict(),Ope=c.object({type:c.literal("handoff"),modelProfile:c.string().min(1),modelId:c.string().min(1),reasoningLevel:c.string().min(1).optional(),triggeringToolCallId:c.string().min(1).optional(),summary:c.string().min(1).optional()}).strict(),qpe=c.object({type:c.literal("subagent"),startedSeq:c.number().int().nonnegative(),startedAt:c.string().datetime(),childConversationId:c.string().min(1),subagentKind:c.string().min(1),parentToolCallId:c.string().min(1).optional(),status:c.enum(["running","completed","error","aborted"])}).strict(),ZH=c.discriminatedUnion("type",[xpe,Dpe,Rpe,Npe,$pe,Ppe,Tpe,Gpe,Mpe,jpe,Upe,Ope,qpe]),j8=c.object({seq:c.number().int().nonnegative(),createdAt:c.string().datetime(),data:ZH}).strict(),P8=c.discriminatedUnion("status",[c.object({status:c.literal("available")}).strict(),c.object({status:c.literal("redacted"),reason:c.literal("non_public_conversation")}).strict(),c.object({status:c.literal("expired"),expiredAt:c.string().datetime()}).strict()]),zpe=c.object({modelId:c.string(),usage:OH}).strict();function VH(e,t){e.eventHistory.status==="expired"&&e.events.length>0&&t.addIssue({code:"custom",path:["events"],message:"expired event history must not contain events"});for(let n=1;n<e.events.length;n+=1)e.events[n].seq<=e.events[n-1].seq&&t.addIssue({code:"custom",path:["events",n,"seq"],message:"report event sequences must be strictly increasing"});for(let[n,r]of e.events.entries())r.data.type==="message"&&(e.eventHistory.status==="redacted"&&r.data.redacted!==!0&&t.addIssue({code:"custom",path:["events",n,"data"],message:"redacted event history must redact messages"}),e.eventHistory.status==="available"&&r.data.redacted===!0&&t.addIssue({code:"custom",path:["events",n,"data"],message:"available event history must expose messages"})),e.eventHistory.status==="redacted"&&r.data.type==="tool_calls"&&r.data.calls.some(a=>a.input!==void 0||a.output!==void 0)&&t.addIssue({code:"custom",path:["events",n,"data"],message:"redacted event history must redact tool payloads"}),e.eventHistory.status==="redacted"&&r.data.type==="assistant_message"&&r.data.parts.some(a=>a.text!==void 0)&&t.addIssue({code:"custom",path:["events",n,"data"],message:"redacted event history must redact assistant messages"}),e.eventHistory.status==="available"&&r.data.type==="assistant_message"&&r.data.parts.some(a=>a.redacted===!0)&&t.addIssue({code:"custom",path:["events",n,"data"],message:"available event history must expose reasoning"}),r.data.type==="tool_calls"&&(e.eventHistory.status==="redacted"&&r.data.assistant?.parts.some(a=>a.type==="reasoning"&&a.text!==void 0)||e.eventHistory.status==="available"&&r.data.assistant?.parts.some(a=>a.type==="reasoning"&&a.redacted===!0))&&t.addIssue({code:"custom",path:["events",n,"data","assistant"],message:"assistant reasoning must match event history visibility"})}var T8=Dp.extend({brief:c.object({content:gpe,updatedAt:c.string().datetime(),version:c.number().int().positive()}).strict().optional(),modelUsage:c.array(zpe).optional(),events:c.array(j8),eventHistory:P8,previousCursor:c.string().min(1).optional(),generatedAt:c.string(),sentryConversationUrl:c.string().optional(),sourceTask:vpe.optional()}).strict().superRefine(VH),H8=c.object({events:c.array(j8),eventHistory:P8,previousCursor:c.string().min(1).optional(),generatedAt:c.string()}).strict().superRefine(VH),G8=c.object({conversations:c.array(Dp),source:c.literal("conversation_index"),generatedAt:c.string()}).strict(),Zu=c.object({active:c.number(),conversations:c.number(),durationMs:c.number(),failed:c.number(),label:c.string(),costUsd:c.number().optional(),tokens:c.number().optional()}).strict(),XH=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),x8=c.object({cachedInputTokens:c.number().optional(),conversations:c.number(),costUsd:c.number().optional(),date:XH,durationMs:c.number(),inputTokens:c.number().optional(),tokens:c.number().optional()}).strict(),D8=c.object({allow:c.number(),ask:c.number(),costUsd:c.number().optional(),date:XH,deny:c.number(),requests:c.number()}).strict(),Kpe=c.object({allow:c.number(),ask:c.number(),costUsd:c.number().optional(),deny:c.number(),metricDays:c.array(D8),metricHours:c.array(D8).optional(),metricSixHours:c.array(D8).optional(),requests:c.number()}).strict(),U8=c.object({active:c.number(),cachedInputTokens:c.number().optional(),conversations:c.number(),durationMs:c.number(),failed:c.number(),generatedAt:c.string(),guardian:Kpe,metricDays:c.array(x8),metricHours:c.array(x8).optional(),metricSixHours:c.array(x8).optional(),locations:c.array(Zu),actors:c.array(Zu),source:c.literal("conversation_index"),costUsd:c.number().optional(),inputTokens:c.number().optional(),tokens:c.number().optional(),windowEnd:c.string(),windowStart:c.string()}).strict();var Ype=c.object({status:c.literal("ok"),service:c.string(),timestamp:c.string()}).strict(),eG=c.object({configKeys:c.array(c.string()),description:c.string(),displayName:c.string(),name:c.string()}).strict(),O8=c.array(eG),q8=c.object({name:c.string(),pluginProvider:c.string().optional()}).strict(),z8=c.array(q8),tG=c.object({dir:c.string(),hasMigrationsDir:c.boolean(),hasSkillsDir:c.boolean(),packageName:c.string()}).strict(),nG=c.object({packageNames:c.array(c.string()),packages:c.array(tG),manifestRoots:c.array(c.string()),skillRoots:c.array(c.string()),tracingIncludes:c.array(c.string())}).strict(),Jpe=c.object({cwd:c.string(),homeDir:c.string(),descriptionText:c.string().optional(),providers:c.array(c.string()),skills:c.array(q8),packagedContent:nG}).strict(),K8=c.enum(["danger","good","neutral","warning"]),Wpe=c.object({label:c.string(),tone:K8.optional(),value:c.string()}).strict(),Zpe=c.object({key:c.string(),label:c.string()}).strict(),Vpe=c.object({id:c.string(),tone:K8.optional(),values:c.record(c.string(),c.string())}).strict(),Xpe=c.object({fields:c.array(Zpe).optional(),emptyText:c.string().optional(),records:c.array(Vpe).optional(),title:c.string()}).strict(),ege=c.object({categories:c.array(c.object({id:c.string().min(1),label:c.string().min(1),values:c.record(c.string(),c.number().finite())}).strict()).max(100),description:c.string().optional(),emptyText:c.string().optional(),id:c.string().min(1),series:c.array(c.object({format:c.literal("usd").optional(),key:c.string().min(1),label:c.string().min(1),tone:K8.optional()}).strict()).min(1).max(8),timeRangeDays:c.array(c.union([c.literal(1),c.literal(7),c.literal(30),c.literal(90)])).min(1).max(4).optional(),title:c.string().min(1),type:c.literal("bar_chart")}).strict(),aG=c.object({generatedAt:c.string().optional(),metrics:c.array(Wpe).optional(),recordSets:c.array(Xpe).optional(),title:c.string().optional(),pluginName:c.string(),widgets:c.array(ege).max(12).optional()}).strict(),qw=c.object({generatedAt:c.string(),reports:c.array(aG),source:c.literal("plugins")}).strict();var D=Symbol.for("drizzle:entityKind");function Un(e,t){if(!e||typeof e!="object")return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,D))throw new Error(`Class "${t.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let n=Object.getPrototypeOf(e).constructor;if(n)for(;n;){if(D in n&&n[D]===t[D])return!0;n=Object.getPrototypeOf(n)}return!1}var Vu=class{constructor(t,n){this.table=t,this.config=n,this.name=n.name,this.keyAsName=n.keyAsName,this.notNull=n.notNull,this.default=n.default,this.defaultFn=n.defaultFn,this.onUpdateFn=n.onUpdateFn,this.hasDefault=n.hasDefault,this.primary=n.primaryKey,this.isUnique=n.isUnique,this.uniqueName=n.uniqueName,this.uniqueType=n.uniqueType,this.dataType=n.dataType,this.columnType=n.columnType,this.generated=n.generated,this.generatedIdentity=n.generatedIdentity}static[D]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(t){return t}mapToDriverValue(t){return t}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}};var zw=class{static[D]="ColumnBuilder";config;constructor(t,n,r){this.config={name:t,keyAsName:t==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:n,columnType:r,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(t){return this.config.default=t,this.config.hasDefault=!0,this}$defaultFn(t){return this.config.defaultFn=t,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(t){return this.config.onUpdateFn=t,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(t){this.config.name===""&&(this.config.name=t)}};var hs=Symbol.for("drizzle:Name");var Kw=class{static[D]="PgForeignKeyBuilder";reference;_onUpdate="no action";_onDelete="no action";constructor(t,n){this.reference=()=>{let{name:r,columns:a,foreignColumns:o}=t();return{name:r,columns:a,foreignTable:o[0].table,foreignColumns:o}},n&&(this._onUpdate=n.onUpdate,this._onDelete=n.onDelete)}onUpdate(t){return this._onUpdate=t===void 0?"no action":t,this}onDelete(t){return this._onDelete=t===void 0?"no action":t,this}build(t){return new Y8(t,this)}},Y8=class{constructor(t,n){this.table=t,this.reference=n.reference,this.onUpdate=n._onUpdate,this.onDelete=n._onDelete}static[D]="PgForeignKey";reference;onUpdate;onDelete;getName(){let{name:t,columns:n,foreignColumns:r}=this.reference(),a=n.map(A=>A.name),o=r.map(A=>A.name),i=[this.table[hs],...a,r[0].table[hs],...o];return t??`${i.join("_")}_fk`}};function Yw(e,...t){return e(...t)}function Z8(e,t){return`${e[hs]}_${t.join("_")}_unique`}var J8=class{constructor(t,n){this.name=n,this.columns=t}static[D]="PgUniqueConstraintBuilder";columns;nullsNotDistinctConfig=!1;nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(t){return new W8(t,this.columns,this.nullsNotDistinctConfig,this.name)}},rG=class{static[D]="PgUniqueOnConstraintBuilder";name;constructor(t){this.name=t}on(...t){return new J8(t,this.name)}},W8=class{constructor(t,n,r,a){this.table=t,this.columns=n,this.name=a??Z8(this.table,this.columns.map(o=>o.name)),this.nullsNotDistinct=r}static[D]="PgUniqueConstraint";columns;name;nullsNotDistinct=!1;getName(){return this.name}};function oG(e,t,n){for(let r=t;r<e.length;r++){let a=e[r];if(a==="\\"){r++;continue}if(a==='"')return[e.slice(t,r).replace(/\\/g,""),r+1];if(!n&&(a===","||a==="}"))return[e.slice(t,r).replace(/\\/g,""),r]}return[e.slice(t).replace(/\\/g,""),e.length]}function iG(e,t=0){let n=[],r=t,a=!1;for(;r<e.length;){let o=e[r];if(o===","){(a||r===t)&&n.push(""),a=!0,r++;continue}if(a=!1,o==="\\"){r+=2;continue}if(o==='"'){let[s,u]=oG(e,r+1,!0);n.push(s),r=u;continue}if(o==="}")return[n,r+1];if(o==="{"){let[s,u]=iG(e,r+1);n.push(s),r=u;continue}let[i,A]=oG(e,r,!1);n.push(i),r=A}return[n,r]}function AG(e){let[t]=iG(e,1);return t}function V8(e){return`{${e.map(t=>Array.isArray(t)?V8(t):typeof t=="string"?`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:`${t}`).join(",")}}`}var ee=class extends zw{foreignKeyConfigs=[];static[D]="PgColumnBuilder";array(t){return new e2(this.config.name,this,t)}references(t,n={}){return this.foreignKeyConfigs.push({ref:t,actions:n}),this}unique(t,n){return this.config.isUnique=!0,this.config.uniqueName=t,this.config.uniqueType=n?.nulls,this}generatedAlwaysAs(t){return this.config.generated={as:t,type:"always",mode:"stored"},this}buildForeignKeys(t,n){return this.foreignKeyConfigs.map(({ref:r,actions:a})=>Yw((o,i)=>{let A=new Kw(()=>{let s=o();return{columns:[t],foreignColumns:[s]}});return i.onUpdate&&A.onUpdate(i.onUpdate),i.onDelete&&A.onDelete(i.onDelete),A.build(n)},r,a))}buildExtraConfigColumn(t){return new X8(t,this.config)}},W=class extends Vu{constructor(t,n){n.uniqueName||(n.uniqueName=Z8(t,[n.name])),super(t,n),this.table=t}static[D]="PgColumn"},X8=class extends W{static[D]="ExtraConfigColumn";getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass};defaultConfig={order:"asc",nulls:"last",opClass:void 0};asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op(t){return this.indexConfig.opClass=t,this}},Fp=class{static[D]="IndexedColumn";constructor(t,n,r,a){this.name=t,this.keyAsName=n,this.type=r,this.indexConfig=a}name;keyAsName;type;indexConfig},e2=class extends ee{static[D]="PgArrayBuilder";constructor(t,n,r){super(t,"array","PgArray"),this.config.baseBuilder=n,this.config.size=r}build(t){let n=this.config.baseBuilder.build(t);return new t2(t,this.config,n)}},t2=class e extends W{constructor(t,n,r,a){super(t,n),this.baseColumn=r,this.range=a,this.size=n.size}size;static[D]="PgArray";getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size=="number"?this.size:""}]`}mapFromDriverValue(t){return typeof t=="string"&&(t=AG(t)),t.map(n=>this.baseColumn.mapFromDriverValue(n))}mapToDriverValue(t,n=!1){let r=t.map(a=>a===null?null:Un(this.baseColumn,e)?this.baseColumn.mapToDriverValue(a,!0):this.baseColumn.mapToDriverValue(a));return n?r:V8(r)}};var sG=class extends ee{static[D]="PgEnumObjectColumnBuilder";constructor(t,n){super(t,"string","PgEnumObjectColumn"),this.config.enum=n}build(t){return new n2(t,this.config)}},n2=class extends W{static[D]="PgEnumObjectColumn";enum;enumValues=this.config.enum.enumValues;constructor(t,n){super(t,n),this.enum=n.enum}getSQLType(){return this.enum.enumName}},cG=Symbol.for("drizzle:isPgEnum");function dG(e){return!!e&&typeof e=="function"&&cG in e&&e[cG]===!0}var uG=class extends ee{static[D]="PgEnumColumnBuilder";constructor(t,n){super(t,"string","PgEnumColumn"),this.config.enum=n}build(t){return new a2(t,this.config)}},a2=class extends W{static[D]="PgEnumColumn";enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(t,n){super(t,n),this.enum=n.enum}getSQLType(){return this.enum.enumName}};var Sp=class{static[D]="Subquery";constructor(t,n,r,a=!1,o=[]){this._={brand:"Subquery",sql:t,selectedFields:n,alias:r,isWith:a,usedTables:o}}},lG=class extends Sp{static[D]="WithSubquery"};var pG="0.45.2";var r2,o2,gG={startActiveSpan(e,t){return r2?(o2||(o2=r2.trace.getTracer("drizzle-orm",pG)),Yw((n,r)=>r.startActiveSpan(e,a=>{try{return t(a)}catch(o){throw a.setStatus({code:n.SpanStatusCode.ERROR,message:o instanceof Error?o.message:"Unknown error"}),o}finally{a.end()}}),r2,o2)):t()}};var Lp=Symbol.for("drizzle:ViewBaseConfig");var i2=Symbol.for("drizzle:Schema"),mG=Symbol.for("drizzle:Columns"),fG=Symbol.for("drizzle:ExtraConfigColumns"),A2=Symbol.for("drizzle:OriginalName"),s2=Symbol.for("drizzle:BaseName"),Hf=Symbol.for("drizzle:IsAlias"),bG=Symbol.for("drizzle:ExtraConfigBuilder"),tge=Symbol.for("drizzle:IsDrizzleTable"),vn=class{static[D]="Table";static Symbol={Name:hs,Schema:i2,OriginalName:A2,Columns:mG,ExtraConfigColumns:fG,BaseName:s2,IsAlias:Hf,ExtraConfigBuilder:bG};[hs];[A2];[i2];[mG];[fG];[s2];[Hf]=!1;[tge]=!0;[bG]=void 0;constructor(t,n,r){this[hs]=this[A2]=t,this[i2]=n,this[s2]=r}};var hG=class{static[D]="FakePrimitiveParam"};function nge(e){return e!=null&&typeof e.getSQL=="function"}function age(e){let t={sql:"",params:[]};for(let n of e)t.sql+=n.sql,t.params.push(...n.params),n.typings?.length&&(t.typings||(t.typings=[]),t.typings.push(...n.typings));return t}var fo=class{static[D]="StringChunk";value;constructor(t){this.value=Array.isArray(t)?t:[t]}getSQL(){return new _n([this])}},_n=class e{constructor(t){this.queryChunks=t;for(let n of t)if(Un(n,vn)){let r=n[vn.Symbol.Schema];this.usedTables.push(r===void 0?n[vn.Symbol.Name]:r+"."+n[vn.Symbol.Name])}}static[D]="SQL";decoder=BG;shouldInlineParams=!1;usedTables=[];append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return gG.startActiveSpan("drizzle.buildSQL",n=>{let r=this.buildQueryFromSourceParams(this.queryChunks,t);return n?.setAttributes({"drizzle.query.text":r.sql,"drizzle.query.params":JSON.stringify(r.params)}),r})}buildQueryFromSourceParams(t,n){let r=Object.assign({},n,{inlineParams:n.inlineParams||this.shouldInlineParams,paramStartIndex:n.paramStartIndex||{value:0}}),{casing:a,escapeName:o,escapeParam:i,prepareTyping:A,inlineParams:s,paramStartIndex:u}=r;return age(t.map(d=>{if(Un(d,fo))return{sql:d.value.join(""),params:[]};if(Un(d,Gf))return{sql:o(d.value),params:[]};if(d===void 0)return{sql:"",params:[]};if(Array.isArray(d)){let l=[new fo("(")];for(let[p,g]of d.entries())l.push(g),p<d.length-1&&l.push(new fo(", "));return l.push(new fo(")")),this.buildQueryFromSourceParams(l,r)}if(Un(d,e))return this.buildQueryFromSourceParams(d.queryChunks,{...r,inlineParams:s||d.shouldInlineParams});if(Un(d,vn)){let l=d[vn.Symbol.Schema],p=d[vn.Symbol.Name];return{sql:l===void 0||d[Hf]?o(p):o(l)+"."+o(p),params:[]}}if(Un(d,Vu)){let l=a.getColumnCasing(d);if(n.invokeSource==="indexes")return{sql:o(l),params:[]};let p=d.table[vn.Symbol.Schema];return{sql:d.table[Hf]||p===void 0?o(d.table[vn.Symbol.Name])+"."+o(l):o(p)+"."+o(d.table[vn.Symbol.Name])+"."+o(l),params:[]}}if(Un(d,c2)){let l=d[Lp].schema,p=d[Lp].name;return{sql:l===void 0||d[Lp].isAlias?o(p):o(l)+"."+o(p),params:[]}}if(Un(d,Jw)){if(Un(d.value,Uf))return{sql:i(u.value++,d),params:[d],typings:["none"]};let l=d.value===null?null:d.encoder.mapToDriverValue(d.value);if(Un(l,e))return this.buildQueryFromSourceParams([l],r);if(s)return{sql:this.mapInlineParam(l,r),params:[]};let p=["none"];return A&&(p=[A(d.encoder)]),{sql:i(u.value++,l),params:[l],typings:p}}return Un(d,Uf)?{sql:i(u.value++,d),params:[d],typings:["none"]}:Un(d,e.Aliased)&&d.fieldAlias!==void 0?{sql:o(d.fieldAlias),params:[]}:Un(d,Sp)?d._.isWith?{sql:o(d._.alias),params:[]}:this.buildQueryFromSourceParams([new fo("("),d._.sql,new fo(") "),new Gf(d._.alias)],r):dG(d)?d.schema?{sql:o(d.schema)+"."+o(d.enumName),params:[]}:{sql:o(d.enumName),params:[]}:nge(d)?d.shouldOmitSQLParens?.()?this.buildQueryFromSourceParams([d.getSQL()],r):this.buildQueryFromSourceParams([new fo("("),d.getSQL(),new fo(")")],r):s?{sql:this.mapInlineParam(d,r),params:[]}:{sql:i(u.value++,d),params:[d],typings:["none"]}}))}mapInlineParam(t,{escapeString:n}){if(t===null)return"null";if(typeof t=="number"||typeof t=="boolean")return t.toString();if(typeof t=="string")return n(t);if(typeof t=="object"){let r=t.toString();return n(r==="[object Object]"?JSON.stringify(t):r)}throw new Error("Unexpected param value: "+t)}getSQL(){return this}as(t){return t===void 0?this:new e.Aliased(this,t)}mapWith(t){return this.decoder=typeof t=="function"?{mapFromDriverValue:t}:t,this}inlineParams(){return this.shouldInlineParams=!0,this}if(t){return t?this:void 0}},Gf=class{constructor(t){this.value=t}static[D]="Name";brand;getSQL(){return new _n([this])}};var BG={mapFromDriverValue:e=>e},yG={mapToDriverValue:e=>e},eLe={...BG,...yG},Jw=class{constructor(t,n=yG){this.value=t,this.encoder=n}static[D]="Param";brand;getSQL(){return new _n([this])}};function Np(e,...t){let n=[];(t.length>0||e.length>0&&e[0]!=="")&&n.push(new fo(e[0]));for(let[r,a]of t.entries())n.push(a,new fo(e[r+1]));return new _n(n)}(e=>{function t(){return new _n([])}e.empty=t;function n(s){return new _n(s)}e.fromList=n;function r(s){return new _n([new fo(s)])}e.raw=r;function a(s,u){let d=[];for(let[l,p]of s.entries())l>0&&u!==void 0&&d.push(u),d.push(p);return new _n(d)}e.join=a;function o(s){return new Gf(s)}e.identifier=o;function i(s){return new Uf(s)}e.placeholder=i;function A(s,u){return new Jw(s,u)}e.param=A})(Np||(Np={}));(e=>{class t{constructor(r,a){this.sql=r,this.fieldAlias=a}static[D]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new t(this.sql,this.fieldAlias)}}e.Aliased=t})(_n||(_n={}));var Uf=class{constructor(t){this.name=t}static[D]="Placeholder";getSQL(){return new _n([this])}};var rge=Symbol.for("drizzle:IsDrizzleView"),c2=class{static[D]="View";[Lp];[rge]=!0;constructor({name:t,schema:n,selectedFields:r,query:a}){this[Lp]={name:t,originalName:t,schema:n,selectedFields:r,query:a,isExisting:!a,isAlias:!1}}getSQL(){return new _n([this])}};Vu.prototype.getSQL=function(){return new _n([this])};vn.prototype.getSQL=function(){return new _n([this])};Sp.prototype.getSQL=function(){return new _n([this])};function We(e,t){return{name:typeof e=="string"&&e.length>0?e:"",config:typeof e=="object"?e:t}}var nLe=typeof TextDecoder>"u"?null:new TextDecoder;var Bs=class extends ee{static[D]="PgIntColumnBaseBuilder";generatedAlwaysAsIdentity(t){if(t){let{name:n,...r}=t;this.config.generatedIdentity={type:"always",sequenceName:n,sequenceOptions:r}}else this.config.generatedIdentity={type:"always"};return this.config.hasDefault=!0,this.config.notNull=!0,this}generatedByDefaultAsIdentity(t){if(t){let{name:n,...r}=t;this.config.generatedIdentity={type:"byDefault",sequenceName:n,sequenceOptions:r}}else this.config.generatedIdentity={type:"byDefault"};return this.config.hasDefault=!0,this.config.notNull=!0,this}};var u2=class extends Bs{static[D]="PgBigInt53Builder";constructor(t){super(t,"number","PgBigInt53")}build(t){return new d2(t,this.config)}},d2=class extends W{static[D]="PgBigInt53";getSQLType(){return"bigint"}mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}},l2=class extends Bs{static[D]="PgBigInt64Builder";constructor(t){super(t,"bigint","PgBigInt64")}build(t){return new p2(t,this.config)}},p2=class extends W{static[D]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(t){return BigInt(t)}};function CG(e,t){let{name:n,config:r}=We(e,t);return r.mode==="number"?new u2(n):new l2(n)}var g2=class extends ee{static[D]="PgBigSerial53Builder";constructor(t){super(t,"number","PgBigSerial53"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new m2(t,this.config)}},m2=class extends W{static[D]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}},f2=class extends ee{static[D]="PgBigSerial64Builder";constructor(t){super(t,"bigint","PgBigSerial64"),this.config.hasDefault=!0}build(t){return new b2(t,this.config)}},b2=class extends W{static[D]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(t){return BigInt(t)}};function wG(e,t){let{name:n,config:r}=We(e,t);return r.mode==="number"?new g2(n):new f2(n)}var h2=class extends ee{static[D]="PgBooleanBuilder";constructor(t){super(t,"boolean","PgBoolean")}build(t){return new B2(t,this.config)}},B2=class extends W{static[D]="PgBoolean";getSQLType(){return"boolean"}};function EG(e){return new h2(e??"")}var y2=class extends ee{static[D]="PgCharBuilder";constructor(t,n){super(t,"string","PgChar"),this.config.length=n.length,this.config.enumValues=n.enum}build(t){return new C2(t,this.config)}},C2=class extends W{static[D]="PgChar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"char":`char(${this.length})`}};function kG(e,t={}){let{name:n,config:r}=We(e,t);return new y2(n,r)}var w2=class extends ee{static[D]="PgCidrBuilder";constructor(t){super(t,"string","PgCidr")}build(t){return new E2(t,this.config)}},E2=class extends W{static[D]="PgCidr";getSQLType(){return"cidr"}};function QG(e){return new w2(e??"")}var k2=class extends ee{static[D]="PgCustomColumnBuilder";constructor(t,n,r){super(t,"custom","PgCustomColumn"),this.config.fieldConfig=n,this.config.customTypeParams=r}build(t){return new Q2(t,this.config)}},Q2=class extends W{static[D]="PgCustomColumn";sqlName;mapTo;mapFrom;constructor(t,n){super(t,n),this.sqlName=n.customTypeParams.dataType(n.fieldConfig),this.mapTo=n.customTypeParams.toDriver,this.mapFrom=n.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(t){return typeof this.mapFrom=="function"?this.mapFrom(t):t}mapToDriverValue(t){return typeof this.mapTo=="function"?this.mapTo(t):t}};function IG(e){return(t,n)=>{let{name:r,config:a}=We(t,n);return new k2(r,a,e)}}var fA=class extends ee{static[D]="PgDateColumnBaseBuilder";defaultNow(){return this.default(Np`now()`)}};var I2=class extends fA{static[D]="PgDateBuilder";constructor(t){super(t,"date","PgDate")}build(t){return new v2(t,this.config)}},v2=class extends W{static[D]="PgDate";getSQLType(){return"date"}mapFromDriverValue(t){return typeof t=="string"?new Date(t):t}mapToDriverValue(t){return t.toISOString()}},_2=class extends fA{static[D]="PgDateStringBuilder";constructor(t){super(t,"string","PgDateString")}build(t){return new x2(t,this.config)}},x2=class extends W{static[D]="PgDateString";getSQLType(){return"date"}mapFromDriverValue(t){return typeof t=="string"?t:t.toISOString().slice(0,-14)}};function vG(e,t){let{name:n,config:r}=We(e,t);return r?.mode==="date"?new I2(n):new _2(n)}var D2=class extends ee{static[D]="PgDoublePrecisionBuilder";constructor(t){super(t,"number","PgDoublePrecision")}build(t){return new F2(t,this.config)}},F2=class extends W{static[D]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(t){return typeof t=="string"?Number.parseFloat(t):t}};function _G(e){return new D2(e??"")}var S2=class extends ee{static[D]="PgInetBuilder";constructor(t){super(t,"string","PgInet")}build(t){return new L2(t,this.config)}},L2=class extends W{static[D]="PgInet";getSQLType(){return"inet"}};function xG(e){return new S2(e??"")}var N2=class extends Bs{static[D]="PgIntegerBuilder";constructor(t){super(t,"number","PgInteger")}build(t){return new R2(t,this.config)}},R2=class extends W{static[D]="PgInteger";getSQLType(){return"integer"}mapFromDriverValue(t){return typeof t=="string"?Number.parseInt(t):t}};function DG(e){return new N2(e??"")}var $2=class extends ee{static[D]="PgIntervalBuilder";constructor(t,n){super(t,"string","PgInterval"),this.config.intervalConfig=n}build(t){return new M2(t,this.config)}},M2=class extends W{static[D]="PgInterval";fields=this.config.intervalConfig.fields;precision=this.config.intervalConfig.precision;getSQLType(){let t=this.fields?` ${this.fields}`:"",n=this.precision?`(${this.precision})`:"";return`interval${t}${n}`}};function FG(e,t={}){let{name:n,config:r}=We(e,t);return new $2(n,r)}var j2=class extends ee{static[D]="PgJsonBuilder";constructor(t){super(t,"json","PgJson")}build(t){return new P2(t,this.config)}},P2=class extends W{static[D]="PgJson";constructor(t,n){super(t,n)}getSQLType(){return"json"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}};function SG(e){return new j2(e??"")}var T2=class extends ee{static[D]="PgJsonbBuilder";constructor(t){super(t,"json","PgJsonb")}build(t){return new H2(t,this.config)}},H2=class extends W{static[D]="PgJsonb";constructor(t,n){super(t,n)}getSQLType(){return"jsonb"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}};function Ww(e){return new T2(e??"")}var G2=class extends ee{static[D]="PgLineBuilder";constructor(t){super(t,"array","PgLine")}build(t){return new U2(t,this.config)}},U2=class extends W{static[D]="PgLine";getSQLType(){return"line"}mapFromDriverValue(t){let[n,r,a]=t.slice(1,-1).split(",");return[Number.parseFloat(n),Number.parseFloat(r),Number.parseFloat(a)]}mapToDriverValue(t){return`{${t[0]},${t[1]},${t[2]}}`}},O2=class extends ee{static[D]="PgLineABCBuilder";constructor(t){super(t,"json","PgLineABC")}build(t){return new q2(t,this.config)}},q2=class extends W{static[D]="PgLineABC";getSQLType(){return"line"}mapFromDriverValue(t){let[n,r,a]=t.slice(1,-1).split(",");return{a:Number.parseFloat(n),b:Number.parseFloat(r),c:Number.parseFloat(a)}}mapToDriverValue(t){return`{${t.a},${t.b},${t.c}}`}};function LG(e,t){let{name:n,config:r}=We(e,t);return!r?.mode||r.mode==="tuple"?new G2(n):new O2(n)}var z2=class extends ee{static[D]="PgMacaddrBuilder";constructor(t){super(t,"string","PgMacaddr")}build(t){return new K2(t,this.config)}},K2=class extends W{static[D]="PgMacaddr";getSQLType(){return"macaddr"}};function NG(e){return new z2(e??"")}var Y2=class extends ee{static[D]="PgMacaddr8Builder";constructor(t){super(t,"string","PgMacaddr8")}build(t){return new J2(t,this.config)}},J2=class extends W{static[D]="PgMacaddr8";getSQLType(){return"macaddr8"}};function RG(e){return new Y2(e??"")}var W2=class extends ee{static[D]="PgNumericBuilder";constructor(t,n,r){super(t,"string","PgNumeric"),this.config.precision=n,this.config.scale=r}build(t){return new Z2(t,this.config)}},Z2=class extends W{static[D]="PgNumeric";precision;scale;constructor(t,n){super(t,n),this.precision=n.precision,this.scale=n.scale}mapFromDriverValue(t){return typeof t=="string"?t:String(t)}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}},V2=class extends ee{static[D]="PgNumericNumberBuilder";constructor(t,n,r){super(t,"number","PgNumericNumber"),this.config.precision=n,this.config.scale=r}build(t){return new X2(t,this.config)}},X2=class extends W{static[D]="PgNumericNumber";precision;scale;constructor(t,n){super(t,n),this.precision=n.precision,this.scale=n.scale}mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}},eS=class extends ee{static[D]="PgNumericBigIntBuilder";constructor(t,n,r){super(t,"bigint","PgNumericBigInt"),this.config.precision=n,this.config.scale=r}build(t){return new tS(t,this.config)}},tS=class extends W{static[D]="PgNumericBigInt";precision;scale;constructor(t,n){super(t,n),this.precision=n.precision,this.scale=n.scale}mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}};function $G(e,t){let{name:n,config:r}=We(e,t),a=r?.mode;return a==="number"?new V2(n,r?.precision,r?.scale):a==="bigint"?new eS(n,r?.precision,r?.scale):new W2(n,r?.precision,r?.scale)}var nS=class extends ee{static[D]="PgPointTupleBuilder";constructor(t){super(t,"array","PgPointTuple")}build(t){return new aS(t,this.config)}},aS=class extends W{static[D]="PgPointTuple";getSQLType(){return"point"}mapFromDriverValue(t){if(typeof t=="string"){let[n,r]=t.slice(1,-1).split(",");return[Number.parseFloat(n),Number.parseFloat(r)]}return[t.x,t.y]}mapToDriverValue(t){return`(${t[0]},${t[1]})`}},rS=class extends ee{static[D]="PgPointObjectBuilder";constructor(t){super(t,"json","PgPointObject")}build(t){return new oS(t,this.config)}},oS=class extends W{static[D]="PgPointObject";getSQLType(){return"point"}mapFromDriverValue(t){if(typeof t=="string"){let[n,r]=t.slice(1,-1).split(",");return{x:Number.parseFloat(n),y:Number.parseFloat(r)}}return t}mapToDriverValue(t){return`(${t.x},${t.y})`}};function MG(e,t){let{name:n,config:r}=We(e,t);return!r?.mode||r.mode==="tuple"?new nS(n):new rS(n)}function oge(e){let t=[];for(let n=0;n<e.length;n+=2)t.push(Number.parseInt(e.slice(n,n+2),16));return new Uint8Array(t)}function jG(e,t){let n=new ArrayBuffer(8),r=new DataView(n);for(let a=0;a<8;a++)r.setUint8(a,e[t+a]);return r.getFloat64(0,!0)}function iS(e){let t=oge(e),n=0,r=t[n];n+=1;let a=new DataView(t.buffer),o=a.getUint32(n,r===1);n+=4;let i;if(o&536870912&&(i=a.getUint32(n,r===1),n+=4),(o&65535)===1){let A=jG(t,n);n+=8;let s=jG(t,n);return n+=8,[A,s]}throw new Error("Unsupported geometry type")}var AS=class extends ee{static[D]="PgGeometryBuilder";constructor(t){super(t,"array","PgGeometry")}build(t){return new sS(t,this.config)}},sS=class extends W{static[D]="PgGeometry";getSQLType(){return"geometry(point)"}mapFromDriverValue(t){return iS(t)}mapToDriverValue(t){return`point(${t[0]} ${t[1]})`}},cS=class extends ee{static[D]="PgGeometryObjectBuilder";constructor(t){super(t,"json","PgGeometryObject")}build(t){return new uS(t,this.config)}},uS=class extends W{static[D]="PgGeometryObject";getSQLType(){return"geometry(point)"}mapFromDriverValue(t){let n=iS(t);return{x:n[0],y:n[1]}}mapToDriverValue(t){return`point(${t.x} ${t.y})`}};function PG(e,t){let{name:n,config:r}=We(e,t);return!r?.mode||r.mode==="tuple"?new AS(n):new cS(n)}var dS=class extends ee{static[D]="PgRealBuilder";constructor(t,n){super(t,"number","PgReal"),this.config.length=n}build(t){return new lS(t,this.config)}},lS=class extends W{static[D]="PgReal";constructor(t,n){super(t,n)}getSQLType(){return"real"}mapFromDriverValue=t=>typeof t=="string"?Number.parseFloat(t):t};function TG(e){return new dS(e??"")}var pS=class extends ee{static[D]="PgSerialBuilder";constructor(t){super(t,"number","PgSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new gS(t,this.config)}},gS=class extends W{static[D]="PgSerial";getSQLType(){return"serial"}};function HG(e){return new pS(e??"")}var mS=class extends Bs{static[D]="PgSmallIntBuilder";constructor(t){super(t,"number","PgSmallInt")}build(t){return new fS(t,this.config)}},fS=class extends W{static[D]="PgSmallInt";getSQLType(){return"smallint"}mapFromDriverValue=t=>typeof t=="string"?Number(t):t};function GG(e){return new mS(e??"")}var bS=class extends ee{static[D]="PgSmallSerialBuilder";constructor(t){super(t,"number","PgSmallSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new hS(t,this.config)}},hS=class extends W{static[D]="PgSmallSerial";getSQLType(){return"smallserial"}};function UG(e){return new bS(e??"")}var BS=class extends ee{static[D]="PgTextBuilder";constructor(t,n){super(t,"string","PgText"),this.config.enumValues=n.enum}build(t){return new yS(t,this.config)}},yS=class extends W{static[D]="PgText";enumValues=this.config.enumValues;getSQLType(){return"text"}};function wi(e,t={}){let{name:n,config:r}=We(e,t);return new BS(n,r)}var CS=class extends fA{constructor(t,n,r){super(t,"string","PgTime"),this.withTimezone=n,this.precision=r,this.config.withTimezone=n,this.config.precision=r}static[D]="PgTimeBuilder";build(t){return new wS(t,this.config)}},wS=class extends W{static[D]="PgTime";withTimezone;precision;constructor(t,n){super(t,n),this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}};function OG(e,t={}){let{name:n,config:r}=We(e,t);return new CS(n,r.withTimezone??!1,r.precision)}var ES=class extends fA{static[D]="PgTimestampBuilder";constructor(t,n,r){super(t,"date","PgTimestamp"),this.config.withTimezone=n,this.config.precision=r}build(t){return new kS(t,this.config)}},kS=class extends W{static[D]="PgTimestamp";withTimezone;precision;constructor(t,n){super(t,n),this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue(t){return typeof t=="string"?new Date(this.withTimezone?t:t+"+0000"):t}mapToDriverValue=t=>t.toISOString()},QS=class extends fA{static[D]="PgTimestampStringBuilder";constructor(t,n,r){super(t,"string","PgTimestampString"),this.config.withTimezone=n,this.config.precision=r}build(t){return new IS(t,this.config)}},IS=class extends W{static[D]="PgTimestampString";withTimezone;precision;constructor(t,n){super(t,n),this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}mapFromDriverValue(t){if(typeof t=="string")return t;let n=t.toISOString().slice(0,-1).replace("T"," ");if(this.withTimezone){let r=t.getTimezoneOffset(),a=r<=0?"+":"-";return`${n}${a}${Math.floor(Math.abs(r)/60).toString().padStart(2,"0")}`}return n}};function Zw(e,t={}){let{name:n,config:r}=We(e,t);return r?.mode==="string"?new QS(n,r.withTimezone??!1,r.precision):new ES(n,r?.withTimezone??!1,r?.precision)}var vS=class extends ee{static[D]="PgUUIDBuilder";constructor(t){super(t,"string","PgUUID")}defaultRandom(){return this.default(Np`gen_random_uuid()`)}build(t){return new _S(t,this.config)}},_S=class extends W{static[D]="PgUUID";getSQLType(){return"uuid"}};function qG(e){return new vS(e??"")}var xS=class extends ee{static[D]="PgVarcharBuilder";constructor(t,n){super(t,"string","PgVarchar"),this.config.length=n.length,this.config.enumValues=n.enum}build(t){return new DS(t,this.config)}},DS=class extends W{static[D]="PgVarchar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?"varchar":`varchar(${this.length})`}};function zG(e,t={}){let{name:n,config:r}=We(e,t);return new xS(n,r)}var FS=class extends ee{static[D]="PgBinaryVectorBuilder";constructor(t,n){super(t,"string","PgBinaryVector"),this.config.dimensions=n.dimensions}build(t){return new SS(t,this.config)}},SS=class extends W{static[D]="PgBinaryVector";dimensions=this.config.dimensions;getSQLType(){return`bit(${this.dimensions})`}};function KG(e,t){let{name:n,config:r}=We(e,t);return new FS(n,r)}var LS=class extends ee{static[D]="PgHalfVectorBuilder";constructor(t,n){super(t,"array","PgHalfVector"),this.config.dimensions=n.dimensions}build(t){return new NS(t,this.config)}},NS=class extends W{static[D]="PgHalfVector";dimensions=this.config.dimensions;getSQLType(){return`halfvec(${this.dimensions})`}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){return t.slice(1,-1).split(",").map(n=>Number.parseFloat(n))}};function YG(e,t){let{name:n,config:r}=We(e,t);return new LS(n,r)}var RS=class extends ee{static[D]="PgSparseVectorBuilder";constructor(t,n){super(t,"string","PgSparseVector"),this.config.dimensions=n.dimensions}build(t){return new $S(t,this.config)}},$S=class extends W{static[D]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}};function JG(e,t){let{name:n,config:r}=We(e,t);return new RS(n,r)}var MS=class extends ee{static[D]="PgVectorBuilder";constructor(t,n){super(t,"array","PgVector"),this.config.dimensions=n.dimensions}build(t){return new jS(t,this.config)}},jS=class extends W{static[D]="PgVector";dimensions=this.config.dimensions;getSQLType(){return`vector(${this.dimensions})`}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){return t.slice(1,-1).split(",").map(n=>Number.parseFloat(n))}};function WG(e,t){let{name:n,config:r}=We(e,t);return new MS(n,r)}function ZG(){return{bigint:CG,bigserial:wG,boolean:EG,char:kG,cidr:QG,customType:IG,date:vG,doublePrecision:_G,inet:xG,integer:DG,interval:FG,json:SG,jsonb:Ww,line:LG,macaddr:NG,macaddr8:RG,numeric:$G,point:MG,geometry:PG,real:TG,serial:HG,smallint:GG,smallserial:UG,text:wi,time:OG,timestamp:Zw,uuid:qG,varchar:zG,bit:KG,halfvec:YG,sparsevec:JG,vector:WG}}var PS=Symbol.for("drizzle:PgInlineForeignKeys"),VG=Symbol.for("drizzle:EnableRLS"),Of=class extends vn{static[D]="PgTable";static Symbol=Object.assign({},vn.Symbol,{InlineForeignKeys:PS,EnableRLS:VG});[PS]=[];[VG]=!1;[vn.Symbol.ExtraConfigBuilder]=void 0;[vn.Symbol.ExtraConfigColumns]={}};function ige(e,t,n,r,a=e){let o=new Of(e,r,a),i=typeof t=="function"?t(ZG()):t,A=Object.fromEntries(Object.entries(i).map(([d,l])=>{let p=l;p.setName(d);let g=p.build(o);return o[PS].push(...p.buildForeignKeys(g,o)),[d,g]})),s=Object.fromEntries(Object.entries(i).map(([d,l])=>{let p=l;p.setName(d);let g=p.buildExtraConfigColumn(o);return[d,g]})),u=Object.assign(o,A);return u[vn.Symbol.Columns]=A,u[vn.Symbol.ExtraConfigColumns]=s,n&&(u[Of.Symbol.ExtraConfigBuilder]=n),Object.assign(u,{enableRLS:()=>(u[Of.Symbol.EnableRLS]=!0,u)})}var XG=(e,t,n)=>ige(e,t,n,void 0);var Vw=class{constructor(t,n){this.unique=t,this.name=n}static[D]="PgIndexBuilderOn";on(...t){return new qf(t.map(n=>{if(Un(n,_n))return n;n=n;let r=new Fp(n.name,!!n.keyAsName,n.columnType,n.indexConfig);return n.indexConfig=JSON.parse(JSON.stringify(n.defaultConfig)),r}),this.unique,!1,this.name)}onOnly(...t){return new qf(t.map(n=>{if(Un(n,_n))return n;n=n;let r=new Fp(n.name,!!n.keyAsName,n.columnType,n.indexConfig);return n.indexConfig=n.defaultConfig,r}),this.unique,!0,this.name)}using(t,...n){return new qf(n.map(r=>{if(Un(r,_n))return r;r=r;let a=new Fp(r.name,!!r.keyAsName,r.columnType,r.indexConfig);return r.indexConfig=JSON.parse(JSON.stringify(r.defaultConfig)),a}),this.unique,!0,this.name,t)}},qf=class{static[D]="PgIndexBuilder";config;constructor(t,n,r,a,o="btree"){this.config={name:a,columns:t,unique:n,only:r,method:o}}concurrently(){return this.config.concurrently=!0,this}with(t){return this.config.with=t,this}where(t){return this.config.where=t,this}build(t){return new TS(this.config,t)}},TS=class{static[D]="PgIndex";config;constructor(t,n){this.config={...t,table:n}}};function e5(e){return new Vw(!1,e)}function t5(e){return new Vw(!0,e)}var n5=e=>Zw(e,{withTimezone:!0}),a5=c.enum(["channel","dm","group","local_conversation","thread","web_session"]),mRe=XG("junior_destinations",{id:wi("id").primaryKey(),provider:wi("provider").notNull(),providerTenantId:wi("provider_tenant_id").notNull().default(""),providerDestinationId:wi("provider_destination_id").notNull(),kind:wi("kind").$type().notNull(),parentDestinationId:wi("parent_destination_id"),displayName:wi("display_name"),visibility:wi("visibility").$type().notNull().default("unknown"),metadata:Ww("metadata_json"),createdAt:n5("created_at").notNull(),updatedAt:n5("updated_at").notNull()},e=>[t5("junior_destinations_provider_destination_uidx").on(e.provider,e.providerTenantId,e.providerDestinationId),e5("junior_destinations_provider_kind_idx").on(e.provider,e.kind)]);var Age=c.object({error:c.string().min(1)}).strict(),o5=36e5,wRe=6*o5,ERe=24*o5;var OS=c.object({closed:c.number().int().nonnegative(),costUsd:c.number().nonnegative().optional(),created:c.number().int().nonnegative(),medianCostUsd:c.number().nonnegative().optional(),medianMergeTimeMs:c.number().nonnegative().optional(),merged:c.number().int().nonnegative(),mergeRate:c.number().min(0).max(1).optional(),open:c.number().int().nonnegative()}).strict(),sge=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),Xu=c.object({closed:c.number().int().nonnegative(),created:c.number().int().nonnegative(),date:sge,merged:c.number().int().nonnegative()}).strict(),i5=c.object({closed:c.number().int().nonnegative(),created:c.number().int().nonnegative(),id:c.string().uuid(),medianCostUsd:c.number().nonnegative().optional(),merged:c.number().int().nonnegative(),mergeRate:c.number().min(0).max(1).optional(),name:c.string().min(1),open:c.number().int().nonnegative(),provider:c.string().min(1),url:c.string().url().optional()}).strict(),A5=c.object({closedAt:c.string().optional(),id:c.string().uuid(),mergedAt:c.string().optional(),number:c.number().int().positive(),openedAt:c.string(),provider:c.string().min(1),repository:c.string().min(1),state:Pf,title:c.string().optional(),url:c.string().url().optional()}).strict(),qS=c.object({activityDays:c.array(Xu),activityHours:c.array(Xu).optional(),activitySixHours:c.array(Xu).optional(),changes:c.array(A5),generatedAt:c.string(),repositories:c.array(i5),summary:OS,windowEnd:c.string(),windowStart:c.string()}).strict(),zS=c.object({activityDays:c.array(Xu),activityHours:c.array(Xu).optional(),activitySixHours:c.array(Xu).optional(),generatedAt:c.string(),summary:OS,windowEnd:c.string(),windowStart:c.string()}).strict(),eE=c.object({active:c.number(),conversations:c.number(),date:c.string(),durationMs:c.number(),failed:c.number(),tokens:c.number().optional()}).strict();var cge=c.object({locationId:c.string().min(1)}).strict(),s5=Zu.extend({id:c.string(),firstSeenAt:c.string(),kind:a5,lastSeenAt:c.string(),provider:c.string(),providerDestinationId:c.string(),visibility:c.literal("public")}).strict(),uge=Zu.extend({actor:xp}).strict(),dge=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),tE=c.object({date:dge,privateConversations:c.number(),publicConversations:c.number()}).strict(),KS=c.object({activityDays:c.array(tE),activityHours:c.array(tE).optional(),activitySixHours:c.array(tE).optional(),generatedAt:c.string(),locations:c.array(s5),privateActivity:Zu,source:c.literal("conversation_index"),windowEnd:c.string(),windowStart:c.string()}).strict(),YS=s5.extend({activityDays:c.array(eE),activityHours:c.array(eE).optional(),activitySixHours:c.array(eE).optional(),actors:c.array(uge),generatedAt:c.string(),recentConversations:c.array(Dp),source:c.literal("conversation_index"),windowEnd:c.string(),windowStart:c.string()}).strict(),lge=c.object({email:c.string().trim().min(1)}).strict(),r5=Zu.omit({costUsd:!0}),c5=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),HS=c.object({active:c.number(),conversations:c.number(),costUsd:c.number().optional(),date:c5,durationMs:c.number(),failed:c.number(),tokens:c.number().optional()}).strict(),GS=c.object({activePeople:c.number(),conversations:c.number(),date:c5}).strict(),u5=c.object({active:c.number(),activeDays:c.number(),conversations:c.number(),durationMs:c.number(),failed:c.number(),tokens:c.number().optional()}).strict(),Xw=c.object({conversations:c.number().int().nonnegative(),costUsd:c.number().finite().nonnegative(),durationMs:c.number().finite().nonnegative(),priorCostUsd:c.number().finite().nonnegative()}).strict(),pge=c.object({1:Xw,7:Xw,30:Xw,90:Xw}).strict(),d5=xp.extend({email:c.string().min(1)}).strict(),gge=u5.extend({firstSeenAt:c.string(),lastSeenAt:c.string(),actor:d5,windows:pge}).strict(),JS=c.object({activityDays:c.array(GS),activityHours:c.array(GS).optional(),activitySixHours:c.array(GS).optional(),generatedAt:c.string(),people:c.array(gge),source:c.literal("conversation_index"),windowEnd:c.string(),windowStart:c.string()}).strict(),WS=c.object({activityDays:c.array(HS),activityHours:c.array(HS).optional(),activitySixHours:c.array(HS).optional(),generatedAt:c.string(),locations:c.array(r5),recentConversations:c.array(Dp),actor:d5,source:c.literal("conversation_index"),surfaces:c.array(r5),totals:u5,windowEnd:c.string(),windowStart:c.string()}).strict(),ZS=c.object({generatedAt:c.string(),sevenDaysUsd:c.number().finite().nonnegative(),source:c.literal("conversation_index"),thirtyDaysUsd:c.number().finite().nonnegative(),windowEnd:c.string(),windowStart:c.string()}).strict(),VS=c.object({id:c.string().uuid(),name:c.string(),tokenSuffix:c.string(),createdAt:c.string().datetime(),expiresAt:c.string().datetime(),lastUsedAt:c.string().datetime().nullable()}).strict(),XS=c.object({tokens:c.array(VS)}).strict(),mge=c.object({name:c.string().trim().min(1).max(80)}).strict(),e4=VS.extend({token:c.string().startsWith("jr_pat_")}).strict(),fge=c.object({id:c.string().uuid()}).strict(),bge=c.object({revoked:c.literal(!0)}).strict(),hge=c.object({channelId:c.string().min(1),label:c.string().min(1),teamId:c.string().min(1),visibility:c.enum(["private","public"])}).strict(),l5=c.object({1:c.number().int().nonnegative(),7:c.number().int().nonnegative(),30:c.number().int().nonnegative(),90:c.number().int().nonnegative()}).strict(),p5=c.object({createdAt:c.string().datetime(),createdBy:c.string().min(1),createdByEmail:c.string().trim().email().optional(),destination:hge,id:c.string().min(1),instruction:c.string().min(1),lastConversationId:c.string().min(1).optional(),lastRunAt:c.string().datetime().optional(),ownedByViewer:c.boolean(),runs:l5,outcomes:c.array(FH).max(5),title:c.string().min(1),totalRuns:c.number().int().nonnegative()}),g5=p5.extend({kind:c.literal("scheduled"),nextRunAt:c.string().datetime().optional(),schedule:c.string().min(1),status:c.enum(["active","blocked","completed"])}).strict(),m5=p5.extend({events:c.array(c.string().min(1)).min(1),kind:c.literal("event"),resource:c.string().min(1),source:c.string().min(1),triggerAvailable:c.boolean()}).strict(),t4=c.discriminatedUnion("kind",[g5,m5]),f5=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),US=c.object({costUsd:c.number().finite().nonnegative(),date:f5,event:c.number().int().nonnegative(),scheduled:c.number().int().nonnegative()}).strict(),Bge=c.object({q:c.string().trim().max(200).optional()}).strict(),n4=c.object({executionDays:c.array(US),executionHours:c.array(US).optional(),executionSixHours:c.array(US).optional(),automations:c.array(t4),truncated:c.boolean()}).strict(),yge=c.object({id:c.string().min(1),kind:c.enum(["scheduled","event"])}).strict(),b5=c.enum(["blocked","completed","failed"]),a4=c.object({conversationId:c.string().min(1).optional(),costUsd:c.number().finite().nonnegative().optional(),durationMs:c.number().finite().nonnegative().optional(),executedAt:c.string().datetime(),executionId:c.string().min(1),status:b5,title:c.string().min(1).optional(),totalTokens:c.number().int().nonnegative().optional()}).strict(),nE=c.object({blocked:c.number().int().nonnegative(),completed:c.number().int().nonnegative(),date:f5,failed:c.number().int().nonnegative()}).strict(),r4=c.object({executionDays:c.array(nE),executionHours:c.array(nE).optional(),executionSixHours:c.array(nE).optional(),executions:c.array(a4),automation:t4,truncated:c.boolean()}).strict(),h5=a4.extend({kind:c.enum(["scheduled","event"]),automationId:c.string().min(1),automationTitle:c.string().min(1)}).strict(),o4=c.object({runs:c.array(h5),truncated:c.boolean()}).strict(),Cge=c.object({provider:c.string(),repo:c.string()}).strict(),B5=c.object({provider:c.string(),repo:c.string(),checkoutPath:c.string()}).strict(),wge=c.object({id:c.string(),generatedAt:c.iso.datetime(),buildDurationMs:c.number().int().nonnegative(),sizeBytes:c.number().int().nonnegative().nullable()}).strict(),y5=c.object({id:c.string(),generatedAt:c.iso.datetime(),buildDurationMs:c.number().int().nonnegative(),dependencyCount:c.number().int().nonnegative()}).strict(),Rp=c.object({id:c.string().uuid(),name:c.string(),setupScript:c.string(),repos:c.array(B5),snapshot:wge.nullable()}).strict(),i4=c.object({baselineSnapshot:y5.nullable(),workspaces:c.array(Rp)}).strict(),Ege=c.object({name:c.string(),setupScript:c.string().optional(),repos:c.array(Cge)}).strict(),kge=c.object({id:c.string().uuid()}).strict(),Qge=c.object({deleted:c.literal(!0)}).strict(),C5=c.object({count:c.number().int().nonnegative(),date:c.string(),metric:c.string().min(1),name:c.string().min(1),namespace:c.string().min(1)}).strict(),A4=c.object({generatedAt:c.string().datetime(),stats:c.array(C5),windowEnd:c.string(),windowStart:c.string()}).strict();function Ige(e){try{let t=new URL(e).protocol;return t==="http:"||t==="https:"}catch{return!1}}var vge=c.object({kind:c.literal("resource_link"),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256),url:c.string().url().max(2048).refine(Ige,"URL must use HTTP or HTTPS."),description:c.string().trim().min(1).max(512).optional(),status:c.enum(["open","draft","closed","merged","warning"]).optional()}).strict(),DRe=c.discriminatedUnion("kind",[vge]),_ge=c.enum(["circle-dot","circle-dashed","circle-x","git-merge","git-pull-request","triangle-alert"]),FRe=c.object({icon:_ge.optional(),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256)}).strict(),xge=c.enum(["closed","merged","open"]),LRe=c.object({closedAt:c.date().optional(),conversationIds:c.array(c.string().min(1)).default([]),mergedAt:c.date().optional(),number:c.number().int().positive(),openedAt:c.date(),providerId:c.string().min(1),repository:c.object({name:c.string().min(1),providerId:c.string().min(1),url:c.string().url().optional()}).strict(),state:xge,title:c.string().min(1).optional(),updatedAt:c.date(),url:c.string().url().optional()}).strict(),RRe=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/),Dge=c.enum(["activity","brain","calendar","check","database","info","key","link","sparkles","warning"]),Fge=c.object({content:c.string().min(1).max(32*1024).optional(),description:c.string().trim().min(1).max(2e3).optional(),metadata:c.array(c.string().trim().min(1).max(120)).max(8).optional(),title:c.string().trim().min(1).max(4e3)}).strict(),$Re=c.object({details:c.array(Fge).max(100).optional(),icon:Dge.optional(),preview:c.string().trim().min(1).max(500).optional(),title:c.string().trim().min(1).max(120)}).strict();var rE=c.string().regex(/^T[A-Z0-9]+$/),c4=c.string().regex(/^(C|G|D)[A-Z0-9]+$/),E5=c.string().regex(/^local:[a-z0-9_-]+:[a-z0-9][a-z0-9_-]*$/),Sge=c.string().min(1).refine(e=>e===e.trim()&&e.toLowerCase()!=="unknown"),aE=Sge,Be=c.string().refine(e=>e.trim().length>0),Va=Be.refine(e=>e===e.trim()),Lge=c.object({id:Be,provider:Va}).strict(),Nge=Lge.extend({provider:c.literal("slack"),teamId:rE,channelId:c4,threadTs:Va.optional()}).strict(),jRe=c.discriminatedUnion("provider",[Nge]),PRe=c.enum(["slack","local"]),k5=c.enum(["public","private"]),Rge=c.enum(["public","private"]),$ge=c.object({platform:c.literal("slack"),teamId:rE,channelId:c4,threadTs:Va.optional()}).strict(),u4=$ge,Mge=c.object({platform:c.literal("local"),conversationId:E5}).strict(),jge=c.discriminatedUnion("platform",[u4,Mge]),TRe=c.object({action:c.literal("send_message"),destination:u4}).strict(),Pge=c.object({kind:c.literal("slack"),teamId:rE,channelId:c4,visibility:k5,messageTs:Be.optional(),threadTs:Be.optional()}).strict(),Tge=c.object({kind:c.literal("local"),visibility:c.literal("private"),conversationId:E5}).strict(),Hge=c.object({kind:c.literal("web"),visibility:k5,conversationId:Va}).strict(),Gge=c.object({kind:c.literal("event"),eventKey:Va,eventType:Va,identifier:Va,namespace:Va}).strict(),Uge=c.object({kind:c.literal("scheduled_automation")}).strict(),Oge=c.object({kind:c.literal("event_automation")}).strict(),qge=c.object({kind:c.literal("plugin_dispatch")}).strict(),zge=c.object({kind:c.literal("agent_invocation")}).strict(),Kge=c.discriminatedUnion("kind",[Pge,Tge,Hge,Gge,Uge,Oge,qge,zge]);function Yge(e){if(!e||typeof e!="object"||Array.isArray(e))return e;let t=e;if("kind"in t){let o={event_task:"event_automation",resource_event:"event",scheduled_task:"scheduled_automation"},i=typeof t.kind=="string"?o[t.kind]:void 0;return i?{...t,kind:i}:e}if(t.platform!=="slack"&&t.platform!=="local"&&t.platform!=="web")return e;let{location:n,platform:r,...a}=t;return{...a,kind:r}}var Jge=c.preprocess(Yge,Kge),Wge=c.discriminatedUnion("allowedWhen",[c.object({type:c.literal("user"),userId:aE,allowedWhen:c.literal("private-direct-conversation")}).strict(),c.object({type:c.literal("user"),userId:aE,allowedWhen:c.literal("scheduled-automation"),taskId:Va}).strict()]),d4={email:Be.optional(),fullName:Be.optional(),userId:aE,userName:Be.optional()},Zge=c.object({...d4,platform:c.literal("slack"),teamId:rE}).strict(),Vge=c.object({...d4,platform:c.literal("local")}).strict(),Xge=c.object({...d4,platform:c.literal("web")}).strict(),eme=c.object({platform:c.literal("system"),name:aE}).strict(),s4=c.discriminatedUnion("platform",[Zge,Vge,Xge,eme]),tme=c.object({displayName:Be.optional(),handle:Be.optional(),id:Va,provider:Va,providerSubjectId:Va,providerTenantId:Va.optional()}).strict(),HRe=c.object({displayName:Be.optional(),email:Be.max(320),id:Va,identities:c.array(tme).max(100)}).strict(),nme=c.record(c.string(),c.string()).superRefine((e,t)=>{let n=Object.entries(e);if(n.length>20){t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata has too many keys"});return}for(let[r,a]of n){if(!r.trim()){t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata values must be strings",path:[r]});continue}r.length>128&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata key exceeds the maximum length",path:[r]}),/[\r\n]/.test(r)&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata keys must be single-line strings",path:[r]}),/[\r\n]/.test(a)&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata values must be single-line strings",path:[r]}),a.length>512&&t.addIssue({code:c.ZodIssueCode.custom,message:"Dispatch metadata value exceeds the maximum length",path:[r]})}}),ame=c.object({label:Va.pipe(c.string().max(48)).refine(e=>!/[\r\n]/.test(e)),detail:Va.pipe(c.string().max(128)).refine(e=>!/[\r\n]/.test(e)).optional()}).strict(),GRe=c.object({idempotencyKey:Be.pipe(c.string().max(512)),credentialSubject:Wge.optional(),destination:u4,destinationVisibility:Rge,input:Be.pipe(c.string().max(32e3)),metadata:nme.optional(),replyAttribution:ame.optional()}).strict();var rme=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/),ORe=c.object({text:c.string().trim().min(1).max(8e3)}).strict(),qRe=c.object({kind:rme,version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict();var ome=4e3,ime=8e3,$p=32,w5=4e3,Ame=1e3,sme=c.record(c.string(),c.unknown()).superRefine((e,t)=>{Object.keys(e).length>$p&&t.addIssue({code:"custom",message:`Event data may include at most ${$p} keys.`}),new TextEncoder().encode(JSON.stringify(e)).byteLength>w5&&t.addIssue({code:"custom",message:`Event data may be at most ${w5} JSON bytes.`})}),ed=c.string().regex(/^[a-z][a-z0-9_-]*(?:\.[a-z][a-z0-9_-]*)+$/).describe("Canonical dotted event type, such as issue.closed or pull_request.review.changes_requested."),Q5=c.string().regex(/^[a-z][a-z0-9_]*$/).describe("Canonical plugin-defined resource type, such as issue or pull_request."),I5=/^[a-z][a-zA-Z0-9]*$/,cme=c.object({kind:c.enum(["boolean","string","number"]),description:c.string().trim().min(1).max(200),enum:c.array(c.string().min(1)).min(1).optional()}).strict().superRefine((e,t)=>{e.enum&&e.kind!=="string"&&t.addIssue({code:"custom",message:'Event match field enum requires kind "string".',path:["enum"]})}),ume=c.record(c.string().regex(I5),cme).superRefine((e,t)=>{Object.keys(e).length>$p&&t.addIssue({code:"custom",message:`Event match keys may include at most ${$p} keys.`})}),KRe=c.record(c.string().regex(I5),c.union([c.boolean(),c.number().finite(),c.string().min(1),c.array(c.union([c.number().finite(),c.string().min(1)])).min(1)])).superRefine((e,t)=>{Object.keys(e).length>$p&&t.addIssue({code:"custom",message:`Event match may include at most ${$p} keys.`});for(let[n,r]of Object.entries(e))Array.isArray(r)&&r.some(a=>typeof a=="boolean")&&t.addIssue({code:"custom",message:`Event match field "${n}" cannot use a boolean list.`,path:[n]})});var dme=c.object({type:Q5,supportedEvents:c.array(ed).min(1),suggestedEvents:c.array(ed).optional(),matchFields:ume.optional(),guidance:c.record(ed,c.string().trim().min(1).max(Ame)).optional()}).strict().superRefine((e,t)=>{let n=new Set;e.supportedEvents.forEach((a,o)=>{n.has(a)&&t.addIssue({code:"custom",message:`Duplicate supported event type "${a}".`,path:["supportedEvents",o]}),n.add(a)});for(let a of Object.keys(e.guidance??{}))n.has(a)||t.addIssue({code:"custom",message:`Guidance event type "${a}" is not supported.`,path:["guidance",a]});let r=new Set;e.suggestedEvents?.forEach((a,o)=>{r.has(a)&&t.addIssue({code:"custom",message:`Duplicate suggested event type "${a}".`,path:["suggestedEvents",o]}),n.has(a)||t.addIssue({code:"custom",message:`Suggested event type "${a}" is not supported.`,path:["suggestedEvents",o]}),r.add(a)})}),YRe=c.object({resourceTypes:c.array(dme).min(1),isEnabled:c.function({input:[],output:c.boolean()}).optional(),normalizeIdentifier:c.function({input:[c.string()],output:c.string()}).optional()}).strict().superRefine((e,t)=>{let n=new Set;e.resourceTypes.forEach((r,a)=>{n.has(r.type)&&t.addIssue({code:"custom",message:`Duplicate resource type "${r.type}".`,path:["resourceTypes",a,"type"]}),n.add(r.type)})});var JRe=c.object({identifier:c.string().min(1),label:c.string().min(1),namespace:c.string().min(1),suggestedEvents:c.array(ed).optional(),supportedEvents:c.array(ed),type:Q5}).strict(),WRe=c.object({events:c.array(ed).min(1),id:c.string().min(1)}).strict(),lme=c.object({eventKey:c.string().min(1),eventType:ed,identifier:c.string().min(1),occurredAtMs:c.number().finite(),terminal:c.boolean().optional(),trustedSummary:c.string().min(1).transform(e=>e.slice(0,ome)),data:sme.optional(),untrustedText:c.string().transform(e=>e.slice(0,ime)).optional()}).strict(),ZRe=lme.extend({namespace:c.string().min(1)}),pme=c.object({authority:c.enum(["instruction","context"]),actor:s4.optional()}).strict(),gme=c.discriminatedUnion("type",[c.object({type:c.literal("message"),role:c.enum(["user","assistant"]),text:c.string().min(1),provenance:pme.optional(),isRunActor:c.boolean().optional()}).strict(),c.object({type:c.literal("toolResult"),toolName:c.string().min(1),isError:c.boolean(),text:c.string().min(1).optional()}).strict()]),XRe=c.object({actorUserId:c.string().min(1).optional(),completedAtMs:c.number().finite(),conversationId:c.string().min(1),destination:jge,locationId:c.string().min(1).optional(),actors:c.array(s4),actor:s4.optional(),runId:c.string().min(1),source:Jge,transcript:c.array(gme)}).strict();var t$e=c.discriminatedUnion("type",[c.object({type:c.literal("text"),text:c.string()}).strict(),c.object({type:c.literal("image"),data:c.string(),mimeType:c.string()}).strict()]),mme=c.object({arguments:c.record(c.string(),c.unknown()),reason:c.string().min(1).optional()}).strict(),n$e=c.object({target:c.string().min(1).optional(),truncated:c.boolean().optional(),continuation:mme.optional()}).passthrough(),a$e=c.enum(["auto","review","approve"]);var o$e=c.object({auth:c.object({user:c.object({email:c.string().nullable().optional(),emailVerified:c.boolean().optional(),name:c.string().nullable().optional()}).strict()}).strict(),pluginName:Be}).strict(),fme=c.string().regex(/^[a-z][a-z0-9-]*$/),bme=c.string().regex(/^[a-z][a-z0-9.-]*$/),hme=c.union([c.literal("read"),c.literal("write")]),v5=c.object({provider:fme,scope:Be.optional(),type:c.literal("oauth")}).strict(),_5=c.object({displayName:Be.optional(),handle:Be.optional(),id:Be,label:Be.optional(),url:Be.optional()}).strict(),A$e=c.object({account:_5.optional(),accessToken:Be,expiresAt:c.number().finite().optional(),refreshToken:Be,refreshTokenExpiresAt:c.number().finite().optional(),scope:Be.optional()}).strict(),s$e=c.object({access:hme,leaseScope:Be.optional(),name:bme,reason:Be.optional(),requirements:c.array(Be).min(1).optional()}).strict(),Bme=c.object({domain:c.string().min(1),headers:c.record(c.string(),c.string()).refine(e=>Object.keys(e).length>0)}).strict(),yme=c.object({account:_5.optional(),authorization:v5.optional(),expiresAt:c.string().refine(e=>Number.isFinite(Date.parse(e))),headerTransforms:c.array(Bme).min(1)}).strict(),c$e=c.discriminatedUnion("type",[c.object({lease:yme,type:c.literal("lease")}).strict(),c.object({authorization:v5.optional(),message:Be,type:c.literal("needed")}).strict(),c.object({message:Be,type:c.literal("unavailable")}).strict()]);var Cme=Be.max(64).regex(/^[a-z][a-z0-9-]*$/),wme=Be.max(80),Eme=Be.max(500),kme=c.enum(["primary","profile"]),Qme=c.object({detail:Be.max(500).optional(),label:Be.max(80),tone:c.enum(["good","neutral","warning"]).optional(),value:Be.max(120)}).strict(),Ime=c.object({label:Be.max(80),value:Be.max(500)}).strict(),vme=c.object({confirmation:Be.max(500).optional(),href:Be.max(500).regex(/^\/api\/plugins\/[a-z][a-z0-9-]*(?:\/|$)/),label:Be.max(80),method:c.literal("DELETE"),tone:c.enum(["danger","neutral"]).optional()}).strict(),_me=c.object({actions:c.array(vme).max(4).optional(),description:Be.max(1e3).optional(),id:Be.max(128),metadata:c.array(Ime).max(8).optional(),title:Be.max(4e3)}).strict(),x5=c.object({emptyText:Be.max(500).optional(),metrics:c.array(Qme).max(6).optional(),nextCursor:Be.max(1e3).optional(),records:c.array(_me).max(100),searchPlaceholder:Be.max(120).optional(),type:c.literal("list")}).strict(),xme=c.object({description:Eme,id:Cme,label:wme,navigation:kme,pluginDisplayName:Be.max(200),pluginName:Be.max(100)}).strict(),D5=c.array(xme),Dme=Be.max(1e3).optional(),Fme=Be.max(64).optional(),Sme=c.string().trim().max(200).optional(),d$e=c.object({cursor:Dme,filter:Fme,limit:c.number().int().min(1).max(50),query:Sme}).strict();var oE=c.object({user:c.object({email:c.string().trim().email(),emailVerified:c.boolean().optional(),name:c.string().nullable().optional()}).strict()}).strict(),g$e=c.object({displayName:c.string().trim().min(1).max(80)}).strict(),F5=c.object({allowedEmailCount:c.number(),allowedGoogleDomainCount:c.number(),authRequired:c.boolean(),authPath:c.string(),basePath:c.string(),componentGallery:c.boolean(),sentryConversationLinks:c.boolean(),timeZone:c.string(),version:c.string().min(1)}).strict();var zf=C(z(),1);var S5="x-junior-version";var l4="junior:dashboard-version";function L5(e){let t=e.headers.get(S5)?.trim();!t||typeof window>"u"||window.dispatchEvent(new CustomEvent(l4,{detail:t}))}function N5(e){let[t,n]=(0,zf.useState)(e);return(0,zf.useEffect)(()=>{e&&n(e)},[e]),(0,zf.useEffect)(()=>{let r=a=>{n(a.detail)};return window.addEventListener(l4,r),()=>window.removeEventListener(l4,r)},[]),t}var ys=class extends Error{status;apiError;constructor(t,n,r){super(`${t} returned ${n}`),this.status=n,r?.trim()&&(this.apiError=r.trim())}};async function td(e,t){let n;try{let r=await t.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new ys(e,t.status,n)}function Mp(){if(typeof window>"u")return;let e=window.__JUNIOR_DASHBOARD_BASE_PATH__??"/",t=e==="/"?"/auth/login":`${e}/auth/login`;if(window.location.pathname!==t){let n=`${window.location.pathname}${window.location.search||""}`,r=new URLSearchParams;n!=="/"&&r.set("next",n);let a=r.toString();window.location.assign(a?`${t}?${a}`:t)}}async function iE(e,t,n){let r=await jp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"PATCH"});return r.status===401&&Mp(),r.ok||await td(t,r),e.parse(await r.json())}async function nd(e,t,n){let r=await jp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"POST"});return r.status===401&&Mp(),r.ok||await td(t,r),e.parse(await r.json())}async function R5(e,t,n){let r=await jp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"PUT"});return r.status===401&&Mp(),r.ok||await td(t,r),e.parse(await r.json())}async function Fc(e){let t=await jp(e,{credentials:"same-origin",method:"DELETE"});t.status===401&&Mp(),t.ok||await td(e,t)}async function $5(e,t,n={}){let r=await jp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"DELETE"});return r.status===401&&Mp(),r.ok||await td(t,r),e.parse(await r.json())}async function jp(e,t){let n=await fetch(e,t);return L5(n),n}async function je(e,t,n){let r=await jp(t,{credentials:"same-origin",...n?{signal:n}:void 0});return r.status===401&&(Mp(),await td(t,r)),r.ok||await td(t,r),e.parse(await r.json())}var AE=5*6e4,p4=5*6e4,Lme=1e3;function Nme(e,t=Date.now()){if(!e)return p4;let n=Date.parse(e);if(!Number.isFinite(n))return p4;let r=Math.max(0,t-n);return Math.max(Lme,p4-r)}function M5(){return Re({queryKey:["dashboard","core"],queryFn:async({signal:e})=>{let[t,n]=await Promise.all([je(oE,"/api/me",e),je(F5,"/api/config",e)]);return{config:n,me:t}},retry:!1,staleTime:AE})}function Rme(){return Re({queryKey:["dashboard","plugins"],queryFn:({signal:e})=>je(O8,"/api/plugins",e),retry:!1,staleTime:AE})}function j5(){return Re({queryKey:["dashboard","plugin-user-pages"],queryFn:({signal:e})=>je(D5,"/api/user-pages",e),retry:!1,staleTime:AE})}function sE(e=""){return Re({queryKey:["dashboard","conversations","viewer",{search:e}],queryFn:({signal:t})=>je(G8,`/api/conversations${e?`?q=${encodeURIComponent(e)}`:""}`,t),placeholderData:qh,retry:!1})}function P5(){return Re({queryKey:["dashboard","code"],queryFn:({signal:e})=>je(qS,"/api/code",e),retry:!1})}function T5(e,t){return Re({enabled:e,queryKey:["dashboard","automations",t],queryFn:({signal:n})=>je(n4,`/api/automations${t?`?q=${encodeURIComponent(t)}`:""}`,n),placeholderData:qh,retry:!1})}function H5(e){return Re({enabled:e,queryKey:["dashboard","automations","runs"],queryFn:({signal:t})=>je(o4,"/api/automations/runs",t),retry:!1})}function G5(e,t,n){return Re({enabled:e&&!!(t&&n),queryKey:["dashboard","automations",t,n,"executions"],queryFn:({signal:r})=>je(r4,`/api/automations/${t}/${encodeURIComponent(n)}/executions`,r),retry:!1})}function U5(){return Re({queryKey:["dashboard","people"],queryFn:({signal:e})=>je(JS,"/api/people",e),retry:!1})}function O5(e){return Re({enabled:!!e,queryKey:["dashboard","people",e],queryFn:async({signal:t})=>je(WS,`/api/people/${encodeURIComponent(e)}`,t),retry:!1})}function q5(e){return Re({enabled:!!e,queryKey:["dashboard","people",e,"plugin-reports"],queryFn:({signal:t})=>je(qw,`/api/people/${encodeURIComponent(e)}/plugin-reports`,t),retry:!1})}function z5(e){return Re({enabled:!!e,queryKey:["dashboard","people",e,"code"],queryFn:({signal:t})=>je(zS,`/api/people/${encodeURIComponent(e)}/code`,t),retry:!1})}function K5(e){return Re({enabled:e,queryKey:["dashboard","personal-spend"],queryFn:({signal:t})=>je(ZS,"/api/people/me/spend",t),refetchInterval:t=>Nme(t.state.data?.generatedAt),retry:!1,staleTime:0})}function Y5(){return Re({queryKey:["dashboard","locations"],queryFn:({signal:e})=>je(KS,"/api/locations",e),retry:!1})}function J5(e){return Re({enabled:!!e,queryKey:["dashboard","locations",e],queryFn:async({signal:t})=>je(YS,`/api/locations/${encodeURIComponent(e)}`,t),retry:!1})}function $me(){return Re({queryKey:["dashboard","skills"],queryFn:({signal:e})=>je(z8,"/api/skills",e),retry:!1,staleTime:AE})}function Mme(){return Re({queryKey:["dashboard","plugin-reports"],queryFn:({signal:e})=>je(qw,"/api/plugin-reports",e),retry:!1})}function W5(){return Re({queryKey:["dashboard","stats"],queryFn:({signal:e})=>je(A4,"/api/stats",e),retry:!1})}function Z5(e){let t=Rme(),n=Re({queryKey:["dashboard","conversation-stats"],queryFn:({signal:i})=>je(U8,"/api/conversations/stats",i),retry:!1}),r=$me(),a=Mme();return{data:t.data&&r.data?{...e,conversationStatsError:!!n.error,...n.data?{conversationStats:n.data}:void 0,conversationStatsLoading:n.isPending,pluginReportsError:!!a.error,...a.data?{pluginReports:a.data}:void 0,pluginReportsLoading:a.isPending,plugins:t.data,skills:r.data}:void 0,error:t.error??r.error,isPending:t.isPending||r.isPending}}var V5=C(z(),1);function cE(){return(0,V5.useSyncExternalStore)(e=>aA.subscribe(e),()=>aA.isOnline(),()=>!0)}var eU=C(w(),1);function X5(){return cE()?null:(0,eU.jsx)("div",{"aria-live":"polite",className:"border-t border-amber-300/15 bg-amber-300/[0.07] px-3 py-1.5 text-center font-sans text-xs text-amber-100/80",role:"status",children:"You\u2019re offline. Drafts stay on this device."})}var g4=C(w(),1);function uE(){return(0,g4.jsx)("div",{className:"relative grid size-10 shrink-0 select-none place-items-center overflow-visible",children:(0,g4.jsx)("img",{alt:"",className:"relative size-11 max-w-none -translate-y-0.5 object-contain opacity-90 drop-shadow-[0_0_7px_rgba(255,255,255,0.16)]",draggable:!1,src:"/_junior/dashboard/avatar.png"})})}var tU=["relative","overflow-hidden","bg-white/15","before:absolute","before:inset-0","before:content-['']","before:bg-[linear-gradient(90deg,#ff4d6d,#ffb703,#56f39a,#4cc9f0,#9b5de5,#ff4d6d)]","before:bg-[length:200%_100%]","before:animate-[junior-rainbow-flow_1.2s_linear_infinite]","motion-reduce:before:animate-none"].join(" ");function k(...e){return e.filter(Boolean).join(" ")}var Bn="mx-auto w-full min-w-0 max-w-screen-xl",bA="text-dashboard-text-muted hover:text-dashboard-text",nU="rounded-2xl bg-dashboard-fill-soft shadow-[inset_0_0_0_1px_var(--color-dashboard-border-subtle)]",aU="dashboard-shell-bg";var Sc=C(w(),1);function On(e){return(0,Sc.jsx)("div",{className:k(Bn,"grid min-h-[calc(100dvh-5rem)] place-items-center px-4 py-8 md:px-8"),children:(0,Sc.jsxs)("section",{className:"grid w-full max-w-lg grid-cols-[auto_minmax(0,1fr)] items-center gap-3 rounded-lg border border-dashboard-border-emphasis bg-dashboard-surface-raised p-4",children:[(0,Sc.jsx)(uE,{}),(0,Sc.jsxs)("div",{children:[(0,Sc.jsx)("div",{className:"font-bold",children:e.label}),(0,Sc.jsx)("div",{"aria-label":e.label,className:`${tU} mt-3 h-1.5 w-full`,role:"progressbar"})]})]})})}var m4="0.209.0",dE=typeof m4=="string"&&m4.trim()?m4:"unknown";var Kf=C(w(),1);function rU(e){return jme(e.serverVersion)?(0,Kf.jsxs)("div",{"aria-live":"polite",className:"flex flex-wrap items-center justify-center gap-x-3 gap-y-1 border-t border-cyan-300/15 bg-cyan-300/[0.07] px-3 py-1.5 text-center font-sans text-xs text-cyan-100/80",role:"status",children:[(0,Kf.jsx)("span",{children:"The dashboard changed. Refresh to load the latest version."}),(0,Kf.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0 font-mono font-semibold text-cyan-100 underline decoration-cyan-300/40 underline-offset-2 hover:text-dashboard-text-solid",onClick:()=>window.location.reload(),type:"button",children:"Refresh"})]}):null}function jme(e){return!!e&&dE!=="unknown"&&e!=="unknown"&&e!==dE}var oU=C(w(),1);function T(e){let t=e.as??"div",n={none:"",sm:"p-4",md:"p-5 sm:p-6"}[e.padding??"none"],r=e.variant==="section"?"mb-4 border-dashboard-border-subtle bg-dashboard-fill-faint shadow-[0_24px_80px_rgba(0,0,0,0.18)]":e.variant==="raised"?"border-dashboard-border-emphasis bg-dashboard-surface-raised":"border-dashboard-border-subtle bg-dashboard-fill-faint";return(0,oU.jsx)(t,{className:k("min-w-0 overflow-hidden rounded-lg border",r,n,e.className),children:e.children})}var iU=C(w(),1);function De(e){let t=e.as??"div";return(0,iU.jsx)(t,{"aria-hidden":"true",className:k("animate-pulse rounded bg-dashboard-fill-soft motion-reduce:animate-none",e.className)})}var Fe=C(w(),1);function Na(e){let t=e.variant??"panel";return(0,Fe.jsxs)("div",{"aria-busy":"true","aria-live":"polite",className:k("grid gap-4",e.className),role:"status",children:[(0,Fe.jsx)("span",{className:"sr-only",children:e.label}),Pme(t)]})}function Pme(e){switch(e){case"stats":return(0,Fe.jsx)(Tme,{});case"overview":return(0,Fe.jsx)(Hme,{});case"list":return(0,Fe.jsx)(Gme,{});case"library":return(0,Fe.jsx)(Ume,{});case"panel":return(0,Fe.jsx)(hA,{className:"min-h-64"})}}function Tme(){return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:Array.from({length:4},(e,t)=>(0,Fe.jsx)(hA,{className:"min-h-[7.5rem] p-4 sm:min-h-32 sm:p-5"},t))}),(0,Fe.jsx)(hA,{className:"min-h-[17rem]"})]})}function Hme(){return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)("div",{className:"grid gap-4 xl:grid-cols-2",children:[(0,Fe.jsx)(hA,{className:"min-h-[17rem]"}),(0,Fe.jsx)(hA,{className:"min-h-[17rem]"})]}),(0,Fe.jsx)(Pp,{className:"h-24 border-y border-dashboard-border-subtle bg-dashboard-fill-faint"}),(0,Fe.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,Fe.jsx)(hA,{className:"min-h-56"}),(0,Fe.jsx)(hA,{className:"min-h-56"})]})]})}function Gme(){return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(hA,{className:"min-h-20 p-4"}),(0,Fe.jsx)(Pp,{className:"h-10 border-b border-dashboard-border-subtle"}),(0,Fe.jsx)(hA,{className:"min-h-80"})]})}function Ume(){return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[(0,Fe.jsx)(Pp,{className:"h-7 w-56 rounded bg-dashboard-fill-soft"}),(0,Fe.jsx)(Pp,{className:"h-10 w-full max-w-md rounded-lg border border-dashboard-border-subtle bg-dashboard-fill-faint sm:w-72"})]}),(0,Fe.jsx)("div",{"aria-hidden":"true",className:"grid min-w-0 grid-cols-3 gap-1 border-b border-dashboard-border-subtle sm:flex",children:Array.from({length:3},(e,t)=>(0,Fe.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 sm:justify-start",children:[(0,Fe.jsx)(Pp,{className:"h-3 w-12 rounded bg-dashboard-fill-soft"}),(0,Fe.jsx)(Pp,{className:"h-5 w-8 rounded-sm border border-dashboard-border-subtle bg-dashboard-fill-faint"})]},t))}),(0,Fe.jsx)(hA,{className:"min-h-80"})]})}function hA(e){return(0,Fe.jsx)(T,{className:k("animate-pulse motion-reduce:animate-none",e.className),children:(0,Fe.jsx)("span",{"aria-hidden":"true"})})}function Pp(e){return(0,Fe.jsx)(De,{className:e.className})}var lE=C(w(),1),AU="inline-flex h-9 max-w-full items-center gap-2 rounded border border-dashboard-border-emphasis bg-dashboard-surface-raised px-3 font-mono text-sm font-semibold leading-none text-dashboard-text transition-colors hover:border-dashboard-border-heavy hover:bg-dashboard-surface-hover hover:text-dashboard-text",Ome="inline-flex h-9 max-w-full items-center justify-center gap-1.5 rounded border border-dashboard-border-strong bg-transparent px-3 font-mono text-xs font-semibold text-dashboard-text-muted transition-colors hover:border-rose-300/40 hover:text-rose-300";function Ze({className:e,size:t="default",tone:n="default",type:r="button",...a}){let o=n==="danger";return(0,lE.jsx)("button",{...a,className:k("font-mono transition-colors disabled:cursor-not-allowed disabled:opacity-50",t==="icon"?k("grid size-9 place-items-center rounded-md border-0 bg-transparent p-0 focus-visible:outline focus-visible:outline-1 disabled:hover:!bg-transparent",o?"text-dashboard-text-muted hover:!bg-rose-300/10 hover:!text-rose-300 focus-visible:outline-rose-300/55 disabled:hover:!text-dashboard-text-muted":"text-dashboard-text-muted hover:!bg-dashboard-fill-strong hover:!text-dashboard-text focus-visible:outline-cyan-300/55 disabled:hover:!text-dashboard-text-muted"):o?k(Ome,"disabled:hover:border-dashboard-border-strong disabled:hover:text-dashboard-text-muted"):k(AU,"disabled:hover:border-dashboard-border-emphasis disabled:hover:bg-dashboard-surface-raised disabled:hover:text-dashboard-text"),a.disabled?"":"cursor-pointer",e),type:r})}function sU({className:e,...t}){return(0,lE.jsx)(pe,{...t,className:k(AU,"no-underline",e)})}function na({className:e,pressed:t,type:n="button",variant:r,...a}){return(0,lE.jsx)("button",{...a,"aria-pressed":t,className:k(qme[r],t?zme[r]:Kme[r],e),type:n})}var qme={pill:"cursor-pointer rounded border px-2 py-1 font-mono text-xs font-semibold uppercase leading-tight transition-colors focus-visible:outline focus-visible:outline-1 focus-visible:outline-cyan-300/55",segment:"h-7 min-w-10 cursor-pointer rounded border px-2 font-mono text-xs transition-colors focus-visible:outline focus-visible:outline-1 focus-visible:outline-cyan-300/55",text:"cursor-pointer border-0 bg-transparent px-1.5 py-1 font-mono uppercase tracking-normal underline-offset-4 transition-colors focus-visible:outline focus-visible:outline-1 focus-visible:outline-cyan-300/55"},zme={pill:"border-dashboard-border-heavy bg-dashboard-text-solid text-dashboard-text-inverse",segment:"border-amber-500/30 bg-amber-500/20 text-amber-400",text:"text-dashboard-text underline decoration-dashboard-text-solid"},Kme={pill:"border-dashboard-border-strong bg-dashboard-surface-raised text-dashboard-text-muted hover:border-dashboard-border-interactive hover:bg-dashboard-surface-hover hover:text-dashboard-text",segment:"border-dashboard-border-strong bg-dashboard-fill-faint text-dashboard-text-muted hover:bg-dashboard-fill-strong hover:text-dashboard-text",text:"text-dashboard-text-muted hover:text-dashboard-text"};var f4=C(w(),1),Yme=[1,7,30,90];function b4(e){return e===1?"24h":`${e}d`}function Tp(e){return e===1?"last 24 hours":`last ${e} days`}function yn(e){return e===1?"hour":e===7?"6hour":"day"}function cU(e){return e===1}function Jme(e){return e===7}function Xa(e){return e==="hour"?"hour":e==="6hour"?"6h":"day"}function pE(e){return e==="hour"?"hour":e==="6hour"?"6 hours":"day"}function Yf(e){return e==="hour"?"Hourly":e==="6hour"?"6-hour":"Daily"}function xn(e){return cU(e.range)&&e.hours?.length?e.hours.slice(-24):cU(e.range)?e.days.slice(-1):Jme(e.range)?e.sixHours?.length?[...e.sixHours]:e.hours?.length&&e.emptySixHour?Wme({empty:e.emptySixHour,hours:e.hours}):e.days.slice(-e.range):e.days.slice(-e.range)}function Wme(e){let t=new Map;for(let n of e.hours){let r=Date.parse(`${n.date}:00:00.000Z`);if(Number.isNaN(r))continue;let a=new Date(r);a.setUTCMinutes(0,0,0),a.setUTCHours(Math.floor(a.getUTCHours()/6)*6,0,0,0);let o=a.toISOString().slice(0,13),A={...t.get(o)??e.empty(o),date:o};for(let[s,u]of Object.entries(n))if(s!=="date"&&typeof u=="number"){let d=A[s];A[s]=(typeof d=="number"?d:0)+u}t.set(o,A)}if(e.hours.length>=24){let n=e.hours[e.hours.length-1]?.date,r=n?Date.parse(`${n}:00:00.000Z`):Date.now(),a=new Date(r);a.setUTCMinutes(0,0,0),a.setUTCHours(Math.floor(a.getUTCHours()/6)*6,0,0,0);let o=new Date(a.getTime()-9720*60*1e3),i=[];for(let A=new Date(o);A.getTime()<=a.getTime();A.setTime(A.getTime()+360*60*1e3)){let s=A.toISOString().slice(0,13);i.push(t.get(s)??e.empty(s))}return i}return[...t.values()].sort((n,r)=>n.date.localeCompare(r.date))}function gE(e){return(0,f4.jsx)("div",{"aria-label":"Reporting period",className:"flex items-center gap-1",role:"group",children:(e.options??Yme).map(t=>(0,f4.jsx)(na,{onClick:()=>e.onChange(t),pressed:e.value===t,variant:"segment",children:b4(t)},t))})}var Lc=C(w(),1);function He(e){let t=e.range!==void 0&&e.onRangeChange?(0,Lc.jsx)(gE,{onChange:e.onRangeChange,...e.rangeOptions?{options:e.rangeOptions}:{},value:e.range}):void 0,n=e.actions??t;return(0,Lc.jsxs)("header",{className:"flex min-w-0 items-center justify-between gap-6 border-b border-white/[0.05] pb-4 sm:pb-6 max-md:flex-col max-md:items-stretch",children:[(0,Lc.jsxs)("div",{className:"min-w-0",children:[(0,Lc.jsx)("h2",{className:"m-0 font-display text-3xl font-light leading-none tracking-[-0.03em] text-dashboard-text sm:text-4xl",children:e.title}),(0,Lc.jsx)("div",{className:"mt-2 max-w-2xl font-mono text-xs leading-relaxed text-dashboard-text-muted sm:text-sm",children:e.description})]}),n?(0,Lc.jsx)("div",{className:"shrink-0",children:n}):null]})}var uU=C(w(),1);function Go(e){return(0,uU.jsx)("div",{className:k(Bn,"grid min-w-0 content-start gap-4 px-4 py-4 pb-[max(1rem,env(safe-area-inset-bottom))] sm:gap-6 sm:px-8 sm:py-8 sm:pb-8",e.className),children:e.children})}var Jf=C(w(),1);function ad(e){return(0,Jf.jsxs)(Go,{children:[(0,Jf.jsx)(He,{description:e.description,title:e.title}),(0,Jf.jsx)(Na,{label:e.label,variant:e.variant})]})}var bE=C(z(),1);var mE=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var dU=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var lU=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());var h4=e=>{let t=lU(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Wf=C(z(),1);var fE={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"};var pU=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var Hp=C(z(),1);var Zme=(0,Hp.createContext)({});var gU=()=>(0,Hp.useContext)(Zme);var mU=(0,Wf.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:a="",children:o,iconNode:i,...A},s)=>{let{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:l=!1,color:p="currentColor",className:g=""}=gU()??{},m=r??l?Number(n??d)*24/Number(t??u):n??d;return(0,Wf.createElement)("svg",{ref:s,...fE,width:t??u??fE.width,height:t??u??fE.height,stroke:e??p,strokeWidth:m,className:mE("lucide",g,a),...!o&&!pU(A)&&{"aria-hidden":"true"},...A},[...i.map(([b,B])=>(0,Wf.createElement)(b,B)),...Array.isArray(o)?o:[o]])});var F=(e,t)=>{let n=(0,bE.forwardRef)(({className:r,...a},o)=>(0,bE.createElement)(mU,{ref:o,iconNode:t,className:mE(`lucide-${dU(h4(e))}`,`lucide-${e}`,r),...a}));return n.displayName=h4(e),n};var Vme=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Ei=F("activity",Vme);var Xme=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],Uo=F("archive-restore",Xme);var efe=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Cs=F("archive",efe);var tfe=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],Zf=F("arrow-down-to-line",tfe);var nfe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],BA=F("arrow-left",nfe);var afe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Vf=F("arrow-right",afe);var rfe=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],Xf=F("bookmark",rfe);var ofe=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],yA=F("bot",ofe);var ife=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],bo=F("boxes",ife);var Afe=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],CA=F("braces",Afe);var sfe=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],Nc=F("brain-circuit",sfe);var cfe=[["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"}]],ws=F("brain",cfe);var ufe=[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],Es=F("calendar-clock",ufe);var dfe=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],eb=F("calendar",dfe);var lfe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],rd=F("check",lfe);var pfe=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],tb=F("chevron-down",pfe);var gfe=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],nb=F("chevron-left",gfe);var mfe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],aa=F("chevron-right",mfe);var ffe=[["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"}]],Ra=F("circle-alert",ffe);var bfe=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],ab=F("circle-dashed",bfe);var hfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]],od=F("circle-dollar-sign",hfe);var Bfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],rb=F("circle-dot",Bfe);var yfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Rc=F("circle-x",yfe);var Cfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],ki=F("clock-3",Cfe);var wfe=[["path",{d:"M13.744 17.736a6 6 0 1 1-7.48-7.48",key:"bq4yh3"}],["path",{d:"M15 6h1v4",key:"11y1tn"}],["path",{d:"m6.134 14.768.866-.5 2 3.464",key:"17snzx"}],["circle",{cx:"16",cy:"8",r:"6",key:"14bfc9"}]],Qi=F("coins",wfe);var Efe=[["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"}]],id=F("copy",Efe);var kfe=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],$c=F("database",kfe);var Qfe=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],fr=F("earth",Qfe);var Ife=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Mc=F("ellipsis",Ife);var vfe=[["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"}]],Ad=F("external-link",vfe);var _fe=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ob=F("file-text",_fe);var xfe=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],jc=F("fingerprint-pattern",xfe);var Dfe=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],ib=F("folder-git-2",Dfe);var Ffe=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Ab=F("gauge",Ffe);var Sfe=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],sb=F("git-merge",Sfe);var Lfe=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]],ks=F("git-pull-request",Lfe);var Nfe=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],cb=F("hash",Nfe);var Rfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Pc=F("info",Rfe);var $fe=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Ii=F("key-round",$fe);var Mfe=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Tc=F("layers",Mfe);var jfe=[["rect",{width:"8",height:"18",x:"3",y:"3",rx:"1",key:"oynpb5"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z",key:"1qboyk"}]],sd=F("library-big",jfe);var Pfe=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],ub=F("lightbulb",Pfe);var Tfe=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],db=F("list-checks",Tfe);var Hfe=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],lb=F("link",Hfe);var Gfe=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Qs=F("loader-circle",Gfe);var Ufe=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],$a=F("lock-keyhole",Ufe);var Ofe=[["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"}]],pb=F("lock",Ofe);var qfe=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],gb=F("log-out",qfe);var zfe=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],cd=F("map-pin",zfe);var Kfe=[["path",{d:"M18 8c0 3.613-3.869 7.429-5.393 8.795a1 1 0 0 1-1.214 0C9.87 15.429 6 11.613 6 8a6 6 0 0 1 12 0",key:"11u0oz"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["path",{d:"M8.714 14h-3.71a1 1 0 0 0-.948.683l-2.004 6A1 1 0 0 0 3 22h18a1 1 0 0 0 .948-1.316l-2-6a1 1 0 0 0-.949-.684h-3.712",key:"q8zwxj"}]],mb=F("map-pinned",Kfe);var Yfe=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],ud=F("menu",Yfe);var Jfe=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],fb=F("message-square-text",Jfe);var Wfe=[["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"}]],ho=F("message-square",Wfe);var Zfe=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],Gp=F("messages-square",Zfe);var Vfe=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],bb=F("minimize-2",Vfe);var Xfe=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],hb=F("paperclip",Xfe);var ebe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],dd=F("plus",ebe);var tbe=[["path",{d:"M4.9 16.1C1 12.2 1 5.8 4.9 1.9",key:"s0qx1y"}],["path",{d:"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5",key:"1idnkw"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}],["path",{d:"M16.2 4.8c2 2 2.26 5.11.8 7.47",key:"ojru2q"}],["path",{d:"M19.1 1.9a9.96 9.96 0 0 1 0 14.1",key:"rhi7fg"}],["path",{d:"M9.5 18h5",key:"mfy3pd"}],["path",{d:"m8 22 4-11 4 11",key:"25yftu"}]],Bb=F("radio-tower",tbe);var nbe=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],Up=F("scroll-text",nbe);var abe=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Hc=F("search",abe);var rbe=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],ld=F("send",rbe);var obe=[["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"}]],yb=F("settings",obe);var ibe=[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]],Cb=F("sigma",ibe);var Abe=[["path",{d:"M21 4v16",key:"7j8fe9"}],["path",{d:"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z",key:"zs4d6"}]],wb=F("skip-forward",Abe);var sbe=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],er=F("sparkles",sbe);var cbe=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],qr=F("square-pen",cbe);var ube=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],vi=F("timer",ube);var dbe=[["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"}]],Ba=F("trash-2",dbe);var lbe=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Eb=F("trending-up",lbe);var pbe=[["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"}]],zr=F("triangle-alert",pbe);var gbe=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],br=F("user-round",gbe);var mbe=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],pd=F("users",mbe);var fbe=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],kb=F("webhook",fbe);var bbe=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],tr=F("x",bbe);var hbe=[["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"}]],Qb=F("zap",hbe);var MA=C(z(),1);var B4=Object.defineProperty,Bbe=Object.getOwnPropertyDescriptor,ybe=Object.getOwnPropertyNames,Cbe=Object.prototype.hasOwnProperty,bU=(e,t)=>{let n={};for(var r in e)B4(n,r,{get:e[r],enumerable:!0});return t||B4(n,Symbol.toStringTag,{value:"Module"}),n},fU=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=ybe(t),o=0,i=a.length,A;o<i;o++)A=a[o],!Cbe.call(e,A)&&A!==n&&B4(e,A,{get:(s=>t[s]).bind(null,A),enumerable:!(r=Bbe(t,A))||r.enumerable});return e},hU=(e,t,n)=>(fU(e,t,"default"),n&&fU(n,t,"default"));var E4={};L(E4,{createOnigurumaEngine:()=>jbe,getDefaultWasmLoader:()=>Mbe,loadWasm:()=>yU,setDefaultWasmLoader:()=>$be});var w4=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function wbe(){return 2147483648}function Ebe(){return typeof performance<"u"?performance.now():Date.now()}var kbe=(e,t)=>e+(t-e%t)%t;async function Qbe(e){let t,n,r={};function a(g){n=g,r.HEAPU8=new Uint8Array(g),r.HEAPU32=new Uint32Array(g)}function o(g,m,b){r.HEAPU8.copyWithin(g,m,m+b)}function i(g){try{return t.grow(g-n.byteLength+65535>>>16),a(t.buffer),1}catch{}}function A(g){let m=r.HEAPU8.length;g=g>>>0;let b=wbe();if(g>b)return!1;for(let B=1;B<=4;B*=2){let h=m*(1+.2/B);h=Math.min(h,g+100663296);let f=Math.min(b,kbe(Math.max(g,h),65536));if(i(f))return!0}return!1}let s=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(g,m,b=1024){let B=m+b,h=m;for(;g[h]&&!(h>=B);)++h;if(h-m>16&&g.buffer&&s)return s.decode(g.subarray(m,h));let f="";for(;m<h;){let y=g[m++];if(!(y&128)){f+=String.fromCharCode(y);continue}let E=g[m++]&63;if((y&224)===192){f+=String.fromCharCode((y&31)<<6|E);continue}let I=g[m++]&63;if((y&240)===224?y=(y&15)<<12|E<<6|I:y=(y&7)<<18|E<<12|I<<6|g[m++]&63,y<65536)f+=String.fromCharCode(y);else{let Q=y-65536;f+=String.fromCharCode(55296|Q>>10,56320|Q&1023)}}return f}function d(g,m){return g?u(r.HEAPU8,g,m):""}let l={emscripten_get_now:Ebe,emscripten_memcpy_big:o,emscripten_resize_heap:A,fd_write:()=>0};async function p(){let m=await e({env:l,wasi_snapshot_preview1:l});t=m.memory,a(t.buffer),Object.assign(r,m),r.UTF8ToString=d}return await p(),r}var Ibe=Object.defineProperty,vbe=(e,t,n)=>t in e?Ibe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ra=(e,t,n)=>vbe(e,typeof t!="symbol"?t+"":t,n),ya=null;function _be(e){throw new w4(e.UTF8ToString(e.getLastOnigError()))}var BE=class e{constructor(t){ra(this,"utf16Length"),ra(this,"utf8Length"),ra(this,"utf16Value"),ra(this,"utf8Value"),ra(this,"utf16OffsetToUtf8"),ra(this,"utf8OffsetToUtf16");let n=t.length,r=e._utf8ByteLength(t),a=r!==n,o=a?new Uint32Array(n+1):null;a&&(o[n]=r);let i=a?new Uint32Array(r+1):null;a&&(i[r]=n);let A=new Uint8Array(r),s=0;for(let u=0;u<n;u++){let d=t.charCodeAt(u),l=d,p=!1;if(d>=55296&&d<=56319&&u+1<n){let g=t.charCodeAt(u+1);g>=56320&&g<=57343&&(l=(d-55296<<10)+65536|g-56320,p=!0)}a&&(o[u]=s,p&&(o[u+1]=s),l<=127?i[s+0]=u:l<=2047?(i[s+0]=u,i[s+1]=u):l<=65535?(i[s+0]=u,i[s+1]=u,i[s+2]=u):(i[s+0]=u,i[s+1]=u,i[s+2]=u,i[s+3]=u)),l<=127?A[s++]=l:l<=2047?(A[s++]=192|(l&1984)>>>6,A[s++]=128|(l&63)>>>0):l<=65535?(A[s++]=224|(l&61440)>>>12,A[s++]=128|(l&4032)>>>6,A[s++]=128|(l&63)>>>0):(A[s++]=240|(l&1835008)>>>18,A[s++]=128|(l&258048)>>>12,A[s++]=128|(l&4032)>>>6,A[s++]=128|(l&63)>>>0),p&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=A,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=i}static _utf8ByteLength(t){let n=0;for(let r=0,a=t.length;r<a;r++){let o=t.charCodeAt(r),i=o,A=!1;if(o>=55296&&o<=56319&&r+1<a){let s=t.charCodeAt(r+1);s>=56320&&s<=57343&&(i=(o-55296<<10)+65536|s-56320,A=!0)}i<=127?n+=1:i<=2047?n+=2:i<=65535?n+=3:n+=4,A&&r++}return n}createString(t){let n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}},yE=class wA{constructor(t){if(ra(this,"id",++wA.LAST_ID),ra(this,"_onigBinding"),ra(this,"content"),ra(this,"utf16Length"),ra(this,"utf8Length"),ra(this,"utf16OffsetToUtf8"),ra(this,"utf8OffsetToUtf16"),ra(this,"ptr"),!ya)throw new w4("Must invoke loadWasm first.");this._onigBinding=ya,this.content=t;let n=new BE(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!wA._sharedPtrInUse?(wA._sharedPtr||(wA._sharedPtr=ya.omalloc(1e4)),wA._sharedPtrInUse=!0,ya.HEAPU8.set(n.utf8Value,wA._sharedPtr),this.ptr=wA._sharedPtr):this.ptr=n.createString(ya)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===wA._sharedPtr?wA._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};ra(yE,"LAST_ID",0);ra(yE,"_sharedPtr",0);ra(yE,"_sharedPtrInUse",!1);var BU=yE,C4=class{constructor(t){if(ra(this,"_onigBinding"),ra(this,"_ptr"),!ya)throw new w4("Must invoke loadWasm first.");let n=[],r=[];for(let A=0,s=t.length;A<s;A++){let u=new BE(t[A]);n[A]=u.createString(ya),r[A]=u.utf8Length}let a=ya.omalloc(4*t.length);ya.HEAPU32.set(n,a/4);let o=ya.omalloc(4*t.length);ya.HEAPU32.set(r,o/4);let i=ya.createOnigScanner(a,o,t.length);for(let A=0,s=t.length;A<s;A++)ya.ofree(n[A]);ya.ofree(o),ya.ofree(a),i===0&&_be(ya),this._onigBinding=ya,this._ptr=i}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,r){let a=0;if(typeof r=="number"&&(a=r),typeof t=="string"){t=new BU(t);let o=this._findNextMatchSync(t,n,!1,a);return t.dispose(),o}return this._findNextMatchSync(t,n,!1,a)}_findNextMatchSync(t,n,r,a){let o=this._onigBinding,i=o.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),a);if(i===0)return null;let A=o.HEAPU32,s=i/4,u=A[s++],d=A[s++],l=[];for(let p=0;p<d;p++){let g=t.convertUtf8OffsetToUtf16(A[s++]),m=t.convertUtf8OffsetToUtf16(A[s++]);l[p]={start:g,end:m,length:m-g}}return{index:u,captureIndices:l}}};function xbe(e){return typeof e.instantiator=="function"}function Dbe(e){return typeof e.default=="function"}function Fbe(e){return typeof e.data<"u"}function Sbe(e){return typeof Response<"u"&&e instanceof Response}function Lbe(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}var hE;function yU(e){if(hE)return hE;async function t(){ya=await Qbe(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),xbe(r)?r=await r.instantiator(n):Dbe(r)?r=await r.default(n):(Fbe(r)&&(r=r.data),Sbe(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await Nbe(r)(n):r=await Rbe(r)(n):Lbe(r)?r=await y4(r)(n):r instanceof WebAssembly.Module?r=await y4(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await y4(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return hE=t(),hE}function y4(e){return t=>WebAssembly.instantiate(e,t)}function Nbe(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Rbe(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var CU;function $be(e){CU=e}function Mbe(){return CU}async function jbe(e){return e&&await yU(e),{createScanner(t){return new C4(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new BU(t)}}}var k4=bU({});hU(k4,E4);var Oq=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>Promise.resolve().then(()=>(EU(),wU)))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>Promise.resolve().then(()=>(QU(),kU)))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(vU(),IU)))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>Promise.resolve().then(()=>(xU(),_U)))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>Promise.resolve().then(()=>(FU(),DU)))},{id:"catppuccin-frappe",displayName:"Catppuccin Frapp\xE9",type:"dark",import:(()=>Promise.resolve().then(()=>(LU(),SU)))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>Promise.resolve().then(()=>(RU(),NU)))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>Promise.resolve().then(()=>(MU(),$U)))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>Promise.resolve().then(()=>(PU(),jU)))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>Promise.resolve().then(()=>(HU(),TU)))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>Promise.resolve().then(()=>(UU(),GU)))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>Promise.resolve().then(()=>(qU(),OU)))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(KU(),zU)))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>Promise.resolve().then(()=>(JU(),YU)))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(ZU(),WU)))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>Promise.resolve().then(()=>(XU(),VU)))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>Promise.resolve().then(()=>(tO(),eO)))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>Promise.resolve().then(()=>(aO(),nO)))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>Promise.resolve().then(()=>(oO(),rO)))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>Promise.resolve().then(()=>(AO(),iO)))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>Promise.resolve().then(()=>(cO(),sO)))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>Promise.resolve().then(()=>(dO(),uO)))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>Promise.resolve().then(()=>(pO(),lO)))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>Promise.resolve().then(()=>(mO(),gO)))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>Promise.resolve().then(()=>(bO(),fO)))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>Promise.resolve().then(()=>(BO(),hO)))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>Promise.resolve().then(()=>(CO(),yO)))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>Promise.resolve().then(()=>(EO(),wO)))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>Promise.resolve().then(()=>(QO(),kO)))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>Promise.resolve().then(()=>(vO(),IO)))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>Promise.resolve().then(()=>(xO(),_O)))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>Promise.resolve().then(()=>(FO(),DO)))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>Promise.resolve().then(()=>(LO(),SO)))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>Promise.resolve().then(()=>(RO(),NO)))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>Promise.resolve().then(()=>(MO(),$O)))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>Promise.resolve().then(()=>(PO(),jO)))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>Promise.resolve().then(()=>(HO(),TO)))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>Promise.resolve().then(()=>(UO(),GO)))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>Promise.resolve().then(()=>(qO(),OO)))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>Promise.resolve().then(()=>(KO(),zO)))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(JO(),YO)))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>Promise.resolve().then(()=>(ZO(),WO)))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>Promise.resolve().then(()=>(XO(),VO)))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>Promise.resolve().then(()=>(tq(),eq)))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>Promise.resolve().then(()=>(aq(),nq)))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>Promise.resolve().then(()=>(oq(),rq)))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>Promise.resolve().then(()=>(Aq(),iq)))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>Promise.resolve().then(()=>(cq(),sq)))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>Promise.resolve().then(()=>(dq(),uq)))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>Promise.resolve().then(()=>(pq(),lq)))},{id:"red",displayName:"Red",type:"dark",import:(()=>Promise.resolve().then(()=>(mq(),gq)))},{id:"rose-pine",displayName:"Ros\xE9 Pine",type:"dark",import:(()=>Promise.resolve().then(()=>(bq(),fq)))},{id:"rose-pine-dawn",displayName:"Ros\xE9 Pine Dawn",type:"light",import:(()=>Promise.resolve().then(()=>(Bq(),hq)))},{id:"rose-pine-moon",displayName:"Ros\xE9 Pine Moon",type:"dark",import:(()=>Promise.resolve().then(()=>(Cq(),yq)))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(Eq(),wq)))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>Promise.resolve().then(()=>(Qq(),kq)))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>Promise.resolve().then(()=>(vq(),Iq)))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(xq(),_q)))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>Promise.resolve().then(()=>(Fq(),Dq)))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>Promise.resolve().then(()=>(Lq(),Sq)))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>Promise.resolve().then(()=>(Rq(),Nq)))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>Promise.resolve().then(()=>(Mq(),$q)))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>Promise.resolve().then(()=>(Pq(),jq)))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(Hq(),Tq)))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>Promise.resolve().then(()=>(Uq(),Gq)))}],qq=Object.fromEntries(Oq.map(e=>[e.id,e.import]));var wt=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Whe(e){return N4(e)}function N4(e){return Array.isArray(e)?Zhe(e):e instanceof RegExp?e:typeof e=="object"?Vhe(e):e}function Zhe(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=N4(e[n]);return t}function Vhe(e){let t={};for(let n in e)t[n]=N4(e[n]);return t}function ez(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function tz(e){let t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?tz(e.substring(0,e.length-1)):e.substr(~t+1)}var Q4=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,CE=class{static hasCaptures(e){return e===null?!1:(Q4.lastIndex=0,Q4.test(e))}static replaceCaptures(e,t,n){return e.replace(Q4,(r,a,o,i)=>{let A=n[parseInt(a||o,10)];if(A){let s=t.substring(A.start,A.end);for(;s[0]===".";)s=s.substring(1);switch(i){case"downcase":return s.toLowerCase();case"upcase":return s.toUpperCase();default:return s}}else return r})}};function nz(e,t){return e<t?-1:e>t?1:0}function az(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let a=0;a<n;a++){let o=nz(e[a],t[a]);if(o!==0)return o}return 0}return n-r}function zq(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function rz(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var oz=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},_b=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(tBe(e),t)}static createFromParsedTheme(e,t){return aBe(e,t)}_cachedMatchRoot=new oz(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,r=this._cachedMatchRoot.get(t).find(a=>Xhe(e.parent,a.parentScopes));return r?new iz(r.fontStyle,r.foreground,r.background):null}},I4=class wE{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(let r of n)t=new wE(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new wE(n,t[r]);return n}push(t){return new wE(this,t)}getSegments(){let t=this,n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){let n=[],r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function Xhe(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],a=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],a=!0}for(;e&&!eBe(e.scopeName,r);){if(a)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function eBe(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var iz=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function tBe(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let a=0,o=t.length;a<o;a++){let i=t[a];if(!i.settings)continue;let A;if(typeof i.scope=="string"){let l=i.scope;l=l.replace(/^[,]+/,""),l=l.replace(/[,]+$/,""),A=l.split(",")}else Array.isArray(i.scope)?A=i.scope:A=[""];let s=-1;if(typeof i.settings.fontStyle=="string"){s=0;let l=i.settings.fontStyle.split(" ");for(let p=0,g=l.length;p<g;p++)switch(l[p]){case"italic":s=s|1;break;case"bold":s=s|2;break;case"underline":s=s|4;break;case"strikethrough":s=s|8;break}}let u=null;typeof i.settings.foreground=="string"&&zq(i.settings.foreground)&&(u=i.settings.foreground);let d=null;typeof i.settings.background=="string"&&zq(i.settings.background)&&(d=i.settings.background);for(let l=0,p=A.length;l<p;l++){let m=A[l].trim().split(" "),b=m[m.length-1],B=null;m.length>1&&(B=m.slice(0,m.length-1),B.reverse()),n[r++]=new nBe(b,B,a,s,u,d)}}return n}var nBe=class{constructor(e,t,n,r,a,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=a,this.background=o}},Ma=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Ma||{});function aBe(e,t){e.sort((s,u)=>{let d=nz(s.scope,u.scope);return d!==0||(d=az(s.parentScopes,u.parentScopes),d!==0)?d:s.index-u.index});let n=0,r="#000000",a="#ffffff";for(;e.length>=1&&e[0].scope==="";){let s=e.shift();s.fontStyle!==-1&&(n=s.fontStyle),s.foreground!==null&&(r=s.foreground),s.background!==null&&(a=s.background)}let o=new rBe(t),i=new iz(n,o.getId(r),o.getId(a)),A=new iBe(new _4(0,null,-1,0,0),[]);for(let s=0,u=e.length;s<u;s++){let d=e[s];A.insert(0,d.scope,d.parentScopes,d.fontStyle,o.getId(d.foreground),o.getId(d.background))}return new _b(o,i,A)}var rBe=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},oBe=Object.freeze([]),_4=class Az{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,a,o){this.scopeDepth=t,this.parentScopes=n||oBe,this.fontStyle=r,this.foreground=a,this.background=o}clone(){return new Az(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,a=t.length;r<a;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,a){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),a!==0&&(this.background=a)}},iBe=class x4{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,a=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[a]===">"&&a++,!(r>=t.parentScopes.length||a>=n.parentScopes.length);){let o=n.parentScopes[a].length-t.parentScopes[r].length;if(o!==0)return o;r++,a++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),a,o;if(r===-1?(a=t,o=""):(a=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(a))return this._children[a].match(o)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(x4._cmpBySpecificity),n}insert(t,n,r,a,o,i){if(n===""){this._doInsertHere(t,r,a,o,i);return}let A=n.indexOf("."),s,u;A===-1?(s=n,u=""):(s=n.substring(0,A),u=n.substring(A+1));let d;this._children.hasOwnProperty(s)?d=this._children[s]:(d=new x4(this._mainRule.clone(),_4.cloneArr(this._rulesWithParentScopes)),this._children[s]=d),d.insert(t+1,u,r,a,o,i)}_doInsertHere(t,n,r,a,o){if(n===null){this._mainRule.acceptOverwrite(t,r,a,o);return}for(let i=0,A=this._rulesWithParentScopes.length;i<A;i++){let s=this._rulesWithParentScopes[i];if(az(s.parentScopes,n)===0){s.acceptOverwrite(t,r,a,o);return}}r===-1&&(r=this._mainRule.fontStyle),a===0&&(a=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new _4(t,n,r,a,o))}},md=class Oo{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){let n=Oo.getLanguageId(t),r=Oo.getTokenType(t),a=Oo.getFontStyle(t),o=Oo.getForeground(t),i=Oo.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:a,foreground:o,background:i})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,a,o,i,A){let s=Oo.getLanguageId(t),u=Oo.getTokenType(t),d=Oo.containsBalancedBrackets(t)?1:0,l=Oo.getFontStyle(t),p=Oo.getForeground(t),g=Oo.getBackground(t);return n!==0&&(s=n),r!==8&&(u=r),a!==null&&(d=a?1:0),o!==-1&&(l=o),i!==0&&(p=i),A!==0&&(g=A),(s<<0|u<<8|d<<10|l<<11|p<<15|g<<24)>>>0}};function kE(e,t){let n=[],r=ABe(e),a=r.next();for(;a!==null;){let s=0;if(a.length===2&&a.charAt(1)===":"){switch(a.charAt(0)){case"R":s=1;break;case"L":s=-1;break;default:console.log(`Unknown priority ${a} in scope selector`)}a=r.next()}let u=i();if(n.push({matcher:u,priority:s}),a!==",")break;a=r.next()}return n;function o(){if(a==="-"){a=r.next();let s=o();return u=>!!s&&!s(u)}if(a==="("){a=r.next();let s=A();return a===")"&&(a=r.next()),s}if(Kq(a)){let s=[];do s.push(a),a=r.next();while(Kq(a));return u=>t(s,u)}return null}function i(){let s=[],u=o();for(;u;)s.push(u),u=o();return d=>s.every(l=>l(d))}function A(){let s=[],u=i();for(;u&&(s.push(u),a==="|"||a===",");){do a=r.next();while(a==="|"||a===",");u=i()}return d=>s.some(l=>l(d))}}function Kq(e){return!!e&&!!e.match(/[\w\.:]+/)}function ABe(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function sz(e){typeof e.dispose=="function"&&e.dispose()}var xb=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},sBe=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},cBe=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},uBe=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new xb(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new cBe;for(let n of e)dBe(n,this.initialScopeName,this.repo,t);for(let n of t.references)if(n instanceof xb){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function dBe(e,t,n,r){let a=n.lookup(e.scopeName);if(!a){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}let o=n.lookup(t);e instanceof xb?EE({baseGrammar:o,selfGrammar:a},r):D4(e.ruleName,{baseGrammar:o,selfGrammar:a,repository:a.repository},r);let i=n.injections(e.scopeName);if(i)for(let A of i)r.add(new xb(A))}function D4(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];QE([r],t,n)}}function EE(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&QE(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&QE(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function QE(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let a=r.repository?ez({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&QE(r.patterns,{...t,repository:a},n);let o=r.include;if(!o)continue;let i=cz(o);switch(i.kind){case 0:EE({...t,selfGrammar:t.baseGrammar},n);break;case 1:EE(t,n);break;case 2:D4(i.ruleName,{...t,repository:a},n);break;case 3:case 4:let A=i.scopeName===t.selfGrammar.scopeName?t.selfGrammar:i.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(A){let s={baseGrammar:t.baseGrammar,selfGrammar:A,repository:a};i.kind===4?D4(i.ruleName,s,n):EE(s,n)}else i.kind===4?n.add(new sBe(i.scopeName,i.ruleName)):n.add(new xb(i.scopeName));break}}}var lBe=class{kind=0},pBe=class{kind=1},gBe=class{constructor(e){this.ruleName=e}kind=2},mBe=class{constructor(e){this.scopeName=e}kind=3},fBe=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function cz(e){if(e==="$base")return new lBe;if(e==="$self")return new pBe;let t=e.indexOf("#");if(t===-1)return new mBe(e);if(t===0)return new gBe(e.substring(1));{let n=e.substring(0,t),r=e.substring(t+1);return new fBe(n,r)}}var bBe=/\\(\d+)/,Yq=/\\(\d+)/g;var hBe=-1,uz=-2;var Sb=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=CE.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=CE.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${tz(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:CE.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:CE.replaceCaptures(this._contentName,e,t)}},BBe=class extends Sb{retokenizeCapturedWithRuleId;constructor(e,t,n,r,a){super(e,t,n,r),this.retokenizeCapturedWithRuleId=a}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},yBe=class extends Sb{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,a){super(e,t,n,null),this._match=new Db(r,this.id),this.captures=a,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Fb,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Jq=class extends Sb{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,a){super(e,t,n,r),this.patterns=a.patterns,this.hasMissingPatterns=a.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Fb,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},F4=class extends Sb{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,a,o,i,A,s,u){super(e,t,n,r),this._begin=new Db(a,this.id),this.beginCaptures=o,this._end=new Db(i||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=A,this.applyEndPatternLast=s||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Fb;for(let n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},IE=class extends Sb{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,a,o,i,A,s){super(e,t,n,r),this._begin=new Db(a,this.id),this.beginCaptures=o,this.whileCaptures=A,this._while=new Db(i,uz),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Fb;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Fb,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"\uFFFF"),this._cachedCompiledWhilePatterns}},dz=class nr{static createCaptureRule(t,n,r,a,o){return t.registerRule(i=>new BBe(n,i,r,a,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(a=>{if(t.id=a,t.match)return new yBe(t.$vscodeTextmateLocation,t.id,t.name,t.match,nr._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=ez({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new Jq(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,nr._compilePatterns(o,n,r))}return t.while?new IE(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,nr._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,nr._compileCaptures(t.whileCaptures||t.captures,n,r),nr._compilePatterns(t.patterns,n,r)):new F4(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,nr._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,nr._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,nr._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let a=[];if(t){let o=0;for(let i in t){if(i==="$vscodeTextmateLocation")continue;let A=parseInt(i,10);A>o&&(o=A)}for(let i=0;i<=o;i++)a[i]=null;for(let i in t){if(i==="$vscodeTextmateLocation")continue;let A=parseInt(i,10),s=0;t[i].patterns&&(s=nr.getCompiledRuleId(t[i],n,r)),a[A]=nr.createCaptureRule(n,t[i].$vscodeTextmateLocation,t[i].name,t[i].contentName,s)}}return a}static _compilePatterns(t,n,r){let a=[];if(t)for(let o=0,i=t.length;o<i;o++){let A=t[o],s=-1;if(A.include){let u=cz(A.include);switch(u.kind){case 0:case 1:s=nr.getCompiledRuleId(r[A.include],n,r);break;case 2:let d=r[u.ruleName];d&&(s=nr.getCompiledRuleId(d,n,r));break;case 3:case 4:let l=u.scopeName,p=u.kind===4?u.ruleName:null,g=n.getExternalGrammar(l,r);if(g)if(p){let m=g.repository[p];m&&(s=nr.getCompiledRuleId(m,n,g.repository))}else s=nr.getCompiledRuleId(g.repository.$self,n,g.repository);break}}else s=nr.getCompiledRuleId(A,n,r);if(s!==-1){let u=n.getRule(s),d=!1;if((u instanceof Jq||u instanceof F4||u instanceof IE)&&u.hasMissingPatterns&&u.patterns.length===0&&(d=!0),d)continue;a.push(s)}}return{patterns:a,hasMissingPatterns:(t?t.length:0)!==a.length}}},Db=class lz{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){let r=t.length,a=0,o=[],i=!1;for(let A=0;A<r;A++)if(t.charAt(A)==="\\"&&A+1<r){let u=t.charAt(A+1);u==="z"?(o.push(t.substring(a,A)),o.push("$(?!\\n)(?<!\\n)"),a=A+2):(u==="A"||u==="G")&&(i=!0),A++}this.hasAnchor=i,a===0?this.source=t:(o.push(t.substring(a,r)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=bBe.test(this.source):this.hasBackReferences=!1}clone(){return new lz(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(a=>t.substring(a.start,a.end));return Yq.lastIndex=0,this.source.replace(Yq,(a,o)=>rz(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],a=[],o,i,A,s;for(o=0,i=this.source.length;o<i;o++)A=this.source.charAt(o),t[o]=A,n[o]=A,r[o]=A,a[o]=A,A==="\\"&&o+1<i&&(s=this.source.charAt(o+1),s==="A"?(t[o+1]="\uFFFF",n[o+1]="\uFFFF",r[o+1]="A",a[o+1]="A"):s==="G"?(t[o+1]="\uFFFF",n[o+1]="G",r[o+1]="\uFFFF",a[o+1]="G"):(t[o+1]=s,n[o+1]=s,r[o+1]=s,a[o+1]=s),o++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:a.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Fb=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new Wq(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(a=>a.resolveAnchors(t,n));return new Wq(e,r,this._items.map(a=>a.ruleId))}},Wq=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
68
68
  `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},v4=class{constructor(e,t){this.languageId=e,this.tokenType=t}},CBe=class S4{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new v4(t,8),this._embeddedLanguagesMatcher=new wBe(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?S4._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new v4(0,0);_getBasicScopeAttributes=new oz(t=>{let n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new v4(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){let n=t.match(S4.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},wBe=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([n,r])=>rz(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},YTe={InDebugMode:typeof process<"u"&&!!process.env.VSCODE_TEXTMATE_DEBUG},pz=!1,Zq=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function gz(e,t,n,r,a,o,i,A){let s=t.content.length,u=!1,d=-1;if(i){let g=EBe(e,t,n,r,a,o);a=g.stack,r=g.linePos,n=g.isFirstLine,d=g.anchorPosition}let l=Date.now();for(;!u;){if(A!==0&&Date.now()-l>A)return new Zq(a,!0);p()}return new Zq(a,!1);function p(){let g=kBe(e,t,n,r,a,d);if(!g){o.produce(a,s),u=!0;return}let m=g.captureIndices,b=g.matchedRuleId,B=m&&m.length>0?m[0].end>r:!1;if(b===hBe){let h=a.getRule(e);o.produce(a,m[0].start),a=a.withContentNameScopesList(a.nameScopesList),Ib(e,t,n,a,o,h.endCaptures,m),o.produce(a,m[0].end);let f=a;if(a=a.parent,d=f.getAnchorPos(),!B&&f.getEnterPos()===r){a=f,o.produce(a,s),u=!0;return}}else{let h=e.getRule(b);o.produce(a,m[0].start);let f=a,y=h.getName(t.content,m),E=a.contentNameScopesList.pushAttributed(y,e);if(a=a.push(b,r,d,m[0].end===s,null,E,E),h instanceof F4){let I=h;Ib(e,t,n,a,o,I.beginCaptures,m),o.produce(a,m[0].end),d=m[0].end;let Q=I.getContentName(t.content,m),_=E.pushAttributed(Q,e);if(a=a.withContentNameScopesList(_),I.endHasBackReferences&&(a=a.withEndRule(I.getEndWithResolvedBackReferences(t.content,m))),!B&&f.hasSameRuleAs(a)){a=a.pop(),o.produce(a,s),u=!0;return}}else if(h instanceof IE){let I=h;Ib(e,t,n,a,o,I.beginCaptures,m),o.produce(a,m[0].end),d=m[0].end;let Q=I.getContentName(t.content,m),_=E.pushAttributed(Q,e);if(a=a.withContentNameScopesList(_),I.whileHasBackReferences&&(a=a.withEndRule(I.getWhileWithResolvedBackReferences(t.content,m))),!B&&f.hasSameRuleAs(a)){a=a.pop(),o.produce(a,s),u=!0;return}}else if(Ib(e,t,n,a,o,h.captures,m),o.produce(a,m[0].end),a=a.pop(),!B){a=a.safePop(),o.produce(a,s),u=!0;return}}m[0].end>r&&(r=m[0].end,n=!1)}}function EBe(e,t,n,r,a,o){let i=a.beginRuleCapturedEOL?0:-1,A=[];for(let s=a;s;s=s.pop()){let u=s.getRule(e);u instanceof IE&&A.push({rule:u,stack:s})}for(let s=A.pop();s;s=A.pop()){let{ruleScanner:u,findOptions:d}=vBe(s.rule,e,s.stack.endRule,n,r===i),l=u.findNextMatchSync(t,r,d);if(l){if(l.ruleId!==uz){a=s.stack.pop();break}l.captureIndices&&l.captureIndices.length&&(o.produce(s.stack,l.captureIndices[0].start),Ib(e,t,n,s.stack,o,s.rule.whileCaptures,l.captureIndices),o.produce(s.stack,l.captureIndices[0].end),i=l.captureIndices[0].end,l.captureIndices[0].end>r&&(r=l.captureIndices[0].end,n=!1))}else{a=s.stack.pop();break}}return{stack:a,linePos:r,anchorPosition:i,isFirstLine:n}}function kBe(e,t,n,r,a,o){let i=QBe(e,t,n,r,a,o),A=e.getInjections();if(A.length===0)return i;let s=IBe(A,e,t,n,r,a,o);if(!s)return i;if(!i)return s;let u=i.captureIndices[0].start,d=s.captureIndices[0].start;return d<u||s.priorityMatch&&d===u?s:i}function QBe(e,t,n,r,a,o){let i=a.getRule(e),{ruleScanner:A,findOptions:s}=mz(i,e,a.endRule,n,r===o),u=A.findNextMatchSync(t,r,s);return u?{captureIndices:u.captureIndices,matchedRuleId:u.ruleId}:null}function IBe(e,t,n,r,a,o,i){let A=Number.MAX_VALUE,s=null,u,d=0,l=o.contentNameScopesList.getScopeNames();for(let p=0,g=e.length;p<g;p++){let m=e[p];if(!m.matcher(l))continue;let b=t.getRule(m.ruleId),{ruleScanner:B,findOptions:h}=mz(b,t,null,r,a===i),f=B.findNextMatchSync(n,a,h);if(!f)continue;let y=f.captureIndices[0].start;if(!(y>=A)&&(A=y,s=f.captureIndices,u=f.ruleId,d=m.priority,A===a))break}return s?{priorityMatch:d===-1,captureIndices:s,matchedRuleId:u}:null}function mz(e,t,n,r,a){if(pz){let i=e.compile(t,n),A=fz(r,a);return{ruleScanner:i,findOptions:A}}return{ruleScanner:e.compileAG(t,n,r,a),findOptions:0}}function vBe(e,t,n,r,a){if(pz){let i=e.compileWhile(t,n),A=fz(r,a);return{ruleScanner:i,findOptions:A}}return{ruleScanner:e.compileWhileAG(t,n,r,a),findOptions:0}}function fz(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function Ib(e,t,n,r,a,o,i){if(o.length===0)return;let A=t.content,s=Math.min(o.length,i.length),u=[],d=i[0].end;for(let l=0;l<s;l++){let p=o[l];if(p===null)continue;let g=i[l];if(g.length===0)continue;if(g.start>d)break;for(;u.length>0&&u[u.length-1].endPos<=g.start;)a.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?a.produceFromScopes(u[u.length-1].scopes,g.start):a.produce(r,g.start),p.retokenizeCapturedWithRuleId){let b=p.getName(A,i),B=r.contentNameScopesList.pushAttributed(b,e),h=p.getContentName(A,i),f=B.pushAttributed(h,e),y=r.push(p.retokenizeCapturedWithRuleId,g.start,-1,!1,null,B,f),E=e.createOnigString(A.substring(0,g.end));gz(e,E,n&&g.start===0,g.start,y,a,!1,0),sz(E);continue}let m=p.getName(A,i);if(m!==null){let B=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(m,e);u.push(new _Be(B,g.end))}}for(;u.length>0;)a.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var _Be=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function xBe(e,t,n,r,a,o,i,A){return new FBe(e,t,n,r,a,o,i,A)}function Vq(e,t,n,r,a){let o=kE(t,vE),i=dz.getCompiledRuleId(n,r,a.repository);for(let A of o)e.push({debugSelector:t,matcher:A.matcher,ruleId:i,grammar:a,priority:A.priority})}function vE(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let a=n;a<t.length;a++)if(DBe(t[a],r))return n=a+1,!0;return!1})}function DBe(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var FBe=class{constructor(e,t,n,r,a,o,i,A){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=A,this._basicScopeAttributesProvider=new CBe(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=i,this._grammar=Xq(t,null),this._injections=null,this._tokenTypeMatchers=[],a)for(let s of Object.keys(a)){let u=kE(s,vE);for(let d of u)this._tokenTypeMatchers.push({matcher:d.matcher,type:a[s]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:a=>a===this._rootScopeName?this._grammar:this.getExternalGrammar(a),injections:a=>this._grammarRepository.injections(a)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let a=r.injections;if(a)for(let i in a)Vq(t,i,a[i],this,r);let o=this._grammarRepository.injections(n);o&&o.forEach(i=>{let A=this.getExternalGrammar(i);if(A){let s=A.injectionSelector;s&&Vq(t,s,A,this,A)}})}return t.sort((a,o)=>a.priority-o.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Xq(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=dz.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let a;if(!t||t===L4.NULL){a=!0;let u=this._basicScopeAttributesProvider.getDefaultAttributes(),d=this.themeProvider.getDefaults(),l=md.set(0,u.languageId,u.tokenType,null,d.fontStyle,d.foregroundId,d.backgroundId),p=this.getRule(this._rootId).getName(null,null),g;p?g=vb.createRootAndLookUpScopeName(p,l,this):g=vb.createRoot("unknown",l),t=new L4(null,this._rootId,-1,-1,!1,null,g,g)}else a=!1,t.reset();e=e+`
69
69
  `;let o=this.createOnigString(e),i=o.content.length,A=new LBe(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),s=gz(this,o,a,0,t,A,!0,r);return sz(o),{lineLength:i,lineTokens:A,ruleStack:s.stack,stoppedEarly:s.stoppedEarly}}};function Xq(e,t){return e=Whe(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var vb=class EA{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,a=t?.scopePath??null;for(let o of n)a=I4.push(a,o.scopeNames),r=new EA(r,a,o.encodedTokenAttributes);return r}static createRoot(t,n){return new EA(null,new I4(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let a=r.getMetadataForScope(t),o=new I4(null,t),i=r.themeProvider.themeMatch(o),A=EA.mergeAttributes(n,a,i);return new EA(null,o,A)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return EA.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let a=-1,o=0,i=0;return r!==null&&(a=r.fontStyle,o=r.foregroundId,i=r.backgroundId),md.set(t,n.languageId,n.tokenType,null,a,o,i)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return EA._pushAttributed(this,t,n);let r=t.split(/ /g),a=this;for(let o of r)a=EA._pushAttributed(a,o,n);return a}static _pushAttributed(t,n,r){let a=r.getMetadataForScope(n),o=t.scopePath.push(n),i=r.themeProvider.themeMatch(o),A=EA.mergeAttributes(t.tokenAttributes,a,i);return new EA(t,o,A)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){let n=[],r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},L4=class gd{constructor(t,n,r,a,o,i,A,s){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=i,this.nameScopesList=A,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=a}_stackElementBrand=void 0;static NULL=new gd(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:gd._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?vb.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){gd._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,a,o,i,A){return new gd(this,t,n,r,a,o,i,A)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){let t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new gd(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=vb.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new gd(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,vb.fromExtension(r,n.contentNameScopesList))}},SBe=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):kE(n,vE).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>kE(n,vE).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},LBe=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let r=e?.tokenAttributes??0,a=!1;if(this.balancedBracketSelectors?.matchesAlways&&(a=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let o=e?.getScopeNames()??[];for(let i of this._tokenTypeOverrides)i.matcher(o)&&(r=md.set(r,0,i.type,null,-1,0,0));this.balancedBracketSelectors&&(a=this.balancedBracketSelectors.match(o))}if(a&&(r=md.set(r,0,8,a,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let r=0,a=this._binaryTokens.length;r<a;r++)n[r]=this._binaryTokens[r];return n}},NBe=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,a){if(!this._grammars.has(e)){let o=this._rawGrammars.get(e);if(!o)return null;this._grammars.set(e,xBe(e,o,t,n,r,a,this,this._onigLib))}return this._grammars.get(e)}},bz=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new NBe(_b.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(_b.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new SBe(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,a){let o=new uBe(this._syncRegistry,e);for(;o.Q.length>0;)o.Q.map(i=>this._loadSingleGrammar(i.scopeName)),o.processQueue();return this._grammarForScopeName(e,t,n,r,a)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,a=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,a)}},_E=L4.NULL;function Nb(e,t){let n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(let[a,o]of Object.entries(t?.colorReplacements||{}))typeof o=="string"?n[a]=o:a===r&&Object.assign(n,o);return n}function Is(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function wz(e){return Array.isArray(e)?e:[e]}async function R4(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Rb(e){return!e||["plaintext","txt","text","plain"].includes(e)}function $4(e){return e==="ansi"||Rb(e)}function $b(e){return e==="none"}function M4(e){return $b(e)}var RBe=/(\r?\n)/g;function Op(e,t=!1){if(e.length===0)return[["",0]];let n=e.split(RBe),r=0,a=[];for(let o=0;o<n.length;o+=2){let i=t?n[o]+(n[o+1]||""):n[o];a.push([i,r]),r+=n[o].length,r+=n[o+1]?.length||0}return a}var hz={light:"#333333",dark:"#bbbbbb"},Bz={light:"#fffffe",dark:"#1e1e1e"},yz="__shiki_resolved";function xE(e){if(e?.[yz])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let A=t.settings?t.settings.find(s=>!s.name&&!s.scope):void 0;A?.settings?.foreground&&(r=A.settings.foreground),A?.settings?.background&&(n=A.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?hz.light:hz.dark),n||(n=t.type==="light"?Bz.light:Bz.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let a=0,o=new Map;function i(A){if(o.has(A))return o.get(A);a+=1;let s=`#${a.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${s}`]?i(A):(o.set(A,s),s)}t.settings=t.settings.map(A=>{let s=A.settings?.foreground&&!A.settings.foreground.startsWith("#"),u=A.settings?.background&&!A.settings.background.startsWith("#");if(!s&&!u)return A;let d={...A,settings:{...A.settings}};if(s){let l=i(A.settings.foreground);t.colorReplacements[l]=A.settings.foreground,d.settings.foreground=l}if(u){let l=i(A.settings.background);t.colorReplacements[l]=A.settings.background,d.settings.background=l}return d});for(let A of Object.keys(t.colors||{}))if((A==="editor.foreground"||A==="editor.background"||A.startsWith("terminal.ansi"))&&!t.colors[A]?.startsWith("#")){let s=i(t.colors[A]);t.colorReplacements[s]=t.colors[A],t.colors[A]=s}return Object.defineProperty(t,yz,{enumerable:!1,writable:!1,value:!0}),t}async function Ez(e){return[...new Set((await Promise.all(e.filter(t=>!$4(t)).map(async t=>await R4(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function kz(e){return(await Promise.all(e.map(async t=>M4(t)?null:xE(await R4(t))))).filter(t=>!!t)}function Qz(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new wt(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var $Be=class extends bz{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(a=>this.loadTheme(a)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=xE(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=_b.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Qz(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(a=>a.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(a=>{this._alias[a]=e.name}),this._loadedLanguagesCache=null,t.size)for(let a of t)this._resolvedGrammars.delete(a.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(a.scopeName),this._syncRegistry?._grammars?.delete(a.scopeName),this.loadLanguage(this._langMap.get(a.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let r of e)this.resolveEmbeddedLanguages(r);let t=[...this._langGraph.entries()],n=t.filter(([r,a])=>!a);if(n.length){let r=t.filter(([a,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(i=>n.map(([A])=>A).includes(i)):!1).filter(a=>!n.includes(a));throw new wt(`Missing languages ${n.map(([a])=>`\`${a}\``).join(", ")}, required by ${r.map(([a])=>`\`${a}\``).join(", ")}`)}for(let[r,a]of t)this._resolver.addLanguage(a);for(let[r,a]of t)this.loadLanguage(a)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let n of t)this._langGraph.set(n,this._langMap.get(n))}},MBe=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split("."),n=[];for(let r=1;r<=t.length;r++){let a=t.slice(0,r).join(".");n=[...n,...this._injections.get(a)||[]]}return n}},Lb=0;function j4(e){Lb+=1,e.warnings!==!1&&Lb>=10&&Lb%10===0&&console.warn(`[Shiki] ${Lb} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new wt("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(xE),a=new $Be(new MBe(e.engine,n),r,n,e.langAlias),o;function i(f){return Qz(f,e.langAlias)}function A(f){B();let y=a.getGrammar(typeof f=="string"?f:f.name);if(!y)throw new wt(`Language \`${f}\` not found, you may need to load it first`);return y}function s(f){if(f==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};B();let y=a.getTheme(f);if(!y)throw new wt(`Theme \`${f}\` not found, you may need to load it first`);return y}function u(f){B();let y=s(f);return o!==f&&(a.setTheme(y),o=f),{theme:y,colorMap:a.getColorMap()}}function d(){return B(),a.getLoadedThemes()}function l(){return B(),a.getLoadedLanguages()}function p(...f){B(),a.loadLanguages(f.flat(1))}async function g(...f){return p(await Ez(f))}function m(...f){B();for(let y of f.flat(1))a.loadTheme(y)}async function b(...f){return B(),m(await kz(f))}function B(){if(t)throw new wt("Shiki instance has been disposed")}function h(){t||(t=!0,a.dispose(),Lb-=1)}return{setTheme:u,getTheme:s,getLanguage:A,getLoadedThemes:d,getLoadedLanguages:l,resolveLangAlias:i,loadLanguage:g,loadLanguageSync:p,loadTheme:b,loadThemeSync:m,dispose:h,[Symbol.dispose]:h}}async function P4(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([kz(e.themes||[]),Ez(e.langs||[]),e.engine]);return j4({...e,themes:t,langs:n,engine:r})}var Iz=new WeakMap;function Mb(e,t){Iz.set(e,t)}function qp(e){return Iz.get(e)}var DE=class vz{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new vz(Object.fromEntries(wz(n).map(r=>[r,_E])),t)}constructor(...t){if(t.length===2){let[n,r]=t;this.lang=r,this._stacks=n}else{let[n,r,a]=t;this.lang=r,this._stacks={[a]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return jBe(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function jBe(e){let t=[],n=new Set;function r(a){if(n.has(a))return;n.add(a);let o=a?.nameScopesList?.scopeName;o&&t.push(o),a.parent&&r(a.parent)}return r(e),t}function PBe(e,t){if(!(e instanceof DE))throw new wt("Invalid grammar state");return e.getInternalStack(t)}var TBe=/,/,HBe=/ /;function T4(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(Rb(e.resolveLangAlias(n.lang||"text"))||$b(r))return Op(t).map(A=>[{content:A[0],offset:A[1]}]);let{theme:a,colorMap:o}=e.setTheme(r),i=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==i.name)throw new wt(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${i.name}"`);if(!n.grammarState.themes.includes(a.name))throw new wt(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return xz(t,i,a,o,n)}function _z(...e){if(e.length===2)return qp(e[1]);let[t,n,r={}]=e,{lang:a="text",theme:o=t.getLoadedThemes()[0]}=r;if(Rb(a)||$b(o))throw new wt("Plain language does not have grammar state");if(a==="ansi")throw new wt("ANSI language does not have grammar state");let{theme:i,colorMap:A}=t.setTheme(o),s=t.getLanguage(a);return new DE(H4(n,s,i,A,r).stateStack,s.name,i.name)}function xz(e,t,n,r,a){let o=H4(e,t,n,r,a),i=new DE(o.stateStack,t.name,n.name);return Mb(o.tokens,i),o.tokens}function H4(e,t,n,r,a){let o=Nb(n,a),{tokenizeMaxLineLength:i=0,tokenizeTimeLimit:A=500}=a,s=Op(e),u=a.grammarState?PBe(a.grammarState,n.name)??_E:a.grammarContextCode!=null?H4(a.grammarContextCode,t,n,r,{...a,grammarState:void 0,grammarContextCode:void 0}).stateStack:_E,d=[],l=[];for(let p=0,g=s.length;p<g;p++){let[m,b]=s[p];if(m===""){d=[],l.push([]);continue}if(i>0&&m.length>=i){d=[],l.push([{content:m,offset:b,color:"",fontStyle:0}]);continue}let B,h,f;a.includeExplanation&&(B=t.tokenizeLine(m,u,A),h=B.tokens,f=0);let y=t.tokenizeLine2(m,u,A),E=y.tokens.length/2;for(let I=0;I<E;I++){let Q=y.tokens[2*I],_=I+1<E?y.tokens[2*I+2]:m.length;if(Q===_)continue;let $=y.tokens[2*I+1],M=Is(r[md.getForeground($)],o),U=md.getFontStyle($),de={content:m.substring(Q,_),offset:b+Q,color:M,fontStyle:U};if(a.includeExplanation){let O=[];if(a.includeExplanation!=="scopeName")for(let ae of n.settings){let ve;switch(typeof ae.scope){case"string":ve=ae.scope.split(TBe).map(ot=>ot.trim());break;case"object":ve=ae.scope;break;default:continue}O.push({settings:ae,selectors:ve.map(ot=>ot.split(HBe))})}de.explanation=[];let V=0;for(;Q+V<_;){let ae=h[f],ve=m.substring(ae.startIndex,ae.endIndex);V+=ve.length,de.explanation.push({content:ve,scopes:a.includeExplanation==="scopeName"?GBe(ae.scopes):UBe(O,ae.scopes)}),f+=1}}d.push(de)}l.push(d),d=[],u=y.ruleStack}return{tokens:l,stateStack:u}}function GBe(e){return e.map(t=>({scopeName:t}))}function UBe(e,t){let n=[];for(let r=0,a=t.length;r<a;r++){let o=t[r];n[r]={scopeName:o,themeMatches:qBe(e,o,t.slice(0,r))}}return n}function Cz(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function OBe(e,t,n){if(!Cz(e.at(-1),t))return!1;let r=e.length-2,a=n.length-1;for(;r>=0&&a>=0;)Cz(e[r],n[a])&&(r-=1),a-=1;return r===-1}function qBe(e,t,n){let r=[];for(let{selectors:a,settings:o}of e)for(let i of a)if(OBe(i,t,n)){r.push(o);break}return r}function FE(e,t,n,r=T4){let a=Object.entries(n.themes).filter(u=>u[1]).map(u=>({color:u[0],theme:u[1]})),o=a.map(u=>{let d=r(e,t,{...n,theme:u.theme});return{tokens:d,state:qp(d),theme:typeof u.theme=="string"?u.theme:u.theme.name}}),i=zBe(...o.map(u=>u.tokens)),A=i[0].map((u,d)=>u.map((l,p)=>{let g={content:l.content,variants:{},offset:l.offset};return"includeExplanation"in n&&n.includeExplanation&&(g.explanation=l.explanation),i.forEach((m,b)=>{let{content:B,explanation:h,offset:f,...y}=m[d][p];g.variants[a[b].color]=y}),g})),s=o[0].state?new DE(Object.fromEntries(o.map(u=>[u.theme,u.state?.getInternalStack(u.theme)])),o[0].state.lang):void 0;return s&&Mb(A,s),A}function zBe(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let a=e.map(s=>s[r]),o=t.map(()=>[]);t.forEach((s,u)=>s.push(o[u]));let i=a.map(()=>0),A=a.map(s=>s[0]);for(;A.every(s=>s);){let s=Math.min(...A.map(u=>u.content.length));for(let u=0;u<n;u++){let d=A[u];d.content.length===s?(o[u].push(d),i[u]+=1,A[u]=a[u][i[u]]):(o[u].push({...d,content:d.content.slice(0,s)}),A[u]={...d,content:d.content.slice(s),offset:d.offset+s})}}}return t}var Dz=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];var vs=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};vs.prototype.normal={};vs.prototype.property={};vs.prototype.space=void 0;function G4(e,t){let n={},r={};for(let a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new vs(n,r,t)}function jb(e){return e.toLowerCase()}var Ca=class{constructor(t,n){this.attribute=n,this.property=t}};Ca.prototype.attribute="";Ca.prototype.booleanish=!1;Ca.prototype.boolean=!1;Ca.prototype.commaOrSpaceSeparated=!1;Ca.prototype.commaSeparated=!1;Ca.prototype.defined=!1;Ca.prototype.mustUseProperty=!1;Ca.prototype.number=!1;Ca.prototype.overloadedBoolean=!1;Ca.prototype.property="";Ca.prototype.spaceSeparated=!1;Ca.prototype.space=void 0;var Pb={};L(Pb,{boolean:()=>Ie,booleanish:()=>Cn,commaOrSpaceSeparated:()=>Kr,commaSeparated:()=>Gc,number:()=>q,overloadedBoolean:()=>SE,spaceSeparated:()=>Et});var KBe=0,Ie=fd(),Cn=fd(),SE=fd(),q=fd(),Et=fd(),Gc=fd(),Kr=fd();function fd(){return 2**++KBe}var U4=Object.keys(Pb),bd=class extends Ca{constructor(t,n,r,a){let o=-1;if(super(t,n),Fz(this,"space",a),typeof r=="number")for(;++o<U4.length;){let i=U4[o];Fz(this,U4[o],(r&Pb[i])===Pb[i])}}};bd.prototype.defined=!0;function Fz(e,t,n){n&&(e[t]=n)}function qo(e){let t={},n={};for(let[r,a]of Object.entries(e.properties)){let o=new bd(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[jb(r)]=r,n[jb(o.attribute)]=r}return new vs(t,n,e.space)}var O4=qo({properties:{ariaActiveDescendant:null,ariaAtomic:Cn,ariaAutoComplete:null,ariaBusy:Cn,ariaChecked:Cn,ariaColCount:q,ariaColIndex:q,ariaColSpan:q,ariaControls:Et,ariaCurrent:null,ariaDescribedBy:Et,ariaDetails:null,ariaDisabled:Cn,ariaDropEffect:Et,ariaErrorMessage:null,ariaExpanded:Cn,ariaFlowTo:Et,ariaGrabbed:Cn,ariaHasPopup:null,ariaHidden:Cn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Et,ariaLevel:q,ariaLive:null,ariaModal:Cn,ariaMultiLine:Cn,ariaMultiSelectable:Cn,ariaOrientation:null,ariaOwns:Et,ariaPlaceholder:null,ariaPosInSet:q,ariaPressed:Cn,ariaReadOnly:Cn,ariaRelevant:null,ariaRequired:Cn,ariaRoleDescription:Et,ariaRowCount:q,ariaRowIndex:q,ariaRowSpan:q,ariaSelected:Cn,ariaSetSize:q,ariaSort:null,ariaValueMax:q,ariaValueMin:q,ariaValueNow:q,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function LE(e,t){return t in e?e[t]:t}function NE(e,t){return LE(e,t.toLowerCase())}var Sz=qo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Gc,acceptCharset:Et,accessKey:Et,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:Et,autoFocus:Ie,autoPlay:Ie,blocking:Et,capture:null,charSet:null,checked:Ie,cite:null,className:Et,cols:q,colSpan:null,content:null,contentEditable:Cn,controls:Ie,controlsList:Et,coords:q|Gc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:SE,draggable:Cn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:Et,height:q,hidden:SE,high:q,href:null,hrefLang:null,htmlFor:Et,httpEquiv:Et,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:Et,itemRef:Et,itemScope:Ie,itemType:Et,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:q,manifest:null,max:null,maxLength:q,media:null,method:null,min:null,minLength:q,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,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:Ie,optimum:q,pattern:null,ping:Et,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:Et,required:Ie,reversed:Ie,rows:q,rowSpan:q,sandbox:Et,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shape:null,size:q,sizes:null,slot:null,span:q,spellCheck:Cn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:q,step:null,style:null,tabIndex:q,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Cn,width:q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Et,axis:null,background:null,bgColor:null,border:q,borderColor:null,bottomMargin:q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:q,leftMargin:q,link:null,longDesc:null,lowSrc:null,marginHeight:q,marginWidth:q,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:q,rules:null,scheme:null,scrolling:Cn,standby:null,summary:null,text:null,topMargin:q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ie,disableRemotePlayback:Ie,prefix:null,property:null,results:q,security:null,unselectable:null},space:"html",transform:NE});var Lz=qo({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",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:Kr,accentHeight:q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:q,amplitude:q,arabicForm:null,ascent:q,attributeName:null,attributeType:null,azimuth:q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:q,by:null,calcMode:null,capHeight:q,className:Et,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:q,diffuseConstant:q,direction:null,display:null,dur:null,divisor:q,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:q,enableBackground:null,end:null,event:null,exponent:q,externalResourcesRequired:null,fill:null,fillOpacity:q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Gc,g2:Gc,glyphName:Gc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:q,horizOriginX:q,horizOriginY:q,id:null,ideographic:q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:q,k:q,k1:q,k2:q,k3:q,k4:q,kernelMatrix:Kr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:q,overlineThickness:q,paintOrder:null,panose1:null,path:null,pathLength:q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Et,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:q,pointsAtY:q,pointsAtZ:q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Kr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Kr,rev:Kr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Kr,requiredFeatures:Kr,requiredFonts:Kr,requiredFormats:Kr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:q,specularExponent:q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:q,strikethroughThickness:q,string:null,stroke:null,strokeDashArray:Kr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:q,strokeOpacity:q,strokeWidth:null,style:null,surfaceScale:q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Kr,tabIndex:q,tableValues:null,target:null,targetX:q,targetY:q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Kr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:q,underlineThickness:q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:q,values:null,vAlphabetic:q,vMathematical:q,vectorEffect:null,vHanging:q,vIdeographic:q,version:null,vertAdvY:q,vertOriginX:q,vertOriginY:q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:LE});var q4=qo({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()}});var z4=qo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:NE});var K4=qo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});var YBe=/[A-Z]/g,Nz=/-[a-z]/g,JBe=/^data[-\w.:]+$/i;function Y4(e,t){let n=jb(t),r=t,a=Ca;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&JBe.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(Nz,ZBe);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!Nz.test(o)){let i=o.replace(YBe,WBe);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}a=bd}return new a(r,t)}function WBe(e){return"-"+e.toLowerCase()}function ZBe(e){return e.charAt(1).toUpperCase()}var Rz=G4([O4,Sz,q4,z4,K4],"html"),RE=G4([O4,Lz,q4,z4,K4],"svg");var $z={}.hasOwnProperty;function Mz(e,t){let n=t||{};function r(a,...o){let i=r.invalid,A=r.handlers;if(a&&$z.call(a,e)){let s=String(a[e]);i=$z.call(A,s)?A[s]:r.unknown}if(i)return i.call(this,a,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var VBe=/["&'<>`]/g,XBe=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,eye=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,tye=/[|\\{}()[\]^$+*?.]/g,jz=new WeakMap;function Pz(e,t){if(e=e.replace(t.subset?nye(t.subset):VBe,r),t.subset||t.escapeOnly)return e;return e.replace(XBe,n).replace(eye,r);function n(a,o,i){return t.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,i.charCodeAt(o+2),t)}function r(a,o,i){return t.format(a.charCodeAt(0),i.charCodeAt(o+1),t)}}function nye(e){let t=jz.get(e);return t||(t=aye(e),jz.set(e,t)),t}function aye(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(tye,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}var rye=/[\dA-Fa-f]/;function Tz(e,t,n){let r="&#x"+e.toString(16).toUpperCase();return n&&t&&!rye.test(String.fromCharCode(t))?r:r+";"}var oye=/\d/;function Hz(e,t,n){let r="&#"+String(e);return n&&t&&!oye.test(String.fromCharCode(t))?r:r+";"}var Gz=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"];var $E={nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",fnof:"\u0192",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",bull:"\u2022",hellip:"\u2026",prime:"\u2032",Prime:"\u2033",oline:"\u203E",frasl:"\u2044",weierp:"\u2118",image:"\u2111",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",quot:'"',amp:"&",lt:"<",gt:">",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",permil:"\u2030",lsaquo:"\u2039",rsaquo:"\u203A",euro:"\u20AC"};var Uz=["cent","copy","divide","gt","lt","not","para","times"];var Oz={}.hasOwnProperty,J4={},ME;for(ME in $E)Oz.call($E,ME)&&(J4[$E[ME]]=ME);var iye=/[^\dA-Za-z]/;function qz(e,t,n,r){let a=String.fromCharCode(e);if(Oz.call(J4,a)){let o=J4[a],i="&"+o;return n&&Gz.includes(o)&&!Uz.includes(o)&&(!r||t&&t!==61&&iye.test(String.fromCharCode(t)))?i:i+";"}return""}function zz(e,t,n){let r=Tz(e,t,n.omitOptionalSemicolons),a;if((n.useNamedReferences||n.useShortestReferences)&&(a=qz(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!a)&&n.useShortestReferences){let o=Hz(e,t,n.omitOptionalSemicolons);o.length<r.length&&(r=o)}return a&&(!n.useShortestReferences||a.length<r.length)?a:r}function _s(e,t){return Pz(e,Object.assign({format:zz},t))}var Aye=/^>|^->|<!--|-->|--!>|<!-$/g,sye=[">"],cye=["<",">"];function Kz(e,t,n,r){return r.settings.bogusComments?"<?"+_s(e.value,Object.assign({},r.settings.characterReferences,{subset:sye}))+">":"<!--"+e.value.replace(Aye,a)+"-->";function a(o){return _s(o,Object.assign({},r.settings.characterReferences,{subset:cye}))}}function Yz(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function W4(e,t){let n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function Jz(e,t){let n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Wz(e){return e.join(" ").trim()}var uye=/[ \t\n\f\r]/g;function hd(e){return typeof e=="object"?e.type==="text"?Zz(e.value):!1:Zz(e)}function Zz(e){return e.replace(uye,"")===""}var Dn=Vz(1),Z4=Vz(-1),dye=[];function Vz(e){return t;function t(n,r,a){let o=n?n.children:dye,i=(r||0)+e,A=o[i];if(!a)for(;A&&hd(A);)i+=e,A=o[i];return A}}var lye={}.hasOwnProperty;function jE(e){return t;function t(n,r,a){return lye.call(e,n.tagName)&&e[n.tagName](n,r,a)}}var Tb=jE({body:gye,caption:V4,colgroup:V4,dd:hye,dt:bye,head:V4,html:pye,li:fye,optgroup:Bye,option:yye,p:mye,rp:Xz,rt:Xz,tbody:wye,td:eK,tfoot:Eye,th:eK,thead:Cye,tr:kye});function V4(e,t,n){let r=Dn(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&hd(r.value.charAt(0)))}function pye(e,t,n){let r=Dn(n,t);return!r||r.type!=="comment"}function gye(e,t,n){let r=Dn(n,t);return!r||r.type!=="comment"}function mye(e,t,n){let r=Dn(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function fye(e,t,n){let r=Dn(n,t);return!r||r.type==="element"&&r.tagName==="li"}function bye(e,t,n){let r=Dn(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function hye(e,t,n){let r=Dn(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Xz(e,t,n){let r=Dn(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Bye(e,t,n){let r=Dn(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function yye(e,t,n){let r=Dn(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Cye(e,t,n){let r=Dn(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function wye(e,t,n){let r=Dn(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Eye(e,t,n){return!Dn(n,t)}function kye(e,t,n){let r=Dn(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function eK(e,t,n){let r=Dn(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}var tK=jE({body:vye,colgroup:_ye,head:Iye,html:Qye,tbody:xye});function Qye(e){let t=Dn(e,-1);return!t||t.type!=="comment"}function Iye(e){let t=new Set;for(let r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}let n=e.children[0];return!n||n.type==="element"}function vye(e){let t=Dn(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&hd(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function _ye(e,t,n){let r=Z4(n,t),a=Dn(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&Tb(r,n.children.indexOf(r),n)?!1:!!(a&&a.type==="element"&&a.tagName==="col")}function xye(e,t,n){let r=Z4(n,t),a=Dn(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&Tb(r,n.children.indexOf(r),n)?!1:!!(a&&a.type==="element"&&a.tagName==="tr")}var PE={name:[[`
70
70
  \f\r &/=>`.split(""),`