@sentry/junior-dashboard 0.215.0 → 0.216.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
  }`,g;try{g=new d(...i,l)(...A)}catch(p){throw new Je(`this schema (generated code failed to evaluate: ${p.message})`)}return t?.debug&&(g.code=u),g}function se(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 Uce(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 pr(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,Oce(e,t,n,r)}}function Oce(e,t,n,r){let a=se(t,n),o=se(t,Uce),i=ge(t);return e.write(`const ${i} = ${o}(${a}, ${r});`),e.write(`if (${i} === INVALID) return INVALID;`),i}var qce=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function zce(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&&!qce.has(A.check))throw new Je('check with a custom "when" condition');switch(A.check){case"greater_than":Kce(e,t,A,o);break;case"less_than":Yce(e,t,A,o);break;case"multiple_of":Jce(e,t,A,o);break;case"number_format":UP(e,A,o);break;case"min_length":{let s=Tu(A.minimum,"min_length"),u=YD(e,t,o,`${o}.length >= ${s} && ${o}.length < ${A.minimum*2}`);e.write(`if (${u} < ${s}) return INVALID;`);break}case"max_length":{let s=Tu(A.maximum,"max_length"),u=YD(e,t,o,`${o}.length > ${s}`);e.write(`if (${u} > ${s}) return INVALID;`);break}case"length_equals":{let s=Tu(A.length,"length_equals"),u=YD(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 < ${Tu(A.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${o}.size > ${Tu(A.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${o}.size !== ${Tu(A.size,"size_equals")}) return INVALID;`);break;case"string_format":o=OP(e,t,A,o);break;case"custom":o=eue(e,t,i,o);break;case"bigint_format":Wce(e,A,o);break;case"mime_type":Zce(e,t,A,o);break;case"property":Vce(e,t,A,o);break;case"overwrite":{let s=ge(t);Xce(e,t,i,o,s),o=s;break}default:throw new Je(`check type ${A.check}`)}}return o}function YD(e,t,n,r){let a=se(t,$u),o=ge(t);return e.write(`const ${o} = typeof ${n} === "string" && ${r} ? ${a}(${n}) : ${n}.length;`),o}function Tu(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new Je(`${t} bound of type ${typeof e}`);return`${e}`}function GP(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 se(e,t)}throw new Je(`comparison check bound of type ${typeof t}`)}function Kce(e,t,n,r){let a=n.inclusive?"<":"<=";e.write(`if (${r} ${a} ${GP(t,n.value)}) return INVALID;`)}function Yce(e,t,n,r){let a=n.inclusive?">":">=";e.write(`if (${r} ${a} ${GP(t,n.value)}) return INVALID;`)}function Jce(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=se(t,ef);e.write(`if (${a}(${r}, ${Tu(n.value,"multiple_of")}) !== 0) return INVALID;`)}}function UP(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 Wce(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 Zce(e,t,n,r){let a=n.mime;if(a&&a.length>0){let o=se(t,new Set(a));e.write(`if (!${o}.has(${r}.type)) return INVALID;`)}}function Vce(e,t,n,r){let a=`${r}[${JSON.stringify(n.property)}]`;nn(e,t,n.schema,a)}function Xce(e,t,n,r,a){let o=n._zod.def.tx;if(!o)throw new Je("overwrite check without a transform function");if(Uu(o))throw new yi("z.compile: async overwrite transforms are not supported");let i=se(t,o);e.write(`const ${a} = ${i}(${r});`)}function JD(){throw new Hr}function VD(e){this.issues.push(e)}function eue(e,t,n,r){let a=n._zod.def;if(a.fn){if(Uu(a.fn))throw new yi("z.compile: async .refine() predicates are not supported");let o=se(t,a.fn),i=se(t,JD),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(Uu(n._zod.check))throw new yi("z.compile: async .superRefine() / check functions are not supported");let o=n._zod.check,A=se(t,u=>{let d={value:u,issues:[],addIssue:VD};return o(d)instanceof Promise&&JD(),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 tue=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 OP(e,t,n,r){let a=n.format;if(a==="base64"){let s=se(t,pf);return e.write(`if (!${s}(${r})) return INVALID;`),r}if(a==="base64url"){let s=se(t,yC);return e.write(`if (!${s}(${r})) return INVALID;`),r}if(a==="jwt"){let s=se(t,wC),u=se(t,n.alg??null);return e.write(`if (!${s}(${r}, ${u})) return INVALID;`),r}if(a==="ipv6"){let s=se(t,lf);return e.write(`if (!${s}(${r})) return INVALID;`),r}if(a==="cidrv6"){let s=se(t,BC);return e.write(`if (!${s}(${r})) return INVALID;`),r}if(a==="credit_card"){let s=se(t,CC);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=se(t,mC),u=se(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=se(t,bC);e.write(`if (!${m}(${l}, ${u}.hostname)) return INVALID;`)}if(o.protocol!==void 0){let m=se(t,hC);e.write(`if (!${m}(${l}, ${u}.protocol)) return INVALID;`)}let g=ge(t),p=o.normalize?`${l}.href`:`${se(t,fC)}(${d})`;return e.write(`const ${g} = ${p};`),g}let i=n.fn;if(i){if(Uu(i))throw new Je(`async string format ${a}`);let s=se(t,i);return e.write(`if (!${s}(${r})) return INVALID;`),r}if(tue.has(a)&&n.pattern){let s=se(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=nue(e,t,n,r);break;case"number":s=aue(e,n,r);break;case"boolean":s=rue(e,r);break;case"bigint":s=oue(e,n,r);break;case"symbol":s=iue(e,r);break;case"undefined":s=Aue(e,r);break;case"null":s=sue(e,r);break;case"any":case"unknown":s=r;break;case"never":e.write("return INVALID;"),s=r;break;case"void":s=cue(e,r);break;case"nan":s=uue(e,r);break;case"date":s=due(e,r);break;case"object":s=lue(e,t,n,r,A);break;case"optional":s=pue(e,t,n,r,A);break;case"nullable":s=fue(e,t,n,r,A);break;case"array":s=bue(e,t,n,r,A);break;case"literal":s=hue(e,t,n,r);break;case"enum":s=Bue(e,t,n,r);break;case"readonly":{let u=TP(e,t,n,r),d=ge(t);e.write(`const ${d} = Object.freeze(${u});`),s=d;break}case"success":TP(e,t,n,r),s="true";break;case"default":case"prefault":s=yue(e,t,n,r);break;case"nonoptional":s=Cue(e,t,n,r);break;case"tuple":s=wue(e,t,n,r);break;case"union":s=Eue(e,t,n,r);break;case"intersection":s=Iue(e,t,n,r);break;case"record":s=vue(e,t,n,r);break;case"map":s=xue(e,t,n,r);break;case"set":s=Due(e,t,n,r);break;case"file":s=Fue(e,r);break;case"template_literal":s=Sue(e,t,n,r);break;case"lazy":s=Lue(e,t,n,r);break;case"pipe":s=Nue(e,t,n,r);break;case"custom":s=Rue(e,t,n,r);break;case"transform":s=jue(e,t,n,r);break;case"catch":s=Mue(e,t,n,r);break;default:throw new Je(`schema type ${i}`)}return s===null?null:zce(e,t,n,s)}function nue(e,t,n,r){e.write(`if (typeof ${r} !== "string") return INVALID;`);let a=n._zod.def;return a.format===void 0?r:OP(e,t,a,r)}function aue(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&&UP(e,{format:r.format},n),n}function rue(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function oue(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 iue(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function Aue(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function sue(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function cue(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function uue(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function due(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function lue(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"?se(t,f):jr(f),l=f=>typeof f=="symbol"?`[${d(f)}]`:jr(f),g=i;if(A.includes("__proto__"))throw new Je('object shape key "__proto__"');let p=new Map;for(let f of u){let y=g[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(v=>{let $=pr(v,t,y,I);v.write(`return ${$};`)}),e.write("})();"),y._zod.optout==="optional"?(e.write(`if (${Q} === INVALID) {`),e.indented(v=>{v.write(`if (${E} in ${r}) return INVALID;`),v.write(`${Q} = undefined;`)}),e.write("}")):e.write(`if (${Q} === INVALID) return INVALID;`),p.set(f,Q)}else{mue(y)&&e.write(`if (!(${E} in ${r})) return INVALID;`);let Q=pr(e,t,y,I,a);Q!==null&&p.set(f,Q)}}let m=o.catchall,h="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?h="passthrough":h="schema"}let B=ge(t),b=u.some(f=>Gu(g[f])||WD(g[f]));if(!a){if(h==="schema"){let f=A.length>0?se(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];`),pr(y,t,m,E,!1)}),e.write("}")}return null}if(b){e.write(`const ${B} = {};`);for(let f of u){let y=d(f),E=p.get(f);WD(g[f])?e.write(`if (${y} in ${r}) ${B}[${y}] = ${E};`):Gu(g[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)}: ${p.get(y)}`).join(", ");e.write(`const ${B} = { ${f} };`)}if(h!=="none"){let f=A.length>0?se(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;`),h==="passthrough")y.write(`${B}[k] = ${r}[k];`);else{let E=ge(t);y.write(`const ${E} = ${r}[k];`);let I=pr(y,t,m,E);y.write(`${B}[k] = ${I};`)}}),e.write("}")}return B}function pue(e,t,n,r,a=!0){let o=n._zod.def;if(gue(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 gue(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function mue(e){return e._zod.optin===void 0&&Hu(e)}function Hu(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?Hu(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?Hu(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(Hu):!0;case"intersection":return!t.left||!t.right?!0:Hu(t.left)&&Hu(t.right);case"pipe":return t.in?Hu(t.in):!0;default:return!0}}function WD(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function Gu(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?Gu(t.innerType):!0;case"union":return t.options?t.options.some(Gu):!0;case"intersection":return!t.left||!t.right||Gu(t.left)||Gu(t.right);case"pipe":return t.out?Gu(t.out):!0;default:return!0}}function fue(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 bue(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=pr(u,t,o.element,s,a);i&&d!==null&&u.write(`${i}[${A}] = ${d};`)}),e.write("}"),i}function hue(e,t,n,r){let o=n._zod.def.values;if(o.length!==1){let A=se(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=se(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 Bue(e,t,n,r){let a=n._zod.values;if(!a)throw new Je("enum schema without enumerated values");let o=se(t,a);return e.write(`if (!${o}.has(${r})) return INVALID;`),r}function TP(e,t,n,r){let a=n._zod.def;return nn(e,t,a.innerType,r)}function yue(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=se(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=se(t,i),u=se(t,tf);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 Cue(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 wue(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=HP(o,"optin"),s=HP(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(g=>{g.write(`if (${d} < ${r}.length) {`),g.indented(p=>{let m=ge(t);p.write(`const ${m} = ${r}[${d}];`);let h=pr(p,t,l,m);p.write(`${u}[${d}] = ${h};`)}),g.write("} else {"),g.indented(p=>{if(WD(l)){p.write(`${u}.length = ${d};`);return}let m=ge(t),h=ge(t);p.write(`const ${m} = undefined;`),p.write(`const ${h} = (() => {`),p.indented(B=>{let b=pr(B,t,l,m);B.write(`return ${b};`)}),p.write("})();"),p.write(`if (${h} === INVALID || ${h} === undefined) ${u}.length = ${d};`),p.write(`else ${u}[${d}] = ${h};`)}),g.write("}")}),e.write("}");else{let g=ge(t);e.write(`const ${g} = ${r}[${d}];`);let p=pr(e,t,l,g);e.write(`${u}[${d}] = ${p};`)}}if(i){let d=ge(t),l=ge(t);e.write(`for (let ${d} = ${o.length}; ${d} < ${r}.length; ${d}++) {`),e.indented(g=>{g.write(`const ${l} = ${r}[${d}];`);let p=pr(g,t,i,l);g.write(`${u}[${d}] = ${p};`)}),e.write("}")}return u}function HP(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 Eue(e,t,n,r){let a=n._zod.def,o=a.options;if(a.discriminator)return kue(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=se(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 kue(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 g of u){if(A.has(g))throw new Je(`duplicate discriminator value ${String(g)}`);A.add(g)}let d=Array.from(u,g=>Que(t,a,g)),l=i?"if":"else if";e.write(`${l} (${d.join(" || ")}) {`),e.indented(g=>{let p=nn(g,t,s,r);g.write(`${o} = ${p};`)}),e.write("}"),i=!1}return e.write("else { return INVALID; }"),o}function Que(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=se(e,n);return`${t} === ${r}`}throw new Je(`literal discriminator value ${String(n)}`)}function Iue(e,t,n,r){let a=n._zod.def,o=pr(e,t,a.left,r),i=pr(e,t,a.right,r),A=se(t,rp),s=ge(t);return e.write(`const ${s} = ${A}(${o}, ${i});`),e.write(`if (!${s}.valid) return INVALID;`),`${s}.data`}function vue(e,t,n,r){let a=n._zod.def,o=se(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 b=typeof B=="number"?B.toString():B;if(b==="__proto__")throw new Je('record key "__proto__"');m.push(b);let f=se(t,B),y=nn(e,t,a.keyType,f),E=ge(t);e.write(`const ${E} = ${r}[${_ue(t,b)}];`);let I=pr(e,t,a.valueType,E);e.write(`${i}[${y}] = ${I};`)}let h=se(t,new Set(m));return e.write(`for (const ${A} in ${r}) {`),e.indented(B=>{B.write(`if (${h}.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",h=se(t,MC(a.keyType)),B=se(t,Cc),b=se(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 (!${b}.call(${r}, ${A})) continue;`),y.write(`let ${f} = ${h}(${A});`),y.write(`if (${f} === INVALID && typeof ${A} === "string" && ${B}.test(${A})) ${f} = ${h}(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=pr(y,t,a.valueType,E);y.write(`${i}[${f}] = ${I};`)}),e.write("}"),i}let p=se(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 (!${p}.call(${r}, ${A})) continue;`),m.write(`if (typeof ${A} !== "string") return INVALID;`),m.write(`const ${s} = ${r}[${A}];`);let h=pr(m,t,a.valueType,s);m.write(`${i}[${A}] = ${h};`)}),e.write("}"),i}function _ue(e,t){return typeof t=="string"?jr(t):se(e,t)}function xue(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 Due(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 Fue(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function Sue(e,t,n,r){e.write(`if (typeof ${r} !== "string") return INVALID;`);let a=n._zod.pattern;if(a){let o=se(t,a);e.write(`${o}.lastIndex = 0;`),e.write(`if (!${o}.test(${r})) return INVALID;`)}return r}function Lue(e,t,n,r){let a=n._zod.def,o=se(t,a.getter),i=se(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 Nue(e,t,n,r){let a=n._zod.def,o=nn(e,t,a.in,r);if(a.transform){if(Uu(a.transform))throw new yi("z.compile: async transforms in pipes are not supported");let i=a.transform,s=se(t,d=>{let l={value:d,issues:[],addIssue:VD},g=i(d,l);return g instanceof Promise?po:l.issues.length===0?g: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 Uu(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function Rue(e,t,n,r){let a=n._zod.def;if(a.fn){if(Uu(a.fn))throw new yi("z.compile: async custom predicates are not supported");let o=se(t,a.fn),i=se(t,JD),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 $ue(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 Mue(e,t,n,r){let a=n._zod.def;if(!a.catchValue[zy])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=pr(u,t,a.innerType,r);u.write(`return ${d};`)}),e.write("})();");let i=se(t,a.innerType),A=se(t,a.catchValue),s=se(t,$ue);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 jue(e,t,n,r){let a=n._zod.def;if(a.transform){if(Uu(a.transform))throw new yi("z.compile: async transforms are not supported");let o=a.transform,A=se(t,u=>{let d={value:u,issues:[],addIssue:VD},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 XD(e,t){return new e({type:"string",...K(t)})}function e1(e,t){return new e({type:"string",coerce:!0,...K(t)})}function jC(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...K(t)})}function PC(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...K(t)})}function TC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...K(t)})}function HC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...K(t)})}function GC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...K(t)})}function UC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...K(t)})}function Cf(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...K(t)})}function OC(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...K(t)})}function qC(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...K(t)})}function zC(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...K(t)})}function KC(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...K(t)})}function YC(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...K(t)})}function JC(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...K(t)})}function WC(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...K(t)})}function ZC(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...K(t)})}function VC(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...K(t)})}function t1(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...K(t)})}function XC(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...K(t)})}function ew(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...K(t)})}function tw(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...K(t)})}function nw(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...K(t)})}function aw(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...K(t)})}function n1(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...K(t)})}function rw(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...K(t)})}var a1={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function wf(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...K(t)})}function Ef(e,t){return new e({type:"string",format:"date",check:"string_format",...K(t)})}function kf(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...K(t)})}function Qf(e,t){return new e({type:"string",format:"duration",check:"string_format",...K(t)})}function r1(e,t){return new e({type:"number",checks:[],...K(t)})}function o1(e,t){return new e({type:"number",coerce:!0,checks:[],...K(t)})}function i1(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...K(t)})}function A1(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...K(t)})}function s1(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...K(t)})}function c1(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...K(t)})}function u1(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...K(t)})}function d1(e,t){return new e({type:"boolean",...K(t)})}function l1(e,t){return new e({type:"boolean",coerce:!0,...K(t)})}function p1(e,t){return new e({type:"bigint",...K(t)})}function g1(e,t){return new e({type:"bigint",coerce:!0,...K(t)})}function m1(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...K(t)})}function f1(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...K(t)})}function b1(e,t){return new e({type:"symbol",...K(t)})}function h1(e,t){return new e({type:"undefined",...K(t)})}function B1(e,t){return new e({type:"null",...K(t)})}function y1(e){return new e({type:"any"})}function C1(e){return new e({type:"unknown"})}function w1(e,t){return new e({type:"never",...K(t)})}function E1(e,t){return new e({type:"void",...K(t)})}function k1(e,t){return new e({type:"date",...K(t)})}function Q1(e,t){return new e({type:"date",coerce:!0,...K(t)})}function I1(e,t){return new e({type:"nan",...K(t)})}function lA(e,t){return new AC({check:"less_than",...K(t),value:e,inclusive:!1})}function go(e,t){return new AC({check:"less_than",...K(t),value:e,inclusive:!0})}function pA(e,t){return new sC({check:"greater_than",...K(t),value:e,inclusive:!1})}function mo(e,t){return new sC({check:"greater_than",...K(t),value:e,inclusive:!0})}function ow(e){return pA(0,e)}function iw(e){return lA(0,e)}function Aw(e){return go(0,e)}function sw(e){return mo(0,e)}function wc(e,t){return new lx({check:"multiple_of",...K(t),value:e})}function Ec(e,t){return new mx({check:"max_size",...K(t),maximum:e})}function gA(e,t){return new fx({check:"min_size",...K(t),minimum:e})}function Ou(e,t){return new bx({check:"size_equals",...K(t),size:e})}function qu(e,t){return new hx({check:"max_length",...K(t),maximum:e})}function fs(e,t){return new Bx({check:"min_length",...K(t),minimum:e})}function zu(e,t){return new yx({check:"length_equals",...K(t),length:e})}function ip(e,t){return new Cx({check:"string_format",format:"regex",...K(t),pattern:e})}function Ap(e){return new wx({check:"string_format",format:"lowercase",...K(e)})}function sp(e){return new Ex({check:"string_format",format:"uppercase",...K(e)})}function cp(e,t){return new kx({check:"string_format",format:"includes",...K(t),includes:e})}function up(e,t){return new Qx({check:"string_format",format:"starts_with",...K(t),prefix:e})}function dp(e,t){return new Ix({check:"string_format",format:"ends_with",...K(t),suffix:e})}function cw(e,t,n){return new cC({check:"property",property:e,schema:t,...K(n)})}function uw(e){return Object.entries(e).map(([t,n])=>new cC({check:"property",property:t,schema:n}))}function lp(e,t){return new vx({check:"mime_type",mime:e,...K(t)})}function Ci(e){return new _x({check:"overwrite",tx:e})}function pp(e){return Ci(t=>t.normalize(e))}function gp(){return Ci(e=>e.trim())}function mp(){return Ci(e=>e.toLowerCase())}function fp(){return Ci(e=>e.toUpperCase())}function bp(){return Ci(e=>l_(e))}function v1(e,t,n){return new e({type:"array",element:t,...K(n)})}function Pue(e,t,n){return new e({type:"union",options:t,...K(n)})}function Tue(e,t,n){return new e({type:"union",options:t,inclusive:!1,...K(n)})}function Hue(e,t,n,r){return new e({type:"union",options:n,discriminator:t,...K(r)})}function Gue(e,t,n){return new e({type:"intersection",left:t,right:n})}function Uue(e,t,n,r){let a=n instanceof we,o=a?r:n,i=a?n:null;return new e({type:"tuple",items:t,rest:i,...K(o)})}function Oue(e,t,n,r){return new e({type:"record",keyType:t,valueType:n,...K(r)})}function que(e,t,n,r){return new e({type:"map",keyType:t,valueType:n,...K(r)})}function zue(e,t,n){return new e({type:"set",valueType:t,...K(n)})}function Kue(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 Yue(e,t,n){return new e({type:"enum",entries:t,...K(n)})}function Jue(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...K(n)})}function _1(e,t){return new e({type:"file",...K(t)})}function Wue(e,t){return new e({type:"transform",transform:t})}function Zue(e,t){return new e({type:"optional",innerType:t})}function Vue(e,t){return new e({type:"nullable",innerType:t})}function Xue(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():tf(n)}})}function ede(e,t,n){return new e({type:"nonoptional",innerType:t,...K(n)})}function tde(e,t){return new e({type:"success",innerType:t})}function nde(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:C_(n)})}function ade(e,t,n){return new e({type:"pipe",in:t,out:n})}function rde(e,t){return new e({type:"readonly",innerType:t})}function ode(e,t,n){return new e({type:"template_literal",parts:t,...K(n)})}function ide(e,t){return new e({type:"lazy",getter:t})}function Ade(e,t){return new e({type:"promise",innerType:t})}function x1(e,t,n){let r=K(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function D1(e,t,n){return new e({type:"custom",check:"custom",fn:t,...K(n)})}function F1(e,t){let n=qP(r=>(r.addIssue=a=>{if(typeof a=="string")r.issues.push(Vl(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(Vl(o))}},e(r.value,r)),t);return n}function qP(e,t){let n=new Nt({check:"custom",...K(t)});return n._zod.check=e,n}function S1(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 L1(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 N1(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(p=>typeof p=="string"?p.toLowerCase():p),a=a.map(p=>typeof p=="string"?p.toLowerCase():p));let o=new Set(r),i=new Set(a),A=e.Codec??ff,s=e.Boolean??gf,u=e.String??Pu,d=new u({type:"string",error:n.error}),l=new s({type:"boolean",error:n.error}),g=new A({type:"pipe",in:d,out:l,transform:((p,m)=>{let h=p;return n.case!=="sensitive"&&(h=h.toLowerCase()),o.has(h)?!0:i.has(h)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...i],input:m.value,inst:g,continue:!1}),{})}),reverseTransform:((p,m)=>p===!0?r[0]||"true":a[0]||"false"),error:n.error});return g._zod.bag.truthy=r,g._zod.bag.falsy=a,g._zod.bag.case=n.case??"insensitive",g}function hp(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 If(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 g=i.schema,p=t.processors[a.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);p(e,t,g,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&&If(i.schema,s),t.io==="input"&&gr(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 zP(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,g=e.external.uri??(m=>m);if(l)return{ref:g(l)};let p=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=p,{defId:p,ref:`${g("__shared")}#/${A}/${zP(p)}`}}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+zP(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 JP(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;JP(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 WP=new Set(["type","properties","required","additionalProperties"]),KP=["oneOf","anyOf"];function YP(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function R1(e){let t=[];for(let o of e){if(typeof o!="object"||o.type!=="object")return null;for(let i in o)if(!WP.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]??YP(u);d!=null&&(A.some(l=>JSON.stringify(l)===JSON.stringify(d))||A.push(d))}let s=A.length===1?A[0]:R1(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=YP(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 sde(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let a of WP)if(a in e)return;let n=t.filter(a=>KP.some(o=>Array.isArray(a[o]))),r=null;if(!n.length)r=R1(t);else{let a=n[0],o=KP.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=>R1([...i,s]));if(A.some(s=>!s))return;r={[o]:A}}r&&(delete e.allOf,If(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 p=e.seen.get(l),m=p.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)):If(u,m),If(u,d),A._zod.parent===l)for(let B in u)B==="$ref"||B==="allOf"||B in d||delete u[B];if(m.$ref&&p.def)for(let B in u)B==="$ref"||B==="allOf"||B in p.def&&JSON.stringify(u[B])===JSON.stringify(p.def[B])&&delete u[B]}let g=A._zod.parent;if(g&&g!==l){r(g);let p=e.seen.get(g);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(let m in u)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(u[m])===JSON.stringify(p.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())JP(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)??[])sde(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)}If(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:Bp(t,"input",e.processors),output:Bp(t,"output",e.processors)}},enumerable:!1,writable:!1}),A}catch{throw new Error("Error converting schema to JSON.")}}function gr(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 gr(r.element,n);if(r.type==="set")return gr(r.valueType,n);if(r.type==="lazy")return gr(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 gr(r.innerType,n);if(r.type==="intersection")return gr(r.left,n)||gr(r.right,n);if(r.type==="record"||r.type==="map")return gr(r.keyType,n)||gr(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:gr(r.in,n)||gr(r.out,n);if(r.type==="object"){for(let a in r.shape)if(gr(r.shape[a],n))return!0;return!1}if(r.type==="union"){for(let a of r.options)if(gr(a,n))return!0;return!1}if(r.type==="tuple"){for(let a of r.items)if(gr(a,n))return!0;return!!(r.rest&&gr(r.rest,n))}return!1}var $1=(e,t={})=>n=>{let r=kc({...n,processors:t});return ht(e,r),Qc(r,e),Ic(r,e)},Bp=(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 cde={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},P1=(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=cde[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(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},T1=(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),g=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";l?p?(a.minimum=d,a.exclusiveMinimum=!0):a.exclusiveMinimum=d:typeof o=="number"&&(a.minimum=o),g?p?(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`))},H1=(e,t,n,r)=>{n.type="boolean"},G1=(e,t,n,r)=>{ta(e,t,n,r,"BigInt cannot be represented in JSON Schema")},U1=(e,t,n,r)=>{ta(e,t,n,r,"Symbols cannot be represented in JSON Schema")},O1=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},q1=(e,t,n,r)=>{ta(e,t,n,r,"Undefined cannot be represented in JSON Schema")},z1=(e,t,n,r)=>{ta(e,t,n,r,"Void cannot be represented in JSON Schema")},K1=(e,t,n,r)=>{n.not={}},Y1=(e,t,n,r)=>{},J1=(e,t,n,r)=>{},W1=(e,t,n,r)=>{ta(e,t,n,r,"Date cannot be represented in JSON Schema")},Z1=(e,t,n,r)=>{let a=e._zod.def,o=Vm(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},V1=(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},X1=(e,t,n,r)=>{ta(e,t,n,r,"NaN cannot be represented in JSON Schema")},eF=(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},tF=(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)},nF=(e,t,n,r)=>{n.type="boolean"},aF=(e,t,n,r)=>{ta(e,t,n,r,"Custom types cannot be represented in JSON Schema")},rF=(e,t,n,r)=>{ta(e,t,n,r,"Function types cannot be represented in JSON Schema")},oF=(e,t,n,r)=>{ta(e,t,n,r,"Transforms cannot be represented in JSON Schema")},iF=(e,t,n,r)=>{ta(e,t,n,r,"Map cannot be represented in JSON Schema")},AF=(e,t,n,r)=>{ta(e,t,n,r,"Set cannot be represented in JSON Schema")},sF=(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 vf(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?vf(t.out):t.type==="catch"?vf(t.innerType):e._zod.optin}var cF=(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"?vf(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)},lw=(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},uF=(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)},dF=(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((h,B)=>ht(h,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 h=o.items[d-1];if(!(t.io==="input"?vf(h)!==void 0:h._zod.optout==="optional"))break;d--}let l=o.items.length,g=!o.rest;t.target==="draft-2020-12"?(a.prefixItems=s,g?a.items=!1:u&&(a.items=u),d>0&&(a.minItems=d),g&&(a.maxItems=l)):t.target==="openapi-3.0"?(a.items={anyOf:s},u&&a.items.anyOf.push(u),d>0&&(a.minItems=d),g&&(a.maxItems=l)):(a.items=s,g?a.additionalItems=!1:u&&(a.additionalItems=u),d>0&&(a.minItems=d),g&&(a.maxItems=l));let{minimum:p,maximum:m}=e._zod.bag;typeof p=="number"&&(a.minItems=p),typeof m=="number"&&(a.maxItems=m)};function M1(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 h=M1(e,m,n);return h===m?t:h}for(let m of["anyOf","oneOf"]){let h=t[m];if(!Array.isArray(h))continue;let B=h.map(b=>M1(e,b,n));B.some((b,f)=>b!==h[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:g,...p}=t;return p.enum?p.enum=p.enum.map(m=>typeof m=="number"?String(m):m):typeof p.const=="number"&&(p.const=String(p.const)),a&&(p.type="string",o||(p.pattern=(r.includes("number")?Cc:cf).source)),p}var j1=new WeakMap;function ude(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 j1.get(e)??[]){let a=e.seen.get(r),o=(a?.def??a?.schema)?.propertyNames;if(!o||o===!0||n.has(o))continue;let i=M1(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 lF=(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 g of s)sn(a.patternProperties,g.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=j1.get(t);l||(l=[],j1.set(t,l),t.deferred.push(()=>ude(t))),l.push(e)}a.additionalProperties=ht(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let u=i._zod.values,d=t.io==="input"&&vf(o.valueType)!==void 0;if(u&&!o.partial&&!d){let l=[...u].filter(g=>typeof g=="string"||typeof g=="number");l.length>0&&(a.required=l.map(String))}},pF=(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"}]},gF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},mF=Symbol();function ZP(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"),mF):JSON.parse(i)}var fF=(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=ZP(a.defaultValue,e,t,n,r);i!==mF&&(n.default=i)},bF=(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=ZP(a.defaultValue,e,t,n,r);i!==mF&&(n._prefault=i)},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;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},BF=(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},yF=(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},CF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},pw=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},wF=(e,t,n,r)=>{let a=e._zod.innerType;ht(a,t,r);let o=t.seen.get(e);o.ref=a},dw={string:P1,number:T1,boolean:H1,bigint:G1,symbol:U1,null:O1,undefined:q1,void:z1,never:K1,any:Y1,unknown:J1,date:W1,enum:Z1,literal:V1,nan:X1,template_literal:eF,file:tF,success:nF,custom:aF,function:rF,transform:oF,map:iF,set:AF,array:sF,object:cF,union:lw,intersection:uF,tuple:dF,record:lF,nullable:pF,nonoptional:gF,default:fF,prefault:bF,catch:hF,pipe:BF,readonly:yF,promise:CF,optional:pw,lazy:wF};function gw(e,t){if("_idmap"in e){let r=e,a=kc({...t,processors:dw}),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:dw});return ht(e,n),Qc(n,e),Ic(n,e)}var mw=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:dw,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 VP={};var _p={};L(_p,{ZodAny:()=>UF,ZodArray:()=>KF,ZodBase64:()=>Nw,ZodBase64URL:()=>Rw,ZodBigInt:()=>Ip,ZodBigIntFormat:()=>jw,ZodBoolean:()=>Qp,ZodCIDRv4:()=>Sw,ZodCIDRv6:()=>Lw,ZodCUID:()=>Qw,ZodCUID2:()=>Iw,ZodCatch:()=>g8,ZodCodec:()=>Mf,ZodCreditCard:()=>$F,ZodCustom:()=>jf,ZodCustomStringFormat:()=>Ep,ZodDate:()=>Ff,ZodDefault:()=>s8,ZodDiscriminatedUnion:()=>JF,ZodE164:()=>$w,ZodEmail:()=>Cw,ZodEmoji:()=>Ew,ZodEnum:()=>Cp,ZodExactOptional:()=>Gw,ZodFile:()=>r8,ZodFunction:()=>k8,ZodGUID:()=>ww,ZodIPv4:()=>Dw,ZodIPv6:()=>Fw,ZodISODate:()=>_c,ZodISODateTime:()=>vc,ZodISODuration:()=>Dc,ZodISOTime:()=>xc,ZodIntersection:()=>WF,ZodJWT:()=>Mw,ZodKSUID:()=>xw,ZodLazy:()=>C8,ZodLiteral:()=>a8,ZodMAC:()=>RF,ZodMap:()=>t8,ZodNaN:()=>f8,ZodNanoID:()=>kw,ZodNever:()=>qF,ZodNonOptional:()=>Uw,ZodNull:()=>HF,ZodNullable:()=>A8,ZodNumber:()=>kp,ZodNumberFormat:()=>Wu,ZodObject:()=>Lf,ZodOptional:()=>Rf,ZodPipe:()=>$f,ZodPrefault:()=>u8,ZodPreprocess:()=>b8,ZodPromise:()=>E8,ZodReadonly:()=>h8,ZodRecord:()=>yp,ZodSet:()=>n8,ZodString:()=>wp,ZodStringFormat:()=>Dt,ZodSuccess:()=>p8,ZodSymbol:()=>PF,ZodTemplateLiteral:()=>y8,ZodTransform:()=>o8,ZodTuple:()=>VF,ZodType:()=>xe,ZodULID:()=>vw,ZodURL:()=>Df,ZodUUID:()=>mA,ZodUndefined:()=>TF,ZodUnion:()=>Nf,ZodUnknown:()=>OF,ZodVoid:()=>zF,ZodXID:()=>_w,ZodXor:()=>YF,_ZodString:()=>yw,_default:()=>c8,_function:()=>sH,any:()=>PT,array:()=>Sf,base64:()=>CT,base64url:()=>wT,bigint:()=>NT,boolean:()=>jF,catch:()=>m8,check:()=>cH,cidrv4:()=>BT,cidrv6:()=>yT,codec:()=>rH,creditCard:()=>kT,cuid:()=>dT,cuid2:()=>lT,custom:()=>uH,date:()=>HT,describe:()=>dH,discriminatedUnion:()=>KT,e164:()=>ET,email:()=>tT,emoji:()=>cT,enum:()=>Tw,exactOptional:()=>i8,file:()=>eH,float32:()=>DT,float64:()=>FT,function:()=>sH,guid:()=>nT,hash:()=>xT,hex:()=>_T,hostname:()=>vT,httpUrl:()=>sT,instanceof:()=>pH,int:()=>hw,int32:()=>ST,int64:()=>RT,intersection:()=>ZF,invertCodec:()=>oH,ipv4:()=>fT,ipv6:()=>hT,json:()=>mH,jwt:()=>QT,keyof:()=>GT,ksuid:()=>mT,lazy:()=>w8,literal:()=>XT,looseObject:()=>qT,looseRecord:()=>JT,mac:()=>bT,map:()=>WT,meta:()=>lH,nan:()=>aH,nanoid:()=>uT,nativeEnum:()=>VT,never:()=>Pw,nonoptional:()=>l8,null:()=>GF,nullable:()=>xf,nullish:()=>tH,number:()=>MF,object:()=>UT,optional:()=>Yu,partialRecord:()=>YT,pipe:()=>Bw,prefault:()=>d8,preprocess:()=>fH,promise:()=>AH,readonly:()=>B8,record:()=>e8,refine:()=>Q8,set:()=>ZT,strictObject:()=>OT,string:()=>_f,stringFormat:()=>IT,stringbool:()=>gH,success:()=>nH,superRefine:()=>I8,symbol:()=>MT,templateLiteral:()=>iH,transform:()=>Hw,tuple:()=>XF,uint32:()=>LT,uint64:()=>$T,ulid:()=>pT,undefined:()=>jT,union:()=>vp,unknown:()=>Ku,url:()=>AT,uuid:()=>aT,uuidv4:()=>rT,uuidv6:()=>oT,uuidv7:()=>iT,void:()=>TT,xid:()=>gT,xor:()=>zT});var fw={};L(fw,{endsWith:()=>dp,gt:()=>pA,gte:()=>mo,includes:()=>cp,length:()=>zu,lowercase:()=>Ap,lt:()=>lA,lte:()=>go,maxLength:()=>qu,maxSize:()=>Ec,mime:()=>lp,minLength:()=>fs,minSize:()=>gA,multipleOf:()=>wc,negative:()=>iw,nonnegative:()=>sw,nonpositive:()=>Aw,normalize:()=>pp,overwrite:()=>Ci,positive:()=>ow,properties:()=>uw,property:()=>cw,regex:()=>ip,size:()=>Ou,slugify:()=>bp,startsWith:()=>up,toLowerCase:()=>mp,toUpperCase:()=>fp,trim:()=>gp,uppercase:()=>sp});var XP=new WeakSet([Object.prototype,Error.prototype]);function bw(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 eT=(e,t)=>{of.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);XP.has(n)||(XP.add(n),bw(n,"format",r=>a=>sf(r,a)),bw(n,"flatten",r=>a=>Af(r,a)),bw(n,"addIssue",r=>a=>{r.issues.push(a),r.message=JSON.stringify(r.issues,Wl,2)}),bw(n,"addIssues",r=>a=>{r.issues.push(...a),r.message=JSON.stringify(r.issues,Wl,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},lde=_("ZodError",eT),Ur=_("ZodError",eT,void 0,{Parent:Error});var EF=Xl(Ur),kF=ep(Ur),QF=tp(Ur),IF=np(Ur),vF=Wy(Ur),_F=Zy(Ur),xF=Vy(Ur),DF=Xy(Ur),FF=eC(Ur),SF=tC(Ur),LF=nC(Ur),NF=aC(Ur);function gde(){ha.localeError||hn(SC())}function Ju(){ha.memoizer||hn({memoizer:hf()})}var xe=_("ZodType",(e,t)=>(gde(),we.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(Q8(e,t))},superRefine(e,t){return this.check(I8(e,t))},overwrite(e){return this.check(Ci(e))},optional(){return Yu(this)},exactOptional(){return i8(this)},nullable(){return xf(this)},nullish(){return Yu(xf(this))},nonoptional(e){return l8(this,e)},array(){return Sf(this)},or(e){return vp([this,e])},and(e){return ZF(this,e)},transform(e){return Bw(this,Hw(e))},default(e){return c8(this,e)},prefault(e){return d8(this,e)},catch(e){return m8(this,e)},pipe(e){return Bw(this,e)},readonly(){return B8(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",{...gC(this),jsonSchema:{input:Bp(this,"input"),output:Bp(this,"output")}})},set"~standard"(e){G.own(this,"~standard",e)},parse:function e(t,n){return EF(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await kF(this,t,n,{callee:e})},safeParse(e,t){return QF(this,e,t)},async safeParseAsync(e,t){return IF(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){G.own(this,"spa",e)},encode:function e(t,n){return vF(this,t,n,{callee:e})},decode:function e(t,n){return _F(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await xF(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await DF(this,t,n,{callee:e})},safeEncode(e,t){return FF(this,e,t)},safeDecode(e,t){return SF(this,e,t)},async safeEncodeAsync(e,t){return LF(this,e,t)},async safeDecodeAsync(e,t){return NF(this,e,t)},toJSONSchema(e){return $1(this,{})(e)},get description(){return La.get(this)?.description},get _def(){return this._zod.def}}),yw=_("_ZodString",(e,t)=>{Pu.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>P1(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(ip(...e))},includes(...e){return this.check(cp(...e))},startsWith(...e){return this.check(up(...e))},endsWith(...e){return this.check(dp(...e))},min(...e){return this.check(fs(...e))},max(...e){return this.check(qu(...e))},length(...e){return this.check(zu(...e))},nonempty(...e){return this.check(fs(1,...e))},lowercase(e){return this.check(Ap(e))},uppercase(e){return this.check(sp(e))},trim(){return this.check(gp())},normalize(...e){return this.check(pp(...e))},toLowerCase(){return this.check(mp())},toUpperCase(){return this.check(fp())},slugify(){return this.check(bp())}}),wp=_("ZodString",(e,t)=>{Pu.init(e,t),yw.init(e,t)},{email(e){return this.check(jC(Cw,e))},url(e){return this.check(Cf(Df,e))},jwt(e){return this.check(rw(Mw,e))},emoji(e){return this.check(OC(Ew,e))},guid(e){return this.check(PC(ww,e))},uuid(e){return this.check(TC(mA,e))},uuidv4(e){return this.check(HC(mA,e))},uuidv6(e){return this.check(GC(mA,e))},uuidv7(e){return this.check(UC(mA,e))},nanoid(e){return this.check(qC(kw,e))},cuid(e){return this.check(zC(Qw,e))},cuid2(e){return this.check(KC(Iw,e))},ulid(e){return this.check(YC(vw,e))},base64(e){return this.check(tw(Nw,e))},base64url(e){return this.check(nw(Rw,e))},xid(e){return this.check(JC(_w,e))},ksuid(e){return this.check(WC(xw,e))},ipv4(e){return this.check(ZC(Dw,e))},ipv6(e){return this.check(VC(Fw,e))},cidrv4(e){return this.check(XC(Sw,e))},cidrv6(e){return this.check(ew(Lw,e))},e164(e){return this.check(aw($w,e))},datetime(e){return this.check(wf(vc,e))},date(e){return this.check(Ef(_c,e))},time(e){return this.check(kf(xc,e))},duration(e){return this.check(Qf(Dc,e))}});function _f(e){return XD(wp,e)}var Dt=_("ZodStringFormat",(e,t)=>{wt.init(e,t),yw.init(e,t)}),vc=_("ZodISODateTime",(e,t)=>{Ox.init(e,t),Dt.init(e,t)}),_c=_("ZodISODate",(e,t)=>{qx.init(e,t),Dt.init(e,t)}),xc=_("ZodISOTime",(e,t)=>{zx.init(e,t),Dt.init(e,t)}),Dc=_("ZodISODuration",(e,t)=>{Kx.init(e,t),Dt.init(e,t)}),Cw=_("ZodEmail",(e,t)=>{Lx.init(e,t),Dt.init(e,t)});function tT(e){return jC(Cw,e)}var ww=_("ZodGUID",(e,t)=>{Fx.init(e,t),Dt.init(e,t)});function nT(e){return PC(ww,e)}var mA=_("ZodUUID",(e,t)=>{Sx.init(e,t),Dt.init(e,t)});function aT(e){return TC(mA,e)}function rT(e){return HC(mA,e)}function oT(e){return GC(mA,e)}function iT(e){return UC(mA,e)}var Df=_("ZodURL",(e,t)=>{$x.init(e,t),Dt.init(e,t)});function AT(e){return Cf(Df,e)}function sT(e){return Cf(Df,{protocol:lr.httpProtocol,hostname:lr.domain,...G.normalizeParams(e)})}var Ew=_("ZodEmoji",(e,t)=>{Mx.init(e,t),Dt.init(e,t)});function cT(e){return OC(Ew,e)}var kw=_("ZodNanoID",(e,t)=>{jx.init(e,t),Dt.init(e,t)});function uT(e){return qC(kw,e)}var Qw=_("ZodCUID",(e,t)=>{Px.init(e,t),Dt.init(e,t)});function dT(e){return zC(Qw,e)}var Iw=_("ZodCUID2",(e,t)=>{Tx.init(e,t),Dt.init(e,t)});function lT(e){return KC(Iw,e)}var vw=_("ZodULID",(e,t)=>{Hx.init(e,t),Dt.init(e,t)});function pT(e){return YC(vw,e)}var _w=_("ZodXID",(e,t)=>{Gx.init(e,t),Dt.init(e,t)});function gT(e){return JC(_w,e)}var xw=_("ZodKSUID",(e,t)=>{Ux.init(e,t),Dt.init(e,t)});function mT(e){return WC(xw,e)}var Dw=_("ZodIPv4",(e,t)=>{Yx.init(e,t),Dt.init(e,t)});function fT(e){return ZC(Dw,e)}var RF=_("ZodMAC",(e,t)=>{Wx.init(e,t),Dt.init(e,t)});function bT(e){return t1(RF,e)}var Fw=_("ZodIPv6",(e,t)=>{Jx.init(e,t),Dt.init(e,t)});function hT(e){return VC(Fw,e)}var Sw=_("ZodCIDRv4",(e,t)=>{Zx.init(e,t),Dt.init(e,t)});function BT(e){return XC(Sw,e)}var Lw=_("ZodCIDRv6",(e,t)=>{Vx.init(e,t),Dt.init(e,t)});function yT(e){return ew(Lw,e)}var Nw=_("ZodBase64",(e,t)=>{Xx.init(e,t),Dt.init(e,t)});function CT(e){return tw(Nw,e)}var Rw=_("ZodBase64URL",(e,t)=>{eD.init(e,t),Dt.init(e,t)});function wT(e){return nw(Rw,e)}var $w=_("ZodE164",(e,t)=>{tD.init(e,t),Dt.init(e,t)});function ET(e){return aw($w,e)}var $F=_("ZodCreditCard",(e,t)=>{nD.init(e,t),Dt.init(e,t)});function kT(e){return n1($F,e)}var Mw=_("ZodJWT",(e,t)=>{aD.init(e,t),Dt.init(e,t)});function QT(e){return rw(Mw,e)}var Ep=_("ZodCustomStringFormat",(e,t)=>{rD.init(e,t),Dt.init(e,t)});function IT(e,t,n={}){return hp(Ep,e,t,n)}function vT(e){return hp(Ep,"hostname",lr.hostname,e)}function _T(e){return hp(Ep,"hex",lr.hex,e)}function xT(e,t){let n=t?.enc??"hex",r=`${e}_${n}`,a=lr[r];if(!a)throw new Error(`Unrecognized hash format: ${r}`);return hp(Ep,r,a,t)}var kp=_("ZodNumber",(e,t)=>{EC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>T1(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(hw(e))},safe(e){return this.check(hw(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 MF(e){return r1(kp,e)}var Wu=_("ZodNumberFormat",(e,t)=>{oD.init(e,t),kp.init(e,t)});function hw(e){return i1(Wu,e)}function DT(e){return A1(Wu,e)}function FT(e){return s1(Wu,e)}function ST(e){return c1(Wu,e)}function LT(e){return u1(Wu,e)}var Qp=_("ZodBoolean",(e,t)=>{gf.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>H1(e,n,r,a)});function jF(e){return d1(Qp,e)}var Ip=_("ZodBigInt",(e,t)=>{kC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>G1(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 NT(e){return p1(Ip,e)}var jw=_("ZodBigIntFormat",(e,t)=>{iD.init(e,t),Ip.init(e,t)});function RT(e){return m1(jw,e)}function $T(e){return f1(jw,e)}var PF=_("ZodSymbol",(e,t)=>{AD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>U1(e,n,r,a)});function MT(e){return b1(PF,e)}var TF=_("ZodUndefined",(e,t)=>{sD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>q1(e,n,r,a)});function jT(e){return h1(TF,e)}var HF=_("ZodNull",(e,t)=>{cD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>O1(e,n,r,a)});function GF(e){return B1(HF,e)}var UF=_("ZodAny",(e,t)=>{uD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>Y1(e,n,r,a)});function PT(){return y1(UF)}var OF=_("ZodUnknown",(e,t)=>{dD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>J1(e,n,r,a)});function Ku(){return C1(OF)}var qF=_("ZodNever",(e,t)=>{lD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>K1(e,n,r,a)});function Pw(e){return w1(qF,e)}var zF=_("ZodVoid",(e,t)=>{pD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>z1(e,n,r,a)});function TT(e){return E1(zF,e)}var Ff=_("ZodDate",(e,t)=>{gD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>W1(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 HT(e){return k1(Ff,e)}var KF=_("ZodArray",(e,t)=>{Ju(),mD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>sF(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(qu(e,t))},length(e,t){return this.check(zu(e,t))},unwrap(){return this.element}});function Sf(e,t){return v1(KF,e,t)}function GT(e){let t=e._zod.def.shape;return Tw(Object.keys(t))}var Lf=_("ZodObject",(e,t)=>{Ju(),fD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>cF(e,n,r,a),G.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Tw(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Ku()})},loose(){return this.clone({...this._zod.def,catchall:Ku()})},strict(){return this.clone({...this._zod.def,catchall:Pw()})},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(Rf,this,e[0])},exactPartial(...e){return G.partial(Gw,this,e[0],"exactPartial")},required(...e){return G.required(Uw,this,e[0])}});function UT(e,t){let n={type:"object",shape:e??{},...G.normalizeParams(t)};return new Lf(n)}function OT(e,t){return new Lf({type:"object",shape:e,catchall:Pw(),...G.normalizeParams(t)})}function qT(e,t){return new Lf({type:"object",shape:e,catchall:Ku(),...G.normalizeParams(t)})}var Nf=_("ZodUnion",(e,t)=>{mf.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>lw(e,n,r,a),e.options=t.options});function vp(e,t){return new Nf({type:"union",options:e,...G.normalizeParams(t)})}var YF=_("ZodXor",(e,t)=>{Nf.init(e,t),bD.init(e,t),e._zod.processJSONSchema=(n,r,a)=>lw(e,n,r,a),e.options=t.options});function zT(e,t){return new YF({type:"union",options:e,inclusive:!1,...G.normalizeParams(t)})}var JF=_("ZodDiscriminatedUnion",(e,t)=>{Nf.init(e,t),BD.init(e,t)});function KT(e,t,n){return new JF({type:"union",options:t,discriminator:e,...G.normalizeParams(n)})}var WF=_("ZodIntersection",(e,t)=>{yD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>uF(e,n,r,a)});function ZF(e,t){return new WF({type:"intersection",left:e,right:t})}var VF=_("ZodTuple",(e,t)=>{Ju(),QC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>dF(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 Rf({type:"optional",innerType:t}))})}});function XF(e,t,n){let r=t instanceof we,a=r?n:t,o=r?t:null;return new VF({type:"tuple",items:e,rest:o,...G.normalizeParams(a)})}var yp=_("ZodRecord",(e,t)=>{Ju(),CD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>lF(e,n,r,a),e.keyType=t.keyType,e.valueType=t.valueType});function e8(e,t,n){return!t||!t._zod?new yp({type:"record",keyType:_f(),valueType:e,...G.normalizeParams(t)}):new yp({type:"record",keyType:e,valueType:t,...G.normalizeParams(n)})}function YT(e,t,n){return new yp({type:"record",keyType:e,valueType:t,...G.normalizeParams(n),partial:!0})}function JT(e,t,n){return new yp({type:"record",keyType:e,valueType:t,mode:"loose",...G.normalizeParams(n)})}var t8=_("ZodMap",(e,t)=>{Ju(),wD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>iF(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(Ou(...n))});function WT(e,t,n){return new t8({type:"map",keyType:e,valueType:t,...G.normalizeParams(n)})}var n8=_("ZodSet",(e,t)=>{Ju(),ED.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>AF(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(Ou(...n))});function ZT(e,t){return new n8({type:"set",valueType:e,...G.normalizeParams(t)})}var Cp=_("ZodEnum",(e,t)=>{kD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>Z1(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 Cp({...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 Cp({...t,checks:[],...G.normalizeParams(a),entries:o})}});function Tw(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Cp({type:"enum",entries:n,...G.normalizeParams(t)})}function VT(e,t){return new Cp({type:"enum",entries:e,...G.normalizeParams(t)})}var a8=_("ZodLiteral",(e,t)=>{QD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>V1(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 XT(e,t){return new a8({type:"literal",values:Array.isArray(e)?e:[e],...G.normalizeParams(t)})}var r8=_("ZodFile",(e,t)=>{ID.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>tF(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(lp(Array.isArray(n)?n:[n],r))});function eH(e){return _1(r8,e)}var o8=_("ZodTransform",(e,t)=>{Ju(),vD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>oF(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 Hw(e){return new o8({type:"transform",transform:e})}var Rf=_("ZodOptional",(e,t)=>{IC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>pw(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function Yu(e){return new Rf({type:"optional",innerType:e})}var Gw=_("ZodExactOptional",(e,t)=>{_D.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>pw(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function i8(e){return new Gw({type:"optional",innerType:e})}var A8=_("ZodNullable",(e,t)=>{xD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>pF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function xf(e){return new A8({type:"nullable",innerType:e})}function tH(e){return Yu(xf(e))}var s8=_("ZodDefault",(e,t)=>{DD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>fF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function c8(e,t){return new s8({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var u8=_("ZodPrefault",(e,t)=>{FD.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 d8(e,t){return new u8({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var Uw=_("ZodNonOptional",(e,t)=>{SD.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 l8(e,t){return new Uw({type:"nonoptional",innerType:e,...G.normalizeParams(t)})}var p8=_("ZodSuccess",(e,t)=>{LD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>nF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function nH(e){return new p8({type:"success",innerType:e})}var g8=_("ZodCatch",(e,t)=>{ND.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>hF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function m8(e,t){return new g8({type:"catch",innerType:e,catchValue:typeof t=="function"?t:G.constantCatch(t)})}var f8=_("ZodNaN",(e,t)=>{RD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>X1(e,n,r,a)});function aH(e){return I1(f8,e)}var $f=_("ZodPipe",(e,t)=>{vC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>BF(e,n,r,a),e.in=t.in,e.out=t.out});function Bw(e,t){return new $f({type:"pipe",in:e,out:t})}var Mf=_("ZodCodec",(e,t)=>{$f.init(e,t),ff.init(e,t)});function rH(e,t,n){return new Mf({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function oH(e){let t=e._zod.def;return new Mf({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var b8=_("ZodPreprocess",(e,t)=>{$f.init(e,t),$D.init(e,t)}),h8=_("ZodReadonly",(e,t)=>{MD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>yF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function B8(e){return new h8({type:"readonly",innerType:e})}var y8=_("ZodTemplateLiteral",(e,t)=>{jD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>eF(e,n,r,a)});function iH(e,t){return new y8({type:"template_literal",parts:e,...G.normalizeParams(t)})}var C8=_("ZodLazy",(e,t)=>{bf.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>wF(e,n,r,a),e.unwrap=()=>e._zod.def.getter()});function w8(e){return new C8({type:"lazy",getter:e})}var E8=_("ZodPromise",(e,t)=>{TD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>CF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function AH(e){return new E8({type:"promise",innerType:e})}var k8=_("ZodFunction",(e,t)=>{PD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>rF(e,n,r,a)});function sH(e){return new k8({type:"function",input:Array.isArray(e?.input)?XF(e?.input):e?.input??Sf(Ku()),output:e?.output??Ku()})}var jf=_("ZodCustom",(e,t)=>{HD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>aF(e,n,r,a)});function cH(e){let t=new Nt({check:"custom"});return t._zod.check=e,t}function uH(e,t){return x1(jf,e??(()=>!0),t)}function Q8(e,t={}){return D1(jf,e,t)}function I8(e,t){return F1(e,t)}var dH=S1,lH=L1;function pH(e,t={}){let n=new jf({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 gH=(...e)=>N1({Codec:Mf,Boolean:Qp,String:wp},...e);function mH(e){let t=w8(()=>vp([_f(e),MF(),jF(),GF(),Sf(t),e8(_f(),t)]));return t}function fH(e,t){return new b8({type:"pipe",in:Hw(e),out:t})}var mde={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 fde(e){hn({customError:e})}function bde(){return hn().customError}var v8;v8||(v8={});var Pf={};L(Pf,{ZodISODate:()=>_c,ZodISODateTime:()=>vc,ZodISODuration:()=>Dc,ZodISOTime:()=>xc,date:()=>Bde,datetime:()=>hde,duration:()=>Cde,time:()=>yde});function hde(e){return wf(vc,e)}function Bde(e){return Ef(_c,e)}function yde(e){return kf(xc,e)}function Cde(e){return Qf(Dc,e)}var X={..._p,...fw,iso:Pf},wde=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 Ede(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 bH(e,t){return e.map((n,r)=>r<t?n:n.optional())}function kde(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Qde(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:kde(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 Ide(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 hH(e,t){if(e!==!1)return e===void 0||e===!0?X.any():Or(e,t)}var vde=/^(?:[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=Qde(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(vde)):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 g of u){let p=Or(s[g],t),m=X.string().regex(new RegExp(g));d.push(X.looseRecord(m,p))}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 g=X.intersection(l[0],l[1]);for(let p=2;p<l.length;p++)g=X.intersection(g,l[p]);r=g}if(e.additionalProperties===!1){let g=Object.keys(a),p=u.map(h=>new RegExp(h)),m=r;r=r.check(h=>{if(!To(h.value))return;let B=[];for(let b of Object.keys(h.value))g.includes(b)||p.some(f=>f.test(b))||B.push(b);B.length&&h.issues.push({code:"unrecognized_keys",keys:B,input:h.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=Ide(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=bH(A,i),u=Array.isArray(o)?void 0:hH(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=bH(A,i),u=hH(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))wde.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 yH(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=Ede(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 CH=Symbol("z.visit/resolving");function Tf(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===CH)return new bf({type:"lazy",getter:()=>r.get(i)});if(A!==void 0)return A;r.set(i,CH);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,g={};for(let m of d){let h=a(u[m]);h!==u[m]&&(l=!0),g[m]=h}let p=A.catchall;return A.catchall&&(p=a(A.catchall),p!==A.catchall&&(l=!0)),l?bt(i,{...A,shape:g,catchall:p}):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 p of u){let m=a(p);m!==p&&(d=!0),l.push(m)}let g=A.rest;return A.rest&&(g=a(A.rest),g!==A.rest&&(d=!0)),d?bt(i,{...A,items:l,rest:g}):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 g of u){let p=a(g);p!==g&&(d=!0),l.push(p)}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 wH(e){return Tf(e,{object:t=>t.partial(),union:t=>{let n=t._zod.def;return n.discriminator===void 0?t:vp(n.options)}})}function _de(e,t){if(!t?.length)return e;let n=e._zod.def;return bt(e,Bi(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function EH(e){return _de(e.out,e.checks)}function xde(e){return e.in._zod.traits.has("$ZodTransform")?EH(e):e.in}function kH(e){return Tf(e,{pipe:t=>xde(t._zod.def),default:(t,n)=>n?Yu(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function QH(e){return Tf(e,{pipe:t=>EH(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var _8={};L(_8,{bigint:()=>Lde,boolean:()=>Sde,date:()=>Nde,number:()=>Fde,string:()=>Dde});function Dde(e){return e1(wp,e)}function Fde(e){return o1(kp,e)}function Sde(e){return l1(Qp,e)}function Lde(e){return g1(Ip,e)}function Nde(e){return Q1(Ff,e)}var IH=["none","low","medium","high","xhigh"];var Ow=c.string().regex(/^[a-z][a-z0-9_-]*$/);function Rde(e){try{let t=new URL(e).protocol;return t==="http:"||t==="https:"}catch{return!1}}var $de=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(Rde,"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(),_H=c.discriminatedUnion("kind",[$de]),Mde=c.enum(["circle-dot","circle-dashed","circle-x","git-merge","git-pull-request","triangle-alert"]),xH=c.object({icon:Mde.optional(),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256)}).strict(),Gf=c.enum(["closed","merged","open"]),D9e=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:Gf,title:c.string().min(1).optional(),updatedAt:c.date(),url:c.string().url().optional()}).strict(),S9e=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/),jde=c.enum(["activity","brain","calendar","check","database","info","key","link","sparkles","warning"]),Pde=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(),DH=c.object({details:c.array(Pde).max(100).optional(),icon:jde.optional(),preview:c.string().trim().min(1).max(500).optional(),title:c.string().trim().min(1).max(120)}).strict();var zw=c.string().regex(/^T[A-Z0-9]+$/),x8=c.string().regex(/^(C|G|D)[A-Z0-9]+$/),FH=c.string().regex(/^local:[a-z0-9_-]+:[a-z0-9][a-z0-9_-]*$/),Tde=c.string().min(1).refine(e=>e===e.trim()&&e.toLowerCase()!=="unknown"),qw=Tde,he=c.string().refine(e=>e.trim().length>0),Ja=he.refine(e=>e===e.trim()),Hde=c.object({id:he,provider:Ja}).strict(),Gde=Hde.extend({provider:c.literal("slack"),teamId:zw,channelId:x8,threadTs:Ja.optional()}).strict(),N9e=c.discriminatedUnion("provider",[Gde]),R9e=c.enum(["slack","local"]),SH=c.enum(["public","private"]),Ude=c.enum(["public","private"]),Ode=c.object({platform:c.literal("slack"),teamId:zw,channelId:x8,threadTs:Ja.optional()}).strict(),D8=Ode,qde=c.object({platform:c.literal("local"),conversationId:FH}).strict(),zde=c.discriminatedUnion("platform",[D8,qde]),LH=c.object({action:c.literal("send_message"),destination:D8}).strict(),Kde=c.object({kind:c.literal("slack"),teamId:zw,channelId:x8,visibility:SH,messageTs:he.optional(),threadTs:he.optional()}).strict(),Yde=c.object({kind:c.literal("local"),visibility:c.literal("private"),conversationId:FH}).strict(),Jde=c.object({kind:c.literal("web"),visibility:SH,conversationId:Ja}).strict(),Wde=c.object({kind:c.literal("event"),eventKey:Ja,eventType:Ja,identifier:Ja,namespace:Ja}).strict(),Zde=c.object({kind:c.literal("scheduled_automation")}).strict(),Vde=c.object({kind:c.literal("event_automation")}).strict(),Xde=c.object({kind:c.literal("plugin_dispatch")}).strict(),ele=c.object({kind:c.literal("agent_invocation")}).strict(),tle=c.discriminatedUnion("kind",[Kde,Yde,Jde,Wde,Zde,Vde,Xde,ele]);function nle(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 ale=c.preprocess(nle,tle),rle=c.discriminatedUnion("allowedWhen",[c.object({type:c.literal("user"),userId:qw,allowedWhen:c.literal("private-direct-conversation")}).strict(),c.object({type:c.literal("user"),userId:qw,allowedWhen:c.literal("scheduled-automation"),taskId:Ja}).strict()]),F8={email:he.optional(),fullName:he.optional(),userId:qw,userName:he.optional()},ole=c.object({...F8,platform:c.literal("slack"),teamId:zw}).strict(),ile=c.object({...F8,platform:c.literal("local")}).strict(),Ale=c.object({...F8,platform:c.literal("web")}).strict(),sle=c.object({platform:c.literal("system"),name:qw}).strict(),Hf=c.discriminatedUnion("platform",[ole,ile,Ale,sle]),cle=c.object({displayName:he.optional(),handle:he.optional(),id:Ja,provider:Ja,providerSubjectId:Ja,providerTenantId:Ja.optional()}).strict(),$9e=c.object({displayName:he.optional(),email:he.max(320),id:Ja,identities:c.array(cle).max(100)}).strict(),ule=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]})}}),dle=c.object({label:Ja.pipe(c.string().max(48)).refine(e=>!/[\r\n]/.test(e)),detail:Ja.pipe(c.string().max(128)).refine(e=>!/[\r\n]/.test(e)).optional()}).strict(),M9e=c.object({idempotencyKey:he.pipe(c.string().max(512)),credentialSubject:rle.optional(),destination:D8,destinationVisibility:Ude,input:he.pipe(c.string().max(32e3)),metadata:ule.optional(),replyAttribution:dle.optional()}).strict();var lle=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/),P9e=c.object({text:c.string().trim().min(1).max(8e3)}).strict(),T9e=c.object({kind:lle,version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict();var ple=4e3,gle=8e3,xp=32,vH=4e3,mle=1e3,fle=c.record(c.string(),c.unknown()).superRefine((e,t)=>{Object.keys(e).length>xp&&t.addIssue({code:"custom",message:`Event data may include at most ${xp} keys.`}),new TextEncoder().encode(JSON.stringify(e)).byteLength>vH&&t.addIssue({code:"custom",message:`Event data may be at most ${vH} JSON bytes.`})}),Zu=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."),NH=c.string().regex(/^[a-z][a-z0-9_]*$/).describe("Canonical plugin-defined resource type, such as issue or pull_request."),RH=/^[a-z][a-zA-Z0-9]*$/,ble=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"]})}),hle=c.record(c.string().regex(RH),ble).superRefine((e,t)=>{Object.keys(e).length>xp&&t.addIssue({code:"custom",message:`Event match keys may include at most ${xp} keys.`})}),G9e=c.record(c.string().regex(RH),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>xp&&t.addIssue({code:"custom",message:`Event match may include at most ${xp} 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 Ble=c.object({type:NH,supportedEvents:c.array(Zu).min(1),suggestedEvents:c.array(Zu).optional(),matchFields:hle.optional(),guidance:c.record(Zu,c.string().trim().min(1).max(mle)).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)})}),U9e=c.object({resourceTypes:c.array(Ble).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 O9e=c.object({identifier:c.string().min(1),label:c.string().min(1),namespace:c.string().min(1),suggestedEvents:c.array(Zu).optional(),supportedEvents:c.array(Zu),type:NH}).strict(),q9e=c.object({events:c.array(Zu).min(1),id:c.string().min(1)}).strict(),yle=c.object({eventKey:c.string().min(1),eventType:Zu,identifier:c.string().min(1),occurredAtMs:c.number().finite(),terminal:c.boolean().optional(),trustedSummary:c.string().min(1).transform(e=>e.slice(0,ple)),data:fle.optional(),untrustedText:c.string().transform(e=>e.slice(0,gle)).optional()}).strict(),z9e=yle.extend({namespace:c.string().min(1)}),Cle=c.object({authority:c.enum(["instruction","context"]),actor:Hf.optional()}).strict(),wle=c.discriminatedUnion("type",[c.object({type:c.literal("message"),role:c.enum(["user","assistant"]),text:c.string().min(1),provenance:Cle.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()]),Y9e=c.object({actorUserId:c.string().min(1).optional(),completedAtMs:c.number().finite(),conversationId:c.string().min(1),destination:zde,locationId:c.string().min(1).optional(),actors:c.array(Hf),actor:Hf.optional(),runId:c.string().min(1),source:ale,transcript:c.array(wle)}).strict();var W9e=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()]),Ele=c.object({arguments:c.record(c.string(),c.unknown()),reason:c.string().min(1).optional()}).strict(),Z9e=c.object({target:c.string().min(1).optional(),truncated:c.boolean().optional(),continuation:Ele.optional()}).passthrough(),V9e=c.enum(["auto","review","approve"]);var e6e=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(),kle=c.string().regex(/^[a-z][a-z0-9-]*$/),Qle=c.string().regex(/^[a-z][a-z0-9.-]*$/),Ile=c.union([c.literal("read"),c.literal("write")]),$H=c.object({provider:kle,scope:he.optional(),type:c.literal("oauth")}).strict(),MH=c.object({displayName:he.optional(),handle:he.optional(),id:he,label:he.optional(),url:he.optional()}).strict(),n6e=c.object({account:MH.optional(),accessToken:he,expiresAt:c.number().finite().optional(),refreshToken:he,refreshTokenExpiresAt:c.number().finite().optional(),scope:he.optional()}).strict(),a6e=c.object({access:Ile,leaseScope:he.optional(),name:Qle,reason:he.optional(),requirements:c.array(he).min(1).optional()}).strict(),vle=c.object({domain:c.string().min(1),headers:c.record(c.string(),c.string()).refine(e=>Object.keys(e).length>0)}).strict(),_le=c.object({account:MH.optional(),authorization:$H.optional(),expiresAt:c.string().refine(e=>Number.isFinite(Date.parse(e))),headerTransforms:c.array(vle).min(1)}).strict(),r6e=c.discriminatedUnion("type",[c.object({lease:_le,type:c.literal("lease")}).strict(),c.object({authorization:$H.optional(),message:he,type:c.literal("needed")}).strict(),c.object({message:he,type:c.literal("unavailable")}).strict()]);var xle=he.max(64).regex(/^[a-z][a-z0-9-]*$/),Dle=he.max(80),Fle=he.max(500),Sle=c.enum(["primary","profile"]),Lle=c.object({detail:he.max(500).optional(),label:he.max(80),tone:c.enum(["good","neutral","warning"]).optional(),value:he.max(120)}).strict(),Nle=c.object({label:he.max(80),value:he.max(500)}).strict(),Rle=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(),$le=c.object({actions:c.array(Rle).max(4).optional(),description:he.max(1e3).optional(),id:he.max(128),metadata:c.array(Nle).max(8).optional(),title:he.max(4e3)}).strict(),i6e=c.object({emptyText:he.max(500).optional(),metrics:c.array(Lle).max(6).optional(),nextCursor:he.max(1e3).optional(),records:c.array($le).max(100),searchPlaceholder:he.max(120).optional(),type:c.literal("list")}).strict(),Mle=c.object({description:Fle,id:xle,label:Dle,navigation:Sle,pluginDisplayName:he.max(200),pluginName:he.max(100)}).strict(),A6e=c.array(Mle),jle=he.max(1e3).optional(),Ple=he.max(64).optional(),Tle=c.string().trim().max(200).optional(),s6e=c.object({cursor:jle,filter:Ple,limit:c.number().int().min(1).max(50),query:Tle}).strict();var Hle=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(),Gle=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:Hle.optional()}).strict(),Ule=c.union([c.literal("instruction"),c.literal("context")]),Ole=c.object({authority:Ule,actor:Hf.optional()}).strict();var qle=c.object({type:c.literal("user_message"),role:c.never().optional(),provenance:Ole}).passthrough(),zle=c.object({type:c.literal("assistant_message"),role:c.never().optional()}).passthrough(),Kle=c.object({type:c.literal("tool_result"),role:c.never().optional()}).passthrough(),PH=c.discriminatedUnion("type",[qle,zle,Kle]),Yle=c.object({item:PH,sourceEventSeq:c.number().int().nonnegative().optional()}).strict(),jH=c.array(Yle),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(),TH=c.discriminatedUnion("type",[c.object({type:c.literal("handoff"),modelProfile:Ow,modelId:c.string().min(1),reasoningLevel:c.string().min(1).optional(),triggeringToolCallId:c.string().min(1).optional(),summary:c.string().min(1).optional(),replacementHistory:jH}).strict(),c.object({type:c.literal("compaction"),modelProfile:Ow,modelId:c.string().min(1),details:Jle.optional(),summary:c.string().min(1).optional(),replacementHistory:jH}).strict()]),p6e=c.object({data:TH,createdAtMs:c.number().finite()}).strict(),Wle=c.object({type:c.literal("mcp_provider_connected"),provider:c.string().min(1),credentialSubjectId:c.string().min(1)}).strict(),Zle=c.object({type:c.literal("mcp_provider_connected_unowned"),provider:c.string().min(1)}).strict(),HH=c.union([c.literal("plugin"),c.literal("mcp")]),Vle=c.object({type:c.literal("authorization_requested"),kind:HH,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(),Xle=c.object({type:c.literal("authorization_completed"),kind:HH,provider:c.string().min(1),actorId:c.string().min(1),authorizationId:c.string().min(1)}).strict(),epe=c.object({type:c.literal("tool_execution_started"),toolCallId:c.string().min(1),toolName:c.string().min(1)}).strict(),tpe=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(),npe=c.union([c.literal("user"),c.literal("assistant"),c.literal("system")]),GH=c.object({type:c.literal("message"),messageId:c.string().min(1),role:npe,text:c.string(),authorIdentityId:c.string().min(1).optional(),meta:c.record(c.string(),c.unknown()).optional()}).strict(),ape=GH.extend({type:c.literal("message_updated")}),rpe=c.object({type:c.literal("message_handled"),messageId:c.string().min(1)}).strict(),ope=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(),ipe=c.enum(["slack","api","scheduler","internal"]),R8=c.enum(["agent_run_failed","delivery_failed","model_execution_failed","persistence_failed"]),$8=c.enum(["auth","permission","rate_limit","capacity","timeout","network","server","invalid_request","invalid_response","quota","content_policy","unknown","empty_output","tool_errors","suppressed_output"]),Ape=c.object({type:c.literal("turn_started"),turnId:c.string().min(1),inputMessageIds:c.array(c.string().min(1)).min(1),surface:ipe}).strict().refine(e=>new Set(e.inputMessageIds).size===e.inputMessageIds.length,"turn input message ids must be unique"),spe=c.object({type:c.literal("turn_routed"),turnId:c.string().min(1),modelProfile:Ow,modelId:c.string().min(1),costUsd:c.number().finite().nonnegative().optional(),reasoningLevel:c.enum(IH),confidence:c.number().min(0).max(1).optional(),source:c.enum(["configured","inherited","router"])}).strict(),cpe=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(),upe=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(),dpe=c.object({id:c.string().min(1),filename:c.string().min(1),contentType:c.string().min(1),bytes:c.number().int().nonnegative()}).strict(),lpe=c.object({type:c.literal("attachments_delivered"),attachments:c.array(dpe).min(1),toolCallId:c.string().min(1).optional(),turnId:c.string().min(1).optional()}).strict(),ppe=c.object({type:c.literal("turn_completed"),turnId:c.string().min(1),outcome:c.enum(["success","no_reply","cancelled"])}).strict(),gpe=c.object({type:c.literal("turn_failed"),turnId:c.string().min(1),failureCode:R8,failureReason:$8.optional(),eventId:c.string().regex(/^[a-f0-9]{32}$/i).optional()}).strict(),mpe=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(),fpe=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(),UH=c.union([GH,ape,PH,Wle,Vle,Xle,epe,tpe,rpe,ope,Ape,cpe,upe,lpe,spe,ppe,gpe,mpe,fpe]),bpe=c.union([UH,TH,Zle]),hpe=["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"],g6e=c.enum(hpe),Bpe=c.object({type:c.literal("unknown"),originalType:c.string().min(1),payload:c.unknown()}).strict(),N8=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(),m6e=c.union([N8.extend({schemaVersion:c.literal(1),data:bpe}),N8.extend({data:Bpe})]),f6e=N8.extend({type:c.string().min(1),payload:c.unknown()});var b6e=c.object({data:UH,idempotencyKey:c.string().min(1).optional(),createdAtMs:c.number().finite()}).strict(),Wa=c.string().trim().min(1).max(400),M8=c.string().url().max(2048),Uf=c.string().datetime(),OH=c.object({provider:c.string().trim().min(1).max(100),channelName:Wa.optional()}).strict(),ype=c.enum(["in_progress","answered","done","partial","blocked","abandoned"]),qH=c.object({repository:Wa,number:c.number().int().positive(),title:Wa.optional(),url:M8,state:Gf,openedAt:Uf.optional(),mergedAt:Uf.optional(),closedAt:Uf.optional()}).strict(),Cpe=c.object({kind:c.enum(["code_change","resource","url"]),label:Wa,url:M8,status:Wa.optional()}).strict(),wpe=c.object({startedAt:Uf,lastActivityAt:Uf,durationMs:c.number().int().nonnegative(),participants:c.array(c.object({name:Wa,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:OH.optional(),codeChanges:c.array(qH)}).strict(),Epe=c.object({schemaVersion:c.literal(1),record:wpe,summary:c.string().trim().min(1).max(600),intent:Wa,outcome:c.object({status:ype,text:c.string().trim().min(1).max(600)}).strict(),decisions:c.array(c.object({text:Wa,by:Wa.optional(),kind:c.enum(["stated","confirmed","assumed"])}).strict()).max(20),openDecisions:c.array(c.object({text:Wa,owner:Wa.optional()}).strict()).max(20),facts:c.array(Wa).max(30),links:c.array(Cpe).max(40),keywords:c.array(c.string().trim().toLowerCase().min(1).max(400)).max(12)}).strict(),kpe=c.object({index:c.number().int().nonnegative(),role:c.enum(["user","assistant","tool","event"]),author:Wa.optional(),text:c.string().min(1),createdAtMs:c.number().int().nonnegative(),turnId:c.string().min(1).optional()}).strict(),Qpe=c.object({label:Wa,url:M8,status:Wa.optional()}).strict(),h6e=c.object({conversationId:c.string().min(1),title:Wa.optional(),visibility:c.enum(["private","public"]),location:OH.optional(),entries:c.array(kpe),codeChanges:c.array(qH),resources:c.array(Qpe)}).strict();var Ipe=c.enum(["active","completed","failed"]),vpe=c.enum(["api","internal","scheduler","slack"]),zH=Gle,_pe=c.object({conversationId:c.string().min(1)}).strict(),B6e=c.object({attachmentId:c.string().min(1),conversationId:c.string().min(1)}).strict(),xpe=c.object({limit:c.coerce.number().int().min(1).max(1e3).default(500)}).strict(),Dpe=c.object({before:c.string().min(1),limit:c.coerce.number().int().min(1).max(1e3).default(500)}).strict(),Fpe=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(),Spe=c.object({archived:c.boolean(),lastSeenAt:c.string().datetime()}).strict(),j8=c.object({archivedAt:c.string().datetime().nullable()}).strict(),Lpe=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(),Npe=c.object({idempotencyKey:c.string().trim().min(1).max(200),message:c.string().trim().min(1).max(32e3)}).strict(),Kw=c.object({conversationId:c.string().min(1),messageId:c.string().min(1),status:c.enum(["accepted","duplicate"])}).strict(),Dp=c.object({email:c.string().optional(),fullName:c.string().optional(),slackUserId:c.string().optional(),slackUserName:c.string().optional()}).strict(),KH=c.enum(["defer","interrupt"]),YH=c.object({actorIdentity:Dp.optional(),createdAt:c.string().datetime(),delivery:KH,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"})}),JH=c.object({authorizationUrl:c.string().url(),completionText:c.string().min(1),label:c.string().min(1)}).strict(),P8=c.object({authorization:JH.optional(),conversationId:c.string().min(1),generatedAt:c.string().datetime(),messages:c.array(YH)}).strict(),Rpe=c.object({inboundMessageIds:c.array(c.string().min(1)).min(1).optional(),receivedBefore:c.string().datetime().optional()}).strict(),T8=c.object({cancelledCount:c.number().int().nonnegative(),cancelledInboundMessageIds:c.array(c.string().min(1)),conversationId:c.string().min(1)}).strict(),WH=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(),$pe=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"})}),Mpe=_H.and(c.object({plugin:c.string().min(1),createdAt:c.string().datetime(),updatedAt:c.string().datetime()})),ZH=c.object({createdAt:c.string().datetime(),role:c.enum(["assistant","user"]),text:c.string().min(1)}).strict(),Fp=c.object({displayTitle:c.string(),activityPreview:ZH.optional(),cumulativeDurationMs:c.number(),cumulativeUsage:zH.optional(),auxiliaryCosts:WH.optional(),conversationId:c.string(),isParticipant:c.boolean(),visibility:c.enum(["private","public"]).optional(),status:Ipe,startedAt:c.string(),lastSeenAt:c.string(),lastProgressAt:c.string(),surface:vpe,actorIdentity:Dp.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(Mpe).optional(),sidebarAnnotations:c.array(xH).optional(),assignedWork:c.boolean().optional(),finishedWorkAt:c.string().datetime().optional(),isPriority:c.boolean().optional(),unfinishedWork:c.boolean().optional()}).strict(),jpe=c.object({type:c.literal("message"),messageId:c.string().min(1),role:c.enum(["assistant","system","user"]),source:c.enum(["slack","web"]).optional(),actorIdentity:Dp.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"})}),Ppe=c.object({type:c.literal("message_handled"),messageId:c.string().min(1)}).strict(),Tpe=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"})}),VH=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"})}),Hpe=c.object({type:c.literal("tool_call"),toolCallId:c.string().min(1)}).strict(),Gpe=c.object({parts:c.array(c.discriminatedUnion("type",[VH,Hpe])).min(1)}).strict(),Upe=c.object({type:c.literal("tool_calls"),calls:c.array(Tpe).min(1),assistant:Gpe.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"})}),Ope=c.object({type:c.literal("assistant_message"),parts:c.array(VH).min(1)}).strict(),qpe=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:R8,failureReason:$8.optional(),eventId:c.string().regex(/^[a-f0-9]{32}$/i).optional(),sentryEventUrl:c.string().url().optional()}).strict()]),zpe=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(),Kpe=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(),Ype=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(),Jpe=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:DH}).strict(),Wpe=c.object({id:c.string().min(1),filename:c.string().min(1),contentType:c.string().min(1),bytes:c.number().int().nonnegative()}).strict(),Zpe=c.object({type:c.literal("attachments_delivered"),attachments:c.array(Wpe).min(1)}).strict(),Vpe=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(),Xpe=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(),ege=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(),XH=c.discriminatedUnion("type",[jpe,Ppe,Ope,Upe,qpe,Ype,Jpe,Zpe,zpe,Kpe,Vpe,Xpe,ege]),H8=c.object({seq:c.number().int().nonnegative(),createdAt:c.string().datetime(),data:XH}).strict(),G8=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()]),tge=c.object({modelId:c.string(),usage:zH}).strict();function eG(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 U8=Fp.extend({brief:c.object({content:Epe,updatedAt:c.string().datetime(),version:c.number().int().positive()}).strict().optional(),modelUsage:c.array(tge).optional(),events:c.array(H8),eventHistory:G8,previousCursor:c.string().min(1).optional(),generatedAt:c.string(),sentryConversationUrl:c.string().optional(),sourceTask:$pe.optional()}).strict().superRefine(eG),O8=c.object({events:c.array(H8),eventHistory:G8,previousCursor:c.string().min(1).optional(),generatedAt:c.string()}).strict().superRefine(eG),q8=c.object({conversations:c.array(Fp),source:c.literal("conversation_index"),generatedAt:c.string()}).strict(),Vu=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(),tG=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),S8=c.object({cachedInputTokens:c.number().optional(),cacheCreationTokens:c.number().optional(),conversations:c.number(),costUsd:c.number().optional(),date:tG,durationMs:c.number(),inputTokens:c.number().optional(),tokens:c.number().optional()}).strict(),L8=c.object({allow:c.number(),ask:c.number(),costUsd:c.number().optional(),date:tG,deny:c.number(),requests:c.number()}).strict(),nge=c.object({allow:c.number(),ask:c.number(),costUsd:c.number().optional(),deny:c.number(),metricDays:c.array(L8),metricHours:c.array(L8).optional(),metricSixHours:c.array(L8).optional(),requests:c.number()}).strict(),z8=c.object({active:c.number(),cachedInputTokens:c.number().optional(),cacheCreationTokens:c.number().optional(),conversations:c.number(),durationMs:c.number(),failed:c.number(),generatedAt:c.string(),guardian:nge,metricDays:c.array(S8),metricHours:c.array(S8).optional(),metricSixHours:c.array(S8).optional(),locations:c.array(Vu),actors:c.array(Vu),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 age=c.object({status:c.literal("ok"),service:c.string(),timestamp:c.string()}).strict(),nG=c.object({configKeys:c.array(c.string()),description:c.string(),displayName:c.string(),name:c.string()}).strict(),K8=c.array(nG),Y8=c.object({name:c.string(),pluginProvider:c.string().optional()}).strict(),J8=c.array(Y8),aG=c.object({dir:c.string(),hasMigrationsDir:c.boolean(),hasSkillsDir:c.boolean(),packageName:c.string()}).strict(),rG=c.object({packageNames:c.array(c.string()),packages:c.array(aG),manifestRoots:c.array(c.string()),skillRoots:c.array(c.string()),tracingIncludes:c.array(c.string())}).strict(),rge=c.object({cwd:c.string(),homeDir:c.string(),descriptionText:c.string().optional(),providers:c.array(c.string()),skills:c.array(Y8),packagedContent:rG}).strict(),W8=c.enum(["danger","good","neutral","warning"]),oge=c.object({label:c.string(),tone:W8.optional(),value:c.string()}).strict(),ige=c.object({key:c.string(),label:c.string()}).strict(),Age=c.object({id:c.string(),tone:W8.optional(),values:c.record(c.string(),c.string())}).strict(),sge=c.object({fields:c.array(ige).optional(),emptyText:c.string().optional(),records:c.array(Age).optional(),title:c.string()}).strict(),cge=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:W8.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(),oG=c.object({generatedAt:c.string().optional(),metrics:c.array(oge).optional(),recordSets:c.array(sge).optional(),title:c.string().optional(),pluginName:c.string(),widgets:c.array(cge).max(12).optional()}).strict(),Yw=c.object({generatedAt:c.string(),reports:c.array(oG),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 Xu=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 Jw=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 Ww=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 Z8(t,this)}},Z8=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 Zw(e,...t){return e(...t)}function e2(e,t){return`${e[hs]}_${t.join("_")}_unique`}var V8=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 X8(t,this.columns,this.nullsNotDistinctConfig,this.name)}},iG=class{static[D]="PgUniqueOnConstraintBuilder";name;constructor(t){this.name=t}on(...t){return new V8(t,this.name)}},X8=class{constructor(t,n,r,a){this.table=t,this.columns=n,this.name=a??e2(this.table,this.columns.map(o=>o.name)),this.nullsNotDistinct=r}static[D]="PgUniqueConstraint";columns;name;nullsNotDistinct=!1;getName(){return this.name}};function AG(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 sG(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]=AG(e,r+1,!0);n.push(s),r=u;continue}if(o==="}")return[n,r+1];if(o==="{"){let[s,u]=sG(e,r+1);n.push(s),r=u;continue}let[i,A]=AG(e,r,!1);n.push(i),r=A}return[n,r]}function cG(e){let[t]=sG(e,1);return t}function t2(e){return`{${e.map(t=>Array.isArray(t)?t2(t):typeof t=="string"?`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:`${t}`).join(",")}}`}var ee=class extends Jw{foreignKeyConfigs=[];static[D]="PgColumnBuilder";array(t){return new a2(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})=>Zw((o,i)=>{let A=new Ww(()=>{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 n2(t,this.config)}},W=class extends Xu{constructor(t,n){n.uniqueName||(n.uniqueName=e2(t,[n.name])),super(t,n),this.table=t}static[D]="PgColumn"},n2=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}},Sp=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},a2=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 r2(t,this.config,n)}},r2=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=cG(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:t2(r)}};var uG=class extends ee{static[D]="PgEnumObjectColumnBuilder";constructor(t,n){super(t,"string","PgEnumObjectColumn"),this.config.enum=n}build(t){return new o2(t,this.config)}},o2=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}},dG=Symbol.for("drizzle:isPgEnum");function pG(e){return!!e&&typeof e=="function"&&dG in e&&e[dG]===!0}var lG=class extends ee{static[D]="PgEnumColumnBuilder";constructor(t,n){super(t,"string","PgEnumColumn"),this.config.enum=n}build(t){return new i2(t,this.config)}},i2=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 Lp=class{static[D]="Subquery";constructor(t,n,r,a=!1,o=[]){this._={brand:"Subquery",sql:t,selectedFields:n,alias:r,isWith:a,usedTables:o}}},gG=class extends Lp{static[D]="WithSubquery"};var mG="0.45.2";var A2,s2,fG={startActiveSpan(e,t){return A2?(s2||(s2=A2.trace.getTracer("drizzle-orm",mG)),Zw((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()}}),A2,s2)):t()}};var Np=Symbol.for("drizzle:ViewBaseConfig");var c2=Symbol.for("drizzle:Schema"),bG=Symbol.for("drizzle:Columns"),hG=Symbol.for("drizzle:ExtraConfigColumns"),u2=Symbol.for("drizzle:OriginalName"),d2=Symbol.for("drizzle:BaseName"),Of=Symbol.for("drizzle:IsAlias"),BG=Symbol.for("drizzle:ExtraConfigBuilder"),uge=Symbol.for("drizzle:IsDrizzleTable"),vn=class{static[D]="Table";static Symbol={Name:hs,Schema:c2,OriginalName:u2,Columns:bG,ExtraConfigColumns:hG,BaseName:d2,IsAlias:Of,ExtraConfigBuilder:BG};[hs];[u2];[c2];[bG];[hG];[d2];[Of]=!1;[uge]=!0;[BG]=void 0;constructor(t,n,r){this[hs]=this[u2]=t,this[c2]=n,this[d2]=r}};var yG=class{static[D]="FakePrimitiveParam"};function dge(e){return e!=null&&typeof e.getSQL=="function"}function lge(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=CG;shouldInlineParams=!1;usedTables=[];append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return fG.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 lge(t.map(d=>{if(Un(d,fo))return{sql:d.value.join(""),params:[]};if(Un(d,qf))return{sql:o(d.value),params:[]};if(d===void 0)return{sql:"",params:[]};if(Array.isArray(d)){let l=[new fo("(")];for(let[g,p]of d.entries())l.push(p),g<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],g=d[vn.Symbol.Name];return{sql:l===void 0||d[Of]?o(g):o(l)+"."+o(g),params:[]}}if(Un(d,Xu)){let l=a.getColumnCasing(d);if(n.invokeSource==="indexes")return{sql:o(l),params:[]};let g=d.table[vn.Symbol.Schema];return{sql:d.table[Of]||g===void 0?o(d.table[vn.Symbol.Name])+"."+o(l):o(g)+"."+o(d.table[vn.Symbol.Name])+"."+o(l),params:[]}}if(Un(d,l2)){let l=d[Np].schema,g=d[Np].name;return{sql:l===void 0||d[Np].isAlias?o(g):o(l)+"."+o(g),params:[]}}if(Un(d,Vw)){if(Un(d.value,zf))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 g=["none"];return A&&(g=[A(d.encoder)]),{sql:i(u.value++,l),params:[l],typings:g}}return Un(d,zf)?{sql:i(u.value++,d),params:[d],typings:["none"]}:Un(d,e.Aliased)&&d.fieldAlias!==void 0?{sql:o(d.fieldAlias),params:[]}:Un(d,Lp)?d._.isWith?{sql:o(d._.alias),params:[]}:this.buildQueryFromSourceParams([new fo("("),d._.sql,new fo(") "),new qf(d._.alias)],r):pG(d)?d.schema?{sql:o(d.schema)+"."+o(d.enumName),params:[]}:{sql:o(d.enumName),params:[]}:dge(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}},qf=class{constructor(t){this.value=t}static[D]="Name";brand;getSQL(){return new _n([this])}};var CG={mapFromDriverValue:e=>e},wG={mapToDriverValue:e=>e},dLe={...CG,...wG},Vw=class{constructor(t,n=wG){this.value=t,this.encoder=n}static[D]="Param";brand;getSQL(){return new _n([this])}};function Rp(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,g]of s.entries())l>0&&u!==void 0&&d.push(u),d.push(g);return new _n(d)}e.join=a;function o(s){return new qf(s)}e.identifier=o;function i(s){return new zf(s)}e.placeholder=i;function A(s,u){return new Vw(s,u)}e.param=A})(Rp||(Rp={}));(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 zf=class{constructor(t){this.name=t}static[D]="Placeholder";getSQL(){return new _n([this])}};var pge=Symbol.for("drizzle:IsDrizzleView"),l2=class{static[D]="View";[Np];[pge]=!0;constructor({name:t,schema:n,selectedFields:r,query:a}){this[Np]={name:t,originalName:t,schema:n,selectedFields:r,query:a,isExisting:!a,isAlias:!1}}getSQL(){return new _n([this])}};Xu.prototype.getSQL=function(){return new _n([this])};vn.prototype.getSQL=function(){return new _n([this])};Lp.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 pLe=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 p2=class extends Bs{static[D]="PgBigInt53Builder";constructor(t){super(t,"number","PgBigInt53")}build(t){return new g2(t,this.config)}},g2=class extends W{static[D]="PgBigInt53";getSQLType(){return"bigint"}mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}},m2=class extends Bs{static[D]="PgBigInt64Builder";constructor(t){super(t,"bigint","PgBigInt64")}build(t){return new f2(t,this.config)}},f2=class extends W{static[D]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(t){return BigInt(t)}};function EG(e,t){let{name:n,config:r}=We(e,t);return r.mode==="number"?new p2(n):new m2(n)}var b2=class extends ee{static[D]="PgBigSerial53Builder";constructor(t){super(t,"number","PgBigSerial53"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new h2(t,this.config)}},h2=class extends W{static[D]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}},B2=class extends ee{static[D]="PgBigSerial64Builder";constructor(t){super(t,"bigint","PgBigSerial64"),this.config.hasDefault=!0}build(t){return new y2(t,this.config)}},y2=class extends W{static[D]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(t){return BigInt(t)}};function kG(e,t){let{name:n,config:r}=We(e,t);return r.mode==="number"?new b2(n):new B2(n)}var C2=class extends ee{static[D]="PgBooleanBuilder";constructor(t){super(t,"boolean","PgBoolean")}build(t){return new w2(t,this.config)}},w2=class extends W{static[D]="PgBoolean";getSQLType(){return"boolean"}};function QG(e){return new C2(e??"")}var E2=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 k2(t,this.config)}},k2=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 IG(e,t={}){let{name:n,config:r}=We(e,t);return new E2(n,r)}var Q2=class extends ee{static[D]="PgCidrBuilder";constructor(t){super(t,"string","PgCidr")}build(t){return new I2(t,this.config)}},I2=class extends W{static[D]="PgCidr";getSQLType(){return"cidr"}};function vG(e){return new Q2(e??"")}var v2=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 _2(t,this.config)}},_2=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 _G(e){return(t,n)=>{let{name:r,config:a}=We(t,n);return new v2(r,a,e)}}var fA=class extends ee{static[D]="PgDateColumnBaseBuilder";defaultNow(){return this.default(Rp`now()`)}};var x2=class extends fA{static[D]="PgDateBuilder";constructor(t){super(t,"date","PgDate")}build(t){return new D2(t,this.config)}},D2=class extends W{static[D]="PgDate";getSQLType(){return"date"}mapFromDriverValue(t){return typeof t=="string"?new Date(t):t}mapToDriverValue(t){return t.toISOString()}},F2=class extends fA{static[D]="PgDateStringBuilder";constructor(t){super(t,"string","PgDateString")}build(t){return new S2(t,this.config)}},S2=class extends W{static[D]="PgDateString";getSQLType(){return"date"}mapFromDriverValue(t){return typeof t=="string"?t:t.toISOString().slice(0,-14)}};function xG(e,t){let{name:n,config:r}=We(e,t);return r?.mode==="date"?new x2(n):new F2(n)}var L2=class extends ee{static[D]="PgDoublePrecisionBuilder";constructor(t){super(t,"number","PgDoublePrecision")}build(t){return new N2(t,this.config)}},N2=class extends W{static[D]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(t){return typeof t=="string"?Number.parseFloat(t):t}};function DG(e){return new L2(e??"")}var R2=class extends ee{static[D]="PgInetBuilder";constructor(t){super(t,"string","PgInet")}build(t){return new $2(t,this.config)}},$2=class extends W{static[D]="PgInet";getSQLType(){return"inet"}};function FG(e){return new R2(e??"")}var M2=class extends Bs{static[D]="PgIntegerBuilder";constructor(t){super(t,"number","PgInteger")}build(t){return new j2(t,this.config)}},j2=class extends W{static[D]="PgInteger";getSQLType(){return"integer"}mapFromDriverValue(t){return typeof t=="string"?Number.parseInt(t):t}};function SG(e){return new M2(e??"")}var P2=class extends ee{static[D]="PgIntervalBuilder";constructor(t,n){super(t,"string","PgInterval"),this.config.intervalConfig=n}build(t){return new T2(t,this.config)}},T2=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 LG(e,t={}){let{name:n,config:r}=We(e,t);return new P2(n,r)}var H2=class extends ee{static[D]="PgJsonBuilder";constructor(t){super(t,"json","PgJson")}build(t){return new G2(t,this.config)}},G2=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 NG(e){return new H2(e??"")}var U2=class extends ee{static[D]="PgJsonbBuilder";constructor(t){super(t,"json","PgJsonb")}build(t){return new O2(t,this.config)}},O2=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 Xw(e){return new U2(e??"")}var q2=class extends ee{static[D]="PgLineBuilder";constructor(t){super(t,"array","PgLine")}build(t){return new z2(t,this.config)}},z2=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]}}`}},K2=class extends ee{static[D]="PgLineABCBuilder";constructor(t){super(t,"json","PgLineABC")}build(t){return new Y2(t,this.config)}},Y2=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 RG(e,t){let{name:n,config:r}=We(e,t);return!r?.mode||r.mode==="tuple"?new q2(n):new K2(n)}var J2=class extends ee{static[D]="PgMacaddrBuilder";constructor(t){super(t,"string","PgMacaddr")}build(t){return new W2(t,this.config)}},W2=class extends W{static[D]="PgMacaddr";getSQLType(){return"macaddr"}};function $G(e){return new J2(e??"")}var Z2=class extends ee{static[D]="PgMacaddr8Builder";constructor(t){super(t,"string","PgMacaddr8")}build(t){return new V2(t,this.config)}},V2=class extends W{static[D]="PgMacaddr8";getSQLType(){return"macaddr8"}};function MG(e){return new Z2(e??"")}var X2=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 eS(t,this.config)}},eS=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})`}},tS=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 nS(t,this.config)}},nS=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})`}},aS=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 rS(t,this.config)}},rS=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 jG(e,t){let{name:n,config:r}=We(e,t),a=r?.mode;return a==="number"?new tS(n,r?.precision,r?.scale):a==="bigint"?new aS(n,r?.precision,r?.scale):new X2(n,r?.precision,r?.scale)}var oS=class extends ee{static[D]="PgPointTupleBuilder";constructor(t){super(t,"array","PgPointTuple")}build(t){return new iS(t,this.config)}},iS=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]})`}},AS=class extends ee{static[D]="PgPointObjectBuilder";constructor(t){super(t,"json","PgPointObject")}build(t){return new sS(t,this.config)}},sS=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 PG(e,t){let{name:n,config:r}=We(e,t);return!r?.mode||r.mode==="tuple"?new oS(n):new AS(n)}function gge(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 TG(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 cS(e){let t=gge(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=TG(t,n);n+=8;let s=TG(t,n);return n+=8,[A,s]}throw new Error("Unsupported geometry type")}var uS=class extends ee{static[D]="PgGeometryBuilder";constructor(t){super(t,"array","PgGeometry")}build(t){return new dS(t,this.config)}},dS=class extends W{static[D]="PgGeometry";getSQLType(){return"geometry(point)"}mapFromDriverValue(t){return cS(t)}mapToDriverValue(t){return`point(${t[0]} ${t[1]})`}},lS=class extends ee{static[D]="PgGeometryObjectBuilder";constructor(t){super(t,"json","PgGeometryObject")}build(t){return new pS(t,this.config)}},pS=class extends W{static[D]="PgGeometryObject";getSQLType(){return"geometry(point)"}mapFromDriverValue(t){let n=cS(t);return{x:n[0],y:n[1]}}mapToDriverValue(t){return`point(${t.x} ${t.y})`}};function HG(e,t){let{name:n,config:r}=We(e,t);return!r?.mode||r.mode==="tuple"?new uS(n):new lS(n)}var gS=class extends ee{static[D]="PgRealBuilder";constructor(t,n){super(t,"number","PgReal"),this.config.length=n}build(t){return new mS(t,this.config)}},mS=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 GG(e){return new gS(e??"")}var fS=class extends ee{static[D]="PgSerialBuilder";constructor(t){super(t,"number","PgSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new bS(t,this.config)}},bS=class extends W{static[D]="PgSerial";getSQLType(){return"serial"}};function UG(e){return new fS(e??"")}var hS=class extends Bs{static[D]="PgSmallIntBuilder";constructor(t){super(t,"number","PgSmallInt")}build(t){return new BS(t,this.config)}},BS=class extends W{static[D]="PgSmallInt";getSQLType(){return"smallint"}mapFromDriverValue=t=>typeof t=="string"?Number(t):t};function OG(e){return new hS(e??"")}var yS=class extends ee{static[D]="PgSmallSerialBuilder";constructor(t){super(t,"number","PgSmallSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new CS(t,this.config)}},CS=class extends W{static[D]="PgSmallSerial";getSQLType(){return"smallserial"}};function qG(e){return new yS(e??"")}var wS=class extends ee{static[D]="PgTextBuilder";constructor(t,n){super(t,"string","PgText"),this.config.enumValues=n.enum}build(t){return new ES(t,this.config)}},ES=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 wS(n,r)}var kS=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 QS(t,this.config)}},QS=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 zG(e,t={}){let{name:n,config:r}=We(e,t);return new kS(n,r.withTimezone??!1,r.precision)}var IS=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 vS(t,this.config)}},vS=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()},_S=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 xS(t,this.config)}},xS=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 eE(e,t={}){let{name:n,config:r}=We(e,t);return r?.mode==="string"?new _S(n,r.withTimezone??!1,r.precision):new IS(n,r?.withTimezone??!1,r?.precision)}var DS=class extends ee{static[D]="PgUUIDBuilder";constructor(t){super(t,"string","PgUUID")}defaultRandom(){return this.default(Rp`gen_random_uuid()`)}build(t){return new FS(t,this.config)}},FS=class extends W{static[D]="PgUUID";getSQLType(){return"uuid"}};function KG(e){return new DS(e??"")}var SS=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 LS(t,this.config)}},LS=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 YG(e,t={}){let{name:n,config:r}=We(e,t);return new SS(n,r)}var NS=class extends ee{static[D]="PgBinaryVectorBuilder";constructor(t,n){super(t,"string","PgBinaryVector"),this.config.dimensions=n.dimensions}build(t){return new RS(t,this.config)}},RS=class extends W{static[D]="PgBinaryVector";dimensions=this.config.dimensions;getSQLType(){return`bit(${this.dimensions})`}};function JG(e,t){let{name:n,config:r}=We(e,t);return new NS(n,r)}var $S=class extends ee{static[D]="PgHalfVectorBuilder";constructor(t,n){super(t,"array","PgHalfVector"),this.config.dimensions=n.dimensions}build(t){return new MS(t,this.config)}},MS=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 WG(e,t){let{name:n,config:r}=We(e,t);return new $S(n,r)}var jS=class extends ee{static[D]="PgSparseVectorBuilder";constructor(t,n){super(t,"string","PgSparseVector"),this.config.dimensions=n.dimensions}build(t){return new PS(t,this.config)}},PS=class extends W{static[D]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}};function ZG(e,t){let{name:n,config:r}=We(e,t);return new jS(n,r)}var TS=class extends ee{static[D]="PgVectorBuilder";constructor(t,n){super(t,"array","PgVector"),this.config.dimensions=n.dimensions}build(t){return new HS(t,this.config)}},HS=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 VG(e,t){let{name:n,config:r}=We(e,t);return new TS(n,r)}function XG(){return{bigint:EG,bigserial:kG,boolean:QG,char:IG,cidr:vG,customType:_G,date:xG,doublePrecision:DG,inet:FG,integer:SG,interval:LG,json:NG,jsonb:Xw,line:RG,macaddr:$G,macaddr8:MG,numeric:jG,point:PG,geometry:HG,real:GG,serial:UG,smallint:OG,smallserial:qG,text:wi,time:zG,timestamp:eE,uuid:KG,varchar:YG,bit:JG,halfvec:WG,sparsevec:ZG,vector:VG}}var GS=Symbol.for("drizzle:PgInlineForeignKeys"),e5=Symbol.for("drizzle:EnableRLS"),Kf=class extends vn{static[D]="PgTable";static Symbol=Object.assign({},vn.Symbol,{InlineForeignKeys:GS,EnableRLS:e5});[GS]=[];[e5]=!1;[vn.Symbol.ExtraConfigBuilder]=void 0;[vn.Symbol.ExtraConfigColumns]={}};function mge(e,t,n,r,a=e){let o=new Kf(e,r,a),i=typeof t=="function"?t(XG()):t,A=Object.fromEntries(Object.entries(i).map(([d,l])=>{let g=l;g.setName(d);let p=g.build(o);return o[GS].push(...g.buildForeignKeys(p,o)),[d,p]})),s=Object.fromEntries(Object.entries(i).map(([d,l])=>{let g=l;g.setName(d);let p=g.buildExtraConfigColumn(o);return[d,p]})),u=Object.assign(o,A);return u[vn.Symbol.Columns]=A,u[vn.Symbol.ExtraConfigColumns]=s,n&&(u[Kf.Symbol.ExtraConfigBuilder]=n),Object.assign(u,{enableRLS:()=>(u[Kf.Symbol.EnableRLS]=!0,u)})}var t5=(e,t,n)=>mge(e,t,n,void 0);var tE=class{constructor(t,n){this.unique=t,this.name=n}static[D]="PgIndexBuilderOn";on(...t){return new Yf(t.map(n=>{if(Un(n,_n))return n;n=n;let r=new Sp(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 Yf(t.map(n=>{if(Un(n,_n))return n;n=n;let r=new Sp(n.name,!!n.keyAsName,n.columnType,n.indexConfig);return n.indexConfig=n.defaultConfig,r}),this.unique,!0,this.name)}using(t,...n){return new Yf(n.map(r=>{if(Un(r,_n))return r;r=r;let a=new Sp(r.name,!!r.keyAsName,r.columnType,r.indexConfig);return r.indexConfig=JSON.parse(JSON.stringify(r.defaultConfig)),a}),this.unique,!0,this.name,t)}},Yf=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 US(this.config,t)}},US=class{static[D]="PgIndex";config;constructor(t,n){this.config={...t,table:n}}};function n5(e){return new tE(!1,e)}function a5(e){return new tE(!0,e)}var r5=e=>eE(e,{withTimezone:!0}),o5=c.enum(["channel","dm","group","local_conversation","thread","web_session"]),IRe=t5("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:Xw("metadata_json"),createdAt:r5("created_at").notNull(),updatedAt:r5("updated_at").notNull()},e=>[a5("junior_destinations_provider_destination_uidx").on(e.provider,e.providerTenantId,e.providerDestinationId),n5("junior_destinations_provider_kind_idx").on(e.provider,e.kind)]);var fge=c.object({error:c.string().min(1)}).strict(),A5=36e5,LRe=6*A5,NRe=24*A5;var KS=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(),bge=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),ed=c.object({closed:c.number().int().nonnegative(),created:c.number().int().nonnegative(),date:bge,merged:c.number().int().nonnegative()}).strict(),s5=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(),c5=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:Gf,title:c.string().optional(),url:c.string().url().optional()}).strict(),YS=c.object({activityDays:c.array(ed),activityHours:c.array(ed).optional(),activitySixHours:c.array(ed).optional(),changes:c.array(c5),generatedAt:c.string(),repositories:c.array(s5),summary:KS,windowEnd:c.string(),windowStart:c.string()}).strict(),JS=c.object({activityDays:c.array(ed),activityHours:c.array(ed).optional(),activitySixHours:c.array(ed).optional(),generatedAt:c.string(),summary:KS,windowEnd:c.string(),windowStart:c.string()}).strict(),aE=c.object({active:c.number(),conversations:c.number(),date:c.string(),durationMs:c.number(),failed:c.number(),tokens:c.number().optional()}).strict();var hge=c.object({locationId:c.string().min(1)}).strict(),u5=Vu.extend({id:c.string(),firstSeenAt:c.string(),kind:o5,lastSeenAt:c.string(),provider:c.string(),providerDestinationId:c.string(),visibility:c.literal("public")}).strict(),Bge=Vu.extend({actor:Dp}).strict(),yge=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),rE=c.object({date:yge,privateConversations:c.number(),publicConversations:c.number()}).strict(),WS=c.object({activityDays:c.array(rE),activityHours:c.array(rE).optional(),activitySixHours:c.array(rE).optional(),generatedAt:c.string(),locations:c.array(u5),privateActivity:Vu,source:c.literal("conversation_index"),windowEnd:c.string(),windowStart:c.string()}).strict(),ZS=u5.extend({activityDays:c.array(aE),activityHours:c.array(aE).optional(),activitySixHours:c.array(aE).optional(),actors:c.array(Bge),generatedAt:c.string(),recentConversations:c.array(Fp),source:c.literal("conversation_index"),windowEnd:c.string(),windowStart:c.string()}).strict(),Cge=c.object({email:c.string().trim().min(1)}).strict(),i5=Vu.omit({costUsd:!0}),d5=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),OS=c.object({active:c.number(),conversations:c.number(),costUsd:c.number().optional(),date:d5,durationMs:c.number(),failed:c.number(),tokens:c.number().optional()}).strict(),qS=c.object({activePeople:c.number(),conversations:c.number(),date:d5}).strict(),l5=c.object({active:c.number(),activeDays:c.number(),conversations:c.number(),durationMs:c.number(),failed:c.number(),tokens:c.number().optional()}).strict(),nE=c.object({conversations:c.number().int().nonnegative(),costUsd:c.number().finite().nonnegative(),durationMs:c.number().finite().nonnegative(),priorCostUsd:c.number().finite().nonnegative()}).strict(),wge=c.object({1:nE,7:nE,30:nE,90:nE}).strict(),p5=Dp.extend({email:c.string().min(1)}).strict(),Ege=l5.extend({firstSeenAt:c.string(),lastSeenAt:c.string(),actor:p5,windows:wge}).strict(),VS=c.object({activityDays:c.array(qS),activityHours:c.array(qS).optional(),activitySixHours:c.array(qS).optional(),generatedAt:c.string(),people:c.array(Ege),source:c.literal("conversation_index"),windowEnd:c.string(),windowStart:c.string()}).strict(),XS=c.object({activityDays:c.array(OS),activityHours:c.array(OS).optional(),activitySixHours:c.array(OS).optional(),generatedAt:c.string(),locations:c.array(i5),recentConversations:c.array(Fp),actor:p5,source:c.literal("conversation_index"),surfaces:c.array(i5),totals:l5,windowEnd:c.string(),windowStart:c.string()}).strict(),e4=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(),t4=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(),n4=c.object({tokens:c.array(t4)}).strict(),kge=c.object({name:c.string().trim().min(1).max(80)}).strict(),a4=t4.extend({token:c.string().startsWith("jr_pat_")}).strict(),Qge=c.object({id:c.string().uuid()}).strict(),Ige=c.object({revoked:c.literal(!0)}).strict(),vge=c.object({channelId:c.string().min(1),label:c.string().min(1),teamId:c.string().min(1),visibility:c.enum(["private","public"])}).strict(),g5=c.object({1:c.number().int().nonnegative(),7:c.number().int().nonnegative(),30:c.number().int().nonnegative(),90:c.number().int().nonnegative()}).strict(),m5=c.object({createdAt:c.string().datetime(),createdBy:c.string().min(1),createdByEmail:c.string().trim().email().optional(),destination:vge,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:g5,outcomes:c.array(LH).max(5),title:c.string().min(1),totalRuns:c.number().int().nonnegative()}),f5=m5.extend({kind:c.literal("scheduled"),nextRunAt:c.string().datetime().optional(),schedule:c.string().min(1),status:c.enum(["active","blocked","completed"])}).strict(),b5=m5.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(),r4=c.discriminatedUnion("kind",[f5,b5]),h5=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),zS=c.object({costUsd:c.number().finite().nonnegative(),date:h5,event:c.number().int().nonnegative(),scheduled:c.number().int().nonnegative()}).strict(),_ge=c.object({q:c.string().trim().max(200).optional()}).strict(),o4=c.object({executionDays:c.array(zS),executionHours:c.array(zS).optional(),executionSixHours:c.array(zS).optional(),automations:c.array(r4),truncated:c.boolean()}).strict(),xge=c.object({id:c.string().min(1),kind:c.enum(["scheduled","event"])}).strict(),B5=c.enum(["blocked","completed","failed"]),i4=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(),oE=c.object({blocked:c.number().int().nonnegative(),completed:c.number().int().nonnegative(),date:h5,failed:c.number().int().nonnegative()}).strict(),A4=c.object({executionDays:c.array(oE),executionHours:c.array(oE).optional(),executionSixHours:c.array(oE).optional(),executions:c.array(i4),automation:r4,truncated:c.boolean()}).strict(),y5=i4.extend({kind:c.enum(["scheduled","event"]),automationId:c.string().min(1),automationTitle:c.string().min(1)}).strict(),s4=c.object({runs:c.array(y5),truncated:c.boolean()}).strict(),Dge=c.object({provider:c.string(),repo:c.string()}).strict(),C5=c.object({provider:c.string(),repo:c.string(),checkoutPath:c.string()}).strict(),Fge=c.object({id:c.string(),generatedAt:c.iso.datetime(),buildDurationMs:c.number().int().nonnegative(),sizeBytes:c.number().int().nonnegative().nullable()}).strict(),w5=c.object({id:c.string(),generatedAt:c.iso.datetime(),buildDurationMs:c.number().int().nonnegative(),dependencyCount:c.number().int().nonnegative()}).strict(),$p=c.object({id:c.string().uuid(),name:c.string(),setupScript:c.string(),repos:c.array(C5),snapshot:Fge.nullable()}).strict(),c4=c.object({baselineSnapshot:w5.nullable(),workspaces:c.array($p)}).strict(),Sge=c.object({name:c.string(),setupScript:c.string().optional(),repos:c.array(Dge)}).strict(),Lge=c.object({id:c.string().uuid()}).strict(),Nge=c.object({deleted:c.literal(!0)}).strict(),E5=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(),u4=c.object({generatedAt:c.string().datetime(),stats:c.array(E5),windowEnd:c.string(),windowStart:c.string()}).strict();function Rge(e){try{let t=new URL(e).protocol;return t==="http:"||t==="https:"}catch{return!1}}var $ge=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(Rge,"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(),HRe=c.discriminatedUnion("kind",[$ge]),Mge=c.enum(["circle-dot","circle-dashed","circle-x","git-merge","git-pull-request","triangle-alert"]),GRe=c.object({icon:Mge.optional(),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256)}).strict(),jge=c.enum(["closed","merged","open"]),ORe=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:jge,title:c.string().min(1).optional(),updatedAt:c.date(),url:c.string().url().optional()}).strict(),zRe=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/),Pge=c.enum(["activity","brain","calendar","check","database","info","key","link","sparkles","warning"]),Tge=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(),KRe=c.object({details:c.array(Tge).max(100).optional(),icon:Pge.optional(),preview:c.string().trim().min(1).max(500).optional(),title:c.string().trim().min(1).max(120)}).strict();var AE=c.string().regex(/^T[A-Z0-9]+$/),l4=c.string().regex(/^(C|G|D)[A-Z0-9]+$/),Q5=c.string().regex(/^local:[a-z0-9_-]+:[a-z0-9][a-z0-9_-]*$/),Hge=c.string().min(1).refine(e=>e===e.trim()&&e.toLowerCase()!=="unknown"),iE=Hge,Be=c.string().refine(e=>e.trim().length>0),Za=Be.refine(e=>e===e.trim()),Gge=c.object({id:Be,provider:Za}).strict(),Uge=Gge.extend({provider:c.literal("slack"),teamId:AE,channelId:l4,threadTs:Za.optional()}).strict(),JRe=c.discriminatedUnion("provider",[Uge]),WRe=c.enum(["slack","local"]),I5=c.enum(["public","private"]),Oge=c.enum(["public","private"]),qge=c.object({platform:c.literal("slack"),teamId:AE,channelId:l4,threadTs:Za.optional()}).strict(),p4=qge,zge=c.object({platform:c.literal("local"),conversationId:Q5}).strict(),Kge=c.discriminatedUnion("platform",[p4,zge]),ZRe=c.object({action:c.literal("send_message"),destination:p4}).strict(),Yge=c.object({kind:c.literal("slack"),teamId:AE,channelId:l4,visibility:I5,messageTs:Be.optional(),threadTs:Be.optional()}).strict(),Jge=c.object({kind:c.literal("local"),visibility:c.literal("private"),conversationId:Q5}).strict(),Wge=c.object({kind:c.literal("web"),visibility:I5,conversationId:Za}).strict(),Zge=c.object({kind:c.literal("event"),eventKey:Za,eventType:Za,identifier:Za,namespace:Za}).strict(),Vge=c.object({kind:c.literal("scheduled_automation")}).strict(),Xge=c.object({kind:c.literal("event_automation")}).strict(),eme=c.object({kind:c.literal("plugin_dispatch")}).strict(),tme=c.object({kind:c.literal("agent_invocation")}).strict(),nme=c.discriminatedUnion("kind",[Yge,Jge,Wge,Zge,Vge,Xge,eme,tme]);function ame(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 rme=c.preprocess(ame,nme),ome=c.discriminatedUnion("allowedWhen",[c.object({type:c.literal("user"),userId:iE,allowedWhen:c.literal("private-direct-conversation")}).strict(),c.object({type:c.literal("user"),userId:iE,allowedWhen:c.literal("scheduled-automation"),taskId:Za}).strict()]),g4={email:Be.optional(),fullName:Be.optional(),userId:iE,userName:Be.optional()},ime=c.object({...g4,platform:c.literal("slack"),teamId:AE}).strict(),Ame=c.object({...g4,platform:c.literal("local")}).strict(),sme=c.object({...g4,platform:c.literal("web")}).strict(),cme=c.object({platform:c.literal("system"),name:iE}).strict(),d4=c.discriminatedUnion("platform",[ime,Ame,sme,cme]),ume=c.object({displayName:Be.optional(),handle:Be.optional(),id:Za,provider:Za,providerSubjectId:Za,providerTenantId:Za.optional()}).strict(),VRe=c.object({displayName:Be.optional(),email:Be.max(320),id:Za,identities:c.array(ume).max(100)}).strict(),dme=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]})}}),lme=c.object({label:Za.pipe(c.string().max(48)).refine(e=>!/[\r\n]/.test(e)),detail:Za.pipe(c.string().max(128)).refine(e=>!/[\r\n]/.test(e)).optional()}).strict(),XRe=c.object({idempotencyKey:Be.pipe(c.string().max(512)),credentialSubject:ome.optional(),destination:p4,destinationVisibility:Oge,input:Be.pipe(c.string().max(32e3)),metadata:dme.optional(),replyAttribution:lme.optional()}).strict();var pme=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/),t$e=c.object({text:c.string().trim().min(1).max(8e3)}).strict(),n$e=c.object({kind:pme,version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict();var gme=4e3,mme=8e3,Mp=32,k5=4e3,fme=1e3,bme=c.record(c.string(),c.unknown()).superRefine((e,t)=>{Object.keys(e).length>Mp&&t.addIssue({code:"custom",message:`Event data may include at most ${Mp} keys.`}),new TextEncoder().encode(JSON.stringify(e)).byteLength>k5&&t.addIssue({code:"custom",message:`Event data may be at most ${k5} JSON bytes.`})}),td=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."),v5=c.string().regex(/^[a-z][a-z0-9_]*$/).describe("Canonical plugin-defined resource type, such as issue or pull_request."),_5=/^[a-z][a-zA-Z0-9]*$/,hme=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"]})}),Bme=c.record(c.string().regex(_5),hme).superRefine((e,t)=>{Object.keys(e).length>Mp&&t.addIssue({code:"custom",message:`Event match keys may include at most ${Mp} keys.`})}),r$e=c.record(c.string().regex(_5),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>Mp&&t.addIssue({code:"custom",message:`Event match may include at most ${Mp} 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 yme=c.object({type:v5,supportedEvents:c.array(td).min(1),suggestedEvents:c.array(td).optional(),matchFields:Bme.optional(),guidance:c.record(td,c.string().trim().min(1).max(fme)).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)})}),o$e=c.object({resourceTypes:c.array(yme).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 i$e=c.object({identifier:c.string().min(1),label:c.string().min(1),namespace:c.string().min(1),suggestedEvents:c.array(td).optional(),supportedEvents:c.array(td),type:v5}).strict(),A$e=c.object({events:c.array(td).min(1),id:c.string().min(1)}).strict(),Cme=c.object({eventKey:c.string().min(1),eventType:td,identifier:c.string().min(1),occurredAtMs:c.number().finite(),terminal:c.boolean().optional(),trustedSummary:c.string().min(1).transform(e=>e.slice(0,gme)),data:bme.optional(),untrustedText:c.string().transform(e=>e.slice(0,mme)).optional()}).strict(),s$e=Cme.extend({namespace:c.string().min(1)}),wme=c.object({authority:c.enum(["instruction","context"]),actor:d4.optional()}).strict(),Eme=c.discriminatedUnion("type",[c.object({type:c.literal("message"),role:c.enum(["user","assistant"]),text:c.string().min(1),provenance:wme.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()]),u$e=c.object({actorUserId:c.string().min(1).optional(),completedAtMs:c.number().finite(),conversationId:c.string().min(1),destination:Kge,locationId:c.string().min(1).optional(),actors:c.array(d4),actor:d4.optional(),runId:c.string().min(1),source:rme,transcript:c.array(Eme)}).strict();var l$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()]),kme=c.object({arguments:c.record(c.string(),c.unknown()),reason:c.string().min(1).optional()}).strict(),p$e=c.object({target:c.string().min(1).optional(),truncated:c.boolean().optional(),continuation:kme.optional()}).passthrough(),g$e=c.enum(["auto","review","approve"]);var f$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(),Qme=c.string().regex(/^[a-z][a-z0-9-]*$/),Ime=c.string().regex(/^[a-z][a-z0-9.-]*$/),vme=c.union([c.literal("read"),c.literal("write")]),x5=c.object({provider:Qme,scope:Be.optional(),type:c.literal("oauth")}).strict(),D5=c.object({displayName:Be.optional(),handle:Be.optional(),id:Be,label:Be.optional(),url:Be.optional()}).strict(),h$e=c.object({account:D5.optional(),accessToken:Be,expiresAt:c.number().finite().optional(),refreshToken:Be,refreshTokenExpiresAt:c.number().finite().optional(),scope:Be.optional()}).strict(),B$e=c.object({access:vme,leaseScope:Be.optional(),name:Ime,reason:Be.optional(),requirements:c.array(Be).min(1).optional()}).strict(),_me=c.object({domain:c.string().min(1),headers:c.record(c.string(),c.string()).refine(e=>Object.keys(e).length>0)}).strict(),xme=c.object({account:D5.optional(),authorization:x5.optional(),expiresAt:c.string().refine(e=>Number.isFinite(Date.parse(e))),headerTransforms:c.array(_me).min(1)}).strict(),y$e=c.discriminatedUnion("type",[c.object({lease:xme,type:c.literal("lease")}).strict(),c.object({authorization:x5.optional(),message:Be,type:c.literal("needed")}).strict(),c.object({message:Be,type:c.literal("unavailable")}).strict()]);var Dme=Be.max(64).regex(/^[a-z][a-z0-9-]*$/),Fme=Be.max(80),Sme=Be.max(500),Lme=c.enum(["primary","profile"]),Nme=c.object({detail:Be.max(500).optional(),label:Be.max(80),tone:c.enum(["good","neutral","warning"]).optional(),value:Be.max(120)}).strict(),Rme=c.object({label:Be.max(80),value:Be.max(500)}).strict(),$me=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(),Mme=c.object({actions:c.array($me).max(4).optional(),description:Be.max(1e3).optional(),id:Be.max(128),metadata:c.array(Rme).max(8).optional(),title:Be.max(4e3)}).strict(),F5=c.object({emptyText:Be.max(500).optional(),metrics:c.array(Nme).max(6).optional(),nextCursor:Be.max(1e3).optional(),records:c.array(Mme).max(100),searchPlaceholder:Be.max(120).optional(),type:c.literal("list")}).strict(),jme=c.object({description:Sme,id:Dme,label:Fme,navigation:Lme,pluginDisplayName:Be.max(200),pluginName:Be.max(100)}).strict(),S5=c.array(jme),Pme=Be.max(1e3).optional(),Tme=Be.max(64).optional(),Hme=c.string().trim().max(200).optional(),w$e=c.object({cursor:Pme,filter:Tme,limit:c.number().int().min(1).max(50),query:Hme}).strict();var sE=c.object({user:c.object({email:c.string().trim().email(),emailVerified:c.boolean().optional(),name:c.string().nullable().optional()}).strict()}).strict(),Q$e=c.object({displayName:c.string().trim().min(1).max(80)}).strict(),L5=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().optional(),version:c.string().min(1)}).strict();var Jf=C(q(),1);var N5="x-junior-version";var m4="junior:dashboard-version";function R5(e){let t=e.headers.get(N5)?.trim();!t||typeof window>"u"||window.dispatchEvent(new CustomEvent(m4,{detail:t}))}function $5(e){let[t,n]=(0,Jf.useState)(e);return(0,Jf.useEffect)(()=>{e&&n(e)},[e]),(0,Jf.useEffect)(()=>{let r=a=>{n(a.detail)};return window.addEventListener(m4,r),()=>window.removeEventListener(m4,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 nd(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 jp(){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 cE(e,t,n){let r=await Pp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"PATCH"});return r.status===401&&jp(),r.ok||await nd(t,r),e.parse(await r.json())}async function ad(e,t,n){let r=await Pp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"POST"});return r.status===401&&jp(),r.ok||await nd(t,r),e.parse(await r.json())}async function M5(e,t,n){let r=await Pp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"PUT"});return r.status===401&&jp(),r.ok||await nd(t,r),e.parse(await r.json())}async function Fc(e){let t=await Pp(e,{credentials:"same-origin",method:"DELETE"});t.status===401&&jp(),t.ok||await nd(e,t)}async function j5(e,t,n={}){let r=await Pp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"DELETE"});return r.status===401&&jp(),r.ok||await nd(t,r),e.parse(await r.json())}async function Pp(e,t){let n=await fetch(e,t);return R5(n),n}async function je(e,t,n){let r=await Pp(t,{credentials:"same-origin",...n?{signal:n}:void 0});return r.status===401&&(jp(),await nd(t,r)),r.ok||await nd(t,r),e.parse(await r.json())}var uE=5*6e4,f4=5*6e4,Gme=1e3;function Ume(e,t=Date.now()){if(!e)return f4;let n=Date.parse(e);if(!Number.isFinite(n))return f4;let r=Math.max(0,t-n);return Math.max(Gme,f4-r)}function P5(){return Re({queryKey:["dashboard","core"],queryFn:async({signal:e})=>{let[t,n]=await Promise.all([je(sE,"/api/me",e),je(L5,"/api/config",e)]);return{config:n,me:t}},retry:!1,staleTime:uE})}function Ome(){return Re({queryKey:["dashboard","plugins"],queryFn:({signal:e})=>je(K8,"/api/plugins",e),retry:!1,staleTime:uE})}function T5(){return Re({queryKey:["dashboard","plugin-user-pages"],queryFn:({signal:e})=>je(S5,"/api/user-pages",e),retry:!1,staleTime:uE})}function dE(e=""){return Re({queryKey:["dashboard","conversations","viewer",{search:e}],queryFn:({signal:t})=>je(q8,`/api/conversations${e?`?q=${encodeURIComponent(e)}`:""}`,t),placeholderData:Yh,retry:!1})}function H5(){return Re({queryKey:["dashboard","code"],queryFn:({signal:e})=>je(YS,"/api/code",e),retry:!1})}function G5(e,t){return Re({enabled:e,queryKey:["dashboard","automations",t],queryFn:({signal:n})=>je(o4,`/api/automations${t?`?q=${encodeURIComponent(t)}`:""}`,n),placeholderData:Yh,retry:!1})}function U5(e){return Re({enabled:e,queryKey:["dashboard","automations","runs"],queryFn:({signal:t})=>je(s4,"/api/automations/runs",t),retry:!1})}function O5(e,t,n){return Re({enabled:e&&!!(t&&n),queryKey:["dashboard","automations",t,n,"executions"],queryFn:({signal:r})=>je(A4,`/api/automations/${t}/${encodeURIComponent(n)}/executions`,r),retry:!1})}function q5(){return Re({queryKey:["dashboard","people"],queryFn:({signal:e})=>je(VS,"/api/people",e),retry:!1})}function z5(e){return Re({enabled:!!e,queryKey:["dashboard","people",e],queryFn:async({signal:t})=>je(XS,`/api/people/${encodeURIComponent(e)}`,t),retry:!1})}function K5(e){return Re({enabled:!!e,queryKey:["dashboard","people",e,"plugin-reports"],queryFn:({signal:t})=>je(Yw,`/api/people/${encodeURIComponent(e)}/plugin-reports`,t),retry:!1})}function Y5(e){return Re({enabled:!!e,queryKey:["dashboard","people",e,"code"],queryFn:({signal:t})=>je(JS,`/api/people/${encodeURIComponent(e)}/code`,t),retry:!1})}function J5(e){return Re({enabled:e,queryKey:["dashboard","personal-spend"],queryFn:({signal:t})=>je(e4,"/api/people/me/spend",t),refetchInterval:t=>Ume(t.state.data?.generatedAt),retry:!1,staleTime:0})}function W5(){return Re({queryKey:["dashboard","locations"],queryFn:({signal:e})=>je(WS,"/api/locations",e),retry:!1})}function Z5(e){return Re({enabled:!!e,queryKey:["dashboard","locations",e],queryFn:async({signal:t})=>je(ZS,`/api/locations/${encodeURIComponent(e)}`,t),retry:!1})}function qme(){return Re({queryKey:["dashboard","skills"],queryFn:({signal:e})=>je(J8,"/api/skills",e),retry:!1,staleTime:uE})}function zme(){return Re({queryKey:["dashboard","plugin-reports"],queryFn:({signal:e})=>je(Yw,"/api/plugin-reports",e),retry:!1})}function V5(){return Re({queryKey:["dashboard","stats"],queryFn:({signal:e})=>je(u4,"/api/stats",e),retry:!1})}function X5(e){let t=Ome(),n=Re({queryKey:["dashboard","conversation-stats"],queryFn:({signal:i})=>je(z8,"/api/conversations/stats",i),retry:!1}),r=qme(),a=zme();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 eU=C(q(),1);function lE(){return(0,eU.useSyncExternalStore)(e=>aA.subscribe(e),()=>aA.isOnline(),()=>!0)}var nU=C(w(),1);function tU(){return lE()?null:(0,nU.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 b4=C(w(),1);function pE(){return(0,b4.jsx)("div",{className:"relative grid size-10 shrink-0 select-none place-items-center overflow-visible",children:(0,b4.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 aU=["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",rU="rounded-2xl bg-dashboard-fill-soft shadow-[inset_0_0_0_1px_var(--color-dashboard-border-subtle)]",oU="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)(pE,{}),(0,Sc.jsxs)("div",{children:[(0,Sc.jsx)("div",{className:"font-bold",children:e.label}),(0,Sc.jsx)("div",{"aria-label":e.label,className:`${aU} mt-3 h-1.5 w-full`,role:"progressbar"})]})]})})}var h4="0.215.0",gE=typeof h4=="string"&&h4.trim()?h4:"unknown";var Wf=C(w(),1);function iU(e){return Kme(e.serverVersion)?(0,Wf.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,Wf.jsx)("span",{children:"The dashboard changed. Refresh to load the latest version."}),(0,Wf.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 Kme(e){return!!e&&gE!=="unknown"&&e!=="unknown"&&e!==gE}var AU=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,AU.jsx)(t,{className:k("min-w-0 overflow-hidden rounded-lg border",r,n,e.className),children:e.children})}var sU=C(w(),1);function De(e){let t=e.as??"div";return(0,sU.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}),Yme(t)]})}function Yme(e){switch(e){case"stats":return(0,Fe.jsx)(Jme,{});case"overview":return(0,Fe.jsx)(Wme,{});case"list":return(0,Fe.jsx)(Zme,{});case"library":return(0,Fe.jsx)(Vme,{});case"panel":return(0,Fe.jsx)(hA,{className:"min-h-64"})}}function Jme(){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 Wme(){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)(Tp,{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 Zme(){return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(hA,{className:"min-h-20 p-4"}),(0,Fe.jsx)(Tp,{className:"h-10 border-b border-dashboard-border-subtle"}),(0,Fe.jsx)(hA,{className:"min-h-80"})]})}function Vme(){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)(Tp,{className:"h-7 w-56 rounded bg-dashboard-fill-soft"}),(0,Fe.jsx)(Tp,{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)(Tp,{className:"h-3 w-12 rounded bg-dashboard-fill-soft"}),(0,Fe.jsx)(Tp,{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 Tp(e){return(0,Fe.jsx)(De,{className:e.className})}var mE=C(w(),1),cU="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",Xme="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,mE.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(Xme,"disabled:hover:border-dashboard-border-strong disabled:hover:text-dashboard-text-muted"):k(cU,"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 uU({className:e,...t}){return(0,mE.jsx)(pe,{...t,className:k(cU,"no-underline",e)})}function na({className:e,pressed:t,type:n="button",variant:r,...a}){return(0,mE.jsx)("button",{...a,"aria-pressed":t,className:k(efe[r],t?tfe[r]:nfe[r],e),type:n})}var efe={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"},tfe={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"},nfe={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 B4=C(w(),1),afe=[1,7,30,90];function y4(e){return e===1?"24h":`${e}d`}function Hp(e){return e===1?"last 24 hours":`last ${e} days`}function yn(e){return e===1?"hour":e===7?"6hour":"day"}function dU(e){return e===1}function rfe(e){return e===7}function Va(e){return e==="hour"?"hour":e==="6hour"?"6h":"day"}function fE(e){return e==="hour"?"hour":e==="6hour"?"6 hours":"day"}function Zf(e){return e==="hour"?"Hourly":e==="6hour"?"6-hour":"Daily"}function xn(e){return dU(e.range)&&e.hours?.length?e.hours.slice(-24):dU(e.range)?e.days.slice(-1):rfe(e.range)?e.sixHours?.length?[...e.sixHours]:e.hours?.length&&e.emptySixHour?ofe({empty:e.emptySixHour,hours:e.hours}):e.days.slice(-e.range):e.days.slice(-e.range)}function ofe(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 bE(e){return(0,B4.jsx)("div",{"aria-label":"Reporting period",className:"flex items-center gap-1",role:"group",children:(e.options??afe).map(t=>(0,B4.jsx)(na,{onClick:()=>e.onChange(t),pressed:e.value===t,variant:"segment",children:y4(t)},t))})}var Lc=C(w(),1);function He(e){let t=e.range!==void 0&&e.onRangeChange?(0,Lc.jsx)(bE,{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 lU=C(w(),1);function Go(e){return(0,lU.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 Vf=C(w(),1);function rd(e){return(0,Vf.jsxs)(Go,{children:[(0,Vf.jsx)(He,{description:e.description,title:e.title}),(0,Vf.jsx)(Na,{label:e.label,variant:e.variant})]})}var yE=C(q(),1);var hE=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var pU=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var gU=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());var C4=e=>{let t=gU(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Xf=C(q(),1);var BE={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 mU=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var Gp=C(q(),1);var ife=(0,Gp.createContext)({});var fU=()=>(0,Gp.useContext)(ife);var bU=(0,Xf.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:g="currentColor",className:p=""}=fU()??{},m=r??l?Number(n??d)*24/Number(t??u):n??d;return(0,Xf.createElement)("svg",{ref:s,...BE,width:t??u??BE.width,height:t??u??BE.height,stroke:e??g,strokeWidth:m,className:hE("lucide",p,a),...!o&&!mU(A)&&{"aria-hidden":"true"},...A},[...i.map(([h,B])=>(0,Xf.createElement)(h,B)),...Array.isArray(o)?o:[o]])});var F=(e,t)=>{let n=(0,yE.forwardRef)(({className:r,...a},o)=>(0,yE.createElement)(bU,{ref:o,iconNode:t,className:hE(`lucide-${pU(C4(e))}`,`lucide-${e}`,r),...a}));return n.displayName=C4(e),n};var Afe=[["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",Afe);var sfe=[["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",sfe);var cfe=[["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",cfe);var ufe=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],eb=F("arrow-down-to-line",ufe);var dfe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],BA=F("arrow-left",dfe);var lfe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],tb=F("arrow-right",lfe);var pfe=[["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"}]],nb=F("bookmark",pfe);var gfe=[["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",gfe);var mfe=[["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",mfe);var ffe=[["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",ffe);var bfe=[["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",bfe);var hfe=[["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",hfe);var Bfe=[["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",Bfe);var yfe=[["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"}]],ab=F("calendar",yfe);var Cfe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],od=F("check",Cfe);var wfe=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],rb=F("chevron-down",wfe);var Efe=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ob=F("chevron-left",Efe);var kfe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],aa=F("chevron-right",kfe);var Qfe=[["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",Qfe);var Ife=[["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"}]],ib=F("circle-dashed",Ife);var vfe=[["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"}]],id=F("circle-dollar-sign",vfe);var _fe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],Ab=F("circle-dot",_fe);var xfe=[["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",xfe);var Dfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],ki=F("clock-3",Dfe);var Ffe=[["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",Ffe);var Sfe=[["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"}]],Ad=F("copy",Sfe);var Lfe=[["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",Lfe);var Nfe=[["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"}]],mr=F("earth",Nfe);var Rfe=[["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",Rfe);var $fe=[["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"}]],sd=F("external-link",$fe);var Mfe=[["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"}]],sb=F("file-text",Mfe);var jfe=[["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",jfe);var Pfe=[["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"}]],cb=F("folder-git-2",Pfe);var Tfe=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],ub=F("gauge",Tfe);var Hfe=[["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"}]],db=F("git-merge",Hfe);var Gfe=[["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",Gfe);var Ufe=[["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"}]],lb=F("hash",Ufe);var Ofe=[["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",Ofe);var qfe=[["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",qfe);var zfe=[["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",zfe);var Kfe=[["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"}]],cd=F("library-big",Kfe);var Yfe=[["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"}]],pb=F("lightbulb",Yfe);var Jfe=[["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"}]],gb=F("list-checks",Jfe);var Wfe=[["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"}]],mb=F("link",Wfe);var Zfe=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Qs=F("loader-circle",Zfe);var Vfe=[["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"}]],fr=F("lock-keyhole",Vfe);var Xfe=[["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"}]],fb=F("lock",Xfe);var ebe=[["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"}]],bb=F("log-out",ebe);var tbe=[["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"}]],ud=F("map-pin",tbe);var nbe=[["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"}]],hb=F("map-pinned",nbe);var abe=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],dd=F("menu",abe);var rbe=[["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"}]],Bb=F("message-square-text",rbe);var obe=[["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",obe);var ibe=[["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"}]],Up=F("messages-square",ibe);var Abe=[["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"}]],yb=F("minimize-2",Abe);var sbe=[["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"}]],Cb=F("paperclip",sbe);var cbe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ld=F("plus",cbe);var ube=[["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"}]],wb=F("radio-tower",ube);var dbe=[["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"}]],Op=F("scroll-text",dbe);var lbe=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Hc=F("search",lbe);var pbe=[["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"}]],pd=F("send",pbe);var gbe=[["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"}]],Eb=F("settings",gbe);var mbe=[["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"}]],kb=F("sigma",mbe);var fbe=[["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"}]],Qb=F("skip-forward",fbe);var bbe=[["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"}]],Xa=F("sparkles",bbe);var hbe=[["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",hbe);var Bbe=[["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",Bbe);var ybe=[["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",ybe);var Cbe=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Ib=F("trending-up",Cbe);var wbe=[["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",wbe);var Ebe=[["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",Ebe);var kbe=[["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"}]],gd=F("users",kbe);var Qbe=[["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"}]],vb=F("webhook",Qbe);var Ibe=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],er=F("x",Ibe);var vbe=[["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"}]],_b=F("zap",vbe);var MA=C(q(),1);var w4=Object.defineProperty,_be=Object.getOwnPropertyDescriptor,xbe=Object.getOwnPropertyNames,Dbe=Object.prototype.hasOwnProperty,BU=(e,t)=>{let n={};for(var r in e)w4(n,r,{get:e[r],enumerable:!0});return t||w4(n,Symbol.toStringTag,{value:"Module"}),n},hU=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=xbe(t),o=0,i=a.length,A;o<i;o++)A=a[o],!Dbe.call(e,A)&&A!==n&&w4(e,A,{get:(s=>t[s]).bind(null,A),enumerable:!(r=_be(t,A))||r.enumerable});return e},yU=(e,t,n)=>(hU(e,t,"default"),n&&hU(n,t,"default"));var I4={};L(I4,{createOnigurumaEngine:()=>Kbe,getDefaultWasmLoader:()=>zbe,loadWasm:()=>wU,setDefaultWasmLoader:()=>qbe});var Q4=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Fbe(){return 2147483648}function Sbe(){return typeof performance<"u"?performance.now():Date.now()}var Lbe=(e,t)=>e+(t-e%t)%t;async function Nbe(e){let t,n,r={};function a(p){n=p,r.HEAPU8=new Uint8Array(p),r.HEAPU32=new Uint32Array(p)}function o(p,m,h){r.HEAPU8.copyWithin(p,m,m+h)}function i(p){try{return t.grow(p-n.byteLength+65535>>>16),a(t.buffer),1}catch{}}function A(p){let m=r.HEAPU8.length;p=p>>>0;let h=Fbe();if(p>h)return!1;for(let B=1;B<=4;B*=2){let b=m*(1+.2/B);b=Math.min(b,p+100663296);let f=Math.min(h,Lbe(Math.max(p,b),65536));if(i(f))return!0}return!1}let s=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(p,m,h=1024){let B=m+h,b=m;for(;p[b]&&!(b>=B);)++b;if(b-m>16&&p.buffer&&s)return s.decode(p.subarray(m,b));let f="";for(;m<b;){let y=p[m++];if(!(y&128)){f+=String.fromCharCode(y);continue}let E=p[m++]&63;if((y&224)===192){f+=String.fromCharCode((y&31)<<6|E);continue}let I=p[m++]&63;if((y&240)===224?y=(y&15)<<12|E<<6|I:y=(y&7)<<18|E<<12|I<<6|p[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(p,m){return p?u(r.HEAPU8,p,m):""}let l={emscripten_get_now:Sbe,emscripten_memcpy_big:o,emscripten_resize_heap:A,fd_write:()=>0};async function g(){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 g(),r}var Rbe=Object.defineProperty,$be=(e,t,n)=>t in e?Rbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ra=(e,t,n)=>$be(e,typeof t!="symbol"?t+"":t,n),ya=null;function Mbe(e){throw new Q4(e.UTF8ToString(e.getLastOnigError()))}var wE=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,g=!1;if(d>=55296&&d<=56319&&u+1<n){let p=t.charCodeAt(u+1);p>=56320&&p<=57343&&(l=(d-55296<<10)+65536|p-56320,g=!0)}a&&(o[u]=s,g&&(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),g&&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}},EE=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 Q4("Must invoke loadWasm first.");this._onigBinding=ya,this.content=t;let n=new wE(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(EE,"LAST_ID",0);ra(EE,"_sharedPtr",0);ra(EE,"_sharedPtrInUse",!1);var CU=EE,k4=class{constructor(t){if(ra(this,"_onigBinding"),ra(this,"_ptr"),!ya)throw new Q4("Must invoke loadWasm first.");let n=[],r=[];for(let A=0,s=t.length;A<s;A++){let u=new wE(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&&Mbe(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 CU(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 g=0;g<d;g++){let p=t.convertUtf8OffsetToUtf16(A[s++]),m=t.convertUtf8OffsetToUtf16(A[s++]);l[g]={start:p,end:m,length:m-p}}return{index:u,captureIndices:l}}};function jbe(e){return typeof e.instantiator=="function"}function Pbe(e){return typeof e.default=="function"}function Tbe(e){return typeof e.data<"u"}function Hbe(e){return typeof Response<"u"&&e instanceof Response}function Gbe(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 CE;function wU(e){if(CE)return CE;async function t(){ya=await Nbe(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),jbe(r)?r=await r.instantiator(n):Pbe(r)?r=await r.default(n):(Tbe(r)&&(r=r.data),Hbe(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await Ube(r)(n):r=await Obe(r)(n):Gbe(r)?r=await E4(r)(n):r instanceof WebAssembly.Module?r=await E4(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await E4(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return CE=t(),CE}function E4(e){return t=>WebAssembly.instantiate(e,t)}function Ube(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Obe(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var EU;function qbe(e){EU=e}function zbe(){return EU}async function Kbe(e){return e&&await wU(e),{createScanner(t){return new k4(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new CU(t)}}}var v4=BU({});yU(v4,I4);var zq=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>Promise.resolve().then(()=>(QU(),kU)))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>Promise.resolve().then(()=>(vU(),IU)))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(xU(),_U)))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>Promise.resolve().then(()=>(FU(),DU)))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>Promise.resolve().then(()=>(LU(),SU)))},{id:"catppuccin-frappe",displayName:"Catppuccin Frapp\xE9",type:"dark",import:(()=>Promise.resolve().then(()=>(RU(),NU)))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>Promise.resolve().then(()=>(MU(),$U)))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>Promise.resolve().then(()=>(PU(),jU)))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>Promise.resolve().then(()=>(HU(),TU)))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>Promise.resolve().then(()=>(UU(),GU)))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>Promise.resolve().then(()=>(qU(),OU)))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>Promise.resolve().then(()=>(KU(),zU)))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(JU(),YU)))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>Promise.resolve().then(()=>(ZU(),WU)))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(XU(),VU)))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>Promise.resolve().then(()=>(tO(),eO)))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>Promise.resolve().then(()=>(aO(),nO)))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>Promise.resolve().then(()=>(oO(),rO)))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>Promise.resolve().then(()=>(AO(),iO)))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>Promise.resolve().then(()=>(cO(),sO)))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>Promise.resolve().then(()=>(dO(),uO)))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>Promise.resolve().then(()=>(pO(),lO)))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>Promise.resolve().then(()=>(mO(),gO)))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>Promise.resolve().then(()=>(bO(),fO)))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>Promise.resolve().then(()=>(BO(),hO)))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>Promise.resolve().then(()=>(CO(),yO)))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>Promise.resolve().then(()=>(EO(),wO)))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>Promise.resolve().then(()=>(QO(),kO)))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>Promise.resolve().then(()=>(vO(),IO)))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>Promise.resolve().then(()=>(xO(),_O)))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>Promise.resolve().then(()=>(FO(),DO)))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>Promise.resolve().then(()=>(LO(),SO)))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>Promise.resolve().then(()=>(RO(),NO)))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>Promise.resolve().then(()=>(MO(),$O)))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>Promise.resolve().then(()=>(PO(),jO)))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>Promise.resolve().then(()=>(HO(),TO)))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>Promise.resolve().then(()=>(UO(),GO)))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>Promise.resolve().then(()=>(qO(),OO)))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>Promise.resolve().then(()=>(KO(),zO)))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>Promise.resolve().then(()=>(JO(),YO)))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(ZO(),WO)))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>Promise.resolve().then(()=>(XO(),VO)))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>Promise.resolve().then(()=>(tq(),eq)))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>Promise.resolve().then(()=>(aq(),nq)))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>Promise.resolve().then(()=>(oq(),rq)))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>Promise.resolve().then(()=>(Aq(),iq)))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>Promise.resolve().then(()=>(cq(),sq)))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>Promise.resolve().then(()=>(dq(),uq)))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>Promise.resolve().then(()=>(pq(),lq)))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>Promise.resolve().then(()=>(mq(),gq)))},{id:"red",displayName:"Red",type:"dark",import:(()=>Promise.resolve().then(()=>(bq(),fq)))},{id:"rose-pine",displayName:"Ros\xE9 Pine",type:"dark",import:(()=>Promise.resolve().then(()=>(Bq(),hq)))},{id:"rose-pine-dawn",displayName:"Ros\xE9 Pine Dawn",type:"light",import:(()=>Promise.resolve().then(()=>(Cq(),yq)))},{id:"rose-pine-moon",displayName:"Ros\xE9 Pine Moon",type:"dark",import:(()=>Promise.resolve().then(()=>(Eq(),wq)))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(Qq(),kq)))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>Promise.resolve().then(()=>(vq(),Iq)))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>Promise.resolve().then(()=>(xq(),_q)))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(Fq(),Dq)))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>Promise.resolve().then(()=>(Lq(),Sq)))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>Promise.resolve().then(()=>(Rq(),Nq)))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>Promise.resolve().then(()=>(Mq(),$q)))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>Promise.resolve().then(()=>(Pq(),jq)))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>Promise.resolve().then(()=>(Hq(),Tq)))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(Uq(),Gq)))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>Promise.resolve().then(()=>(qq(),Oq)))}],Kq=Object.fromEntries(zq.map(e=>[e.id,e.import]));var Et=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function oBe(e){return M4(e)}function M4(e){return Array.isArray(e)?iBe(e):e instanceof RegExp?e:typeof e=="object"?ABe(e):e}function iBe(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=M4(e[n]);return t}function ABe(e){let t={};for(let n in e)t[n]=M4(e[n]);return t}function nz(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function az(e){let t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?az(e.substring(0,e.length-1)):e.substr(~t+1)}var _4=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,kE=class{static hasCaptures(e){return e===null?!1:(_4.lastIndex=0,_4.test(e))}static replaceCaptures(e,t,n){return e.replace(_4,(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 rz(e,t){return e<t?-1:e>t?1:0}function oz(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=rz(e[a],t[a]);if(o!==0)return o}return 0}return n-r}function Yq(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 iz(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Az=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}},Fb=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(uBe(e),t)}static createFromParsedTheme(e,t){return lBe(e,t)}_cachedMatchRoot=new Az(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=>sBe(e.parent,a.parentScopes));return r?new sz(r.fontStyle,r.foreground,r.background):null}},x4=class QE{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(let r of n)t=new QE(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new QE(n,t[r]);return n}push(t){return new QE(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 sBe(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&&!cBe(e.scopeName,r);){if(a)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function cBe(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var sz=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function uBe(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 g=0,p=l.length;g<p;g++)switch(l[g]){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"&&Yq(i.settings.foreground)&&(u=i.settings.foreground);let d=null;typeof i.settings.background=="string"&&Yq(i.settings.background)&&(d=i.settings.background);for(let l=0,g=A.length;l<g;l++){let m=A[l].trim().split(" "),h=m[m.length-1],B=null;m.length>1&&(B=m.slice(0,m.length-1),B.reverse()),n[r++]=new dBe(h,B,a,s,u,d)}}return n}var dBe=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}},$a=(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))($a||{});function lBe(e,t){e.sort((s,u)=>{let d=rz(s.scope,u.scope);return d!==0||(d=oz(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 pBe(t),i=new sz(n,o.getId(r),o.getId(a)),A=new mBe(new F4(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 Fb(o,i,A)}var pBe=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)}},gBe=Object.freeze([]),F4=class cz{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,a,o){this.scopeDepth=t,this.parentScopes=n||gBe,this.fontStyle=r,this.foreground=a,this.background=o}clone(){return new cz(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)}},mBe=class S4{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(S4._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 S4(this._mainRule.clone(),F4.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(oz(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 F4(t,n,r,a,o))}},fd=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),g=Oo.getForeground(t),p=Oo.getBackground(t);return n!==0&&(s=n),r!==8&&(u=r),a!==null&&(d=a?1:0),o!==-1&&(l=o),i!==0&&(g=i),A!==0&&(p=A),(s<<0|u<<8|d<<10|l<<11|g<<15|p<<24)>>>0}};function vE(e,t){let n=[],r=fBe(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(Jq(a)){let s=[];do s.push(a),a=r.next();while(Jq(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 Jq(e){return!!e&&!!e.match(/[\w\.:]+/)}function fBe(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 uz(e){typeof e.dispose=="function"&&e.dispose()}var Sb=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},bBe=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},hBe=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))}},BBe=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Sb(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new hBe;for(let n of e)yBe(n,this.initialScopeName,this.repo,t);for(let n of t.references)if(n instanceof Sb){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 yBe(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 Sb?IE({baseGrammar:o,selfGrammar:a},r):L4(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 Sb(A))}function L4(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];_E([r],t,n)}}function IE(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&_E(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&_E(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function _E(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let a=r.repository?nz({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&_E(r.patterns,{...t,repository:a},n);let o=r.include;if(!o)continue;let i=dz(o);switch(i.kind){case 0:IE({...t,selfGrammar:t.baseGrammar},n);break;case 1:IE(t,n);break;case 2:L4(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?L4(i.ruleName,s,n):IE(s,n)}else i.kind===4?n.add(new bBe(i.scopeName,i.ruleName)):n.add(new Sb(i.scopeName));break}}}var CBe=class{kind=0},wBe=class{kind=1},EBe=class{constructor(e){this.ruleName=e}kind=2},kBe=class{constructor(e){this.scopeName=e}kind=3},QBe=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function dz(e){if(e==="$base")return new CBe;if(e==="$self")return new wBe;let t=e.indexOf("#");if(t===-1)return new kBe(e);if(t===0)return new EBe(e.substring(1));{let n=e.substring(0,t),r=e.substring(t+1);return new QBe(n,r)}}var IBe=/\\(\d+)/,Wq=/\\(\d+)/g;var vBe=-1,lz=-2;var Rb=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=kE.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=kE.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${az(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:kE.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:kE.replaceCaptures(this._contentName,e,t)}},_Be=class extends Rb{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!")}},xBe=class extends Rb{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,a){super(e,t,n,null),this._match=new Lb(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 Nb,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Zq=class extends Rb{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 Nb,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},N4=class extends Rb{_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 Lb(a,this.id),this.beginCaptures=o,this._end=new Lb(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 Nb;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}},xE=class extends Rb{_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 Lb(a,this.id),this.beginCaptures=o,this.whileCaptures=A,this._while=new Lb(i,lz),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 Nb;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 Nb,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"\uFFFF"),this._cachedCompiledWhilePatterns}},pz=class tr{static createCaptureRule(t,n,r,a,o){return t.registerRule(i=>new _Be(n,i,r,a,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(a=>{if(t.id=a,t.match)return new xBe(t.$vscodeTextmateLocation,t.id,t.name,t.match,tr._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=nz({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new Zq(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,tr._compilePatterns(o,n,r))}return t.while?new xE(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,tr._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,tr._compileCaptures(t.whileCaptures||t.captures,n,r),tr._compilePatterns(t.patterns,n,r)):new N4(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,tr._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,tr._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,tr._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=tr.getCompiledRuleId(t[i],n,r)),a[A]=tr.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=dz(A.include);switch(u.kind){case 0:case 1:s=tr.getCompiledRuleId(r[A.include],n,r);break;case 2:let d=r[u.ruleName];d&&(s=tr.getCompiledRuleId(d,n,r));break;case 3:case 4:let l=u.scopeName,g=u.kind===4?u.ruleName:null,p=n.getExternalGrammar(l,r);if(p)if(g){let m=p.repository[g];m&&(s=tr.getCompiledRuleId(m,n,p.repository))}else s=tr.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else s=tr.getCompiledRuleId(A,n,r);if(s!==-1){let u=n.getRule(s),d=!1;if((u instanceof Zq||u instanceof N4||u instanceof xE)&&u.hasMissingPatterns&&u.patterns.length===0&&(d=!0),d)continue;a.push(s)}}return{patterns:a,hasMissingPatterns:(t?t.length:0)!==a.length}}},Lb=class gz{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=IBe.test(this.source):this.hasBackReferences=!1}clone(){return new gz(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 Wq.lastIndex=0,this.source.replace(Wq,(a,o)=>iz(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}},Nb=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 Vq(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 Vq(e,r,this._items.map(a=>a.ruleId))}},Vq=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 JP(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;JP(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 WP=new Set(["type","properties","required","additionalProperties"]),KP=["oneOf","anyOf"];function YP(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function R1(e){let t=[];for(let o of e){if(typeof o!="object"||o.type!=="object")return null;for(let i in o)if(!WP.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]??YP(u);d!=null&&(A.some(l=>JSON.stringify(l)===JSON.stringify(d))||A.push(d))}let s=A.length===1?A[0]:R1(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=YP(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 sde(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let a of WP)if(a in e)return;let n=t.filter(a=>KP.some(o=>Array.isArray(a[o]))),r=null;if(!n.length)r=R1(t);else{let a=n[0],o=KP.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=>R1([...i,s]));if(A.some(s=>!s))return;r={[o]:A}}r&&(delete e.allOf,If(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 p=e.seen.get(l),m=p.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)):If(u,m),If(u,d),A._zod.parent===l)for(let B in u)B==="$ref"||B==="allOf"||B in d||delete u[B];if(m.$ref&&p.def)for(let B in u)B==="$ref"||B==="allOf"||B in p.def&&JSON.stringify(u[B])===JSON.stringify(p.def[B])&&delete u[B]}let g=A._zod.parent;if(g&&g!==l){r(g);let p=e.seen.get(g);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(let m in u)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(u[m])===JSON.stringify(p.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())JP(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)??[])sde(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)}If(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:Bp(t,"input",e.processors),output:Bp(t,"output",e.processors)}},enumerable:!1,writable:!1}),A}catch{throw new Error("Error converting schema to JSON.")}}function gr(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 gr(r.element,n);if(r.type==="set")return gr(r.valueType,n);if(r.type==="lazy")return gr(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 gr(r.innerType,n);if(r.type==="intersection")return gr(r.left,n)||gr(r.right,n);if(r.type==="record"||r.type==="map")return gr(r.keyType,n)||gr(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:gr(r.in,n)||gr(r.out,n);if(r.type==="object"){for(let a in r.shape)if(gr(r.shape[a],n))return!0;return!1}if(r.type==="union"){for(let a of r.options)if(gr(a,n))return!0;return!1}if(r.type==="tuple"){for(let a of r.items)if(gr(a,n))return!0;return!!(r.rest&&gr(r.rest,n))}return!1}var $1=(e,t={})=>n=>{let r=kc({...n,processors:t});return ht(e,r),Qc(r,e),Ic(r,e)},Bp=(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 cde={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},P1=(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=cde[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(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},T1=(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),g=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";l?p?(a.minimum=d,a.exclusiveMinimum=!0):a.exclusiveMinimum=d:typeof o=="number"&&(a.minimum=o),g?p?(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`))},H1=(e,t,n,r)=>{n.type="boolean"},G1=(e,t,n,r)=>{ta(e,t,n,r,"BigInt cannot be represented in JSON Schema")},U1=(e,t,n,r)=>{ta(e,t,n,r,"Symbols cannot be represented in JSON Schema")},O1=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},q1=(e,t,n,r)=>{ta(e,t,n,r,"Undefined cannot be represented in JSON Schema")},z1=(e,t,n,r)=>{ta(e,t,n,r,"Void cannot be represented in JSON Schema")},K1=(e,t,n,r)=>{n.not={}},Y1=(e,t,n,r)=>{},J1=(e,t,n,r)=>{},W1=(e,t,n,r)=>{ta(e,t,n,r,"Date cannot be represented in JSON Schema")},Z1=(e,t,n,r)=>{let a=e._zod.def,o=Vm(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},V1=(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},X1=(e,t,n,r)=>{ta(e,t,n,r,"NaN cannot be represented in JSON Schema")},eF=(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},tF=(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)},nF=(e,t,n,r)=>{n.type="boolean"},aF=(e,t,n,r)=>{ta(e,t,n,r,"Custom types cannot be represented in JSON Schema")},rF=(e,t,n,r)=>{ta(e,t,n,r,"Function types cannot be represented in JSON Schema")},oF=(e,t,n,r)=>{ta(e,t,n,r,"Transforms cannot be represented in JSON Schema")},iF=(e,t,n,r)=>{ta(e,t,n,r,"Map cannot be represented in JSON Schema")},AF=(e,t,n,r)=>{ta(e,t,n,r,"Set cannot be represented in JSON Schema")},sF=(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 vf(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?vf(t.out):t.type==="catch"?vf(t.innerType):e._zod.optin}var cF=(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"?vf(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)},lw=(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},uF=(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)},dF=(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((h,B)=>ht(h,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 h=o.items[d-1];if(!(t.io==="input"?vf(h)!==void 0:h._zod.optout==="optional"))break;d--}let l=o.items.length,g=!o.rest;t.target==="draft-2020-12"?(a.prefixItems=s,g?a.items=!1:u&&(a.items=u),d>0&&(a.minItems=d),g&&(a.maxItems=l)):t.target==="openapi-3.0"?(a.items={anyOf:s},u&&a.items.anyOf.push(u),d>0&&(a.minItems=d),g&&(a.maxItems=l)):(a.items=s,g?a.additionalItems=!1:u&&(a.additionalItems=u),d>0&&(a.minItems=d),g&&(a.maxItems=l));let{minimum:p,maximum:m}=e._zod.bag;typeof p=="number"&&(a.minItems=p),typeof m=="number"&&(a.maxItems=m)};function M1(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 h=M1(e,m,n);return h===m?t:h}for(let m of["anyOf","oneOf"]){let h=t[m];if(!Array.isArray(h))continue;let B=h.map(b=>M1(e,b,n));B.some((b,f)=>b!==h[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:g,...p}=t;return p.enum?p.enum=p.enum.map(m=>typeof m=="number"?String(m):m):typeof p.const=="number"&&(p.const=String(p.const)),a&&(p.type="string",o||(p.pattern=(r.includes("number")?Cc:cf).source)),p}var j1=new WeakMap;function ude(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 j1.get(e)??[]){let a=e.seen.get(r),o=(a?.def??a?.schema)?.propertyNames;if(!o||o===!0||n.has(o))continue;let i=M1(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 lF=(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 g of s)sn(a.patternProperties,g.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=j1.get(t);l||(l=[],j1.set(t,l),t.deferred.push(()=>ude(t))),l.push(e)}a.additionalProperties=ht(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let u=i._zod.values,d=t.io==="input"&&vf(o.valueType)!==void 0;if(u&&!o.partial&&!d){let l=[...u].filter(g=>typeof g=="string"||typeof g=="number");l.length>0&&(a.required=l.map(String))}},pF=(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"}]},gF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},mF=Symbol();function ZP(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"),mF):JSON.parse(i)}var fF=(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=ZP(a.defaultValue,e,t,n,r);i!==mF&&(n.default=i)},bF=(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=ZP(a.defaultValue,e,t,n,r);i!==mF&&(n._prefault=i)},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;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},BF=(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},yF=(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},CF=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},pw=(e,t,n,r)=>{let a=e._zod.def;ht(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},wF=(e,t,n,r)=>{let a=e._zod.innerType;ht(a,t,r);let o=t.seen.get(e);o.ref=a},dw={string:P1,number:T1,boolean:H1,bigint:G1,symbol:U1,null:O1,undefined:q1,void:z1,never:K1,any:Y1,unknown:J1,date:W1,enum:Z1,literal:V1,nan:X1,template_literal:eF,file:tF,success:nF,custom:aF,function:rF,transform:oF,map:iF,set:AF,array:sF,object:cF,union:lw,intersection:uF,tuple:dF,record:lF,nullable:pF,nonoptional:gF,default:fF,prefault:bF,catch:hF,pipe:BF,readonly:yF,promise:CF,optional:pw,lazy:wF};function gw(e,t){if("_idmap"in e){let r=e,a=kc({...t,processors:dw}),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:dw});return ht(e,n),Qc(n,e),Ic(n,e)}var mw=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:dw,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 VP={};var _p={};L(_p,{ZodAny:()=>UF,ZodArray:()=>KF,ZodBase64:()=>Nw,ZodBase64URL:()=>Rw,ZodBigInt:()=>Ip,ZodBigIntFormat:()=>jw,ZodBoolean:()=>Qp,ZodCIDRv4:()=>Sw,ZodCIDRv6:()=>Lw,ZodCUID:()=>Qw,ZodCUID2:()=>Iw,ZodCatch:()=>g8,ZodCodec:()=>Mf,ZodCreditCard:()=>$F,ZodCustom:()=>jf,ZodCustomStringFormat:()=>Ep,ZodDate:()=>Ff,ZodDefault:()=>s8,ZodDiscriminatedUnion:()=>JF,ZodE164:()=>$w,ZodEmail:()=>Cw,ZodEmoji:()=>Ew,ZodEnum:()=>Cp,ZodExactOptional:()=>Gw,ZodFile:()=>r8,ZodFunction:()=>k8,ZodGUID:()=>ww,ZodIPv4:()=>Dw,ZodIPv6:()=>Fw,ZodISODate:()=>_c,ZodISODateTime:()=>vc,ZodISODuration:()=>Dc,ZodISOTime:()=>xc,ZodIntersection:()=>WF,ZodJWT:()=>Mw,ZodKSUID:()=>xw,ZodLazy:()=>C8,ZodLiteral:()=>a8,ZodMAC:()=>RF,ZodMap:()=>t8,ZodNaN:()=>f8,ZodNanoID:()=>kw,ZodNever:()=>qF,ZodNonOptional:()=>Uw,ZodNull:()=>HF,ZodNullable:()=>A8,ZodNumber:()=>kp,ZodNumberFormat:()=>Wu,ZodObject:()=>Lf,ZodOptional:()=>Rf,ZodPipe:()=>$f,ZodPrefault:()=>u8,ZodPreprocess:()=>b8,ZodPromise:()=>E8,ZodReadonly:()=>h8,ZodRecord:()=>yp,ZodSet:()=>n8,ZodString:()=>wp,ZodStringFormat:()=>Dt,ZodSuccess:()=>p8,ZodSymbol:()=>PF,ZodTemplateLiteral:()=>y8,ZodTransform:()=>o8,ZodTuple:()=>VF,ZodType:()=>xe,ZodULID:()=>vw,ZodURL:()=>Df,ZodUUID:()=>mA,ZodUndefined:()=>TF,ZodUnion:()=>Nf,ZodUnknown:()=>OF,ZodVoid:()=>zF,ZodXID:()=>_w,ZodXor:()=>YF,_ZodString:()=>yw,_default:()=>c8,_function:()=>sH,any:()=>PT,array:()=>Sf,base64:()=>CT,base64url:()=>wT,bigint:()=>NT,boolean:()=>jF,catch:()=>m8,check:()=>cH,cidrv4:()=>BT,cidrv6:()=>yT,codec:()=>rH,creditCard:()=>kT,cuid:()=>dT,cuid2:()=>lT,custom:()=>uH,date:()=>HT,describe:()=>dH,discriminatedUnion:()=>KT,e164:()=>ET,email:()=>tT,emoji:()=>cT,enum:()=>Tw,exactOptional:()=>i8,file:()=>eH,float32:()=>DT,float64:()=>FT,function:()=>sH,guid:()=>nT,hash:()=>xT,hex:()=>_T,hostname:()=>vT,httpUrl:()=>sT,instanceof:()=>pH,int:()=>hw,int32:()=>ST,int64:()=>RT,intersection:()=>ZF,invertCodec:()=>oH,ipv4:()=>fT,ipv6:()=>hT,json:()=>mH,jwt:()=>QT,keyof:()=>GT,ksuid:()=>mT,lazy:()=>w8,literal:()=>XT,looseObject:()=>qT,looseRecord:()=>JT,mac:()=>bT,map:()=>WT,meta:()=>lH,nan:()=>aH,nanoid:()=>uT,nativeEnum:()=>VT,never:()=>Pw,nonoptional:()=>l8,null:()=>GF,nullable:()=>xf,nullish:()=>tH,number:()=>MF,object:()=>UT,optional:()=>Yu,partialRecord:()=>YT,pipe:()=>Bw,prefault:()=>d8,preprocess:()=>fH,promise:()=>AH,readonly:()=>B8,record:()=>e8,refine:()=>Q8,set:()=>ZT,strictObject:()=>OT,string:()=>_f,stringFormat:()=>IT,stringbool:()=>gH,success:()=>nH,superRefine:()=>I8,symbol:()=>MT,templateLiteral:()=>iH,transform:()=>Hw,tuple:()=>XF,uint32:()=>LT,uint64:()=>$T,ulid:()=>pT,undefined:()=>jT,union:()=>vp,unknown:()=>Ku,url:()=>AT,uuid:()=>aT,uuidv4:()=>rT,uuidv6:()=>oT,uuidv7:()=>iT,void:()=>TT,xid:()=>gT,xor:()=>zT});var fw={};L(fw,{endsWith:()=>dp,gt:()=>pA,gte:()=>mo,includes:()=>cp,length:()=>zu,lowercase:()=>Ap,lt:()=>lA,lte:()=>go,maxLength:()=>qu,maxSize:()=>Ec,mime:()=>lp,minLength:()=>fs,minSize:()=>gA,multipleOf:()=>wc,negative:()=>iw,nonnegative:()=>sw,nonpositive:()=>Aw,normalize:()=>pp,overwrite:()=>Ci,positive:()=>ow,properties:()=>uw,property:()=>cw,regex:()=>ip,size:()=>Ou,slugify:()=>bp,startsWith:()=>up,toLowerCase:()=>mp,toUpperCase:()=>fp,trim:()=>gp,uppercase:()=>sp});var XP=new WeakSet([Object.prototype,Error.prototype]);function bw(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 eT=(e,t)=>{of.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);XP.has(n)||(XP.add(n),bw(n,"format",r=>a=>sf(r,a)),bw(n,"flatten",r=>a=>Af(r,a)),bw(n,"addIssue",r=>a=>{r.issues.push(a),r.message=JSON.stringify(r.issues,Wl,2)}),bw(n,"addIssues",r=>a=>{r.issues.push(...a),r.message=JSON.stringify(r.issues,Wl,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},lde=_("ZodError",eT),Ur=_("ZodError",eT,void 0,{Parent:Error});var EF=Xl(Ur),kF=ep(Ur),QF=tp(Ur),IF=np(Ur),vF=Wy(Ur),_F=Zy(Ur),xF=Vy(Ur),DF=Xy(Ur),FF=eC(Ur),SF=tC(Ur),LF=nC(Ur),NF=aC(Ur);function gde(){ha.localeError||hn(SC())}function Ju(){ha.memoizer||hn({memoizer:hf()})}var xe=_("ZodType",(e,t)=>(gde(),we.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(Q8(e,t))},superRefine(e,t){return this.check(I8(e,t))},overwrite(e){return this.check(Ci(e))},optional(){return Yu(this)},exactOptional(){return i8(this)},nullable(){return xf(this)},nullish(){return Yu(xf(this))},nonoptional(e){return l8(this,e)},array(){return Sf(this)},or(e){return vp([this,e])},and(e){return ZF(this,e)},transform(e){return Bw(this,Hw(e))},default(e){return c8(this,e)},prefault(e){return d8(this,e)},catch(e){return m8(this,e)},pipe(e){return Bw(this,e)},readonly(){return B8(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",{...gC(this),jsonSchema:{input:Bp(this,"input"),output:Bp(this,"output")}})},set"~standard"(e){G.own(this,"~standard",e)},parse:function e(t,n){return EF(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await kF(this,t,n,{callee:e})},safeParse(e,t){return QF(this,e,t)},async safeParseAsync(e,t){return IF(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){G.own(this,"spa",e)},encode:function e(t,n){return vF(this,t,n,{callee:e})},decode:function e(t,n){return _F(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await xF(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await DF(this,t,n,{callee:e})},safeEncode(e,t){return FF(this,e,t)},safeDecode(e,t){return SF(this,e,t)},async safeEncodeAsync(e,t){return LF(this,e,t)},async safeDecodeAsync(e,t){return NF(this,e,t)},toJSONSchema(e){return $1(this,{})(e)},get description(){return La.get(this)?.description},get _def(){return this._zod.def}}),yw=_("_ZodString",(e,t)=>{Pu.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>P1(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(ip(...e))},includes(...e){return this.check(cp(...e))},startsWith(...e){return this.check(up(...e))},endsWith(...e){return this.check(dp(...e))},min(...e){return this.check(fs(...e))},max(...e){return this.check(qu(...e))},length(...e){return this.check(zu(...e))},nonempty(...e){return this.check(fs(1,...e))},lowercase(e){return this.check(Ap(e))},uppercase(e){return this.check(sp(e))},trim(){return this.check(gp())},normalize(...e){return this.check(pp(...e))},toLowerCase(){return this.check(mp())},toUpperCase(){return this.check(fp())},slugify(){return this.check(bp())}}),wp=_("ZodString",(e,t)=>{Pu.init(e,t),yw.init(e,t)},{email(e){return this.check(jC(Cw,e))},url(e){return this.check(Cf(Df,e))},jwt(e){return this.check(rw(Mw,e))},emoji(e){return this.check(OC(Ew,e))},guid(e){return this.check(PC(ww,e))},uuid(e){return this.check(TC(mA,e))},uuidv4(e){return this.check(HC(mA,e))},uuidv6(e){return this.check(GC(mA,e))},uuidv7(e){return this.check(UC(mA,e))},nanoid(e){return this.check(qC(kw,e))},cuid(e){return this.check(zC(Qw,e))},cuid2(e){return this.check(KC(Iw,e))},ulid(e){return this.check(YC(vw,e))},base64(e){return this.check(tw(Nw,e))},base64url(e){return this.check(nw(Rw,e))},xid(e){return this.check(JC(_w,e))},ksuid(e){return this.check(WC(xw,e))},ipv4(e){return this.check(ZC(Dw,e))},ipv6(e){return this.check(VC(Fw,e))},cidrv4(e){return this.check(XC(Sw,e))},cidrv6(e){return this.check(ew(Lw,e))},e164(e){return this.check(aw($w,e))},datetime(e){return this.check(wf(vc,e))},date(e){return this.check(Ef(_c,e))},time(e){return this.check(kf(xc,e))},duration(e){return this.check(Qf(Dc,e))}});function _f(e){return XD(wp,e)}var Dt=_("ZodStringFormat",(e,t)=>{wt.init(e,t),yw.init(e,t)}),vc=_("ZodISODateTime",(e,t)=>{Ox.init(e,t),Dt.init(e,t)}),_c=_("ZodISODate",(e,t)=>{qx.init(e,t),Dt.init(e,t)}),xc=_("ZodISOTime",(e,t)=>{zx.init(e,t),Dt.init(e,t)}),Dc=_("ZodISODuration",(e,t)=>{Kx.init(e,t),Dt.init(e,t)}),Cw=_("ZodEmail",(e,t)=>{Lx.init(e,t),Dt.init(e,t)});function tT(e){return jC(Cw,e)}var ww=_("ZodGUID",(e,t)=>{Fx.init(e,t),Dt.init(e,t)});function nT(e){return PC(ww,e)}var mA=_("ZodUUID",(e,t)=>{Sx.init(e,t),Dt.init(e,t)});function aT(e){return TC(mA,e)}function rT(e){return HC(mA,e)}function oT(e){return GC(mA,e)}function iT(e){return UC(mA,e)}var Df=_("ZodURL",(e,t)=>{$x.init(e,t),Dt.init(e,t)});function AT(e){return Cf(Df,e)}function sT(e){return Cf(Df,{protocol:lr.httpProtocol,hostname:lr.domain,...G.normalizeParams(e)})}var Ew=_("ZodEmoji",(e,t)=>{Mx.init(e,t),Dt.init(e,t)});function cT(e){return OC(Ew,e)}var kw=_("ZodNanoID",(e,t)=>{jx.init(e,t),Dt.init(e,t)});function uT(e){return qC(kw,e)}var Qw=_("ZodCUID",(e,t)=>{Px.init(e,t),Dt.init(e,t)});function dT(e){return zC(Qw,e)}var Iw=_("ZodCUID2",(e,t)=>{Tx.init(e,t),Dt.init(e,t)});function lT(e){return KC(Iw,e)}var vw=_("ZodULID",(e,t)=>{Hx.init(e,t),Dt.init(e,t)});function pT(e){return YC(vw,e)}var _w=_("ZodXID",(e,t)=>{Gx.init(e,t),Dt.init(e,t)});function gT(e){return JC(_w,e)}var xw=_("ZodKSUID",(e,t)=>{Ux.init(e,t),Dt.init(e,t)});function mT(e){return WC(xw,e)}var Dw=_("ZodIPv4",(e,t)=>{Yx.init(e,t),Dt.init(e,t)});function fT(e){return ZC(Dw,e)}var RF=_("ZodMAC",(e,t)=>{Wx.init(e,t),Dt.init(e,t)});function bT(e){return t1(RF,e)}var Fw=_("ZodIPv6",(e,t)=>{Jx.init(e,t),Dt.init(e,t)});function hT(e){return VC(Fw,e)}var Sw=_("ZodCIDRv4",(e,t)=>{Zx.init(e,t),Dt.init(e,t)});function BT(e){return XC(Sw,e)}var Lw=_("ZodCIDRv6",(e,t)=>{Vx.init(e,t),Dt.init(e,t)});function yT(e){return ew(Lw,e)}var Nw=_("ZodBase64",(e,t)=>{Xx.init(e,t),Dt.init(e,t)});function CT(e){return tw(Nw,e)}var Rw=_("ZodBase64URL",(e,t)=>{eD.init(e,t),Dt.init(e,t)});function wT(e){return nw(Rw,e)}var $w=_("ZodE164",(e,t)=>{tD.init(e,t),Dt.init(e,t)});function ET(e){return aw($w,e)}var $F=_("ZodCreditCard",(e,t)=>{nD.init(e,t),Dt.init(e,t)});function kT(e){return n1($F,e)}var Mw=_("ZodJWT",(e,t)=>{aD.init(e,t),Dt.init(e,t)});function QT(e){return rw(Mw,e)}var Ep=_("ZodCustomStringFormat",(e,t)=>{rD.init(e,t),Dt.init(e,t)});function IT(e,t,n={}){return hp(Ep,e,t,n)}function vT(e){return hp(Ep,"hostname",lr.hostname,e)}function _T(e){return hp(Ep,"hex",lr.hex,e)}function xT(e,t){let n=t?.enc??"hex",r=`${e}_${n}`,a=lr[r];if(!a)throw new Error(`Unrecognized hash format: ${r}`);return hp(Ep,r,a,t)}var kp=_("ZodNumber",(e,t)=>{EC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>T1(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(hw(e))},safe(e){return this.check(hw(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 MF(e){return r1(kp,e)}var Wu=_("ZodNumberFormat",(e,t)=>{oD.init(e,t),kp.init(e,t)});function hw(e){return i1(Wu,e)}function DT(e){return A1(Wu,e)}function FT(e){return s1(Wu,e)}function ST(e){return c1(Wu,e)}function LT(e){return u1(Wu,e)}var Qp=_("ZodBoolean",(e,t)=>{gf.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>H1(e,n,r,a)});function jF(e){return d1(Qp,e)}var Ip=_("ZodBigInt",(e,t)=>{kC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>G1(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 NT(e){return p1(Ip,e)}var jw=_("ZodBigIntFormat",(e,t)=>{iD.init(e,t),Ip.init(e,t)});function RT(e){return m1(jw,e)}function $T(e){return f1(jw,e)}var PF=_("ZodSymbol",(e,t)=>{AD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>U1(e,n,r,a)});function MT(e){return b1(PF,e)}var TF=_("ZodUndefined",(e,t)=>{sD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>q1(e,n,r,a)});function jT(e){return h1(TF,e)}var HF=_("ZodNull",(e,t)=>{cD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>O1(e,n,r,a)});function GF(e){return B1(HF,e)}var UF=_("ZodAny",(e,t)=>{uD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>Y1(e,n,r,a)});function PT(){return y1(UF)}var OF=_("ZodUnknown",(e,t)=>{dD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>J1(e,n,r,a)});function Ku(){return C1(OF)}var qF=_("ZodNever",(e,t)=>{lD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>K1(e,n,r,a)});function Pw(e){return w1(qF,e)}var zF=_("ZodVoid",(e,t)=>{pD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>z1(e,n,r,a)});function TT(e){return E1(zF,e)}var Ff=_("ZodDate",(e,t)=>{gD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>W1(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 HT(e){return k1(Ff,e)}var KF=_("ZodArray",(e,t)=>{Ju(),mD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>sF(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(qu(e,t))},length(e,t){return this.check(zu(e,t))},unwrap(){return this.element}});function Sf(e,t){return v1(KF,e,t)}function GT(e){let t=e._zod.def.shape;return Tw(Object.keys(t))}var Lf=_("ZodObject",(e,t)=>{Ju(),fD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>cF(e,n,r,a),G.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Tw(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Ku()})},loose(){return this.clone({...this._zod.def,catchall:Ku()})},strict(){return this.clone({...this._zod.def,catchall:Pw()})},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(Rf,this,e[0])},exactPartial(...e){return G.partial(Gw,this,e[0],"exactPartial")},required(...e){return G.required(Uw,this,e[0])}});function UT(e,t){let n={type:"object",shape:e??{},...G.normalizeParams(t)};return new Lf(n)}function OT(e,t){return new Lf({type:"object",shape:e,catchall:Pw(),...G.normalizeParams(t)})}function qT(e,t){return new Lf({type:"object",shape:e,catchall:Ku(),...G.normalizeParams(t)})}var Nf=_("ZodUnion",(e,t)=>{mf.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>lw(e,n,r,a),e.options=t.options});function vp(e,t){return new Nf({type:"union",options:e,...G.normalizeParams(t)})}var YF=_("ZodXor",(e,t)=>{Nf.init(e,t),bD.init(e,t),e._zod.processJSONSchema=(n,r,a)=>lw(e,n,r,a),e.options=t.options});function zT(e,t){return new YF({type:"union",options:e,inclusive:!1,...G.normalizeParams(t)})}var JF=_("ZodDiscriminatedUnion",(e,t)=>{Nf.init(e,t),BD.init(e,t)});function KT(e,t,n){return new JF({type:"union",options:t,discriminator:e,...G.normalizeParams(n)})}var WF=_("ZodIntersection",(e,t)=>{yD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>uF(e,n,r,a)});function ZF(e,t){return new WF({type:"intersection",left:e,right:t})}var VF=_("ZodTuple",(e,t)=>{Ju(),QC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>dF(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 Rf({type:"optional",innerType:t}))})}});function XF(e,t,n){let r=t instanceof we,a=r?n:t,o=r?t:null;return new VF({type:"tuple",items:e,rest:o,...G.normalizeParams(a)})}var yp=_("ZodRecord",(e,t)=>{Ju(),CD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>lF(e,n,r,a),e.keyType=t.keyType,e.valueType=t.valueType});function e8(e,t,n){return!t||!t._zod?new yp({type:"record",keyType:_f(),valueType:e,...G.normalizeParams(t)}):new yp({type:"record",keyType:e,valueType:t,...G.normalizeParams(n)})}function YT(e,t,n){return new yp({type:"record",keyType:e,valueType:t,...G.normalizeParams(n),partial:!0})}function JT(e,t,n){return new yp({type:"record",keyType:e,valueType:t,mode:"loose",...G.normalizeParams(n)})}var t8=_("ZodMap",(e,t)=>{Ju(),wD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>iF(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(Ou(...n))});function WT(e,t,n){return new t8({type:"map",keyType:e,valueType:t,...G.normalizeParams(n)})}var n8=_("ZodSet",(e,t)=>{Ju(),ED.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>AF(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(Ou(...n))});function ZT(e,t){return new n8({type:"set",valueType:e,...G.normalizeParams(t)})}var Cp=_("ZodEnum",(e,t)=>{kD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,a,o)=>Z1(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 Cp({...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 Cp({...t,checks:[],...G.normalizeParams(a),entries:o})}});function Tw(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Cp({type:"enum",entries:n,...G.normalizeParams(t)})}function VT(e,t){return new Cp({type:"enum",entries:e,...G.normalizeParams(t)})}var a8=_("ZodLiteral",(e,t)=>{QD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>V1(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 XT(e,t){return new a8({type:"literal",values:Array.isArray(e)?e:[e],...G.normalizeParams(t)})}var r8=_("ZodFile",(e,t)=>{ID.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>tF(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(lp(Array.isArray(n)?n:[n],r))});function eH(e){return _1(r8,e)}var o8=_("ZodTransform",(e,t)=>{Ju(),vD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>oF(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 Hw(e){return new o8({type:"transform",transform:e})}var Rf=_("ZodOptional",(e,t)=>{IC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>pw(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function Yu(e){return new Rf({type:"optional",innerType:e})}var Gw=_("ZodExactOptional",(e,t)=>{_D.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>pw(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function i8(e){return new Gw({type:"optional",innerType:e})}var A8=_("ZodNullable",(e,t)=>{xD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>pF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function xf(e){return new A8({type:"nullable",innerType:e})}function tH(e){return Yu(xf(e))}var s8=_("ZodDefault",(e,t)=>{DD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>fF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function c8(e,t){return new s8({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var u8=_("ZodPrefault",(e,t)=>{FD.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 d8(e,t){return new u8({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():G.shallowClone(t)}})}var Uw=_("ZodNonOptional",(e,t)=>{SD.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 l8(e,t){return new Uw({type:"nonoptional",innerType:e,...G.normalizeParams(t)})}var p8=_("ZodSuccess",(e,t)=>{LD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>nF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function nH(e){return new p8({type:"success",innerType:e})}var g8=_("ZodCatch",(e,t)=>{ND.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>hF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function m8(e,t){return new g8({type:"catch",innerType:e,catchValue:typeof t=="function"?t:G.constantCatch(t)})}var f8=_("ZodNaN",(e,t)=>{RD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>X1(e,n,r,a)});function aH(e){return I1(f8,e)}var $f=_("ZodPipe",(e,t)=>{vC.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>BF(e,n,r,a),e.in=t.in,e.out=t.out});function Bw(e,t){return new $f({type:"pipe",in:e,out:t})}var Mf=_("ZodCodec",(e,t)=>{$f.init(e,t),ff.init(e,t)});function rH(e,t,n){return new Mf({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function oH(e){let t=e._zod.def;return new Mf({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var b8=_("ZodPreprocess",(e,t)=>{$f.init(e,t),$D.init(e,t)}),h8=_("ZodReadonly",(e,t)=>{MD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>yF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function B8(e){return new h8({type:"readonly",innerType:e})}var y8=_("ZodTemplateLiteral",(e,t)=>{jD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>eF(e,n,r,a)});function iH(e,t){return new y8({type:"template_literal",parts:e,...G.normalizeParams(t)})}var C8=_("ZodLazy",(e,t)=>{bf.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>wF(e,n,r,a),e.unwrap=()=>e._zod.def.getter()});function w8(e){return new C8({type:"lazy",getter:e})}var E8=_("ZodPromise",(e,t)=>{TD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>CF(e,n,r,a),e.unwrap=()=>e._zod.def.innerType});function AH(e){return new E8({type:"promise",innerType:e})}var k8=_("ZodFunction",(e,t)=>{PD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>rF(e,n,r,a)});function sH(e){return new k8({type:"function",input:Array.isArray(e?.input)?XF(e?.input):e?.input??Sf(Ku()),output:e?.output??Ku()})}var jf=_("ZodCustom",(e,t)=>{HD.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,a)=>aF(e,n,r,a)});function cH(e){let t=new Nt({check:"custom"});return t._zod.check=e,t}function uH(e,t){return x1(jf,e??(()=>!0),t)}function Q8(e,t={}){return D1(jf,e,t)}function I8(e,t){return F1(e,t)}var dH=S1,lH=L1;function pH(e,t={}){let n=new jf({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 gH=(...e)=>N1({Codec:Mf,Boolean:Qp,String:wp},...e);function mH(e){let t=w8(()=>vp([_f(e),MF(),jF(),GF(),Sf(t),e8(_f(),t)]));return t}function fH(e,t){return new b8({type:"pipe",in:Hw(e),out:t})}var mde={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 fde(e){hn({customError:e})}function bde(){return hn().customError}var v8;v8||(v8={});var Pf={};L(Pf,{ZodISODate:()=>_c,ZodISODateTime:()=>vc,ZodISODuration:()=>Dc,ZodISOTime:()=>xc,date:()=>Bde,datetime:()=>hde,duration:()=>Cde,time:()=>yde});function hde(e){return wf(vc,e)}function Bde(e){return Ef(_c,e)}function yde(e){return kf(xc,e)}function Cde(e){return Qf(Dc,e)}var X={..._p,...fw,iso:Pf},wde=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 Ede(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 bH(e,t){return e.map((n,r)=>r<t?n:n.optional())}function kde(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Qde(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:kde(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 Ide(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 hH(e,t){if(e!==!1)return e===void 0||e===!0?X.any():Or(e,t)}var vde=/^(?:[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=Qde(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(vde)):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 g of u){let p=Or(s[g],t),m=X.string().regex(new RegExp(g));d.push(X.looseRecord(m,p))}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 g=X.intersection(l[0],l[1]);for(let p=2;p<l.length;p++)g=X.intersection(g,l[p]);r=g}if(e.additionalProperties===!1){let g=Object.keys(a),p=u.map(h=>new RegExp(h)),m=r;r=r.check(h=>{if(!To(h.value))return;let B=[];for(let b of Object.keys(h.value))g.includes(b)||p.some(f=>f.test(b))||B.push(b);B.length&&h.issues.push({code:"unrecognized_keys",keys:B,input:h.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=Ide(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=bH(A,i),u=Array.isArray(o)?void 0:hH(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=bH(A,i),u=hH(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))wde.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 yH(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=Ede(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 CH=Symbol("z.visit/resolving");function Tf(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===CH)return new bf({type:"lazy",getter:()=>r.get(i)});if(A!==void 0)return A;r.set(i,CH);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,g={};for(let m of d){let h=a(u[m]);h!==u[m]&&(l=!0),g[m]=h}let p=A.catchall;return A.catchall&&(p=a(A.catchall),p!==A.catchall&&(l=!0)),l?bt(i,{...A,shape:g,catchall:p}):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 p of u){let m=a(p);m!==p&&(d=!0),l.push(m)}let g=A.rest;return A.rest&&(g=a(A.rest),g!==A.rest&&(d=!0)),d?bt(i,{...A,items:l,rest:g}):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 g of u){let p=a(g);p!==g&&(d=!0),l.push(p)}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 wH(e){return Tf(e,{object:t=>t.partial(),union:t=>{let n=t._zod.def;return n.discriminator===void 0?t:vp(n.options)}})}function _de(e,t){if(!t?.length)return e;let n=e._zod.def;return bt(e,Bi(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function EH(e){return _de(e.out,e.checks)}function xde(e){return e.in._zod.traits.has("$ZodTransform")?EH(e):e.in}function kH(e){return Tf(e,{pipe:t=>xde(t._zod.def),default:(t,n)=>n?Yu(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function QH(e){return Tf(e,{pipe:t=>EH(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var _8={};L(_8,{bigint:()=>Lde,boolean:()=>Sde,date:()=>Nde,number:()=>Fde,string:()=>Dde});function Dde(e){return e1(wp,e)}function Fde(e){return o1(kp,e)}function Sde(e){return l1(Qp,e)}function Lde(e){return g1(Ip,e)}function Nde(e){return Q1(Ff,e)}var IH=["none","low","medium","high","xhigh"];var Ow=c.string().regex(/^[a-z][a-z0-9_-]*$/);function Rde(e){try{let t=new URL(e).protocol;return t==="http:"||t==="https:"}catch{return!1}}var $de=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(Rde,"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(),_H=c.discriminatedUnion("kind",[$de]),Mde=c.enum(["circle-dot","circle-dashed","circle-x","git-merge","git-pull-request","triangle-alert"]),xH=c.object({icon:Mde.optional(),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256)}).strict(),Gf=c.enum(["closed","merged","open"]),D9e=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:Gf,title:c.string().min(1).optional(),updatedAt:c.date(),url:c.string().url().optional()}).strict(),S9e=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/),jde=c.enum(["activity","brain","calendar","check","database","info","key","link","sparkles","warning"]),Pde=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(),DH=c.object({details:c.array(Pde).max(100).optional(),icon:jde.optional(),preview:c.string().trim().min(1).max(500).optional(),title:c.string().trim().min(1).max(120)}).strict();var zw=c.string().regex(/^T[A-Z0-9]+$/),x8=c.string().regex(/^(C|G|D)[A-Z0-9]+$/),FH=c.string().regex(/^local:[a-z0-9_-]+:[a-z0-9][a-z0-9_-]*$/),Tde=c.string().min(1).refine(e=>e===e.trim()&&e.toLowerCase()!=="unknown"),qw=Tde,he=c.string().refine(e=>e.trim().length>0),Ja=he.refine(e=>e===e.trim()),Hde=c.object({id:he,provider:Ja}).strict(),Gde=Hde.extend({provider:c.literal("slack"),teamId:zw,channelId:x8,threadTs:Ja.optional()}).strict(),N9e=c.discriminatedUnion("provider",[Gde]),R9e=c.enum(["slack","local"]),SH=c.enum(["public","private"]),Ude=c.enum(["public","private"]),Ode=c.object({platform:c.literal("slack"),teamId:zw,channelId:x8,threadTs:Ja.optional()}).strict(),D8=Ode,qde=c.object({platform:c.literal("local"),conversationId:FH}).strict(),zde=c.discriminatedUnion("platform",[D8,qde]),LH=c.object({action:c.literal("send_message"),destination:D8}).strict(),Kde=c.object({kind:c.literal("slack"),teamId:zw,channelId:x8,visibility:SH,messageTs:he.optional(),threadTs:he.optional()}).strict(),Yde=c.object({kind:c.literal("local"),visibility:c.literal("private"),conversationId:FH}).strict(),Jde=c.object({kind:c.literal("web"),visibility:SH,conversationId:Ja}).strict(),Wde=c.object({kind:c.literal("event"),eventKey:Ja,eventType:Ja,identifier:Ja,namespace:Ja}).strict(),Zde=c.object({kind:c.literal("scheduled_automation")}).strict(),Vde=c.object({kind:c.literal("event_automation")}).strict(),Xde=c.object({kind:c.literal("plugin_dispatch")}).strict(),ele=c.object({kind:c.literal("agent_invocation")}).strict(),tle=c.discriminatedUnion("kind",[Kde,Yde,Jde,Wde,Zde,Vde,Xde,ele]);function nle(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 ale=c.preprocess(nle,tle),rle=c.discriminatedUnion("allowedWhen",[c.object({type:c.literal("user"),userId:qw,allowedWhen:c.literal("private-direct-conversation")}).strict(),c.object({type:c.literal("user"),userId:qw,allowedWhen:c.literal("scheduled-automation"),taskId:Ja}).strict()]),F8={email:he.optional(),fullName:he.optional(),userId:qw,userName:he.optional()},ole=c.object({...F8,platform:c.literal("slack"),teamId:zw}).strict(),ile=c.object({...F8,platform:c.literal("local")}).strict(),Ale=c.object({...F8,platform:c.literal("web")}).strict(),sle=c.object({platform:c.literal("system"),name:qw}).strict(),Hf=c.discriminatedUnion("platform",[ole,ile,Ale,sle]),cle=c.object({displayName:he.optional(),handle:he.optional(),id:Ja,provider:Ja,providerSubjectId:Ja,providerTenantId:Ja.optional()}).strict(),$9e=c.object({displayName:he.optional(),email:he.max(320),id:Ja,identities:c.array(cle).max(100)}).strict(),ule=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]})}}),dle=c.object({label:Ja.pipe(c.string().max(48)).refine(e=>!/[\r\n]/.test(e)),detail:Ja.pipe(c.string().max(128)).refine(e=>!/[\r\n]/.test(e)).optional()}).strict(),M9e=c.object({idempotencyKey:he.pipe(c.string().max(512)),credentialSubject:rle.optional(),destination:D8,destinationVisibility:Ude,input:he.pipe(c.string().max(32e3)),metadata:ule.optional(),replyAttribution:dle.optional()}).strict();var lle=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/),P9e=c.object({text:c.string().trim().min(1).max(8e3)}).strict(),T9e=c.object({kind:lle,version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict();var ple=4e3,gle=8e3,xp=32,vH=4e3,mle=1e3,fle=c.record(c.string(),c.unknown()).superRefine((e,t)=>{Object.keys(e).length>xp&&t.addIssue({code:"custom",message:`Event data may include at most ${xp} keys.`}),new TextEncoder().encode(JSON.stringify(e)).byteLength>vH&&t.addIssue({code:"custom",message:`Event data may be at most ${vH} JSON bytes.`})}),Zu=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."),NH=c.string().regex(/^[a-z][a-z0-9_]*$/).describe("Canonical plugin-defined resource type, such as issue or pull_request."),RH=/^[a-z][a-zA-Z0-9]*$/,ble=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"]})}),hle=c.record(c.string().regex(RH),ble).superRefine((e,t)=>{Object.keys(e).length>xp&&t.addIssue({code:"custom",message:`Event match keys may include at most ${xp} keys.`})}),G9e=c.record(c.string().regex(RH),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>xp&&t.addIssue({code:"custom",message:`Event match may include at most ${xp} 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 Ble=c.object({type:NH,supportedEvents:c.array(Zu).min(1),suggestedEvents:c.array(Zu).optional(),matchFields:hle.optional(),guidance:c.record(Zu,c.string().trim().min(1).max(mle)).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)})}),U9e=c.object({resourceTypes:c.array(Ble).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 O9e=c.object({identifier:c.string().min(1),label:c.string().min(1),namespace:c.string().min(1),suggestedEvents:c.array(Zu).optional(),supportedEvents:c.array(Zu),type:NH}).strict(),q9e=c.object({events:c.array(Zu).min(1),id:c.string().min(1)}).strict(),yle=c.object({eventKey:c.string().min(1),eventType:Zu,identifier:c.string().min(1),occurredAtMs:c.number().finite(),terminal:c.boolean().optional(),trustedSummary:c.string().min(1).transform(e=>e.slice(0,ple)),data:fle.optional(),untrustedText:c.string().transform(e=>e.slice(0,gle)).optional()}).strict(),z9e=yle.extend({namespace:c.string().min(1)}),Cle=c.object({authority:c.enum(["instruction","context"]),actor:Hf.optional()}).strict(),wle=c.discriminatedUnion("type",[c.object({type:c.literal("message"),role:c.enum(["user","assistant"]),text:c.string().min(1),provenance:Cle.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()]),Y9e=c.object({actorUserId:c.string().min(1).optional(),completedAtMs:c.number().finite(),conversationId:c.string().min(1),destination:zde,locationId:c.string().min(1).optional(),actors:c.array(Hf),actor:Hf.optional(),runId:c.string().min(1),source:ale,transcript:c.array(wle)}).strict();var W9e=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()]),Ele=c.object({arguments:c.record(c.string(),c.unknown()),reason:c.string().min(1).optional()}).strict(),Z9e=c.object({target:c.string().min(1).optional(),truncated:c.boolean().optional(),continuation:Ele.optional()}).passthrough(),V9e=c.enum(["auto","review","approve"]);var e6e=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(),kle=c.string().regex(/^[a-z][a-z0-9-]*$/),Qle=c.string().regex(/^[a-z][a-z0-9.-]*$/),Ile=c.union([c.literal("read"),c.literal("write")]),$H=c.object({provider:kle,scope:he.optional(),type:c.literal("oauth")}).strict(),MH=c.object({displayName:he.optional(),handle:he.optional(),id:he,label:he.optional(),url:he.optional()}).strict(),n6e=c.object({account:MH.optional(),accessToken:he,expiresAt:c.number().finite().optional(),refreshToken:he,refreshTokenExpiresAt:c.number().finite().optional(),scope:he.optional()}).strict(),a6e=c.object({access:Ile,leaseScope:he.optional(),name:Qle,reason:he.optional(),requirements:c.array(he).min(1).optional()}).strict(),vle=c.object({domain:c.string().min(1),headers:c.record(c.string(),c.string()).refine(e=>Object.keys(e).length>0)}).strict(),_le=c.object({account:MH.optional(),authorization:$H.optional(),expiresAt:c.string().refine(e=>Number.isFinite(Date.parse(e))),headerTransforms:c.array(vle).min(1)}).strict(),r6e=c.discriminatedUnion("type",[c.object({lease:_le,type:c.literal("lease")}).strict(),c.object({authorization:$H.optional(),message:he,type:c.literal("needed")}).strict(),c.object({message:he,type:c.literal("unavailable")}).strict()]);var xle=he.max(64).regex(/^[a-z][a-z0-9-]*$/),Dle=he.max(80),Fle=he.max(500),Sle=c.enum(["primary","profile"]),Lle=c.object({detail:he.max(500).optional(),label:he.max(80),tone:c.enum(["good","neutral","warning"]).optional(),value:he.max(120)}).strict(),Nle=c.object({label:he.max(80),value:he.max(500)}).strict(),Rle=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(),$le=c.object({actions:c.array(Rle).max(4).optional(),description:he.max(1e3).optional(),id:he.max(128),metadata:c.array(Nle).max(8).optional(),title:he.max(4e3)}).strict(),i6e=c.object({emptyText:he.max(500).optional(),metrics:c.array(Lle).max(6).optional(),nextCursor:he.max(1e3).optional(),records:c.array($le).max(100),searchPlaceholder:he.max(120).optional(),type:c.literal("list")}).strict(),Mle=c.object({description:Fle,id:xle,label:Dle,navigation:Sle,pluginDisplayName:he.max(200),pluginName:he.max(100)}).strict(),A6e=c.array(Mle),jle=he.max(1e3).optional(),Ple=he.max(64).optional(),Tle=c.string().trim().max(200).optional(),s6e=c.object({cursor:jle,filter:Ple,limit:c.number().int().min(1).max(50),query:Tle}).strict();var Hle=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(),Gle=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:Hle.optional()}).strict(),Ule=c.union([c.literal("instruction"),c.literal("context")]),Ole=c.object({authority:Ule,actor:Hf.optional()}).strict();var qle=c.object({type:c.literal("user_message"),role:c.never().optional(),provenance:Ole}).passthrough(),zle=c.object({type:c.literal("assistant_message"),role:c.never().optional()}).passthrough(),Kle=c.object({type:c.literal("tool_result"),role:c.never().optional()}).passthrough(),PH=c.discriminatedUnion("type",[qle,zle,Kle]),Yle=c.object({item:PH,sourceEventSeq:c.number().int().nonnegative().optional()}).strict(),jH=c.array(Yle),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(),TH=c.discriminatedUnion("type",[c.object({type:c.literal("handoff"),modelProfile:Ow,modelId:c.string().min(1),reasoningLevel:c.string().min(1).optional(),triggeringToolCallId:c.string().min(1).optional(),summary:c.string().min(1).optional(),replacementHistory:jH}).strict(),c.object({type:c.literal("compaction"),modelProfile:Ow,modelId:c.string().min(1),details:Jle.optional(),summary:c.string().min(1).optional(),replacementHistory:jH}).strict()]),p6e=c.object({data:TH,createdAtMs:c.number().finite()}).strict(),Wle=c.object({type:c.literal("mcp_provider_connected"),provider:c.string().min(1),credentialSubjectId:c.string().min(1)}).strict(),Zle=c.object({type:c.literal("mcp_provider_connected_unowned"),provider:c.string().min(1)}).strict(),HH=c.union([c.literal("plugin"),c.literal("mcp")]),Vle=c.object({type:c.literal("authorization_requested"),kind:HH,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(),Xle=c.object({type:c.literal("authorization_completed"),kind:HH,provider:c.string().min(1),actorId:c.string().min(1),authorizationId:c.string().min(1)}).strict(),epe=c.object({type:c.literal("tool_execution_started"),toolCallId:c.string().min(1),toolName:c.string().min(1)}).strict(),tpe=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(),npe=c.union([c.literal("user"),c.literal("assistant"),c.literal("system")]),GH=c.object({type:c.literal("message"),messageId:c.string().min(1),role:npe,text:c.string(),authorIdentityId:c.string().min(1).optional(),meta:c.record(c.string(),c.unknown()).optional()}).strict(),ape=GH.extend({type:c.literal("message_updated")}),rpe=c.object({type:c.literal("message_handled"),messageId:c.string().min(1)}).strict(),ope=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(),ipe=c.enum(["slack","api","scheduler","internal"]),R8=c.enum(["agent_run_failed","delivery_failed","model_execution_failed","persistence_failed"]),$8=c.enum(["auth","permission","rate_limit","capacity","timeout","network","server","invalid_request","invalid_response","quota","content_policy","unknown","empty_output","tool_errors","suppressed_output"]),Ape=c.object({type:c.literal("turn_started"),turnId:c.string().min(1),inputMessageIds:c.array(c.string().min(1)).min(1),surface:ipe}).strict().refine(e=>new Set(e.inputMessageIds).size===e.inputMessageIds.length,"turn input message ids must be unique"),spe=c.object({type:c.literal("turn_routed"),turnId:c.string().min(1),modelProfile:Ow,modelId:c.string().min(1),costUsd:c.number().finite().nonnegative().optional(),reasoningLevel:c.enum(IH),confidence:c.number().min(0).max(1).optional(),source:c.enum(["configured","inherited","router"])}).strict(),cpe=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(),upe=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(),dpe=c.object({id:c.string().min(1),filename:c.string().min(1),contentType:c.string().min(1),bytes:c.number().int().nonnegative()}).strict(),lpe=c.object({type:c.literal("attachments_delivered"),attachments:c.array(dpe).min(1),toolCallId:c.string().min(1).optional(),turnId:c.string().min(1).optional()}).strict(),ppe=c.object({type:c.literal("turn_completed"),turnId:c.string().min(1),outcome:c.enum(["success","no_reply","cancelled"])}).strict(),gpe=c.object({type:c.literal("turn_failed"),turnId:c.string().min(1),failureCode:R8,failureReason:$8.optional(),eventId:c.string().regex(/^[a-f0-9]{32}$/i).optional()}).strict(),mpe=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(),fpe=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(),UH=c.union([GH,ape,PH,Wle,Vle,Xle,epe,tpe,rpe,ope,Ape,cpe,upe,lpe,spe,ppe,gpe,mpe,fpe]),bpe=c.union([UH,TH,Zle]),hpe=["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"],g6e=c.enum(hpe),Bpe=c.object({type:c.literal("unknown"),originalType:c.string().min(1),payload:c.unknown()}).strict(),N8=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(),m6e=c.union([N8.extend({schemaVersion:c.literal(1),data:bpe}),N8.extend({data:Bpe})]),f6e=N8.extend({type:c.string().min(1),payload:c.unknown()});var b6e=c.object({data:UH,idempotencyKey:c.string().min(1).optional(),createdAtMs:c.number().finite()}).strict(),Wa=c.string().trim().min(1).max(400),M8=c.string().url().max(2048),Uf=c.string().datetime(),OH=c.object({provider:c.string().trim().min(1).max(100),channelName:Wa.optional()}).strict(),ype=c.enum(["in_progress","answered","done","partial","blocked","abandoned"]),qH=c.object({repository:Wa,number:c.number().int().positive(),title:Wa.optional(),url:M8,state:Gf,openedAt:Uf.optional(),mergedAt:Uf.optional(),closedAt:Uf.optional()}).strict(),Cpe=c.object({kind:c.enum(["code_change","resource","url"]),label:Wa,url:M8,status:Wa.optional()}).strict(),wpe=c.object({startedAt:Uf,lastActivityAt:Uf,durationMs:c.number().int().nonnegative(),participants:c.array(c.object({name:Wa,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:OH.optional(),codeChanges:c.array(qH)}).strict(),Epe=c.object({schemaVersion:c.literal(1),record:wpe,summary:c.string().trim().min(1).max(600),intent:Wa,outcome:c.object({status:ype,text:c.string().trim().min(1).max(600)}).strict(),decisions:c.array(c.object({text:Wa,by:Wa.optional(),kind:c.enum(["stated","confirmed","assumed"])}).strict()).max(20),openDecisions:c.array(c.object({text:Wa,owner:Wa.optional()}).strict()).max(20),facts:c.array(Wa).max(30),links:c.array(Cpe).max(40),keywords:c.array(c.string().trim().toLowerCase().min(1).max(400)).max(12)}).strict(),kpe=c.object({index:c.number().int().nonnegative(),role:c.enum(["user","assistant","tool","event"]),author:Wa.optional(),text:c.string().min(1),createdAtMs:c.number().int().nonnegative(),turnId:c.string().min(1).optional()}).strict(),Qpe=c.object({label:Wa,url:M8,status:Wa.optional()}).strict(),h6e=c.object({conversationId:c.string().min(1),title:Wa.optional(),visibility:c.enum(["private","public"]),location:OH.optional(),entries:c.array(kpe),codeChanges:c.array(qH),resources:c.array(Qpe)}).strict();var Ipe=c.enum(["active","completed","failed"]),vpe=c.enum(["api","internal","scheduler","slack"]),zH=Gle,_pe=c.object({conversationId:c.string().min(1)}).strict(),B6e=c.object({attachmentId:c.string().min(1),conversationId:c.string().min(1)}).strict(),xpe=c.object({limit:c.coerce.number().int().min(1).max(1e3).default(500)}).strict(),Dpe=c.object({before:c.string().min(1),limit:c.coerce.number().int().min(1).max(1e3).default(500)}).strict(),Fpe=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(),Spe=c.object({archived:c.boolean(),lastSeenAt:c.string().datetime()}).strict(),j8=c.object({archivedAt:c.string().datetime().nullable()}).strict(),Lpe=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(),Npe=c.object({idempotencyKey:c.string().trim().min(1).max(200),message:c.string().trim().min(1).max(32e3)}).strict(),Kw=c.object({conversationId:c.string().min(1),messageId:c.string().min(1),status:c.enum(["accepted","duplicate"])}).strict(),Dp=c.object({email:c.string().optional(),fullName:c.string().optional(),slackUserId:c.string().optional(),slackUserName:c.string().optional()}).strict(),KH=c.enum(["defer","interrupt"]),YH=c.object({actorIdentity:Dp.optional(),createdAt:c.string().datetime(),delivery:KH,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"})}),JH=c.object({authorizationUrl:c.string().url(),completionText:c.string().min(1),label:c.string().min(1)}).strict(),P8=c.object({authorization:JH.optional(),conversationId:c.string().min(1),generatedAt:c.string().datetime(),messages:c.array(YH)}).strict(),Rpe=c.object({inboundMessageIds:c.array(c.string().min(1)).min(1).optional(),receivedBefore:c.string().datetime().optional()}).strict(),T8=c.object({cancelledCount:c.number().int().nonnegative(),cancelledInboundMessageIds:c.array(c.string().min(1)),conversationId:c.string().min(1)}).strict(),WH=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(),$pe=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"})}),Mpe=_H.and(c.object({plugin:c.string().min(1),createdAt:c.string().datetime(),updatedAt:c.string().datetime()})),ZH=c.object({createdAt:c.string().datetime(),role:c.enum(["assistant","user"]),text:c.string().min(1)}).strict(),Fp=c.object({displayTitle:c.string(),activityPreview:ZH.optional(),cumulativeDurationMs:c.number(),cumulativeUsage:zH.optional(),auxiliaryCosts:WH.optional(),conversationId:c.string(),isParticipant:c.boolean(),visibility:c.enum(["private","public"]).optional(),status:Ipe,startedAt:c.string(),lastSeenAt:c.string(),lastProgressAt:c.string(),surface:vpe,actorIdentity:Dp.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(Mpe).optional(),sidebarAnnotations:c.array(xH).optional(),assignedWork:c.boolean().optional(),finishedWorkAt:c.string().datetime().optional(),isPriority:c.boolean().optional(),unfinishedWork:c.boolean().optional()}).strict(),jpe=c.object({type:c.literal("message"),messageId:c.string().min(1),role:c.enum(["assistant","system","user"]),source:c.enum(["slack","web"]).optional(),actorIdentity:Dp.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"})}),Ppe=c.object({type:c.literal("message_handled"),messageId:c.string().min(1)}).strict(),Tpe=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"})}),VH=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"})}),Hpe=c.object({type:c.literal("tool_call"),toolCallId:c.string().min(1)}).strict(),Gpe=c.object({parts:c.array(c.discriminatedUnion("type",[VH,Hpe])).min(1)}).strict(),Upe=c.object({type:c.literal("tool_calls"),calls:c.array(Tpe).min(1),assistant:Gpe.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"})}),Ope=c.object({type:c.literal("assistant_message"),parts:c.array(VH).min(1)}).strict(),qpe=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:R8,failureReason:$8.optional(),eventId:c.string().regex(/^[a-f0-9]{32}$/i).optional(),sentryEventUrl:c.string().url().optional()}).strict()]),zpe=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(),Kpe=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(),Ype=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(),Jpe=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:DH}).strict(),Wpe=c.object({id:c.string().min(1),filename:c.string().min(1),contentType:c.string().min(1),bytes:c.number().int().nonnegative()}).strict(),Zpe=c.object({type:c.literal("attachments_delivered"),attachments:c.array(Wpe).min(1)}).strict(),Vpe=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(),Xpe=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(),ege=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(),XH=c.discriminatedUnion("type",[jpe,Ppe,Ope,Upe,qpe,Ype,Jpe,Zpe,zpe,Kpe,Vpe,Xpe,ege]),H8=c.object({seq:c.number().int().nonnegative(),createdAt:c.string().datetime(),data:XH}).strict(),G8=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()]),tge=c.object({modelId:c.string(),usage:zH}).strict();function eG(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 U8=Fp.extend({brief:c.object({content:Epe,updatedAt:c.string().datetime(),version:c.number().int().positive()}).strict().optional(),modelUsage:c.array(tge).optional(),events:c.array(H8),eventHistory:G8,previousCursor:c.string().min(1).optional(),generatedAt:c.string(),sentryConversationUrl:c.string().optional(),sourceTask:$pe.optional()}).strict().superRefine(eG),O8=c.object({events:c.array(H8),eventHistory:G8,previousCursor:c.string().min(1).optional(),generatedAt:c.string()}).strict().superRefine(eG),q8=c.object({conversations:c.array(Fp),source:c.literal("conversation_index"),generatedAt:c.string()}).strict(),Vu=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(),tG=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),S8=c.object({cachedInputTokens:c.number().optional(),cacheCreationTokens:c.number().optional(),conversations:c.number(),costUsd:c.number().optional(),date:tG,durationMs:c.number(),inputTokens:c.number().optional(),tokens:c.number().optional()}).strict(),L8=c.object({allow:c.number(),ask:c.number(),costUsd:c.number().optional(),date:tG,deny:c.number(),requests:c.number()}).strict(),nge=c.object({allow:c.number(),ask:c.number(),costUsd:c.number().optional(),deny:c.number(),metricDays:c.array(L8),metricHours:c.array(L8).optional(),metricSixHours:c.array(L8).optional(),requests:c.number()}).strict(),z8=c.object({active:c.number(),cachedInputTokens:c.number().optional(),cacheCreationTokens:c.number().optional(),conversations:c.number(),durationMs:c.number(),failed:c.number(),generatedAt:c.string(),guardian:nge,metricDays:c.array(S8),metricHours:c.array(S8).optional(),metricSixHours:c.array(S8).optional(),locations:c.array(Vu),actors:c.array(Vu),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 age=c.object({status:c.literal("ok"),service:c.string(),timestamp:c.string()}).strict(),nG=c.object({configKeys:c.array(c.string()),description:c.string(),displayName:c.string(),name:c.string()}).strict(),K8=c.array(nG),Y8=c.object({name:c.string(),pluginProvider:c.string().optional()}).strict(),J8=c.array(Y8),aG=c.object({dir:c.string(),hasMigrationsDir:c.boolean(),hasSkillsDir:c.boolean(),packageName:c.string()}).strict(),rG=c.object({packageNames:c.array(c.string()),packages:c.array(aG),manifestRoots:c.array(c.string()),skillRoots:c.array(c.string()),tracingIncludes:c.array(c.string())}).strict(),rge=c.object({cwd:c.string(),homeDir:c.string(),descriptionText:c.string().optional(),providers:c.array(c.string()),skills:c.array(Y8),packagedContent:rG}).strict(),W8=c.enum(["danger","good","neutral","warning"]),oge=c.object({label:c.string(),tone:W8.optional(),value:c.string()}).strict(),ige=c.object({key:c.string(),label:c.string()}).strict(),Age=c.object({id:c.string(),tone:W8.optional(),values:c.record(c.string(),c.string())}).strict(),sge=c.object({fields:c.array(ige).optional(),emptyText:c.string().optional(),records:c.array(Age).optional(),title:c.string()}).strict(),cge=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:W8.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(),oG=c.object({generatedAt:c.string().optional(),metrics:c.array(oge).optional(),recordSets:c.array(sge).optional(),title:c.string().optional(),pluginName:c.string(),widgets:c.array(cge).max(12).optional()}).strict(),Yw=c.object({generatedAt:c.string(),reports:c.array(oG),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 Xu=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 Jw=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 Ww=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 Z8(t,this)}},Z8=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 Zw(e,...t){return e(...t)}function e2(e,t){return`${e[hs]}_${t.join("_")}_unique`}var V8=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 X8(t,this.columns,this.nullsNotDistinctConfig,this.name)}},iG=class{static[D]="PgUniqueOnConstraintBuilder";name;constructor(t){this.name=t}on(...t){return new V8(t,this.name)}},X8=class{constructor(t,n,r,a){this.table=t,this.columns=n,this.name=a??e2(this.table,this.columns.map(o=>o.name)),this.nullsNotDistinct=r}static[D]="PgUniqueConstraint";columns;name;nullsNotDistinct=!1;getName(){return this.name}};function AG(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 sG(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]=AG(e,r+1,!0);n.push(s),r=u;continue}if(o==="}")return[n,r+1];if(o==="{"){let[s,u]=sG(e,r+1);n.push(s),r=u;continue}let[i,A]=AG(e,r,!1);n.push(i),r=A}return[n,r]}function cG(e){let[t]=sG(e,1);return t}function t2(e){return`{${e.map(t=>Array.isArray(t)?t2(t):typeof t=="string"?`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:`${t}`).join(",")}}`}var ee=class extends Jw{foreignKeyConfigs=[];static[D]="PgColumnBuilder";array(t){return new a2(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})=>Zw((o,i)=>{let A=new Ww(()=>{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 n2(t,this.config)}},W=class extends Xu{constructor(t,n){n.uniqueName||(n.uniqueName=e2(t,[n.name])),super(t,n),this.table=t}static[D]="PgColumn"},n2=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}},Sp=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},a2=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 r2(t,this.config,n)}},r2=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=cG(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:t2(r)}};var uG=class extends ee{static[D]="PgEnumObjectColumnBuilder";constructor(t,n){super(t,"string","PgEnumObjectColumn"),this.config.enum=n}build(t){return new o2(t,this.config)}},o2=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}},dG=Symbol.for("drizzle:isPgEnum");function pG(e){return!!e&&typeof e=="function"&&dG in e&&e[dG]===!0}var lG=class extends ee{static[D]="PgEnumColumnBuilder";constructor(t,n){super(t,"string","PgEnumColumn"),this.config.enum=n}build(t){return new i2(t,this.config)}},i2=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 Lp=class{static[D]="Subquery";constructor(t,n,r,a=!1,o=[]){this._={brand:"Subquery",sql:t,selectedFields:n,alias:r,isWith:a,usedTables:o}}},gG=class extends Lp{static[D]="WithSubquery"};var mG="0.45.2";var A2,s2,fG={startActiveSpan(e,t){return A2?(s2||(s2=A2.trace.getTracer("drizzle-orm",mG)),Zw((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()}}),A2,s2)):t()}};var Np=Symbol.for("drizzle:ViewBaseConfig");var c2=Symbol.for("drizzle:Schema"),bG=Symbol.for("drizzle:Columns"),hG=Symbol.for("drizzle:ExtraConfigColumns"),u2=Symbol.for("drizzle:OriginalName"),d2=Symbol.for("drizzle:BaseName"),Of=Symbol.for("drizzle:IsAlias"),BG=Symbol.for("drizzle:ExtraConfigBuilder"),uge=Symbol.for("drizzle:IsDrizzleTable"),vn=class{static[D]="Table";static Symbol={Name:hs,Schema:c2,OriginalName:u2,Columns:bG,ExtraConfigColumns:hG,BaseName:d2,IsAlias:Of,ExtraConfigBuilder:BG};[hs];[u2];[c2];[bG];[hG];[d2];[Of]=!1;[uge]=!0;[BG]=void 0;constructor(t,n,r){this[hs]=this[u2]=t,this[c2]=n,this[d2]=r}};var yG=class{static[D]="FakePrimitiveParam"};function dge(e){return e!=null&&typeof e.getSQL=="function"}function lge(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=CG;shouldInlineParams=!1;usedTables=[];append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return fG.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 lge(t.map(d=>{if(Un(d,fo))return{sql:d.value.join(""),params:[]};if(Un(d,qf))return{sql:o(d.value),params:[]};if(d===void 0)return{sql:"",params:[]};if(Array.isArray(d)){let l=[new fo("(")];for(let[g,p]of d.entries())l.push(p),g<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],g=d[vn.Symbol.Name];return{sql:l===void 0||d[Of]?o(g):o(l)+"."+o(g),params:[]}}if(Un(d,Xu)){let l=a.getColumnCasing(d);if(n.invokeSource==="indexes")return{sql:o(l),params:[]};let g=d.table[vn.Symbol.Schema];return{sql:d.table[Of]||g===void 0?o(d.table[vn.Symbol.Name])+"."+o(l):o(g)+"."+o(d.table[vn.Symbol.Name])+"."+o(l),params:[]}}if(Un(d,l2)){let l=d[Np].schema,g=d[Np].name;return{sql:l===void 0||d[Np].isAlias?o(g):o(l)+"."+o(g),params:[]}}if(Un(d,Vw)){if(Un(d.value,zf))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 g=["none"];return A&&(g=[A(d.encoder)]),{sql:i(u.value++,l),params:[l],typings:g}}return Un(d,zf)?{sql:i(u.value++,d),params:[d],typings:["none"]}:Un(d,e.Aliased)&&d.fieldAlias!==void 0?{sql:o(d.fieldAlias),params:[]}:Un(d,Lp)?d._.isWith?{sql:o(d._.alias),params:[]}:this.buildQueryFromSourceParams([new fo("("),d._.sql,new fo(") "),new qf(d._.alias)],r):pG(d)?d.schema?{sql:o(d.schema)+"."+o(d.enumName),params:[]}:{sql:o(d.enumName),params:[]}:dge(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}},qf=class{constructor(t){this.value=t}static[D]="Name";brand;getSQL(){return new _n([this])}};var CG={mapFromDriverValue:e=>e},wG={mapToDriverValue:e=>e},dLe={...CG,...wG},Vw=class{constructor(t,n=wG){this.value=t,this.encoder=n}static[D]="Param";brand;getSQL(){return new _n([this])}};function Rp(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,g]of s.entries())l>0&&u!==void 0&&d.push(u),d.push(g);return new _n(d)}e.join=a;function o(s){return new qf(s)}e.identifier=o;function i(s){return new zf(s)}e.placeholder=i;function A(s,u){return new Vw(s,u)}e.param=A})(Rp||(Rp={}));(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 zf=class{constructor(t){this.name=t}static[D]="Placeholder";getSQL(){return new _n([this])}};var pge=Symbol.for("drizzle:IsDrizzleView"),l2=class{static[D]="View";[Np];[pge]=!0;constructor({name:t,schema:n,selectedFields:r,query:a}){this[Np]={name:t,originalName:t,schema:n,selectedFields:r,query:a,isExisting:!a,isAlias:!1}}getSQL(){return new _n([this])}};Xu.prototype.getSQL=function(){return new _n([this])};vn.prototype.getSQL=function(){return new _n([this])};Lp.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 pLe=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 p2=class extends Bs{static[D]="PgBigInt53Builder";constructor(t){super(t,"number","PgBigInt53")}build(t){return new g2(t,this.config)}},g2=class extends W{static[D]="PgBigInt53";getSQLType(){return"bigint"}mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}},m2=class extends Bs{static[D]="PgBigInt64Builder";constructor(t){super(t,"bigint","PgBigInt64")}build(t){return new f2(t,this.config)}},f2=class extends W{static[D]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(t){return BigInt(t)}};function EG(e,t){let{name:n,config:r}=We(e,t);return r.mode==="number"?new p2(n):new m2(n)}var b2=class extends ee{static[D]="PgBigSerial53Builder";constructor(t){super(t,"number","PgBigSerial53"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new h2(t,this.config)}},h2=class extends W{static[D]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(t){return typeof t=="number"?t:Number(t)}},B2=class extends ee{static[D]="PgBigSerial64Builder";constructor(t){super(t,"bigint","PgBigSerial64"),this.config.hasDefault=!0}build(t){return new y2(t,this.config)}},y2=class extends W{static[D]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(t){return BigInt(t)}};function kG(e,t){let{name:n,config:r}=We(e,t);return r.mode==="number"?new b2(n):new B2(n)}var C2=class extends ee{static[D]="PgBooleanBuilder";constructor(t){super(t,"boolean","PgBoolean")}build(t){return new w2(t,this.config)}},w2=class extends W{static[D]="PgBoolean";getSQLType(){return"boolean"}};function QG(e){return new C2(e??"")}var E2=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 k2(t,this.config)}},k2=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 IG(e,t={}){let{name:n,config:r}=We(e,t);return new E2(n,r)}var Q2=class extends ee{static[D]="PgCidrBuilder";constructor(t){super(t,"string","PgCidr")}build(t){return new I2(t,this.config)}},I2=class extends W{static[D]="PgCidr";getSQLType(){return"cidr"}};function vG(e){return new Q2(e??"")}var v2=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 _2(t,this.config)}},_2=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 _G(e){return(t,n)=>{let{name:r,config:a}=We(t,n);return new v2(r,a,e)}}var fA=class extends ee{static[D]="PgDateColumnBaseBuilder";defaultNow(){return this.default(Rp`now()`)}};var x2=class extends fA{static[D]="PgDateBuilder";constructor(t){super(t,"date","PgDate")}build(t){return new D2(t,this.config)}},D2=class extends W{static[D]="PgDate";getSQLType(){return"date"}mapFromDriverValue(t){return typeof t=="string"?new Date(t):t}mapToDriverValue(t){return t.toISOString()}},F2=class extends fA{static[D]="PgDateStringBuilder";constructor(t){super(t,"string","PgDateString")}build(t){return new S2(t,this.config)}},S2=class extends W{static[D]="PgDateString";getSQLType(){return"date"}mapFromDriverValue(t){return typeof t=="string"?t:t.toISOString().slice(0,-14)}};function xG(e,t){let{name:n,config:r}=We(e,t);return r?.mode==="date"?new x2(n):new F2(n)}var L2=class extends ee{static[D]="PgDoublePrecisionBuilder";constructor(t){super(t,"number","PgDoublePrecision")}build(t){return new N2(t,this.config)}},N2=class extends W{static[D]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(t){return typeof t=="string"?Number.parseFloat(t):t}};function DG(e){return new L2(e??"")}var R2=class extends ee{static[D]="PgInetBuilder";constructor(t){super(t,"string","PgInet")}build(t){return new $2(t,this.config)}},$2=class extends W{static[D]="PgInet";getSQLType(){return"inet"}};function FG(e){return new R2(e??"")}var M2=class extends Bs{static[D]="PgIntegerBuilder";constructor(t){super(t,"number","PgInteger")}build(t){return new j2(t,this.config)}},j2=class extends W{static[D]="PgInteger";getSQLType(){return"integer"}mapFromDriverValue(t){return typeof t=="string"?Number.parseInt(t):t}};function SG(e){return new M2(e??"")}var P2=class extends ee{static[D]="PgIntervalBuilder";constructor(t,n){super(t,"string","PgInterval"),this.config.intervalConfig=n}build(t){return new T2(t,this.config)}},T2=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 LG(e,t={}){let{name:n,config:r}=We(e,t);return new P2(n,r)}var H2=class extends ee{static[D]="PgJsonBuilder";constructor(t){super(t,"json","PgJson")}build(t){return new G2(t,this.config)}},G2=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 NG(e){return new H2(e??"")}var U2=class extends ee{static[D]="PgJsonbBuilder";constructor(t){super(t,"json","PgJsonb")}build(t){return new O2(t,this.config)}},O2=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 Xw(e){return new U2(e??"")}var q2=class extends ee{static[D]="PgLineBuilder";constructor(t){super(t,"array","PgLine")}build(t){return new z2(t,this.config)}},z2=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]}}`}},K2=class extends ee{static[D]="PgLineABCBuilder";constructor(t){super(t,"json","PgLineABC")}build(t){return new Y2(t,this.config)}},Y2=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 RG(e,t){let{name:n,config:r}=We(e,t);return!r?.mode||r.mode==="tuple"?new q2(n):new K2(n)}var J2=class extends ee{static[D]="PgMacaddrBuilder";constructor(t){super(t,"string","PgMacaddr")}build(t){return new W2(t,this.config)}},W2=class extends W{static[D]="PgMacaddr";getSQLType(){return"macaddr"}};function $G(e){return new J2(e??"")}var Z2=class extends ee{static[D]="PgMacaddr8Builder";constructor(t){super(t,"string","PgMacaddr8")}build(t){return new V2(t,this.config)}},V2=class extends W{static[D]="PgMacaddr8";getSQLType(){return"macaddr8"}};function MG(e){return new Z2(e??"")}var X2=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 eS(t,this.config)}},eS=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})`}},tS=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 nS(t,this.config)}},nS=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})`}},aS=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 rS(t,this.config)}},rS=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 jG(e,t){let{name:n,config:r}=We(e,t),a=r?.mode;return a==="number"?new tS(n,r?.precision,r?.scale):a==="bigint"?new aS(n,r?.precision,r?.scale):new X2(n,r?.precision,r?.scale)}var oS=class extends ee{static[D]="PgPointTupleBuilder";constructor(t){super(t,"array","PgPointTuple")}build(t){return new iS(t,this.config)}},iS=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]})`}},AS=class extends ee{static[D]="PgPointObjectBuilder";constructor(t){super(t,"json","PgPointObject")}build(t){return new sS(t,this.config)}},sS=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 PG(e,t){let{name:n,config:r}=We(e,t);return!r?.mode||r.mode==="tuple"?new oS(n):new AS(n)}function gge(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 TG(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 cS(e){let t=gge(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=TG(t,n);n+=8;let s=TG(t,n);return n+=8,[A,s]}throw new Error("Unsupported geometry type")}var uS=class extends ee{static[D]="PgGeometryBuilder";constructor(t){super(t,"array","PgGeometry")}build(t){return new dS(t,this.config)}},dS=class extends W{static[D]="PgGeometry";getSQLType(){return"geometry(point)"}mapFromDriverValue(t){return cS(t)}mapToDriverValue(t){return`point(${t[0]} ${t[1]})`}},lS=class extends ee{static[D]="PgGeometryObjectBuilder";constructor(t){super(t,"json","PgGeometryObject")}build(t){return new pS(t,this.config)}},pS=class extends W{static[D]="PgGeometryObject";getSQLType(){return"geometry(point)"}mapFromDriverValue(t){let n=cS(t);return{x:n[0],y:n[1]}}mapToDriverValue(t){return`point(${t.x} ${t.y})`}};function HG(e,t){let{name:n,config:r}=We(e,t);return!r?.mode||r.mode==="tuple"?new uS(n):new lS(n)}var gS=class extends ee{static[D]="PgRealBuilder";constructor(t,n){super(t,"number","PgReal"),this.config.length=n}build(t){return new mS(t,this.config)}},mS=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 GG(e){return new gS(e??"")}var fS=class extends ee{static[D]="PgSerialBuilder";constructor(t){super(t,"number","PgSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new bS(t,this.config)}},bS=class extends W{static[D]="PgSerial";getSQLType(){return"serial"}};function UG(e){return new fS(e??"")}var hS=class extends Bs{static[D]="PgSmallIntBuilder";constructor(t){super(t,"number","PgSmallInt")}build(t){return new BS(t,this.config)}},BS=class extends W{static[D]="PgSmallInt";getSQLType(){return"smallint"}mapFromDriverValue=t=>typeof t=="string"?Number(t):t};function OG(e){return new hS(e??"")}var yS=class extends ee{static[D]="PgSmallSerialBuilder";constructor(t){super(t,"number","PgSmallSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(t){return new CS(t,this.config)}},CS=class extends W{static[D]="PgSmallSerial";getSQLType(){return"smallserial"}};function qG(e){return new yS(e??"")}var wS=class extends ee{static[D]="PgTextBuilder";constructor(t,n){super(t,"string","PgText"),this.config.enumValues=n.enum}build(t){return new ES(t,this.config)}},ES=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 wS(n,r)}var kS=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 QS(t,this.config)}},QS=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 zG(e,t={}){let{name:n,config:r}=We(e,t);return new kS(n,r.withTimezone??!1,r.precision)}var IS=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 vS(t,this.config)}},vS=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()},_S=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 xS(t,this.config)}},xS=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 eE(e,t={}){let{name:n,config:r}=We(e,t);return r?.mode==="string"?new _S(n,r.withTimezone??!1,r.precision):new IS(n,r?.withTimezone??!1,r?.precision)}var DS=class extends ee{static[D]="PgUUIDBuilder";constructor(t){super(t,"string","PgUUID")}defaultRandom(){return this.default(Rp`gen_random_uuid()`)}build(t){return new FS(t,this.config)}},FS=class extends W{static[D]="PgUUID";getSQLType(){return"uuid"}};function KG(e){return new DS(e??"")}var SS=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 LS(t,this.config)}},LS=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 YG(e,t={}){let{name:n,config:r}=We(e,t);return new SS(n,r)}var NS=class extends ee{static[D]="PgBinaryVectorBuilder";constructor(t,n){super(t,"string","PgBinaryVector"),this.config.dimensions=n.dimensions}build(t){return new RS(t,this.config)}},RS=class extends W{static[D]="PgBinaryVector";dimensions=this.config.dimensions;getSQLType(){return`bit(${this.dimensions})`}};function JG(e,t){let{name:n,config:r}=We(e,t);return new NS(n,r)}var $S=class extends ee{static[D]="PgHalfVectorBuilder";constructor(t,n){super(t,"array","PgHalfVector"),this.config.dimensions=n.dimensions}build(t){return new MS(t,this.config)}},MS=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 WG(e,t){let{name:n,config:r}=We(e,t);return new $S(n,r)}var jS=class extends ee{static[D]="PgSparseVectorBuilder";constructor(t,n){super(t,"string","PgSparseVector"),this.config.dimensions=n.dimensions}build(t){return new PS(t,this.config)}},PS=class extends W{static[D]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}};function ZG(e,t){let{name:n,config:r}=We(e,t);return new jS(n,r)}var TS=class extends ee{static[D]="PgVectorBuilder";constructor(t,n){super(t,"array","PgVector"),this.config.dimensions=n.dimensions}build(t){return new HS(t,this.config)}},HS=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 VG(e,t){let{name:n,config:r}=We(e,t);return new TS(n,r)}function XG(){return{bigint:EG,bigserial:kG,boolean:QG,char:IG,cidr:vG,customType:_G,date:xG,doublePrecision:DG,inet:FG,integer:SG,interval:LG,json:NG,jsonb:Xw,line:RG,macaddr:$G,macaddr8:MG,numeric:jG,point:PG,geometry:HG,real:GG,serial:UG,smallint:OG,smallserial:qG,text:wi,time:zG,timestamp:eE,uuid:KG,varchar:YG,bit:JG,halfvec:WG,sparsevec:ZG,vector:VG}}var GS=Symbol.for("drizzle:PgInlineForeignKeys"),e5=Symbol.for("drizzle:EnableRLS"),Kf=class extends vn{static[D]="PgTable";static Symbol=Object.assign({},vn.Symbol,{InlineForeignKeys:GS,EnableRLS:e5});[GS]=[];[e5]=!1;[vn.Symbol.ExtraConfigBuilder]=void 0;[vn.Symbol.ExtraConfigColumns]={}};function mge(e,t,n,r,a=e){let o=new Kf(e,r,a),i=typeof t=="function"?t(XG()):t,A=Object.fromEntries(Object.entries(i).map(([d,l])=>{let g=l;g.setName(d);let p=g.build(o);return o[GS].push(...g.buildForeignKeys(p,o)),[d,p]})),s=Object.fromEntries(Object.entries(i).map(([d,l])=>{let g=l;g.setName(d);let p=g.buildExtraConfigColumn(o);return[d,p]})),u=Object.assign(o,A);return u[vn.Symbol.Columns]=A,u[vn.Symbol.ExtraConfigColumns]=s,n&&(u[Kf.Symbol.ExtraConfigBuilder]=n),Object.assign(u,{enableRLS:()=>(u[Kf.Symbol.EnableRLS]=!0,u)})}var t5=(e,t,n)=>mge(e,t,n,void 0);var tE=class{constructor(t,n){this.unique=t,this.name=n}static[D]="PgIndexBuilderOn";on(...t){return new Yf(t.map(n=>{if(Un(n,_n))return n;n=n;let r=new Sp(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 Yf(t.map(n=>{if(Un(n,_n))return n;n=n;let r=new Sp(n.name,!!n.keyAsName,n.columnType,n.indexConfig);return n.indexConfig=n.defaultConfig,r}),this.unique,!0,this.name)}using(t,...n){return new Yf(n.map(r=>{if(Un(r,_n))return r;r=r;let a=new Sp(r.name,!!r.keyAsName,r.columnType,r.indexConfig);return r.indexConfig=JSON.parse(JSON.stringify(r.defaultConfig)),a}),this.unique,!0,this.name,t)}},Yf=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 US(this.config,t)}},US=class{static[D]="PgIndex";config;constructor(t,n){this.config={...t,table:n}}};function n5(e){return new tE(!1,e)}function a5(e){return new tE(!0,e)}var r5=e=>eE(e,{withTimezone:!0}),o5=c.enum(["channel","dm","group","local_conversation","thread","web_session"]),IRe=t5("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:Xw("metadata_json"),createdAt:r5("created_at").notNull(),updatedAt:r5("updated_at").notNull()},e=>[a5("junior_destinations_provider_destination_uidx").on(e.provider,e.providerTenantId,e.providerDestinationId),n5("junior_destinations_provider_kind_idx").on(e.provider,e.kind)]);var fge=c.object({error:c.string().min(1)}).strict(),A5=36e5,LRe=6*A5,NRe=24*A5;var KS=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(),bge=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),ed=c.object({closed:c.number().int().nonnegative(),created:c.number().int().nonnegative(),date:bge,merged:c.number().int().nonnegative()}).strict(),s5=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(),c5=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:Gf,title:c.string().optional(),url:c.string().url().optional()}).strict(),YS=c.object({activityDays:c.array(ed),activityHours:c.array(ed).optional(),activitySixHours:c.array(ed).optional(),changes:c.array(c5),generatedAt:c.string(),repositories:c.array(s5),summary:KS,windowEnd:c.string(),windowStart:c.string()}).strict(),JS=c.object({activityDays:c.array(ed),activityHours:c.array(ed).optional(),activitySixHours:c.array(ed).optional(),generatedAt:c.string(),summary:KS,windowEnd:c.string(),windowStart:c.string()}).strict(),aE=c.object({active:c.number(),conversations:c.number(),date:c.string(),durationMs:c.number(),failed:c.number(),tokens:c.number().optional()}).strict();var hge=c.object({locationId:c.string().min(1)}).strict(),u5=Vu.extend({id:c.string(),firstSeenAt:c.string(),kind:o5,lastSeenAt:c.string(),provider:c.string(),providerDestinationId:c.string(),visibility:c.literal("public")}).strict(),Bge=Vu.extend({actor:Dp}).strict(),yge=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),rE=c.object({date:yge,privateConversations:c.number(),publicConversations:c.number()}).strict(),WS=c.object({activityDays:c.array(rE),activityHours:c.array(rE).optional(),activitySixHours:c.array(rE).optional(),generatedAt:c.string(),locations:c.array(u5),privateActivity:Vu,source:c.literal("conversation_index"),windowEnd:c.string(),windowStart:c.string()}).strict(),ZS=u5.extend({activityDays:c.array(aE),activityHours:c.array(aE).optional(),activitySixHours:c.array(aE).optional(),actors:c.array(Bge),generatedAt:c.string(),recentConversations:c.array(Fp),source:c.literal("conversation_index"),windowEnd:c.string(),windowStart:c.string()}).strict(),Cge=c.object({email:c.string().trim().min(1)}).strict(),i5=Vu.omit({costUsd:!0}),d5=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),OS=c.object({active:c.number(),conversations:c.number(),costUsd:c.number().optional(),date:d5,durationMs:c.number(),failed:c.number(),tokens:c.number().optional()}).strict(),qS=c.object({activePeople:c.number(),conversations:c.number(),date:d5}).strict(),l5=c.object({active:c.number(),activeDays:c.number(),conversations:c.number(),durationMs:c.number(),failed:c.number(),tokens:c.number().optional()}).strict(),nE=c.object({conversations:c.number().int().nonnegative(),costUsd:c.number().finite().nonnegative(),durationMs:c.number().finite().nonnegative(),priorCostUsd:c.number().finite().nonnegative()}).strict(),wge=c.object({1:nE,7:nE,30:nE,90:nE}).strict(),p5=Dp.extend({email:c.string().min(1)}).strict(),Ege=l5.extend({firstSeenAt:c.string(),lastSeenAt:c.string(),actor:p5,windows:wge}).strict(),VS=c.object({activityDays:c.array(qS),activityHours:c.array(qS).optional(),activitySixHours:c.array(qS).optional(),generatedAt:c.string(),people:c.array(Ege),source:c.literal("conversation_index"),windowEnd:c.string(),windowStart:c.string()}).strict(),XS=c.object({activityDays:c.array(OS),activityHours:c.array(OS).optional(),activitySixHours:c.array(OS).optional(),generatedAt:c.string(),locations:c.array(i5),recentConversations:c.array(Fp),actor:p5,source:c.literal("conversation_index"),surfaces:c.array(i5),totals:l5,windowEnd:c.string(),windowStart:c.string()}).strict(),e4=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(),t4=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(),n4=c.object({tokens:c.array(t4)}).strict(),kge=c.object({name:c.string().trim().min(1).max(80)}).strict(),a4=t4.extend({token:c.string().startsWith("jr_pat_")}).strict(),Qge=c.object({id:c.string().uuid()}).strict(),Ige=c.object({revoked:c.literal(!0)}).strict(),vge=c.object({channelId:c.string().min(1),label:c.string().min(1),teamId:c.string().min(1),visibility:c.enum(["private","public"])}).strict(),g5=c.object({1:c.number().int().nonnegative(),7:c.number().int().nonnegative(),30:c.number().int().nonnegative(),90:c.number().int().nonnegative()}).strict(),m5=c.object({createdAt:c.string().datetime(),createdBy:c.string().min(1),createdByEmail:c.string().trim().email().optional(),destination:vge,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:g5,outcomes:c.array(LH).max(5),title:c.string().min(1),totalRuns:c.number().int().nonnegative()}),f5=m5.extend({kind:c.literal("scheduled"),nextRunAt:c.string().datetime().optional(),schedule:c.string().min(1),status:c.enum(["active","blocked","completed"])}).strict(),b5=m5.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(),r4=c.discriminatedUnion("kind",[f5,b5]),h5=c.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),zS=c.object({costUsd:c.number().finite().nonnegative(),date:h5,event:c.number().int().nonnegative(),scheduled:c.number().int().nonnegative()}).strict(),_ge=c.object({q:c.string().trim().max(200).optional()}).strict(),o4=c.object({executionDays:c.array(zS),executionHours:c.array(zS).optional(),executionSixHours:c.array(zS).optional(),automations:c.array(r4),truncated:c.boolean()}).strict(),xge=c.object({id:c.string().min(1),kind:c.enum(["scheduled","event"])}).strict(),B5=c.enum(["blocked","completed","failed"]),i4=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(),oE=c.object({blocked:c.number().int().nonnegative(),completed:c.number().int().nonnegative(),date:h5,failed:c.number().int().nonnegative()}).strict(),A4=c.object({executionDays:c.array(oE),executionHours:c.array(oE).optional(),executionSixHours:c.array(oE).optional(),executions:c.array(i4),automation:r4,truncated:c.boolean()}).strict(),y5=i4.extend({kind:c.enum(["scheduled","event"]),automationId:c.string().min(1),automationTitle:c.string().min(1)}).strict(),s4=c.object({runs:c.array(y5),truncated:c.boolean()}).strict(),Dge=c.object({provider:c.string(),repo:c.string()}).strict(),C5=c.object({provider:c.string(),repo:c.string(),checkoutPath:c.string()}).strict(),Fge=c.object({id:c.string(),generatedAt:c.iso.datetime(),buildDurationMs:c.number().int().nonnegative(),sizeBytes:c.number().int().nonnegative().nullable()}).strict(),w5=c.object({id:c.string(),generatedAt:c.iso.datetime(),buildDurationMs:c.number().int().nonnegative(),dependencyCount:c.number().int().nonnegative()}).strict(),$p=c.object({id:c.string().uuid(),name:c.string(),setupScript:c.string(),repos:c.array(C5),snapshot:Fge.nullable()}).strict(),c4=c.object({baselineSnapshot:w5.nullable(),workspaces:c.array($p)}).strict(),Sge=c.object({name:c.string(),setupScript:c.string().optional(),repos:c.array(Dge)}).strict(),Lge=c.object({id:c.string().uuid()}).strict(),Nge=c.object({deleted:c.literal(!0)}).strict(),E5=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(),u4=c.object({generatedAt:c.string().datetime(),stats:c.array(E5),windowEnd:c.string(),windowStart:c.string()}).strict();function Rge(e){try{let t=new URL(e).protocol;return t==="http:"||t==="https:"}catch{return!1}}var $ge=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(Rge,"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(),HRe=c.discriminatedUnion("kind",[$ge]),Mge=c.enum(["circle-dot","circle-dashed","circle-x","git-merge","git-pull-request","triangle-alert"]),GRe=c.object({icon:Mge.optional(),key:c.string().trim().min(1).max(256),label:c.string().trim().min(1).max(256)}).strict(),jge=c.enum(["closed","merged","open"]),ORe=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:jge,title:c.string().min(1).optional(),updatedAt:c.date(),url:c.string().url().optional()}).strict(),zRe=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/),Pge=c.enum(["activity","brain","calendar","check","database","info","key","link","sparkles","warning"]),Tge=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(),KRe=c.object({details:c.array(Tge).max(100).optional(),icon:Pge.optional(),preview:c.string().trim().min(1).max(500).optional(),title:c.string().trim().min(1).max(120)}).strict();var AE=c.string().regex(/^T[A-Z0-9]+$/),l4=c.string().regex(/^(C|G|D)[A-Z0-9]+$/),Q5=c.string().regex(/^local:[a-z0-9_-]+:[a-z0-9][a-z0-9_-]*$/),Hge=c.string().min(1).refine(e=>e===e.trim()&&e.toLowerCase()!=="unknown"),iE=Hge,Be=c.string().refine(e=>e.trim().length>0),Za=Be.refine(e=>e===e.trim()),Gge=c.object({id:Be,provider:Za}).strict(),Uge=Gge.extend({provider:c.literal("slack"),teamId:AE,channelId:l4,threadTs:Za.optional()}).strict(),JRe=c.discriminatedUnion("provider",[Uge]),WRe=c.enum(["slack","local"]),I5=c.enum(["public","private"]),Oge=c.enum(["public","private"]),qge=c.object({platform:c.literal("slack"),teamId:AE,channelId:l4,threadTs:Za.optional()}).strict(),p4=qge,zge=c.object({platform:c.literal("local"),conversationId:Q5}).strict(),Kge=c.discriminatedUnion("platform",[p4,zge]),ZRe=c.object({action:c.literal("send_message"),destination:p4}).strict(),Yge=c.object({kind:c.literal("slack"),teamId:AE,channelId:l4,visibility:I5,messageTs:Be.optional(),threadTs:Be.optional()}).strict(),Jge=c.object({kind:c.literal("local"),visibility:c.literal("private"),conversationId:Q5}).strict(),Wge=c.object({kind:c.literal("web"),visibility:I5,conversationId:Za}).strict(),Zge=c.object({kind:c.literal("event"),eventKey:Za,eventType:Za,identifier:Za,namespace:Za}).strict(),Vge=c.object({kind:c.literal("scheduled_automation")}).strict(),Xge=c.object({kind:c.literal("event_automation")}).strict(),eme=c.object({kind:c.literal("plugin_dispatch")}).strict(),tme=c.object({kind:c.literal("agent_invocation")}).strict(),nme=c.discriminatedUnion("kind",[Yge,Jge,Wge,Zge,Vge,Xge,eme,tme]);function ame(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 rme=c.preprocess(ame,nme),ome=c.discriminatedUnion("allowedWhen",[c.object({type:c.literal("user"),userId:iE,allowedWhen:c.literal("private-direct-conversation")}).strict(),c.object({type:c.literal("user"),userId:iE,allowedWhen:c.literal("scheduled-automation"),taskId:Za}).strict()]),g4={email:Be.optional(),fullName:Be.optional(),userId:iE,userName:Be.optional()},ime=c.object({...g4,platform:c.literal("slack"),teamId:AE}).strict(),Ame=c.object({...g4,platform:c.literal("local")}).strict(),sme=c.object({...g4,platform:c.literal("web")}).strict(),cme=c.object({platform:c.literal("system"),name:iE}).strict(),d4=c.discriminatedUnion("platform",[ime,Ame,sme,cme]),ume=c.object({displayName:Be.optional(),handle:Be.optional(),id:Za,provider:Za,providerSubjectId:Za,providerTenantId:Za.optional()}).strict(),VRe=c.object({displayName:Be.optional(),email:Be.max(320),id:Za,identities:c.array(ume).max(100)}).strict(),dme=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]})}}),lme=c.object({label:Za.pipe(c.string().max(48)).refine(e=>!/[\r\n]/.test(e)),detail:Za.pipe(c.string().max(128)).refine(e=>!/[\r\n]/.test(e)).optional()}).strict(),XRe=c.object({idempotencyKey:Be.pipe(c.string().max(512)),credentialSubject:ome.optional(),destination:p4,destinationVisibility:Oge,input:Be.pipe(c.string().max(32e3)),metadata:dme.optional(),replyAttribution:lme.optional()}).strict();var pme=c.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/),t$e=c.object({text:c.string().trim().min(1).max(8e3)}).strict(),n$e=c.object({kind:pme,version:c.number().int().positive(),content:c.record(c.string(),c.unknown())}).strict();var gme=4e3,mme=8e3,Mp=32,k5=4e3,fme=1e3,bme=c.record(c.string(),c.unknown()).superRefine((e,t)=>{Object.keys(e).length>Mp&&t.addIssue({code:"custom",message:`Event data may include at most ${Mp} keys.`}),new TextEncoder().encode(JSON.stringify(e)).byteLength>k5&&t.addIssue({code:"custom",message:`Event data may be at most ${k5} JSON bytes.`})}),td=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."),v5=c.string().regex(/^[a-z][a-z0-9_]*$/).describe("Canonical plugin-defined resource type, such as issue or pull_request."),_5=/^[a-z][a-zA-Z0-9]*$/,hme=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"]})}),Bme=c.record(c.string().regex(_5),hme).superRefine((e,t)=>{Object.keys(e).length>Mp&&t.addIssue({code:"custom",message:`Event match keys may include at most ${Mp} keys.`})}),r$e=c.record(c.string().regex(_5),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>Mp&&t.addIssue({code:"custom",message:`Event match may include at most ${Mp} 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 yme=c.object({type:v5,supportedEvents:c.array(td).min(1),suggestedEvents:c.array(td).optional(),matchFields:Bme.optional(),guidance:c.record(td,c.string().trim().min(1).max(fme)).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)})}),o$e=c.object({resourceTypes:c.array(yme).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 i$e=c.object({identifier:c.string().min(1),label:c.string().min(1),namespace:c.string().min(1),suggestedEvents:c.array(td).optional(),supportedEvents:c.array(td),type:v5}).strict(),A$e=c.object({events:c.array(td).min(1),id:c.string().min(1)}).strict(),Cme=c.object({eventKey:c.string().min(1),eventType:td,identifier:c.string().min(1),occurredAtMs:c.number().finite(),terminal:c.boolean().optional(),trustedSummary:c.string().min(1).transform(e=>e.slice(0,gme)),data:bme.optional(),untrustedText:c.string().transform(e=>e.slice(0,mme)).optional()}).strict(),s$e=Cme.extend({namespace:c.string().min(1)}),wme=c.object({authority:c.enum(["instruction","context"]),actor:d4.optional()}).strict(),Eme=c.discriminatedUnion("type",[c.object({type:c.literal("message"),role:c.enum(["user","assistant"]),text:c.string().min(1),provenance:wme.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()]),u$e=c.object({actorUserId:c.string().min(1).optional(),completedAtMs:c.number().finite(),conversationId:c.string().min(1),destination:Kge,locationId:c.string().min(1).optional(),actors:c.array(d4),actor:d4.optional(),runId:c.string().min(1),source:rme,transcript:c.array(Eme)}).strict();var l$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()]),kme=c.object({arguments:c.record(c.string(),c.unknown()),reason:c.string().min(1).optional()}).strict(),p$e=c.object({target:c.string().min(1).optional(),truncated:c.boolean().optional(),continuation:kme.optional()}).passthrough(),g$e=c.enum(["auto","review","approve"]);var f$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(),Qme=c.string().regex(/^[a-z][a-z0-9-]*$/),Ime=c.string().regex(/^[a-z][a-z0-9.-]*$/),vme=c.union([c.literal("read"),c.literal("write")]),x5=c.object({provider:Qme,scope:Be.optional(),type:c.literal("oauth")}).strict(),D5=c.object({displayName:Be.optional(),handle:Be.optional(),id:Be,label:Be.optional(),url:Be.optional()}).strict(),h$e=c.object({account:D5.optional(),accessToken:Be,expiresAt:c.number().finite().optional(),refreshToken:Be,refreshTokenExpiresAt:c.number().finite().optional(),scope:Be.optional()}).strict(),B$e=c.object({access:vme,leaseScope:Be.optional(),name:Ime,reason:Be.optional(),requirements:c.array(Be).min(1).optional()}).strict(),_me=c.object({domain:c.string().min(1),headers:c.record(c.string(),c.string()).refine(e=>Object.keys(e).length>0)}).strict(),xme=c.object({account:D5.optional(),authorization:x5.optional(),expiresAt:c.string().refine(e=>Number.isFinite(Date.parse(e))),headerTransforms:c.array(_me).min(1)}).strict(),y$e=c.discriminatedUnion("type",[c.object({lease:xme,type:c.literal("lease")}).strict(),c.object({authorization:x5.optional(),message:Be,type:c.literal("needed")}).strict(),c.object({message:Be,type:c.literal("unavailable")}).strict()]);var Dme=Be.max(64).regex(/^[a-z][a-z0-9-]*$/),Fme=Be.max(80),Sme=Be.max(500),Lme=c.enum(["primary","profile"]),Nme=c.object({detail:Be.max(500).optional(),label:Be.max(80),tone:c.enum(["good","neutral","warning"]).optional(),value:Be.max(120)}).strict(),Rme=c.object({label:Be.max(80),value:Be.max(500)}).strict(),$me=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(),Mme=c.object({actions:c.array($me).max(4).optional(),description:Be.max(1e3).optional(),id:Be.max(128),metadata:c.array(Rme).max(8).optional(),title:Be.max(4e3)}).strict(),F5=c.object({emptyText:Be.max(500).optional(),metrics:c.array(Nme).max(6).optional(),nextCursor:Be.max(1e3).optional(),records:c.array(Mme).max(100),searchPlaceholder:Be.max(120).optional(),type:c.literal("list")}).strict(),jme=c.object({description:Sme,id:Dme,label:Fme,navigation:Lme,pluginDisplayName:Be.max(200),pluginName:Be.max(100)}).strict(),S5=c.array(jme),Pme=Be.max(1e3).optional(),Tme=Be.max(64).optional(),Hme=c.string().trim().max(200).optional(),w$e=c.object({cursor:Pme,filter:Tme,limit:c.number().int().min(1).max(50),query:Hme}).strict();var sE=c.object({user:c.object({email:c.string().trim().email(),emailVerified:c.boolean().optional(),name:c.string().nullable().optional()}).strict()}).strict(),Q$e=c.object({displayName:c.string().trim().min(1).max(80)}).strict(),L5=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().optional(),version:c.string().min(1)}).strict();var Jf=C(q(),1);var N5="x-junior-version";var m4="junior:dashboard-version";function R5(e){let t=e.headers.get(N5)?.trim();!t||typeof window>"u"||window.dispatchEvent(new CustomEvent(m4,{detail:t}))}function $5(e){let[t,n]=(0,Jf.useState)(e);return(0,Jf.useEffect)(()=>{e&&n(e)},[e]),(0,Jf.useEffect)(()=>{let r=a=>{n(a.detail)};return window.addEventListener(m4,r),()=>window.removeEventListener(m4,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 nd(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 jp(){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 cE(e,t,n){let r=await Pp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"PATCH"});return r.status===401&&jp(),r.ok||await nd(t,r),e.parse(await r.json())}async function ad(e,t,n){let r=await Pp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"POST"});return r.status===401&&jp(),r.ok||await nd(t,r),e.parse(await r.json())}async function M5(e,t,n){let r=await Pp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"PUT"});return r.status===401&&jp(),r.ok||await nd(t,r),e.parse(await r.json())}async function Fc(e){let t=await Pp(e,{credentials:"same-origin",method:"DELETE"});t.status===401&&jp(),t.ok||await nd(e,t)}async function j5(e,t,n={}){let r=await Pp(t,{body:JSON.stringify(n),credentials:"same-origin",headers:{"content-type":"application/json"},method:"DELETE"});return r.status===401&&jp(),r.ok||await nd(t,r),e.parse(await r.json())}async function Pp(e,t){let n=await fetch(e,t);return R5(n),n}async function je(e,t,n){let r=await Pp(t,{credentials:"same-origin",...n?{signal:n}:void 0});return r.status===401&&(jp(),await nd(t,r)),r.ok||await nd(t,r),e.parse(await r.json())}var uE=5*6e4,f4=5*6e4,Gme=1e3;function Ume(e,t=Date.now()){if(!e)return f4;let n=Date.parse(e);if(!Number.isFinite(n))return f4;let r=Math.max(0,t-n);return Math.max(Gme,f4-r)}function P5(){return Re({queryKey:["dashboard","core"],queryFn:async({signal:e})=>{let[t,n]=await Promise.all([je(sE,"/api/me",e),je(L5,"/api/config",e)]);return{config:n,me:t}},retry:!1,staleTime:uE})}function Ome(){return Re({queryKey:["dashboard","plugins"],queryFn:({signal:e})=>je(K8,"/api/plugins",e),retry:!1,staleTime:uE})}function T5(){return Re({queryKey:["dashboard","plugin-user-pages"],queryFn:({signal:e})=>je(S5,"/api/user-pages",e),retry:!1,staleTime:uE})}function dE(e=""){return Re({queryKey:["dashboard","conversations","viewer",{search:e}],queryFn:({signal:t})=>je(q8,`/api/conversations${e?`?q=${encodeURIComponent(e)}`:""}`,t),placeholderData:Yh,retry:!1})}function H5(){return Re({queryKey:["dashboard","code"],queryFn:({signal:e})=>je(YS,"/api/code",e),retry:!1})}function G5(e,t){return Re({enabled:e,queryKey:["dashboard","automations",t],queryFn:({signal:n})=>je(o4,`/api/automations${t?`?q=${encodeURIComponent(t)}`:""}`,n),placeholderData:Yh,retry:!1})}function U5(e){return Re({enabled:e,queryKey:["dashboard","automations","runs"],queryFn:({signal:t})=>je(s4,"/api/automations/runs",t),retry:!1})}function O5(e,t,n){return Re({enabled:e&&!!(t&&n),queryKey:["dashboard","automations",t,n,"executions"],queryFn:({signal:r})=>je(A4,`/api/automations/${t}/${encodeURIComponent(n)}/executions`,r),retry:!1})}function q5(){return Re({queryKey:["dashboard","people"],queryFn:({signal:e})=>je(VS,"/api/people",e),retry:!1})}function z5(e){return Re({enabled:!!e,queryKey:["dashboard","people",e],queryFn:async({signal:t})=>je(XS,`/api/people/${encodeURIComponent(e)}`,t),retry:!1})}function K5(e){return Re({enabled:!!e,queryKey:["dashboard","people",e,"plugin-reports"],queryFn:({signal:t})=>je(Yw,`/api/people/${encodeURIComponent(e)}/plugin-reports`,t),retry:!1})}function Y5(e){return Re({enabled:!!e,queryKey:["dashboard","people",e,"code"],queryFn:({signal:t})=>je(JS,`/api/people/${encodeURIComponent(e)}/code`,t),retry:!1})}function J5(e){return Re({enabled:e,queryKey:["dashboard","personal-spend"],queryFn:({signal:t})=>je(e4,"/api/people/me/spend",t),refetchInterval:t=>Ume(t.state.data?.generatedAt),retry:!1,staleTime:0})}function W5(){return Re({queryKey:["dashboard","locations"],queryFn:({signal:e})=>je(WS,"/api/locations",e),retry:!1})}function Z5(e){return Re({enabled:!!e,queryKey:["dashboard","locations",e],queryFn:async({signal:t})=>je(ZS,`/api/locations/${encodeURIComponent(e)}`,t),retry:!1})}function qme(){return Re({queryKey:["dashboard","skills"],queryFn:({signal:e})=>je(J8,"/api/skills",e),retry:!1,staleTime:uE})}function zme(){return Re({queryKey:["dashboard","plugin-reports"],queryFn:({signal:e})=>je(Yw,"/api/plugin-reports",e),retry:!1})}function V5(){return Re({queryKey:["dashboard","stats"],queryFn:({signal:e})=>je(u4,"/api/stats",e),retry:!1})}function X5(e){let t=Ome(),n=Re({queryKey:["dashboard","conversation-stats"],queryFn:({signal:i})=>je(z8,"/api/conversations/stats",i),retry:!1}),r=qme(),a=zme();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 eU=C(q(),1);function lE(){return(0,eU.useSyncExternalStore)(e=>aA.subscribe(e),()=>aA.isOnline(),()=>!0)}var nU=C(w(),1);function tU(){return lE()?null:(0,nU.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 b4=C(w(),1);function pE(){return(0,b4.jsx)("div",{className:"relative grid size-10 shrink-0 select-none place-items-center overflow-visible",children:(0,b4.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 aU=["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",rU="rounded-2xl bg-dashboard-fill-soft shadow-[inset_0_0_0_1px_var(--color-dashboard-border-subtle)]",oU="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)(pE,{}),(0,Sc.jsxs)("div",{children:[(0,Sc.jsx)("div",{className:"font-bold",children:e.label}),(0,Sc.jsx)("div",{"aria-label":e.label,className:`${aU} mt-3 h-1.5 w-full`,role:"progressbar"})]})]})})}var h4="0.216.0",gE=typeof h4=="string"&&h4.trim()?h4:"unknown";var Wf=C(w(),1);function iU(e){return Kme(e.serverVersion)?(0,Wf.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,Wf.jsx)("span",{children:"The dashboard changed. Refresh to load the latest version."}),(0,Wf.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 Kme(e){return!!e&&gE!=="unknown"&&e!=="unknown"&&e!==gE}var AU=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,AU.jsx)(t,{className:k("min-w-0 overflow-hidden rounded-lg border",r,n,e.className),children:e.children})}var sU=C(w(),1);function De(e){let t=e.as??"div";return(0,sU.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}),Yme(t)]})}function Yme(e){switch(e){case"stats":return(0,Fe.jsx)(Jme,{});case"overview":return(0,Fe.jsx)(Wme,{});case"list":return(0,Fe.jsx)(Zme,{});case"library":return(0,Fe.jsx)(Vme,{});case"panel":return(0,Fe.jsx)(hA,{className:"min-h-64"})}}function Jme(){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 Wme(){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)(Tp,{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 Zme(){return(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)(hA,{className:"min-h-20 p-4"}),(0,Fe.jsx)(Tp,{className:"h-10 border-b border-dashboard-border-subtle"}),(0,Fe.jsx)(hA,{className:"min-h-80"})]})}function Vme(){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)(Tp,{className:"h-7 w-56 rounded bg-dashboard-fill-soft"}),(0,Fe.jsx)(Tp,{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)(Tp,{className:"h-3 w-12 rounded bg-dashboard-fill-soft"}),(0,Fe.jsx)(Tp,{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 Tp(e){return(0,Fe.jsx)(De,{className:e.className})}var mE=C(w(),1),cU="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",Xme="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,mE.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(Xme,"disabled:hover:border-dashboard-border-strong disabled:hover:text-dashboard-text-muted"):k(cU,"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 uU({className:e,...t}){return(0,mE.jsx)(pe,{...t,className:k(cU,"no-underline",e)})}function na({className:e,pressed:t,type:n="button",variant:r,...a}){return(0,mE.jsx)("button",{...a,"aria-pressed":t,className:k(efe[r],t?tfe[r]:nfe[r],e),type:n})}var efe={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"},tfe={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"},nfe={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 B4=C(w(),1),afe=[1,7,30,90];function y4(e){return e===1?"24h":`${e}d`}function Hp(e){return e===1?"last 24 hours":`last ${e} days`}function yn(e){return e===1?"hour":e===7?"6hour":"day"}function dU(e){return e===1}function rfe(e){return e===7}function Va(e){return e==="hour"?"hour":e==="6hour"?"6h":"day"}function fE(e){return e==="hour"?"hour":e==="6hour"?"6 hours":"day"}function Zf(e){return e==="hour"?"Hourly":e==="6hour"?"6-hour":"Daily"}function xn(e){return dU(e.range)&&e.hours?.length?e.hours.slice(-24):dU(e.range)?e.days.slice(-1):rfe(e.range)?e.sixHours?.length?[...e.sixHours]:e.hours?.length&&e.emptySixHour?ofe({empty:e.emptySixHour,hours:e.hours}):e.days.slice(-e.range):e.days.slice(-e.range)}function ofe(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 bE(e){return(0,B4.jsx)("div",{"aria-label":"Reporting period",className:"flex items-center gap-1",role:"group",children:(e.options??afe).map(t=>(0,B4.jsx)(na,{onClick:()=>e.onChange(t),pressed:e.value===t,variant:"segment",children:y4(t)},t))})}var Lc=C(w(),1);function He(e){let t=e.range!==void 0&&e.onRangeChange?(0,Lc.jsx)(bE,{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 lU=C(w(),1);function Go(e){return(0,lU.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 Vf=C(w(),1);function rd(e){return(0,Vf.jsxs)(Go,{children:[(0,Vf.jsx)(He,{description:e.description,title:e.title}),(0,Vf.jsx)(Na,{label:e.label,variant:e.variant})]})}var yE=C(q(),1);var hE=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var pU=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var gU=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());var C4=e=>{let t=gU(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Xf=C(q(),1);var BE={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 mU=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var Gp=C(q(),1);var ife=(0,Gp.createContext)({});var fU=()=>(0,Gp.useContext)(ife);var bU=(0,Xf.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:g="currentColor",className:p=""}=fU()??{},m=r??l?Number(n??d)*24/Number(t??u):n??d;return(0,Xf.createElement)("svg",{ref:s,...BE,width:t??u??BE.width,height:t??u??BE.height,stroke:e??g,strokeWidth:m,className:hE("lucide",p,a),...!o&&!mU(A)&&{"aria-hidden":"true"},...A},[...i.map(([h,B])=>(0,Xf.createElement)(h,B)),...Array.isArray(o)?o:[o]])});var F=(e,t)=>{let n=(0,yE.forwardRef)(({className:r,...a},o)=>(0,yE.createElement)(bU,{ref:o,iconNode:t,className:hE(`lucide-${pU(C4(e))}`,`lucide-${e}`,r),...a}));return n.displayName=C4(e),n};var Afe=[["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",Afe);var sfe=[["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",sfe);var cfe=[["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",cfe);var ufe=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],eb=F("arrow-down-to-line",ufe);var dfe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],BA=F("arrow-left",dfe);var lfe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],tb=F("arrow-right",lfe);var pfe=[["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"}]],nb=F("bookmark",pfe);var gfe=[["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",gfe);var mfe=[["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",mfe);var ffe=[["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",ffe);var bfe=[["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",bfe);var hfe=[["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",hfe);var Bfe=[["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",Bfe);var yfe=[["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"}]],ab=F("calendar",yfe);var Cfe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],od=F("check",Cfe);var wfe=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],rb=F("chevron-down",wfe);var Efe=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ob=F("chevron-left",Efe);var kfe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],aa=F("chevron-right",kfe);var Qfe=[["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",Qfe);var Ife=[["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"}]],ib=F("circle-dashed",Ife);var vfe=[["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"}]],id=F("circle-dollar-sign",vfe);var _fe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],Ab=F("circle-dot",_fe);var xfe=[["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",xfe);var Dfe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],ki=F("clock-3",Dfe);var Ffe=[["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",Ffe);var Sfe=[["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"}]],Ad=F("copy",Sfe);var Lfe=[["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",Lfe);var Nfe=[["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"}]],mr=F("earth",Nfe);var Rfe=[["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",Rfe);var $fe=[["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"}]],sd=F("external-link",$fe);var Mfe=[["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"}]],sb=F("file-text",Mfe);var jfe=[["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",jfe);var Pfe=[["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"}]],cb=F("folder-git-2",Pfe);var Tfe=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],ub=F("gauge",Tfe);var Hfe=[["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"}]],db=F("git-merge",Hfe);var Gfe=[["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",Gfe);var Ufe=[["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"}]],lb=F("hash",Ufe);var Ofe=[["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",Ofe);var qfe=[["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",qfe);var zfe=[["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",zfe);var Kfe=[["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"}]],cd=F("library-big",Kfe);var Yfe=[["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"}]],pb=F("lightbulb",Yfe);var Jfe=[["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"}]],gb=F("list-checks",Jfe);var Wfe=[["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"}]],mb=F("link",Wfe);var Zfe=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Qs=F("loader-circle",Zfe);var Vfe=[["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"}]],fr=F("lock-keyhole",Vfe);var Xfe=[["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"}]],fb=F("lock",Xfe);var ebe=[["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"}]],bb=F("log-out",ebe);var tbe=[["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"}]],ud=F("map-pin",tbe);var nbe=[["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"}]],hb=F("map-pinned",nbe);var abe=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],dd=F("menu",abe);var rbe=[["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"}]],Bb=F("message-square-text",rbe);var obe=[["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",obe);var ibe=[["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"}]],Up=F("messages-square",ibe);var Abe=[["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"}]],yb=F("minimize-2",Abe);var sbe=[["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"}]],Cb=F("paperclip",sbe);var cbe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ld=F("plus",cbe);var ube=[["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"}]],wb=F("radio-tower",ube);var dbe=[["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"}]],Op=F("scroll-text",dbe);var lbe=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Hc=F("search",lbe);var pbe=[["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"}]],pd=F("send",pbe);var gbe=[["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"}]],Eb=F("settings",gbe);var mbe=[["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"}]],kb=F("sigma",mbe);var fbe=[["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"}]],Qb=F("skip-forward",fbe);var bbe=[["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"}]],Xa=F("sparkles",bbe);var hbe=[["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",hbe);var Bbe=[["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",Bbe);var ybe=[["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",ybe);var Cbe=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Ib=F("trending-up",Cbe);var wbe=[["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",wbe);var Ebe=[["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",Ebe);var kbe=[["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"}]],gd=F("users",kbe);var Qbe=[["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"}]],vb=F("webhook",Qbe);var Ibe=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],er=F("x",Ibe);var vbe=[["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"}]],_b=F("zap",vbe);var MA=C(q(),1);var w4=Object.defineProperty,_be=Object.getOwnPropertyDescriptor,xbe=Object.getOwnPropertyNames,Dbe=Object.prototype.hasOwnProperty,BU=(e,t)=>{let n={};for(var r in e)w4(n,r,{get:e[r],enumerable:!0});return t||w4(n,Symbol.toStringTag,{value:"Module"}),n},hU=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=xbe(t),o=0,i=a.length,A;o<i;o++)A=a[o],!Dbe.call(e,A)&&A!==n&&w4(e,A,{get:(s=>t[s]).bind(null,A),enumerable:!(r=_be(t,A))||r.enumerable});return e},yU=(e,t,n)=>(hU(e,t,"default"),n&&hU(n,t,"default"));var I4={};L(I4,{createOnigurumaEngine:()=>Kbe,getDefaultWasmLoader:()=>zbe,loadWasm:()=>wU,setDefaultWasmLoader:()=>qbe});var Q4=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Fbe(){return 2147483648}function Sbe(){return typeof performance<"u"?performance.now():Date.now()}var Lbe=(e,t)=>e+(t-e%t)%t;async function Nbe(e){let t,n,r={};function a(p){n=p,r.HEAPU8=new Uint8Array(p),r.HEAPU32=new Uint32Array(p)}function o(p,m,h){r.HEAPU8.copyWithin(p,m,m+h)}function i(p){try{return t.grow(p-n.byteLength+65535>>>16),a(t.buffer),1}catch{}}function A(p){let m=r.HEAPU8.length;p=p>>>0;let h=Fbe();if(p>h)return!1;for(let B=1;B<=4;B*=2){let b=m*(1+.2/B);b=Math.min(b,p+100663296);let f=Math.min(h,Lbe(Math.max(p,b),65536));if(i(f))return!0}return!1}let s=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(p,m,h=1024){let B=m+h,b=m;for(;p[b]&&!(b>=B);)++b;if(b-m>16&&p.buffer&&s)return s.decode(p.subarray(m,b));let f="";for(;m<b;){let y=p[m++];if(!(y&128)){f+=String.fromCharCode(y);continue}let E=p[m++]&63;if((y&224)===192){f+=String.fromCharCode((y&31)<<6|E);continue}let I=p[m++]&63;if((y&240)===224?y=(y&15)<<12|E<<6|I:y=(y&7)<<18|E<<12|I<<6|p[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(p,m){return p?u(r.HEAPU8,p,m):""}let l={emscripten_get_now:Sbe,emscripten_memcpy_big:o,emscripten_resize_heap:A,fd_write:()=>0};async function g(){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 g(),r}var Rbe=Object.defineProperty,$be=(e,t,n)=>t in e?Rbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ra=(e,t,n)=>$be(e,typeof t!="symbol"?t+"":t,n),ya=null;function Mbe(e){throw new Q4(e.UTF8ToString(e.getLastOnigError()))}var wE=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,g=!1;if(d>=55296&&d<=56319&&u+1<n){let p=t.charCodeAt(u+1);p>=56320&&p<=57343&&(l=(d-55296<<10)+65536|p-56320,g=!0)}a&&(o[u]=s,g&&(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),g&&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}},EE=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 Q4("Must invoke loadWasm first.");this._onigBinding=ya,this.content=t;let n=new wE(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(EE,"LAST_ID",0);ra(EE,"_sharedPtr",0);ra(EE,"_sharedPtrInUse",!1);var CU=EE,k4=class{constructor(t){if(ra(this,"_onigBinding"),ra(this,"_ptr"),!ya)throw new Q4("Must invoke loadWasm first.");let n=[],r=[];for(let A=0,s=t.length;A<s;A++){let u=new wE(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&&Mbe(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 CU(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 g=0;g<d;g++){let p=t.convertUtf8OffsetToUtf16(A[s++]),m=t.convertUtf8OffsetToUtf16(A[s++]);l[g]={start:p,end:m,length:m-p}}return{index:u,captureIndices:l}}};function jbe(e){return typeof e.instantiator=="function"}function Pbe(e){return typeof e.default=="function"}function Tbe(e){return typeof e.data<"u"}function Hbe(e){return typeof Response<"u"&&e instanceof Response}function Gbe(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 CE;function wU(e){if(CE)return CE;async function t(){ya=await Nbe(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),jbe(r)?r=await r.instantiator(n):Pbe(r)?r=await r.default(n):(Tbe(r)&&(r=r.data),Hbe(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await Ube(r)(n):r=await Obe(r)(n):Gbe(r)?r=await E4(r)(n):r instanceof WebAssembly.Module?r=await E4(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await E4(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return CE=t(),CE}function E4(e){return t=>WebAssembly.instantiate(e,t)}function Ube(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Obe(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var EU;function qbe(e){EU=e}function zbe(){return EU}async function Kbe(e){return e&&await wU(e),{createScanner(t){return new k4(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new CU(t)}}}var v4=BU({});yU(v4,I4);var zq=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>Promise.resolve().then(()=>(QU(),kU)))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>Promise.resolve().then(()=>(vU(),IU)))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(xU(),_U)))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>Promise.resolve().then(()=>(FU(),DU)))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>Promise.resolve().then(()=>(LU(),SU)))},{id:"catppuccin-frappe",displayName:"Catppuccin Frapp\xE9",type:"dark",import:(()=>Promise.resolve().then(()=>(RU(),NU)))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>Promise.resolve().then(()=>(MU(),$U)))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>Promise.resolve().then(()=>(PU(),jU)))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>Promise.resolve().then(()=>(HU(),TU)))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>Promise.resolve().then(()=>(UU(),GU)))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>Promise.resolve().then(()=>(qU(),OU)))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>Promise.resolve().then(()=>(KU(),zU)))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(JU(),YU)))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>Promise.resolve().then(()=>(ZU(),WU)))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(XU(),VU)))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>Promise.resolve().then(()=>(tO(),eO)))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>Promise.resolve().then(()=>(aO(),nO)))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>Promise.resolve().then(()=>(oO(),rO)))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>Promise.resolve().then(()=>(AO(),iO)))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>Promise.resolve().then(()=>(cO(),sO)))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>Promise.resolve().then(()=>(dO(),uO)))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>Promise.resolve().then(()=>(pO(),lO)))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>Promise.resolve().then(()=>(mO(),gO)))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>Promise.resolve().then(()=>(bO(),fO)))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>Promise.resolve().then(()=>(BO(),hO)))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>Promise.resolve().then(()=>(CO(),yO)))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>Promise.resolve().then(()=>(EO(),wO)))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>Promise.resolve().then(()=>(QO(),kO)))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>Promise.resolve().then(()=>(vO(),IO)))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>Promise.resolve().then(()=>(xO(),_O)))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>Promise.resolve().then(()=>(FO(),DO)))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>Promise.resolve().then(()=>(LO(),SO)))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>Promise.resolve().then(()=>(RO(),NO)))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>Promise.resolve().then(()=>(MO(),$O)))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>Promise.resolve().then(()=>(PO(),jO)))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>Promise.resolve().then(()=>(HO(),TO)))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>Promise.resolve().then(()=>(UO(),GO)))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>Promise.resolve().then(()=>(qO(),OO)))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>Promise.resolve().then(()=>(KO(),zO)))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>Promise.resolve().then(()=>(JO(),YO)))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(ZO(),WO)))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>Promise.resolve().then(()=>(XO(),VO)))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>Promise.resolve().then(()=>(tq(),eq)))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>Promise.resolve().then(()=>(aq(),nq)))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>Promise.resolve().then(()=>(oq(),rq)))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>Promise.resolve().then(()=>(Aq(),iq)))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>Promise.resolve().then(()=>(cq(),sq)))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>Promise.resolve().then(()=>(dq(),uq)))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>Promise.resolve().then(()=>(pq(),lq)))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>Promise.resolve().then(()=>(mq(),gq)))},{id:"red",displayName:"Red",type:"dark",import:(()=>Promise.resolve().then(()=>(bq(),fq)))},{id:"rose-pine",displayName:"Ros\xE9 Pine",type:"dark",import:(()=>Promise.resolve().then(()=>(Bq(),hq)))},{id:"rose-pine-dawn",displayName:"Ros\xE9 Pine Dawn",type:"light",import:(()=>Promise.resolve().then(()=>(Cq(),yq)))},{id:"rose-pine-moon",displayName:"Ros\xE9 Pine Moon",type:"dark",import:(()=>Promise.resolve().then(()=>(Eq(),wq)))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(Qq(),kq)))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>Promise.resolve().then(()=>(vq(),Iq)))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>Promise.resolve().then(()=>(xq(),_q)))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(Fq(),Dq)))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>Promise.resolve().then(()=>(Lq(),Sq)))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>Promise.resolve().then(()=>(Rq(),Nq)))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>Promise.resolve().then(()=>(Mq(),$q)))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>Promise.resolve().then(()=>(Pq(),jq)))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>Promise.resolve().then(()=>(Hq(),Tq)))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>Promise.resolve().then(()=>(Uq(),Gq)))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>Promise.resolve().then(()=>(qq(),Oq)))}],Kq=Object.fromEntries(zq.map(e=>[e.id,e.import]));var Et=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function oBe(e){return M4(e)}function M4(e){return Array.isArray(e)?iBe(e):e instanceof RegExp?e:typeof e=="object"?ABe(e):e}function iBe(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=M4(e[n]);return t}function ABe(e){let t={};for(let n in e)t[n]=M4(e[n]);return t}function nz(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function az(e){let t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?az(e.substring(0,e.length-1)):e.substr(~t+1)}var _4=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,kE=class{static hasCaptures(e){return e===null?!1:(_4.lastIndex=0,_4.test(e))}static replaceCaptures(e,t,n){return e.replace(_4,(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 rz(e,t){return e<t?-1:e>t?1:0}function oz(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=rz(e[a],t[a]);if(o!==0)return o}return 0}return n-r}function Yq(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 iz(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Az=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}},Fb=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(uBe(e),t)}static createFromParsedTheme(e,t){return lBe(e,t)}_cachedMatchRoot=new Az(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=>sBe(e.parent,a.parentScopes));return r?new sz(r.fontStyle,r.foreground,r.background):null}},x4=class QE{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(let r of n)t=new QE(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new QE(n,t[r]);return n}push(t){return new QE(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 sBe(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&&!cBe(e.scopeName,r);){if(a)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function cBe(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var sz=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function uBe(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 g=0,p=l.length;g<p;g++)switch(l[g]){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"&&Yq(i.settings.foreground)&&(u=i.settings.foreground);let d=null;typeof i.settings.background=="string"&&Yq(i.settings.background)&&(d=i.settings.background);for(let l=0,g=A.length;l<g;l++){let m=A[l].trim().split(" "),h=m[m.length-1],B=null;m.length>1&&(B=m.slice(0,m.length-1),B.reverse()),n[r++]=new dBe(h,B,a,s,u,d)}}return n}var dBe=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}},$a=(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))($a||{});function lBe(e,t){e.sort((s,u)=>{let d=rz(s.scope,u.scope);return d!==0||(d=oz(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 pBe(t),i=new sz(n,o.getId(r),o.getId(a)),A=new mBe(new F4(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 Fb(o,i,A)}var pBe=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)}},gBe=Object.freeze([]),F4=class cz{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,a,o){this.scopeDepth=t,this.parentScopes=n||gBe,this.fontStyle=r,this.foreground=a,this.background=o}clone(){return new cz(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)}},mBe=class S4{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(S4._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 S4(this._mainRule.clone(),F4.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(oz(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 F4(t,n,r,a,o))}},fd=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),g=Oo.getForeground(t),p=Oo.getBackground(t);return n!==0&&(s=n),r!==8&&(u=r),a!==null&&(d=a?1:0),o!==-1&&(l=o),i!==0&&(g=i),A!==0&&(p=A),(s<<0|u<<8|d<<10|l<<11|g<<15|p<<24)>>>0}};function vE(e,t){let n=[],r=fBe(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(Jq(a)){let s=[];do s.push(a),a=r.next();while(Jq(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 Jq(e){return!!e&&!!e.match(/[\w\.:]+/)}function fBe(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 uz(e){typeof e.dispose=="function"&&e.dispose()}var Sb=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},bBe=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},hBe=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))}},BBe=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Sb(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new hBe;for(let n of e)yBe(n,this.initialScopeName,this.repo,t);for(let n of t.references)if(n instanceof Sb){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 yBe(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 Sb?IE({baseGrammar:o,selfGrammar:a},r):L4(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 Sb(A))}function L4(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];_E([r],t,n)}}function IE(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&_E(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&_E(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function _E(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let a=r.repository?nz({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&_E(r.patterns,{...t,repository:a},n);let o=r.include;if(!o)continue;let i=dz(o);switch(i.kind){case 0:IE({...t,selfGrammar:t.baseGrammar},n);break;case 1:IE(t,n);break;case 2:L4(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?L4(i.ruleName,s,n):IE(s,n)}else i.kind===4?n.add(new bBe(i.scopeName,i.ruleName)):n.add(new Sb(i.scopeName));break}}}var CBe=class{kind=0},wBe=class{kind=1},EBe=class{constructor(e){this.ruleName=e}kind=2},kBe=class{constructor(e){this.scopeName=e}kind=3},QBe=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function dz(e){if(e==="$base")return new CBe;if(e==="$self")return new wBe;let t=e.indexOf("#");if(t===-1)return new kBe(e);if(t===0)return new EBe(e.substring(1));{let n=e.substring(0,t),r=e.substring(t+1);return new QBe(n,r)}}var IBe=/\\(\d+)/,Wq=/\\(\d+)/g;var vBe=-1,lz=-2;var Rb=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=kE.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=kE.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${az(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:kE.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:kE.replaceCaptures(this._contentName,e,t)}},_Be=class extends Rb{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!")}},xBe=class extends Rb{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,a){super(e,t,n,null),this._match=new Lb(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 Nb,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Zq=class extends Rb{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 Nb,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},N4=class extends Rb{_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 Lb(a,this.id),this.beginCaptures=o,this._end=new Lb(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 Nb;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}},xE=class extends Rb{_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 Lb(a,this.id),this.beginCaptures=o,this.whileCaptures=A,this._while=new Lb(i,lz),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 Nb;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 Nb,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"\uFFFF"),this._cachedCompiledWhilePatterns}},pz=class tr{static createCaptureRule(t,n,r,a,o){return t.registerRule(i=>new _Be(n,i,r,a,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(a=>{if(t.id=a,t.match)return new xBe(t.$vscodeTextmateLocation,t.id,t.name,t.match,tr._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=nz({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new Zq(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,tr._compilePatterns(o,n,r))}return t.while?new xE(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,tr._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,tr._compileCaptures(t.whileCaptures||t.captures,n,r),tr._compilePatterns(t.patterns,n,r)):new N4(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,tr._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,tr._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,tr._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=tr.getCompiledRuleId(t[i],n,r)),a[A]=tr.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=dz(A.include);switch(u.kind){case 0:case 1:s=tr.getCompiledRuleId(r[A.include],n,r);break;case 2:let d=r[u.ruleName];d&&(s=tr.getCompiledRuleId(d,n,r));break;case 3:case 4:let l=u.scopeName,g=u.kind===4?u.ruleName:null,p=n.getExternalGrammar(l,r);if(p)if(g){let m=p.repository[g];m&&(s=tr.getCompiledRuleId(m,n,p.repository))}else s=tr.getCompiledRuleId(p.repository.$self,n,p.repository);break}}else s=tr.getCompiledRuleId(A,n,r);if(s!==-1){let u=n.getRule(s),d=!1;if((u instanceof Zq||u instanceof N4||u instanceof xE)&&u.hasMissingPatterns&&u.patterns.length===0&&(d=!0),d)continue;a.push(s)}}return{patterns:a,hasMissingPatterns:(t?t.length:0)!==a.length}}},Lb=class gz{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=IBe.test(this.source):this.hasBackReferences=!1}clone(){return new gz(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 Wq.lastIndex=0,this.source.replace(Wq,(a,o)=>iz(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}},Nb=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 Vq(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 Vq(e,r,this._items.map(a=>a.ruleId))}},Vq=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}},D4=class{constructor(e,t){this.languageId=e,this.tokenType=t}},DBe=class R4{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new D4(t,8),this._embeddedLanguagesMatcher=new FBe(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?R4._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new D4(0,0);_getBasicScopeAttributes=new Az(t=>{let n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new D4(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){let n=t.match(R4.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/},FBe=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])=>iz(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])}},oHe={InDebugMode:typeof process<"u"&&!!process.env.VSCODE_TEXTMATE_DEBUG},mz=!1,Xq=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function fz(e,t,n,r,a,o,i,A){let s=t.content.length,u=!1,d=-1;if(i){let p=SBe(e,t,n,r,a,o);a=p.stack,r=p.linePos,n=p.isFirstLine,d=p.anchorPosition}let l=Date.now();for(;!u;){if(A!==0&&Date.now()-l>A)return new Xq(a,!0);g()}return new Xq(a,!1);function g(){let p=LBe(e,t,n,r,a,d);if(!p){o.produce(a,s),u=!0;return}let m=p.captureIndices,h=p.matchedRuleId,B=m&&m.length>0?m[0].end>r:!1;if(h===vBe){let b=a.getRule(e);o.produce(a,m[0].start),a=a.withContentNameScopesList(a.nameScopesList),xb(e,t,n,a,o,b.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 b=e.getRule(h);o.produce(a,m[0].start);let f=a,y=b.getName(t.content,m),E=a.contentNameScopesList.pushAttributed(y,e);if(a=a.push(h,r,d,m[0].end===s,null,E,E),b instanceof N4){let I=b;xb(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),v=E.pushAttributed(Q,e);if(a=a.withContentNameScopesList(v),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(b instanceof xE){let I=b;xb(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),v=E.pushAttributed(Q,e);if(a=a.withContentNameScopesList(v),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(xb(e,t,n,a,o,b.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 SBe(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 xE&&A.push({rule:u,stack:s})}for(let s=A.pop();s;s=A.pop()){let{ruleScanner:u,findOptions:d}=$Be(s.rule,e,s.stack.endRule,n,r===i),l=u.findNextMatchSync(t,r,d);if(l){if(l.ruleId!==lz){a=s.stack.pop();break}l.captureIndices&&l.captureIndices.length&&(o.produce(s.stack,l.captureIndices[0].start),xb(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 LBe(e,t,n,r,a,o){let i=NBe(e,t,n,r,a,o),A=e.getInjections();if(A.length===0)return i;let s=RBe(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 NBe(e,t,n,r,a,o){let i=a.getRule(e),{ruleScanner:A,findOptions:s}=bz(i,e,a.endRule,n,r===o),u=A.findNextMatchSync(t,r,s);return u?{captureIndices:u.captureIndices,matchedRuleId:u.ruleId}:null}function RBe(e,t,n,r,a,o,i){let A=Number.MAX_VALUE,s=null,u,d=0,l=o.contentNameScopesList.getScopeNames();for(let g=0,p=e.length;g<p;g++){let m=e[g];if(!m.matcher(l))continue;let h=t.getRule(m.ruleId),{ruleScanner:B,findOptions:b}=bz(h,t,null,r,a===i),f=B.findNextMatchSync(n,a,b);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 bz(e,t,n,r,a){if(mz){let i=e.compile(t,n),A=hz(r,a);return{ruleScanner:i,findOptions:A}}return{ruleScanner:e.compileAG(t,n,r,a),findOptions:0}}function $Be(e,t,n,r,a){if(mz){let i=e.compileWhile(t,n),A=hz(r,a);return{ruleScanner:i,findOptions:A}}return{ruleScanner:e.compileWhileAG(t,n,r,a),findOptions:0}}function hz(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function xb(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 g=o[l];if(g===null)continue;let p=i[l];if(p.length===0)continue;if(p.start>d)break;for(;u.length>0&&u[u.length-1].endPos<=p.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,p.start):a.produce(r,p.start),g.retokenizeCapturedWithRuleId){let h=g.getName(A,i),B=r.contentNameScopesList.pushAttributed(h,e),b=g.getContentName(A,i),f=B.pushAttributed(b,e),y=r.push(g.retokenizeCapturedWithRuleId,p.start,-1,!1,null,B,f),E=e.createOnigString(A.substring(0,p.end));fz(e,E,n&&p.start===0,p.start,y,a,!1,0),uz(E);continue}let m=g.getName(A,i);if(m!==null){let B=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(m,e);u.push(new MBe(B,p.end))}}for(;u.length>0;)a.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var MBe=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function jBe(e,t,n,r,a,o,i,A){return new TBe(e,t,n,r,a,o,i,A)}function ez(e,t,n,r,a){let o=vE(t,DE),i=pz.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 DE(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(PBe(t[a],r))return n=a+1,!0;return!1})}function PBe(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 TBe=class{constructor(e,t,n,r,a,o,i,A){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=A,this._basicScopeAttributesProvider=new DBe(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=i,this._grammar=tz(t,null),this._injections=null,this._tokenTypeMatchers=[],a)for(let s of Object.keys(a)){let u=vE(s,DE);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)ez(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&&ez(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]=tz(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=pz.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let a;if(!t||t===$4.NULL){a=!0;let u=this._basicScopeAttributesProvider.getDefaultAttributes(),d=this.themeProvider.getDefaults(),l=fd.set(0,u.languageId,u.tokenType,null,d.fontStyle,d.foregroundId,d.backgroundId),g=this.getRule(this._rootId).getName(null,null),p;g?p=Db.createRootAndLookUpScopeName(g,l,this):p=Db.createRoot("unknown",l),t=new $4(null,this._rootId,-1,-1,!1,null,p,p)}else a=!1,t.reset();e=e+`
69
69
  `;let o=this.createOnigString(e),i=o.content.length,A=new GBe(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),s=fz(this,o,a,0,t,A,!0,r);return uz(o),{lineLength:i,lineTokens:A,ruleStack:s.stack,stoppedEarly:s.stoppedEarly}}};function tz(e,t){return e=oBe(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 Db=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=x4.push(a,o.scopeNames),r=new EA(r,a,o.encodedTokenAttributes);return r}static createRoot(t,n){return new EA(null,new x4(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let a=r.getMetadataForScope(t),o=new x4(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),fd.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}},$4=class md{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 md(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:md._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Db.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(){md._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,a,o,i,A){return new md(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 md(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=Db.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new md(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Db.fromExtension(r,n.contentNameScopesList))}},HBe=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):vE(n,DE).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>vE(n,DE).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}},GBe=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=fd.set(r,0,i.type,null,-1,0,0));this.balancedBracketSelectors&&(a=this.balancedBracketSelectors.match(o))}if(a&&(r=fd.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}},UBe=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,jBe(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 UBe(Fb.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Fb.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 HBe(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,a){let o=new BBe(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)}},FE=$4.NULL;function Mb(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 kz(e){return Array.isArray(e)?e:[e]}async function j4(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function jb(e){return!e||["plaintext","txt","text","plain"].includes(e)}function P4(e){return e==="ansi"||jb(e)}function Pb(e){return e==="none"}function T4(e){return Pb(e)}var OBe=/(\r?\n)/g;function qp(e,t=!1){if(e.length===0)return[["",0]];let n=e.split(OBe),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 yz={light:"#333333",dark:"#bbbbbb"},Cz={light:"#fffffe",dark:"#1e1e1e"},wz="__shiki_resolved";function SE(e){if(e?.[wz])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"?yz.light:yz.dark),n||(n=t.type==="light"?Cz.light:Cz.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,wz,{enumerable:!1,writable:!1,value:!0}),t}async function Qz(e){return[...new Set((await Promise.all(e.filter(t=>!P4(t)).map(async t=>await j4(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function Iz(e){return(await Promise.all(e.map(async t=>T4(t)?null:SE(await j4(t))))).filter(t=>!!t)}function vz(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 Et(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var qBe=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=SE(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=Fb.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=vz(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 Et(`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))}},zBe=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}},$b=0;function H4(e){$b+=1,e.warnings!==!1&&$b>=10&&$b%10===0&&console.warn(`[Shiki] ${$b} 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 Et("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(SE),a=new qBe(new zBe(e.engine,n),r,n,e.langAlias),o;function i(f){return vz(f,e.langAlias)}function A(f){B();let y=a.getGrammar(typeof f=="string"?f:f.name);if(!y)throw new Et(`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 Et(`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 g(...f){B(),a.loadLanguages(f.flat(1))}async function p(...f){return g(await Qz(f))}function m(...f){B();for(let y of f.flat(1))a.loadTheme(y)}async function h(...f){return B(),m(await Iz(f))}function B(){if(t)throw new Et("Shiki instance has been disposed")}function b(){t||(t=!0,a.dispose(),$b-=1)}return{setTheme:u,getTheme:s,getLanguage:A,getLoadedThemes:d,getLoadedLanguages:l,resolveLangAlias:i,loadLanguage:p,loadLanguageSync:g,loadTheme:h,loadThemeSync:m,dispose:b,[Symbol.dispose]:b}}async function G4(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([Iz(e.themes||[]),Qz(e.langs||[]),e.engine]);return H4({...e,themes:t,langs:n,engine:r})}var _z=new WeakMap;function Tb(e,t){_z.set(e,t)}function zp(e){return _z.get(e)}var LE=class xz{_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 xz(Object.fromEntries(kz(n).map(r=>[r,FE])),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 KBe(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function KBe(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 YBe(e,t){if(!(e instanceof LE))throw new Et("Invalid grammar state");return e.getInternalStack(t)}var JBe=/,/,WBe=/ /;function U4(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(jb(e.resolveLangAlias(n.lang||"text"))||Pb(r))return qp(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 Et(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${i.name}"`);if(!n.grammarState.themes.includes(a.name))throw new Et(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return Fz(t,i,a,o,n)}function Dz(...e){if(e.length===2)return zp(e[1]);let[t,n,r={}]=e,{lang:a="text",theme:o=t.getLoadedThemes()[0]}=r;if(jb(a)||Pb(o))throw new Et("Plain language does not have grammar state");if(a==="ansi")throw new Et("ANSI language does not have grammar state");let{theme:i,colorMap:A}=t.setTheme(o),s=t.getLanguage(a);return new LE(O4(n,s,i,A,r).stateStack,s.name,i.name)}function Fz(e,t,n,r,a){let o=O4(e,t,n,r,a),i=new LE(o.stateStack,t.name,n.name);return Tb(o.tokens,i),o.tokens}function O4(e,t,n,r,a){let o=Mb(n,a),{tokenizeMaxLineLength:i=0,tokenizeTimeLimit:A=500}=a,s=qp(e),u=a.grammarState?YBe(a.grammarState,n.name)??FE:a.grammarContextCode!=null?O4(a.grammarContextCode,t,n,r,{...a,grammarState:void 0,grammarContextCode:void 0}).stateStack:FE,d=[],l=[];for(let g=0,p=s.length;g<p;g++){let[m,h]=s[g];if(m===""){d=[],l.push([]);continue}if(i>0&&m.length>=i){d=[],l.push([{content:m,offset:h,color:"",fontStyle:0}]);continue}let B,b,f;a.includeExplanation&&(B=t.tokenizeLine(m,u,A),b=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],v=I+1<E?y.tokens[2*I+2]:m.length;if(Q===v)continue;let $=y.tokens[2*I+1],P=Is(r[fd.getForeground($)],o),U=fd.getFontStyle($),de={content:m.substring(Q,v),offset:h+Q,color:P,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(JBe).map(ot=>ot.trim());break;case"object":ve=ae.scope;break;default:continue}O.push({settings:ae,selectors:ve.map(ot=>ot.split(WBe))})}de.explanation=[];let V=0;for(;Q+V<v;){let ae=b[f],ve=m.substring(ae.startIndex,ae.endIndex);V+=ve.length,de.explanation.push({content:ve,scopes:a.includeExplanation==="scopeName"?ZBe(ae.scopes):VBe(O,ae.scopes)}),f+=1}}d.push(de)}l.push(d),d=[],u=y.ruleStack}return{tokens:l,stateStack:u}}function ZBe(e){return e.map(t=>({scopeName:t}))}function VBe(e,t){let n=[];for(let r=0,a=t.length;r<a;r++){let o=t[r];n[r]={scopeName:o,themeMatches:eye(e,o,t.slice(0,r))}}return n}function Ez(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function XBe(e,t,n){if(!Ez(e.at(-1),t))return!1;let r=e.length-2,a=n.length-1;for(;r>=0&&a>=0;)Ez(e[r],n[a])&&(r-=1),a-=1;return r===-1}function eye(e,t,n){let r=[];for(let{selectors:a,settings:o}of e)for(let i of a)if(XBe(i,t,n)){r.push(o);break}return r}function NE(e,t,n,r=U4){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:zp(d),theme:typeof u.theme=="string"?u.theme:u.theme.name}}),i=tye(...o.map(u=>u.tokens)),A=i[0].map((u,d)=>u.map((l,g)=>{let p={content:l.content,variants:{},offset:l.offset};return"includeExplanation"in n&&n.includeExplanation&&(p.explanation=l.explanation),i.forEach((m,h)=>{let{content:B,explanation:b,offset:f,...y}=m[d][g];p.variants[a[h].color]=y}),p})),s=o[0].state?new LE(Object.fromEntries(o.map(u=>[u.theme,u.state?.getInternalStack(u.theme)])),o[0].state.lang):void 0;return s&&Tb(A,s),A}function tye(...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 Sz=["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 q4(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 Hb(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 Gb={};L(Gb,{boolean:()=>Ie,booleanish:()=>Cn,commaOrSpaceSeparated:()=>Kr,commaSeparated:()=>Gc,number:()=>z,overloadedBoolean:()=>RE,spaceSeparated:()=>kt});var nye=0,Ie=bd(),Cn=bd(),RE=bd(),z=bd(),kt=bd(),Gc=bd(),Kr=bd();function bd(){return 2**++nye}var z4=Object.keys(Gb),hd=class extends Ca{constructor(t,n,r,a){let o=-1;if(super(t,n),Lz(this,"space",a),typeof r=="number")for(;++o<z4.length;){let i=z4[o];Lz(this,z4[o],(r&Gb[i])===Gb[i])}}};hd.prototype.defined=!0;function Lz(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 hd(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Hb(r)]=r,n[Hb(o.attribute)]=r}return new vs(t,n,e.space)}var K4=qo({properties:{ariaActiveDescendant:null,ariaAtomic:Cn,ariaAutoComplete:null,ariaBusy:Cn,ariaChecked:Cn,ariaColCount:z,ariaColIndex:z,ariaColSpan:z,ariaControls:kt,ariaCurrent:null,ariaDescribedBy:kt,ariaDetails:null,ariaDisabled:Cn,ariaDropEffect:kt,ariaErrorMessage:null,ariaExpanded:Cn,ariaFlowTo:kt,ariaGrabbed:Cn,ariaHasPopup:null,ariaHidden:Cn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:kt,ariaLevel:z,ariaLive:null,ariaModal:Cn,ariaMultiLine:Cn,ariaMultiSelectable:Cn,ariaOrientation:null,ariaOwns:kt,ariaPlaceholder:null,ariaPosInSet:z,ariaPressed:Cn,ariaReadOnly:Cn,ariaRelevant:null,ariaRequired:Cn,ariaRoleDescription:kt,ariaRowCount:z,ariaRowIndex:z,ariaRowSpan:z,ariaSelected:Cn,ariaSetSize:z,ariaSort:null,ariaValueMax:z,ariaValueMin:z,ariaValueNow:z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function $E(e,t){return t in e?e[t]:t}function ME(e,t){return $E(e,t.toLowerCase())}var Nz=qo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Gc,acceptCharset:kt,accessKey:kt,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:kt,autoFocus:Ie,autoPlay:Ie,blocking:kt,capture:null,charSet:null,checked:Ie,cite:null,className:kt,cols:z,colSpan:null,content:null,contentEditable:Cn,controls:Ie,controlsList:kt,coords:z|Gc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:RE,draggable:Cn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:kt,height:z,hidden:RE,high:z,href:null,hrefLang:null,htmlFor:kt,httpEquiv:kt,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:kt,itemRef:kt,itemScope:Ie,itemType:kt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:z,manifest:null,max:null,maxLength:z,media:null,method:null,min:null,minLength:z,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:z,pattern:null,ping:kt,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:kt,required:Ie,reversed:Ie,rows:z,rowSpan:z,sandbox:kt,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shape:null,size:z,sizes:null,slot:null,span:z,spellCheck:Cn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:z,step:null,style:null,tabIndex:z,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Cn,width:z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:kt,axis:null,background:null,bgColor:null,border:z,borderColor:null,bottomMargin:z,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:z,leftMargin:z,link:null,longDesc:null,lowSrc:null,marginHeight:z,marginWidth:z,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:z,rules:null,scheme:null,scrolling:Cn,standby:null,summary:null,text:null,topMargin:z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ie,disableRemotePlayback:Ie,prefix:null,property:null,results:z,security:null,unselectable:null},space:"html",transform:ME});var Rz=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:z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:z,amplitude:z,arabicForm:null,ascent:z,attributeName:null,attributeType:null,azimuth:z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:z,by:null,calcMode:null,capHeight:z,className:kt,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:z,diffuseConstant:z,direction:null,display:null,dur:null,divisor:z,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:z,enableBackground:null,end:null,event:null,exponent:z,externalResourcesRequired:null,fill:null,fillOpacity:z,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:z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:z,horizOriginX:z,horizOriginY:z,id:null,ideographic:z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:z,k:z,k1:z,k2:z,k3:z,k4:z,kernelMatrix:Kr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:z,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:z,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:z,overlineThickness:z,paintOrder:null,panose1:null,path:null,pathLength:z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:kt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:z,pointsAtY:z,pointsAtZ:z,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:z,specularExponent:z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:z,strikethroughThickness:z,string:null,stroke:null,strokeDashArray:Kr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:z,strokeOpacity:z,strokeWidth:null,style:null,surfaceScale:z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Kr,tabIndex:z,tableValues:null,target:null,targetX:z,targetY:z,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:z,underlineThickness:z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:z,values:null,vAlphabetic:z,vMathematical:z,vectorEffect:null,vHanging:z,vIdeographic:z,version:null,vertAdvY:z,vertOriginX:z,vertOriginY:z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$E});var Y4=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 J4=qo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ME});var W4=qo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});var aye=/[A-Z]/g,$z=/-[a-z]/g,rye=/^data[-\w.:]+$/i;function Z4(e,t){let n=Hb(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"&&rye.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace($z,iye);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!$z.test(o)){let i=o.replace(aye,oye);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}a=hd}return new a(r,t)}function oye(e){return"-"+e.toLowerCase()}function iye(e){return e.charAt(1).toUpperCase()}var Mz=q4([K4,Nz,Y4,J4,W4],"html"),jE=q4([K4,Rz,Y4,J4,W4],"svg");var jz={}.hasOwnProperty;function Pz(e,t){let n=t||{};function r(a,...o){let i=r.invalid,A=r.handlers;if(a&&jz.call(a,e)){let s=String(a[e]);i=jz.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 Aye=/["&'<>`]/g,sye=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,cye=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,uye=/[|\\{}()[\]^$+*?.]/g,Tz=new WeakMap;function Hz(e,t){if(e=e.replace(t.subset?dye(t.subset):Aye,r),t.subset||t.escapeOnly)return e;return e.replace(sye,n).replace(cye,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 dye(e){let t=Tz.get(e);return t||(t=lye(e),Tz.set(e,t)),t}function lye(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(uye,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}var pye=/[\dA-Fa-f]/;function Gz(e,t,n){let r="&#x"+e.toString(16).toUpperCase();return n&&t&&!pye.test(String.fromCharCode(t))?r:r+";"}var gye=/\d/;function Uz(e,t,n){let r="&#"+String(e);return n&&t&&!gye.test(String.fromCharCode(t))?r:r+";"}var Oz=["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 PE={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 qz=["cent","copy","divide","gt","lt","not","para","times"];var zz={}.hasOwnProperty,V4={},TE;for(TE in PE)zz.call(PE,TE)&&(V4[PE[TE]]=TE);var mye=/[^\dA-Za-z]/;function Kz(e,t,n,r){let a=String.fromCharCode(e);if(zz.call(V4,a)){let o=V4[a],i="&"+o;return n&&Oz.includes(o)&&!qz.includes(o)&&(!r||t&&t!==61&&mye.test(String.fromCharCode(t)))?i:i+";"}return""}function Yz(e,t,n){let r=Gz(e,t,n.omitOptionalSemicolons),a;if((n.useNamedReferences||n.useShortestReferences)&&(a=Kz(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!a)&&n.useShortestReferences){let o=Uz(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 Hz(e,Object.assign({format:Yz},t))}var fye=/^>|^->|<!--|-->|--!>|<!-$/g,bye=[">"],hye=["<",">"];function Jz(e,t,n,r){return r.settings.bogusComments?"<?"+_s(e.value,Object.assign({},r.settings.characterReferences,{subset:bye}))+">":"<!--"+e.value.replace(fye,a)+"-->";function a(o){return _s(o,Object.assign({},r.settings.characterReferences,{subset:hye}))}}function Wz(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function X4(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 Zz(e,t){let n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Vz(e){return e.join(" ").trim()}var Bye=/[ \t\n\f\r]/g;function Bd(e){return typeof e=="object"?e.type==="text"?Xz(e.value):!1:Xz(e)}function Xz(e){return e.replace(Bye,"")===""}var Dn=eK(1),e9=eK(-1),yye=[];function eK(e){return t;function t(n,r,a){let o=n?n.children:yye,i=(r||0)+e,A=o[i];if(!a)for(;A&&Bd(A);)i+=e,A=o[i];return A}}var Cye={}.hasOwnProperty;function HE(e){return t;function t(n,r,a){return Cye.call(e,n.tagName)&&e[n.tagName](n,r,a)}}var Ub=HE({body:Eye,caption:t9,colgroup:t9,dd:vye,dt:Iye,head:t9,html:wye,li:Qye,optgroup:_ye,option:xye,p:kye,rp:tK,rt:tK,tbody:Fye,td:nK,tfoot:Sye,th:nK,thead:Dye,tr:Lye});function t9(e,t,n){let r=Dn(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&Bd(r.value.charAt(0)))}function wye(e,t,n){let r=Dn(n,t);return!r||r.type!=="comment"}function Eye(e,t,n){let r=Dn(n,t);return!r||r.type!=="comment"}function kye(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 Qye(e,t,n){let r=Dn(n,t);return!r||r.type==="element"&&r.tagName==="li"}function Iye(e,t,n){let r=Dn(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function vye(e,t,n){let r=Dn(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function tK(e,t,n){let r=Dn(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function _ye(e,t,n){let r=Dn(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function xye(e,t,n){let r=Dn(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Dye(e,t,n){let r=Dn(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Fye(e,t,n){let r=Dn(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Sye(e,t,n){return!Dn(n,t)}function Lye(e,t,n){let r=Dn(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function nK(e,t,n){let r=Dn(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}var aK=HE({body:$ye,colgroup:Mye,head:Rye,html:Nye,tbody:jye});function Nye(e){let t=Dn(e,-1);return!t||t.type!=="comment"}function Rye(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 $ye(e){let t=Dn(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Bd(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Mye(e,t,n){let r=e9(n,t),a=Dn(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&Ub(r,n.children.indexOf(r),n)?!1:!!(a&&a.type==="element"&&a.tagName==="col")}function jye(e,t,n){let r=e9(n,t),a=Dn(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&Ub(r,n.children.indexOf(r),n)?!1:!!(a&&a.type==="element"&&a.tagName==="tr")}var GE={name:[[`
70
70
  \f\r &/=>`.split(""),`