@anthropic-ai/claude-agent-sdk 0.3.218 → 0.3.220
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/bridge.mjs +49 -49
- package/browser-sdk.js +2 -2
- package/manifest.json +22 -20
- package/manifest.zst.json +26 -24
- package/package.json +10 -10
- package/sdk.d.ts +53 -8
- package/sdk.mjs +4 -4
package/sdk.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
|
|
3
3
|
|
|
4
|
-
// Version: 0.3.
|
|
4
|
+
// Version: 0.3.220
|
|
5
5
|
|
|
6
6
|
// Want to see the unminified source? We're hiring!
|
|
7
7
|
// https://job-boards.greenhouse.io/anthropic/jobs/4816199008
|
|
@@ -31,7 +31,7 @@ import{createRequire as DW}from"node:module";var wW=Object.create;var{getPrototy
|
|
|
31
31
|
|| ${s} === "boolean" || ${o} === null`).assign(a,ue._`[${o}]`)}}}function Ake({gen:e,parentData:t,parentDataProperty:r},n){e.if(ue._`${t} !== undefined`,()=>e.assign(ue._`${t}[${r}]`,n))}function DA(e,t,r,n=wc.Correct){let o=n===wc.Correct?ue.operators.EQ:ue.operators.NEQ,i;switch(e){case"null":return ue._`${t} ${o} null`;case"array":i=ue._`Array.isArray(${t})`;break;case"object":i=ue._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=s(ue._`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=s();break;default:return ue._`typeof ${t} ${o} ${e}`}return n===wc.Correct?i:(0,ue.not)(i);function s(a=ue.nil){return(0,ue.and)(ue._`typeof ${t} == "number"`,a,r?ue._`isFinite(${t})`:ue.nil)}}xB.checkDataType=DA;function LA(e,t,r,n){if(e.length===1)return DA(e[0],t,r,n);let o,i=(0,_B.toHash)(e);if(i.array&&i.object){let s=ue._`typeof ${t} != "object"`;o=i.null?s:ue._`!${t} || ${s}`,delete i.null,delete i.array,delete i.object}else o=ue.nil;if(i.number)delete i.integer;for(let s in i)o=(0,ue.and)(o,DA(s,t,r,n));return o}xB.checkDataTypes=LA;var kke={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?ue._`{type: ${e}}`:ue._`{type: ${t}}`};function NA(e){let t=Oke(e);(0,vke.reportError)(t,kke)}xB.reportTypeError=NA;function Oke(e){let{gen:t,data:r,schema:n}=e,o=(0,_B.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var TB=v(function(EB){Object.defineProperty(EB,"__esModule",{value:!0});EB.assignDefaults=void 0;var Tc=pe(),Nke=Te();function Mke(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)SB(e,o,r[o].default);else if(t==="array"&&Array.isArray(n))n.forEach((o,i)=>SB(e,i,o.default))}EB.assignDefaults=Mke;function SB(e,t,r){let{gen:n,compositeRule:o,data:i,opts:s}=e;if(r===void 0)return;let a=Tc._`${i}${(0,Tc.getProperty)(t)}`;if(o){(0,Nke.checkStrictMode)(e,`default is ignored for: ${a}`);return}let c=Tc._`${a} === undefined`;if(s.useDefaults==="empty")c=Tc._`${c} || ${a} === null || ${a} === ""`;n.if(c,Tc._`${a} = ${(0,Tc.stringify)(r)}`)}});var Vr=v(function(OB){Object.defineProperty(OB,"__esModule",{value:!0});OB.validateUnion=OB.validateArray=OB.usePattern=OB.callValidateCode=OB.schemaProperties=OB.allSchemaProperties=OB.noPropertyInData=OB.propertyInData=OB.isOwnProperty=OB.hasPropFunc=OB.reportMissingProp=OB.checkMissingProp=OB.checkReportMissingProp=void 0;var Je=pe(),MA=Te(),ii=lo(),Uke=Te();function $ke(e,t){let{gen:r,data:n,it:o}=e;r.if($A(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:Je._`${t}`},!0),e.error()})}OB.checkReportMissingProp=$ke;function jke({gen:e,data:t,it:{opts:r}},n,o){return(0,Je.or)(...n.map((i)=>(0,Je.and)($A(e,t,i,r.ownProperties),Je._`${o} = ${i}`)))}OB.checkMissingProp=jke;function Fke(e,t){e.setParams({missingProperty:t},!0),e.error()}OB.reportMissingProp=Fke;function AB(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Je._`Object.prototype.hasOwnProperty`})}OB.hasPropFunc=AB;function UA(e,t,r){return Je._`${AB(e)}.call(${t}, ${r})`}OB.isOwnProperty=UA;function zke(e,t,r,n){let o=Je._`${t}${(0,Je.getProperty)(r)} !== undefined`;return n?Je._`${o} && ${UA(e,t,r)}`:o}OB.propertyInData=zke;function $A(e,t,r,n){let o=Je._`${t}${(0,Je.getProperty)(r)} === undefined`;return n?(0,Je.or)(o,(0,Je.not)(UA(e,t,r))):o}OB.noPropertyInData=$A;function kB(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}OB.allSchemaProperties=kB;function Bke(e,t){return kB(t).filter((r)=>!(0,MA.alwaysValidSchema)(e,t[r]))}OB.schemaProperties=Bke;function Hke({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:s},a,c,u){let d=u?Je._`${e}, ${t}, ${n}${o}`:t,f=[[ii.default.instancePath,(0,Je.strConcat)(ii.default.instancePath,i)],[ii.default.parentData,s.parentData],[ii.default.parentDataProperty,s.parentDataProperty],[ii.default.rootData,ii.default.rootData]];if(s.opts.dynamicRef)f.push([ii.default.dynamicAnchors,ii.default.dynamicAnchors]);let m=Je._`${d}, ${r.object(...f)}`;return c!==Je.nil?Je._`${a}.call(${c}, ${m})`:Je._`${a}(${m})`}OB.callValidateCode=Hke;var qke=Je._`new RegExp`;function Gke({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:Je._`${o.code==="new RegExp"?qke:(0,Uke.useFunc)(e,o)}(${r}, ${n})`})}OB.usePattern=Gke;function Wke(e){let{gen:t,data:r,keyword:n,it:o}=e,i=t.name("valid");if(o.allErrors){let a=t.let("valid",!0);return s(()=>t.assign(a,!1)),a}return t.var(i,!0),s(()=>t.break()),i;function s(a){let c=t.const("len",Je._`${r}.length`);t.forRange("i",0,c,(u)=>{e.subschema({keyword:n,dataProp:u,dataPropType:MA.Type.Num},i),t.if((0,Je.not)(i),a)})}}OB.validateArray=Wke;function Vke(e){let{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>(0,MA.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let s=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let d=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);if(t.assign(s,Je._`${s} || ${a}`),!e.mergeValidEvaluated(d,a))t.if((0,Je.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}OB.validateUnion=Vke});var LB=v(function(PB){Object.defineProperty(PB,"__esModule",{value:!0});PB.validateKeywordUsage=PB.validSchemaType=PB.funcKeywordCode=PB.macroKeywordCode=void 0;var nr=pe(),ms=lo(),sOe=Vr(),aOe=sd();function cOe(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:s}=e,a=t.macro.call(s.self,o,i,s),c=IB(r,n,a);if(s.opts.validateSchema!==!1)s.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:nr.nil,errSchemaPath:`${s.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}PB.macroKeywordCode=cOe;function lOe(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:s,$data:a,it:c}=e;pOe(c,t);let u=!a&&t.compile?t.compile.call(c.self,i,s,c):t.validate,d=IB(n,o,u),f=n.let("valid");e.block$data(f,m),e.ok((r=t.valid)!==null&&r!==void 0?r:f);function m(){if(t.errors===!1){if(_(),t.modifying)RB(e);y(()=>e.error())}else{let b=t.async?g():h();if(t.modifying)RB(e);y(()=>uOe(e,b))}}function g(){let b=n.let("ruleErrs",null);return n.try(()=>_(nr._`await `),(T)=>n.assign(f,!1).if(nr._`${T} instanceof ${c.ValidationError}`,()=>n.assign(b,nr._`${T}.errors`),()=>n.throw(T))),b}function h(){let b=nr._`${d}.errors`;return n.assign(b,null),_(nr.nil),b}function _(b=t.async?nr._`await `:nr.nil){let T=c.opts.passContext?ms.default.this:ms.default.self,w=!(("compile"in t)&&!a||t.schema===!1);n.assign(f,nr._`${b}${(0,sOe.callValidateCode)(e,d,T,w)}`,t.modifying)}function y(b){var T;n.if((0,nr.not)((T=t.valid)!==null&&T!==void 0?T:f),b)}}PB.funcKeywordCode=lOe;function RB(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,nr._`${n.parentData}[${n.parentDataProperty}]`))}function uOe(e,t){let{gen:r}=e;r.if(nr._`Array.isArray(${t})`,()=>{r.assign(ms.default.vErrors,nr._`${ms.default.vErrors} === null ? ${t} : ${ms.default.vErrors}.concat(${t})`).assign(ms.default.errors,nr._`${ms.default.vErrors}.length`),(0,aOe.extendErrors)(e)},()=>e.error())}function pOe({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function IB(e,t,r){if(r===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,nr.stringify)(r)})}function dOe(e,t,r=!1){return!t.length||t.some((n)=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}PB.validSchemaType=dOe;function fOe({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw Error("ajv implementation error");let s=o.dependencies;if(s===null||s===void 0?void 0:s.some((a)=>!Object.prototype.hasOwnProperty.call(e,a)))throw Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema){if(!o.validateSchema(e[i])){let c=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw Error(c)}}}PB.validateKeywordUsage=fOe});var $B=v(function(MB){Object.defineProperty(MB,"__esModule",{value:!0});MB.extendSubschemaMode=MB.extendSubschemaData=MB.getSubschema=void 0;var Nn=pe(),NB=Te();function _Oe(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:i,topSchemaRef:s}){if(t!==void 0&&n!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:Nn._`${e.schemaPath}${(0,Nn.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:Nn._`${e.schemaPath}${(0,Nn.getProperty)(t)}${(0,Nn.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,NB.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||i===void 0||s===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:s,errSchemaPath:i}}throw Error('either "keyword" or "schema" must be passed')}MB.getSubschema=_Oe;function yOe(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:i,propertyName:s}){if(o!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:u,dataPathArr:d,opts:f}=t,m=a.let("data",Nn._`${t.data}${(0,Nn.getProperty)(r)}`,!0);c(m),e.errorPath=Nn.str`${u}${(0,NB.getErrorPath)(r,n,f.jsPropertySyntax)}`,e.parentDataProperty=Nn._`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(o!==void 0){let u=o instanceof Nn.Name?o:a.let("data",o,!0);if(c(u),s!==void 0)e.propertyName=s}if(i)e.dataTypes=i;function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}MB.extendSubschemaData=yOe;function bOe(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){if(n!==void 0)e.compositeRule=n;if(o!==void 0)e.createErrors=o;if(i!==void 0)e.allErrors=i;e.jtdDiscriminator=t,e.jtdMetadata=r}MB.extendSubschemaMode=bOe});var jA=v(function(nyt,jB){jB.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}});var zB=v(function(oyt,FB){var si=FB.exports=function(e,t,r){if(typeof t=="function")r=t,t={};r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};q_(t,n,o,e,"",e)};si.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};si.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};si.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};si.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function q_(e,t,r,n,o,i,s,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,s,a,c,u);for(var d in n){var f=n[d];if(Array.isArray(f)){if(d in si.arrayKeywords)for(var m=0;m<f.length;m++)q_(e,t,r,f[m],o+"/"+d+"/"+m,i,o,d,n,m)}else if(d in si.propsKeywords){if(f&&typeof f=="object")for(var g in f)q_(e,t,r,f[g],o+"/"+d+"/"+SOe(g),i,o,d,n,g)}else if(d in si.keywords||e.allKeys&&!(d in si.skipKeywords))q_(e,t,r,f,o+"/"+d,i,o,d,n)}r(n,o,i,s,a,c,u)}}function SOe(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var cd=v(function(GB){Object.defineProperty(GB,"__esModule",{value:!0});GB.getSchemaRefs=GB.resolveUrl=GB.normalizeId=GB._getFullPath=GB.getFullPath=GB.inlineRef=void 0;var EOe=Te(),wOe=jA(),TOe=zB(),AOe=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function kOe(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!FA(e);if(!t)return!1;return BB(e)<=t}GB.inlineRef=kOe;var OOe=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function FA(e){for(let t in e){if(OOe.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(FA))return!0;if(typeof r=="object"&&FA(r))return!0}return!1}function BB(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,AOe.has(r))continue;if(typeof e[r]=="object")(0,EOe.eachItem)(e[r],(n)=>t+=BB(n));if(t===1/0)return 1/0}return t}function HB(e,t="",r){if(r!==!1)t=Ac(t);let n=e.parse(t);return qB(e,n)}GB.getFullPath=HB;function qB(e,t){return e.serialize(t).split("#")[0]+"#"}GB._getFullPath=qB;var COe=/#\/?$/;function Ac(e){return e?e.replace(COe,""):""}GB.normalizeId=Ac;function ROe(e,t,r){return r=Ac(r),e.resolve(t,r)}GB.resolveUrl=ROe;var IOe=/^[a-z_][-a-z0-9._]*$/i;function POe(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Ac(e[r]||t),i={"":o},s=HB(n,o,!1),a={},c=new Set;return TOe(e,{allKeys:!0},(f,m,g,h)=>{if(h===void 0)return;let _=s+m,y=i[h];if(typeof f[r]=="string")y=b.call(this,f[r]);T.call(this,f.$anchor),T.call(this,f.$dynamicAnchor),i[m]=y;function b(w){let k=this.opts.uriResolver.resolve;if(w=Ac(y?k(y,w):w),c.has(w))throw d(w);c.add(w);let P=this.refs[w];if(typeof P=="string")P=this.refs[P];if(typeof P=="object")u(f,P.schema,w);else if(w!==Ac(_))if(w[0]==="#")u(f,a[w],w),a[w]=f;else this.refs[w]=_;return w}function T(w){if(typeof w=="string"){if(!IOe.test(w))throw Error(`invalid anchor "${w}"`);b.call(this,`#${w}`)}}}),a;function u(f,m,g){if(m!==void 0&&!wOe(f,m))throw d(g)}function d(f){return Error(`reference "${f}" resolves to more than one schema`)}}GB.getSchemaRefs=POe});var pd=v(function(aH){Object.defineProperty(aH,"__esModule",{value:!0});aH.getData=aH.KeywordCxt=aH.validateFunctionCode=void 0;var YB=uB(),VB=ad(),BA=PA(),G_=ad(),$Oe=TB(),ud=LB(),zA=$B(),Y=pe(),ae=lo(),jOe=cd(),uo=Te(),ld=sd();function FOe(e){if(eH(e)){if(tH(e),QB(e)){HOe(e);return}}XB(e,()=>(0,YB.topBoolOrEmptySchema)(e))}aH.validateFunctionCode=FOe;function XB({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){if(o.code.es5)e.func(t,Y._`${ae.default.data}, ${ae.default.valCxt}`,n.$async,()=>{e.code(Y._`"use strict"; ${KB(r,o)}`),BOe(e,o),e.code(i)});else e.func(t,Y._`${ae.default.data}, ${zOe(o)}`,n.$async,()=>e.code(KB(r,o)).code(i))}function zOe(e){return Y._`{${ae.default.instancePath}="", ${ae.default.parentData}, ${ae.default.parentDataProperty}, ${ae.default.rootData}=${ae.default.data}${e.dynamicRef?Y._`, ${ae.default.dynamicAnchors}={}`:Y.nil}}={}`}function BOe(e,t){e.if(ae.default.valCxt,()=>{if(e.var(ae.default.instancePath,Y._`${ae.default.valCxt}.${ae.default.instancePath}`),e.var(ae.default.parentData,Y._`${ae.default.valCxt}.${ae.default.parentData}`),e.var(ae.default.parentDataProperty,Y._`${ae.default.valCxt}.${ae.default.parentDataProperty}`),e.var(ae.default.rootData,Y._`${ae.default.valCxt}.${ae.default.rootData}`),t.dynamicRef)e.var(ae.default.dynamicAnchors,Y._`${ae.default.valCxt}.${ae.default.dynamicAnchors}`)},()=>{if(e.var(ae.default.instancePath,Y._`""`),e.var(ae.default.parentData,Y._`undefined`),e.var(ae.default.parentDataProperty,Y._`undefined`),e.var(ae.default.rootData,ae.default.data),t.dynamicRef)e.var(ae.default.dynamicAnchors,Y._`{}`)})}function HOe(e){let{schema:t,opts:r,gen:n}=e;XB(e,()=>{if(r.$comment&&t.$comment)nH(e);if(KOe(e),n.let(ae.default.vErrors,null),n.let(ae.default.errors,0),r.unevaluated)qOe(e);rH(e),YOe(e)});return}function qOe(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",Y._`${r}.evaluated`),t.if(Y._`${e.evaluated}.dynamicProps`,()=>t.assign(Y._`${e.evaluated}.props`,Y._`undefined`)),t.if(Y._`${e.evaluated}.dynamicItems`,()=>t.assign(Y._`${e.evaluated}.items`,Y._`undefined`))}function KB(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?Y._`/*# sourceURL=${r} */`:Y.nil}function GOe(e,t){if(eH(e)){if(tH(e),QB(e)){WOe(e,t);return}}(0,YB.boolOrEmptySchema)(e,t)}function QB({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function eH(e){return typeof e.schema!="boolean"}function WOe(e,t){let{schema:r,gen:n,opts:o}=e;if(o.$comment&&r.$comment)nH(e);ZOe(e),JOe(e);let i=n.const("_errs",ae.default.errors);rH(e,i),n.var(t,Y._`${i} === ${ae.default.errors}`)}function tH(e){(0,uo.checkUnknownRules)(e),VOe(e)}function rH(e,t){if(e.opts.jtd)return ZB(e,[],!1,t);let r=(0,VB.getSchemaTypes)(e.schema),n=(0,VB.coerceAndCheckDataType)(e,r);ZB(e,r,!n,t)}function VOe(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&(0,uo.schemaHasRulesButRef)(t,o.RULES))o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function KOe(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)(0,uo.checkStrictMode)(e,"default is ignored in the schema root")}function ZOe(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=(0,jOe.resolveUrl)(e.opts.uriResolver,e.baseId,t)}function JOe(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function nH({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code(Y._`${ae.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){let s=Y.str`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code(Y._`${ae.default.self}.opts.$comment(${i}, ${s}, ${a}.schema)`)}}function YOe(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;if(r.$async)t.if(Y._`${ae.default.errors} === 0`,()=>t.return(ae.default.data),()=>t.throw(Y._`new ${o}(${ae.default.vErrors})`));else{if(t.assign(Y._`${n}.errors`,ae.default.vErrors),i.unevaluated)XOe(e);t.return(Y._`${ae.default.errors} === 0`)}}function XOe({gen:e,evaluated:t,props:r,items:n}){if(r instanceof Y.Name)e.assign(Y._`${t}.props`,r);if(n instanceof Y.Name)e.assign(Y._`${t}.items`,n)}function ZB(e,t,r,n){let{gen:o,schema:i,data:s,allErrors:a,opts:c,self:u}=e,{RULES:d}=u;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,uo.schemaHasRulesButRef)(i,d))){o.block(()=>iH(e,"$ref",d.all.$ref.definition));return}if(!c.jtd)QOe(e,t);o.block(()=>{for(let m of d.rules)f(m);f(d.post)});function f(m){if(!(0,BA.shouldUseGroup)(i,m))return;if(m.type){if(o.if((0,G_.checkDataType)(m.type,s,c.strictNumbers)),JB(e,m),t.length===1&&t[0]===m.type&&r)o.else(),(0,G_.reportTypeError)(e);o.endIf()}else JB(e,m);if(!a)o.if(Y._`${ae.default.errors} === ${n||0}`)}}function JB(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;if(o)(0,$Oe.assignDefaults)(e,t.type);r.block(()=>{for(let i of t.rules)if((0,BA.shouldUseRule)(n,i))iH(e,i.keyword,i.definition,t.type)})}function QOe(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(eCe(e,t),!e.opts.allowUnionTypes)tCe(e,t);rCe(e,e.dataTypes)}function eCe(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!oH(e.dataTypes,r))HA(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),oCe(e,t)}function tCe(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))HA(e,"use allowUnionTypes to allow union type keyword")}function rCe(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,BA.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;if(i.length&&!i.some((s)=>nCe(t,s)))HA(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function nCe(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function oH(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function oCe(e,t){let r=[];for(let n of e.dataTypes)if(oH(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function HA(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,uo.checkStrictMode)(e,t,e.opts.strictTypes)}class qA{constructor(e,t,r){if((0,ud.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,uo.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",sH(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ud.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",ae.default.errors)}result(e,t,r){this.failResult((0,Y.not)(e),t,r)}failResult(e,t,r){if(this.gen.if(e),r)r();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult((0,Y.not)(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(Y._`${t} !== undefined && (${(0,Y.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?ld.reportExtraError:ld.reportError)(this,this.def.error,t)}$dataError(){(0,ld.reportError)(this,this.def.$dataError||ld.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,ld.resetErrorsCount)(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,r=Y.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=Y.nil,t=Y.nil){if(!this.$data)return;let{gen:r,schemaCode:n,schemaType:o,def:i}=this;if(r.if((0,Y.or)(Y._`${n} === undefined`,t)),e!==Y.nil)r.assign(e,!0);if(o.length||i.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==Y.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:n,it:o}=this;return(0,Y.or)(i(),s());function i(){if(r.length){if(!(t instanceof Y.Name))throw Error("ajv implementation error");let a=Array.isArray(r)?r:[r];return Y._`${(0,G_.checkDataTypes)(a,t,o.opts.strictNumbers,G_.DataType.Wrong)}`}return Y.nil}function s(){if(n.validateSchema){let a=e.scopeValue("validate$data",{ref:n.validateSchema});return Y._`!${a}(${t})`}return Y.nil}}subschema(e,t){let r=(0,zA.getSubschema)(this.it,e);(0,zA.extendSubschemaData)(r,this.it,e),(0,zA.extendSubschemaMode)(r,e);let n={...this.it,...r,items:void 0,props:void 0};return GOe(n,t),n}mergeEvaluated(e,t){let{it:r,gen:n}=this;if(!r.opts.unevaluated)return;if(r.props!==!0&&e.props!==void 0)r.props=uo.mergeEvaluated.props(n,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=uo.mergeEvaluated.items(n,e.items,r.items,t)}mergeValidEvaluated(e,t){let{it:r,gen:n}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return n.if(t,()=>this.mergeEvaluated(e,Y.Name)),!0}}aH.KeywordCxt=qA;function iH(e,t,r,n){let o=new qA(e,r,t);if("code"in r)r.code(o,n);else if(o.$data&&r.validate)(0,ud.funcKeywordCode)(o,r);else if("macro"in r)(0,ud.macroKeywordCode)(o,r);else if(r.compile||r.validate)(0,ud.funcKeywordCode)(o,r)}var iCe=/^\/(?:[^~]|~0|~1)*$/,sCe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function sH(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return ae.default.rootData;if(e[0]==="/"){if(!iCe.test(e))throw Error(`Invalid JSON-pointer: ${e}`);o=e,i=ae.default.rootData}else{let u=sCe.exec(e);if(!u)throw Error(`Invalid JSON-pointer: ${e}`);let d=+u[1];if(o=u[2],o==="#"){if(d>=t)throw Error(c("property/index",d));return n[t-d]}if(d>t)throw Error(c("data",d));if(i=r[t-d],!o)return i}let s=i,a=o.split("/");for(let u of a)if(u)i=Y._`${i}${(0,Y.getProperty)((0,uo.unescapeJsonPointer)(u))}`,s=Y._`${s} && ${i}`;return s;function c(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}aH.getData=sH});var W_=v(function(uH){Object.defineProperty(uH,"__esModule",{value:!0});class lH extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}uH.default=lH});var dd=v(function(dH){Object.defineProperty(dH,"__esModule",{value:!0});var GA=cd();class pH extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=(0,GA.resolveUrl)(e,t,r),this.missingSchema=(0,GA.normalizeId)((0,GA.getFullPath)(e,this.missingRef))}}dH.default=pH});var K_=v(function(gH){Object.defineProperty(gH,"__esModule",{value:!0});gH.resolveSchema=gH.getCompilingSchema=gH.resolveRef=gH.compileSchema=gH.SchemaEnv=void 0;var yn=pe(),pCe=W_(),gs=lo(),bn=cd(),fH=Te(),dCe=pd();class fd{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,bn.normalizeId)(r===null||r===void 0?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r===null||r===void 0?void 0:r.$async,this.refs={}}}gH.SchemaEnv=fd;function VA(e){let t=mH.call(this,e);if(t)return t;let r=(0,bn.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,s=new yn.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),a;if(e.$async)a=s.scopeValue("Error",{ref:pCe.default,code:yn._`require("ajv/dist/runtime/validation_error").default`});let c=s.scopeName("validate");e.validateName=c;let u={gen:s,allErrors:this.opts.allErrors,data:gs.default.data,parentData:gs.default.parentData,parentDataProperty:gs.default.parentDataProperty,dataNames:[gs.default.data],dataPathArr:[yn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,yn.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:yn.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:yn._`""`,opts:this.opts,self:this},d;try{this._compilations.add(e),(0,dCe.validateFunctionCode)(u),s.optimize(this.opts.code.optimize);let f=s.toString();if(d=`${s.scopeRefs(gs.default.scope)}return ${f}`,this.opts.code.process)d=this.opts.code.process(d,e);let g=Function(`${gs.default.self}`,`${gs.default.scope}`,d)(this,this.scope.get());if(this.scope.value(c,{ref:g}),g.errors=null,g.schema=e.schema,g.schemaEnv=e,e.$async)g.$async=!0;if(this.opts.code.source===!0)g.source={validateName:c,validateCode:f,scopeValues:s._values};if(this.opts.unevaluated){let{props:h,items:_}=u;if(g.evaluated={props:h instanceof yn.Name?void 0:h,items:_ instanceof yn.Name?void 0:_,dynamicProps:h instanceof yn.Name,dynamicItems:_ instanceof yn.Name},g.source)g.source.evaluated=(0,yn.stringify)(g.evaluated)}return e.validate=g,e}catch(f){if(delete e.validate,delete e.validateName,d)this.logger.error("Error compiling schema, function code:",d);throw f}finally{this._compilations.delete(e)}}gH.compileSchema=VA;function fCe(e,t,r){var n;r=(0,bn.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=hCe.call(this,e,r);if(i===void 0){let s=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;if(s)i=new fd({schema:s,schemaId:a,root:e,baseId:t})}if(i===void 0)return;return e.refs[r]=mCe.call(this,i)}gH.resolveRef=fCe;function mCe(e){if((0,bn.inlineRef)(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:VA.call(this,e)}function mH(e){for(let t of this._compilations)if(gCe(t,e))return t}gH.getCompilingSchema=mH;function gCe(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function hCe(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||V_.call(this,e,t)}function V_(e,t){let r=this.opts.uriResolver.parse(t),n=(0,bn._getFullPath)(this.opts.uriResolver,r),o=(0,bn.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return WA.call(this,r,e);let i=(0,bn.normalizeId)(n),s=this.refs[i]||this.schemas[i];if(typeof s=="string"){let a=V_.call(this,e,s);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return WA.call(this,r,a)}if(typeof(s===null||s===void 0?void 0:s.schema)!=="object")return;if(!s.validate)VA.call(this,s);if(i===(0,bn.normalizeId)(t)){let{schema:a}=s,{schemaId:c}=this.opts,u=a[c];if(u)o=(0,bn.resolveUrl)(this.opts.uriResolver,o,u);return new fd({schema:a,schemaId:c,root:e,baseId:o})}return WA.call(this,r,s)}gH.resolveSchema=V_;var _Ce=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function WA(e,{baseId:t,schema:r,root:n}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[(0,fH.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r==="object"&&r[this.opts.schemaId];if(!_Ce.has(a)&&u)t=(0,bn.resolveUrl)(this.opts.uriResolver,t,u)}let i;if(typeof r!="boolean"&&r.$ref&&!(0,fH.schemaHasRulesButRef)(r,this.RULES)){let a=(0,bn.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=V_.call(this,n,a)}let{schemaId:s}=this.opts;if(i=i||new fd({schema:r,schemaId:s,root:n,baseId:t}),i.schema!==i.root.schema)return i;return}});var _H=v(function(uyt,SCe){SCe.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var JA=v(function(pyt,EH){var ECe=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),bH=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),KA=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),xH=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),wCe=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function ZA(e){let t="",r=0,n=0;for(n=0;n<e.length;n++){if(r=e[n].charCodeAt(0),r===48)continue;if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var TCe=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function yH(e){return e.length=0,!0}function ACe(e,t,r){if(e.length){let n=ZA(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function kCe(e){let t=0,r={error:!1,address:"",zone:""},n=[],o=[],i=!1,s=!1,a=ACe;for(let c=0;c<e.length;c++){let u=e[c];if(u==="["||u==="]")continue;if(u===":"){if(i===!0)s=!0;if(!a(o,n,r))break;if(++t>7){r.error=!0;break}if(c>0&&e[c-1]===":")i=!0;n.push(":");continue}else if(u==="%"){if(!a(o,n,r))break;a=yH}else{o.push(u);continue}}if(o.length)if(a===yH)r.zone=o.join("");else if(s)n.push(o.join(""));else n.push(ZA(o));return r.address=n.join(""),r}function vH(e){if(OCe(e,":")<2)return{host:e,isIPV6:!1};let t=kCe(e);if(!t.error){let{address:r,address:n}=t;if(t.zone)r+="%"+t.zone,n+="%25"+t.zone;return{host:r,isIPV6:!0,escapedHost:n}}else return{host:e,isIPV6:!1}}function OCe(e,t){let r=0;for(let n=0;n<e.length;n++)if(e[n]===t)r++;return r}function CCe(e){let t=e,r=[],n=-1,o=0;while(o=t.length){if(o===1)if(t===".")break;else if(t==="/"){r.push("/");break}else{r.push(t);break}else if(o===2){if(t[0]==="."){if(t[1]===".")break;else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."||t[1]==="/"){r.push("/");break}}}else if(o===3){if(t==="/.."){if(r.length!==0)r.pop();r.push("/");break}}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."){if(t[3]==="/"){if(t=t.slice(3),r.length!==0)r.pop();continue}}}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}var RCe={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},ICe=/[@/?#:]/g,PCe=/[@/?#]/g;function SH(e,t){let r=t?PCe:ICe;return r.lastIndex=0,e.replace(r,(n)=>RCe[n])}function DCe(e,t=!1){if(e.indexOf("%")===-1)return e;let r="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let o=e.slice(n+1,n+3);if(KA(o)){let i=o.toUpperCase(),s=String.fromCharCode(parseInt(i,16));if(t&&xH(s))r+=s;else r+="%"+i;n+=2;continue}}r+=e[n]}return r}function LCe(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let n=e.slice(r+1,r+3);if(KA(n)){let o=n.toUpperCase(),i=String.fromCharCode(parseInt(o,16));if(i!=="."&&xH(i))t+=i;else t+="%"+o;r+=2;continue}}if(wCe(e[r]))t+=e[r];else t+=escape(e[r])}return t}function NCe(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let n=e.slice(r+1,r+3);if(KA(n)){t+="%"+n.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function MCe(e){let t=[];if(e.userinfo!==void 0)t.push(e.userinfo),t.push("@");if(e.host!==void 0){let r=unescape(e.host);if(!bH(r)){let n=vH(r);if(n.isIPV6===!0)r=`[${n.escapedHost}]`;else r=SH(r,!1)}t.push(r)}if(typeof e.port==="number"||typeof e.port==="string")t.push(":"),t.push(String(e.port));return t.length?t.join(""):void 0}EH.exports={nonSimpleDomain:TCe,recomposeAuthority:MCe,reescapeHostDelimiters:SH,normalizePercentEncoding:DCe,normalizePathEncoding:LCe,escapePreservingEscapes:NCe,removeDotSegments:CCe,isIPv4:bH,isUUID:ECe,normalizeIPv6:vH,stringArrayToHexStripped:ZA}});var OH=v(function(dyt,kH){var{isUUID:UCe}=JA(),$Ce=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,jCe=["http","https","ws","wss","urn","urn:uuid"];function FCe(e){return jCe.indexOf(e)!==-1}function YA(e){if(e.secure===!0)return!0;else if(e.secure===!1)return!1;else if(e.scheme)return e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S");else return!1}function wH(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function TH(e){let t=String(e.scheme).toLowerCase()==="https";if(e.port===(t?443:80)||e.port==="")e.port=void 0;if(!e.path)e.path="/";return e}function zCe(e){return e.secure=YA(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function BCe(e){if(e.port===(YA(e)?443:80)||e.port==="")e.port=void 0;if(typeof e.secure==="boolean")e.scheme=e.secure?"wss":"ws",e.secure=void 0;if(e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function HCe(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match($Ce);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let o=`${n}:${t.nid||e.nid}`,i=XA(o);if(e.path=void 0,i)e=i.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e}function qCe(e,t){if(e.nid===void 0)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o=`${r}:${t.nid||n}`,i=XA(o);if(i)e=i.serialize(e,t);let s=e,a=e.nss;return s.path=`${n||t.nid}:${a}`,t.skipEscape=!0,s}function GCe(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!UCe(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function WCe(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var AH={scheme:"http",domainHost:!0,parse:wH,serialize:TH},VCe={scheme:"https",domainHost:AH.domainHost,parse:wH,serialize:TH},Z_={scheme:"ws",domainHost:!0,parse:zCe,serialize:BCe},KCe={scheme:"wss",domainHost:Z_.domainHost,parse:Z_.parse,serialize:Z_.serialize},ZCe={scheme:"urn",parse:HCe,serialize:qCe,skipNormalize:!0},JCe={scheme:"urn:uuid",parse:GCe,serialize:WCe,skipNormalize:!0},J_={http:AH,https:VCe,ws:Z_,wss:KCe,urn:ZCe,"urn:uuid":JCe};Object.setPrototypeOf(J_,null);function XA(e){return e&&(J_[e]||J_[e.toLowerCase()])||void 0}kH.exports={wsIsSecure:YA,SCHEMES:J_,isValidSchemeName:FCe,getSchemeHandler:XA}});var LH=v(function(fyt,Y_){var{normalizeIPv6:YCe,removeDotSegments:md,recomposeAuthority:XCe,normalizePercentEncoding:QCe,normalizePathEncoding:eRe,escapePreservingEscapes:tRe,reescapeHostDelimiters:rRe,isIPv4:nRe,nonSimpleDomain:oRe}=JA(),{SCHEMES:iRe,getSchemeHandler:RH}=OH();function sRe(e,t){if(typeof e==="string")e=pRe(e,t);else if(typeof e==="object")e=kc(hs(e,t),t);return e}function aRe(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=IH(kc(e,n),kc(t,n),n,!0);return n.skipEscape=!0,hs(o,n)}function IH(e,t,r,n){let o={};if(!n)e=kc(hs(e,r),r),t=kc(hs(t,r),r);if(r=r||{},!r.tolerant&&t.scheme)o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=md(t.path||""),o.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=md(t.path||""),o.query=t.query;else{if(!t.path)if(o.path=e.path,t.query!==void 0)o.query=t.query;else o.query=e.query;else{if(t.path[0]==="/")o.path=md(t.path);else{if((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path)o.path="/"+t.path;else if(!e.path)o.path=t.path;else o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path;o.path=md(o.path)}o.query=t.query}o.userinfo=e.userinfo,o.host=e.host,o.port=e.port}o.scheme=e.scheme}return o.fragment=t.fragment,o}function cRe(e,t,r){let n=CH(e,r),o=CH(t,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}function hs(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),o=[],i=RH(n.scheme||r.scheme);if(i&&i.serialize)i.serialize(r,n);if(r.path!==void 0)if(!n.skipEscape){if(r.path=tRe(r.path),r.scheme!==void 0)r.path=r.path.split("%3A").join(":")}else r.path=QCe(r.path);if(n.reference!=="suffix"&&r.scheme)o.push(r.scheme,":");let s=XCe(r);if(s!==void 0){if(n.reference!=="suffix")o.push("//");if(o.push(s),r.path&&r.path[0]!=="/")o.push("/")}if(r.path!==void 0){let a=r.path;if(!n.absolutePath&&(!i||!i.absolutePath))a=md(a);if(s===void 0&&a[0]==="/"&&a[1]==="/")a="/%2F"+a.slice(2);o.push(a)}if(r.query!==void 0)o.push("?",r.query);if(r.fragment!==void 0)o.push("#",r.fragment);return o.join("")}var lRe=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function uRe(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port==="number"&&(e.port<0||e.port>65535))return"URI port is malformed.";return}function PH(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,i=!1;if(r.reference==="suffix")if(r.scheme)e=r.scheme+":"+e;else e="//"+e;let s=e.match(lRe);if(s){if(n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port))n.port=s[5];let a=uRe(n,s);if(a!==void 0)n.error=n.error||a,o=!0;if(n.host)if(nRe(n.host)===!1){let d=YCe(n.host);n.host=d.host.toLowerCase(),i=d.isIPV6}else i=!0;if(n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path)n.reference="same-document";else if(n.scheme===void 0)n.reference="relative";else if(n.fragment===void 0)n.reference="absolute";else n.reference="uri";if(r.reference&&r.reference!=="suffix"&&r.reference!==n.reference)n.error=n.error||"URI is not a "+r.reference+" reference.";let c=RH(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)){if(n.host&&(r.domainHost||c&&c.domainHost)&&i===!1&&oRe(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(u){n.error=n.error||"Host's domain name can not be converted to ASCII: "+u}}if(!c||c&&!c.skipNormalize){if(e.indexOf("%")!==-1){if(n.scheme!==void 0)n.scheme=unescape(n.scheme);if(n.host!==void 0)n.host=rRe(unescape(n.host),i)}if(n.path)n.path=eRe(n.path);if(n.fragment)try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}}if(c&&c.parse)c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o}}function kc(e,t){return PH(e,t).parsed}function pRe(e,t){return DH(e,t).normalized}function DH(e,t){let{parsed:r,malformedAuthorityOrPort:n}=PH(e,t);return{normalized:n?e:hs(r,t),malformedAuthorityOrPort:n}}function CH(e,t){if(typeof e==="string"){let{normalized:r,malformedAuthorityOrPort:n}=DH(e,t);return n?void 0:r}if(typeof e==="object")return hs(e,t)}var QA={SCHEMES:iRe,normalize:sRe,resolve:aRe,resolveComponent:IH,equal:cRe,serialize:hs,parse:kc};Y_.exports=QA;Y_.exports.default=QA;Y_.exports.fastUri=QA});var UH=v(function(MH){Object.defineProperty(MH,"__esModule",{value:!0});var NH=LH();NH.code='require("ajv/dist/runtime/uri").default';MH.default=NH});var GH=v(function(po){Object.defineProperty(po,"__esModule",{value:!0});po.CodeGen=po.Name=po.nil=po.stringify=po.str=po._=po.KeywordCxt=void 0;var fRe=pd();Object.defineProperty(po,"KeywordCxt",{enumerable:!0,get:function(){return fRe.KeywordCxt}});var Oc=pe();Object.defineProperty(po,"_",{enumerable:!0,get:function(){return Oc._}});Object.defineProperty(po,"str",{enumerable:!0,get:function(){return Oc.str}});Object.defineProperty(po,"stringify",{enumerable:!0,get:function(){return Oc.stringify}});Object.defineProperty(po,"nil",{enumerable:!0,get:function(){return Oc.nil}});Object.defineProperty(po,"Name",{enumerable:!0,get:function(){return Oc.Name}});Object.defineProperty(po,"CodeGen",{enumerable:!0,get:function(){return Oc.CodeGen}});var mRe=W_(),BH=dd(),gRe=IA(),gd=K_(),hRe=pe(),hd=cd(),X_=ad(),tk=Te(),$H=_H(),_Re=UH(),HH=(e,t)=>new RegExp(e,t);HH.code="new RegExp";var yRe=["removeAdditional","useDefaults","coerceTypes"],bRe=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),xRe={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},vRe={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},jH=200;function SRe(e){var t,r,n,o,i,s,a,c,u,d,f,m,g,h,_,y,b,T,w,k,P,te,oe,Oe,ke;let jt=e.strict,xt=(t=e.code)===null||t===void 0?void 0:t.optimize,Ft=xt===!0||xt===void 0?1:xt||0,vt=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:HH,St=(o=e.uriResolver)!==null&&o!==void 0?o:_Re.default;return{strictSchema:(s=(i=e.strictSchema)!==null&&i!==void 0?i:jt)!==null&&s!==void 0?s:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:jt)!==null&&c!==void 0?c:!0,strictTypes:(d=(u=e.strictTypes)!==null&&u!==void 0?u:jt)!==null&&d!==void 0?d:"log",strictTuples:(m=(f=e.strictTuples)!==null&&f!==void 0?f:jt)!==null&&m!==void 0?m:"log",strictRequired:(h=(g=e.strictRequired)!==null&&g!==void 0?g:jt)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:Ft,regExp:vt}:{optimize:Ft,regExp:vt},loopRequired:(_=e.loopRequired)!==null&&_!==void 0?_:jH,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:jH,meta:(b=e.meta)!==null&&b!==void 0?b:!0,messages:(T=e.messages)!==null&&T!==void 0?T:!0,inlineRefs:(w=e.inlineRefs)!==null&&w!==void 0?w:!0,schemaId:(k=e.schemaId)!==null&&k!==void 0?k:"$id",addUsedSchema:(P=e.addUsedSchema)!==null&&P!==void 0?P:!0,validateSchema:(te=e.validateSchema)!==null&&te!==void 0?te:!0,validateFormats:(oe=e.validateFormats)!==null&&oe!==void 0?oe:!0,unicodeRegExp:(Oe=e.unicodeRegExp)!==null&&Oe!==void 0?Oe:!0,int32range:(ke=e.int32range)!==null&&ke!==void 0?ke:!0,uriResolver:St}}class Q_{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...SRe(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new hRe.ValueScope({scope:{},prefixes:bRe,es5:t,lines:r}),this.logger=ORe(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=(0,gRe.getRules)(),FH.call(this,xRe,e,"NOT SUPPORTED"),FH.call(this,vRe,e,"DEPRECATED","warn"),this._metaOpts=ARe.call(this),e.formats)wRe.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)TRe.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);ERe.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=$H;if(r==="id")n={...$H},n.id=n.$id,delete n.$id;if(t&&e)this.addMetaSchema(n,n[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let n=r(t);if(!("$async"in r))this.errors=r.errors;return n}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(u,d){await o.call(this,u.$schema);let f=this._addSchema(u,d);return f.validate||i.call(this,f)}async function o(u){if(u&&!this.getSchema(u))await n.call(this,{$ref:u},!0)}async function i(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof BH.default))throw d;return s.call(this,d),await a.call(this,d.missingSchema),i.call(this,u)}}function s({missingSchema:u,missingRef:d}){if(this.refs[u])throw Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function a(u){let d=await c.call(this,u);if(!this.refs[u])await o.call(this,d.$schema);if(!this.refs[u])this.addSchema(d,u,t)}async function c(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=r(u))}finally{delete this._loading[u]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(let i of e)this.addSchema(i,void 0,r,n);return this}let o;if(typeof e==="object"){let{schemaId:i}=this.opts;if(o=e[i],o!==void 0&&typeof o!="string")throw Error(`schema ${i} must be string`)}return t=(0,hd.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(r,e);if(!n&&t){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw Error(o)}return n}getSchema(e){let t;while(typeof(t=zH.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new gd.SchemaEnv({schema:{},schemaId:r});if(t=gd.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=zH.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];if(r)r=(0,hd.normalizeId)(r),delete this.schemas[r],delete this.refs[r];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string"){if(r=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r}else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(RRe.call(this,r,t),!t)return(0,tk.eachItem)(r,(o)=>ek.call(this,o)),this;PRe.call(this,t);let n={...t,type:(0,X_.getJSONTypes)(t.type),schemaType:(0,X_.getJSONTypes)(t.schemaType)};return(0,tk.eachItem)(r,n.type.length===0?(o)=>ek.call(this,o,n):(o)=>n.type.forEach((i)=>ek.call(this,o,n,i))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let n=r.rules.findIndex((o)=>o.keyword===e);if(n>=0)r.rules.splice(n,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){if(!e||e.length===0)return"No errors";return e.map((n)=>`${r}${n.instancePath} ${n.message}`).reduce((n,o)=>n+t+o)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of t){let o=n.split("/").slice(1),i=e;for(let s of o)i=i[s];for(let s in r){let a=r[s];if(typeof a!="object")continue;let{$data:c}=a.definition,u=i[s];if(c&&u)i[s]=qH(u)}}return e}_removeAllSchemas(e,t){for(let r in e){let n=e[r];if(!t||t.test(r)){if(typeof n=="string")delete e[r];else if(n&&!n.meta)this._cache.delete(n.schema),delete e[r]}}}_addSchema(e,t,r,n=this.opts.validateSchema,o=this.opts.addUsedSchema){let i,{schemaId:s}=this.opts;if(typeof e=="object")i=e[s];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let a=this._cache.get(e);if(a!==void 0)return a;r=(0,hd.normalizeId)(i||r);let c=hd.getSchemaRefs.call(this,e,r);if(a=new gd.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:c}),this._cache.set(a.schema,a),o&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=a}if(n)this.validateSchema(e,!0);return a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else gd.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{gd.compileSchema.call(this,e)}finally{this.opts=t}}}Q_.ValidationError=mRe.default;Q_.MissingRefError=BH.default;po.default=Q_;function FH(e,t,r,n="error"){for(let o in e){let i=o;if(i in t)this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function zH(e){return e=(0,hd.normalizeId)(e),this.schemas[e]||this.refs[e]}function ERe(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function wRe(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function TRe(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}function ARe(){let e={...this.opts};for(let t of yRe)delete e[t];return e}var kRe={log(){},warn(){},error(){}};function ORe(e){if(e===!1)return kRe;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var CRe=/^[a-z_$][a-z0-9_$:-]*$/i;function RRe(e,t){let{RULES:r}=this;if((0,tk.eachItem)(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!CRe.test(n))throw Error(`Keyword ${n} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function ek(e,t,r){var n;let o=t===null||t===void 0?void 0:t.post;if(r&&o)throw Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,s=o?i.post:i.rules.find(({type:c})=>c===r);if(!s)s={type:r,rules:[]},i.rules.push(s);if(i.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,X_.getJSONTypes)(t.type),schemaType:(0,X_.getJSONTypes)(t.schemaType)}};if(t.before)IRe.call(this,s,a,t.before);else s.rules.push(a);i.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach((c)=>this.addKeyword(c))}function IRe(e,t,r){let n=e.rules.findIndex((o)=>o.keyword===r);if(n>=0)e.rules.splice(n,0,t);else e.rules.push(t),this.logger.warn(`rule ${r} is not defined`)}function PRe(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=qH(t);e.validateSchema=this.compile(t,!0)}var DRe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function qH(e){return{anyOf:[e,DRe]}}});var VH=v(function(WH){Object.defineProperty(WH,"__esModule",{value:!0});var MRe={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};WH.default=MRe});var QH=v(function(YH){Object.defineProperty(YH,"__esModule",{value:!0});YH.callRef=YH.getValidate=void 0;var $Re=dd(),KH=Vr(),hr=pe(),Cc=lo(),ZH=K_(),ey=Te(),jRe={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:i,validateName:s,opts:a,self:c}=n,{root:u}=i;if((r==="#"||r==="#/")&&o===u.baseId)return f();let d=ZH.resolveRef.call(c,u,o,r);if(d===void 0)throw new $Re.default(n.opts.uriResolver,o,r);if(d instanceof ZH.SchemaEnv)return m(d);return g(d);function f(){if(i===u)return ty(e,s,i,i.$async);let h=t.scopeValue("root",{ref:u});return ty(e,hr._`${h}.validate`,u,u.$async)}function m(h){let _=JH(e,h);ty(e,_,h,h.$async)}function g(h){let _=t.scopeValue("schema",a.code.source===!0?{ref:h,code:(0,hr.stringify)(h)}:{ref:h}),y=t.name("valid"),b=e.subschema({schema:h,dataTypes:[],schemaPath:hr.nil,topSchemaRef:_,errSchemaPath:r},y);e.mergeEvaluated(b),e.ok(y)}}};function JH(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):hr._`${r.scopeValue("wrapper",{ref:t})}.validate`}YH.getValidate=JH;function ty(e,t,r,n){let{gen:o,it:i}=e,{allErrors:s,schemaEnv:a,opts:c}=i,u=c.passContext?Cc.default.this:hr.nil;if(n)d();else f();function d(){if(!a.$async)throw Error("async schema referenced by sync schema");let h=o.let("valid");o.try(()=>{if(o.code(hr._`await ${(0,KH.callValidateCode)(e,t,u)}`),g(t),!s)o.assign(h,!0)},(_)=>{if(o.if(hr._`!(${_} instanceof ${i.ValidationError})`,()=>o.throw(_)),m(_),!s)o.assign(h,!1)}),e.ok(h)}function f(){e.result((0,KH.callValidateCode)(e,t,u),()=>g(t),()=>m(t))}function m(h){let _=hr._`${h}.errors`;o.assign(Cc.default.vErrors,hr._`${Cc.default.vErrors} === null ? ${_} : ${Cc.default.vErrors}.concat(${_})`),o.assign(Cc.default.errors,hr._`${Cc.default.vErrors}.length`)}function g(h){var _;if(!i.opts.unevaluated)return;let y=(_=r===null||r===void 0?void 0:r.validate)===null||_===void 0?void 0:_.evaluated;if(i.props!==!0)if(y&&!y.dynamicProps){if(y.props!==void 0)i.props=ey.mergeEvaluated.props(o,y.props,i.props)}else{let b=o.var("props",hr._`${h}.evaluated.props`);i.props=ey.mergeEvaluated.props(o,b,i.props,hr.Name)}if(i.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)i.items=ey.mergeEvaluated.items(o,y.items,i.items)}else{let b=o.var("items",hr._`${h}.evaluated.items`);i.items=ey.mergeEvaluated.items(o,b,i.items,hr.Name)}}}YH.callRef=ty;YH.default=jRe});var t2=v(function(e2){Object.defineProperty(e2,"__esModule",{value:!0});var BRe=VH(),HRe=QH(),qRe=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",BRe.default,HRe.default];e2.default=qRe});var n2=v(function(r2){Object.defineProperty(r2,"__esModule",{value:!0});var ry=pe(),ai=ry.operators,ny={maximum:{okStr:"<=",ok:ai.LTE,fail:ai.GT},minimum:{okStr:">=",ok:ai.GTE,fail:ai.LT},exclusiveMaximum:{okStr:"<",ok:ai.LT,fail:ai.GTE},exclusiveMinimum:{okStr:">",ok:ai.GT,fail:ai.LTE}},WRe={message:({keyword:e,schemaCode:t})=>ry.str`must be ${ny[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>ry._`{comparison: ${ny[e].okStr}, limit: ${t}}`},VRe={keyword:Object.keys(ny),type:"number",schemaType:"number",$data:!0,error:WRe,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(ry._`${r} ${ny[t].fail} ${n} || isNaN(${r})`)}};r2.default=VRe});var i2=v(function(o2){Object.defineProperty(o2,"__esModule",{value:!0});var _d=pe(),ZRe={message:({schemaCode:e})=>_d.str`must be multiple of ${e}`,params:({schemaCode:e})=>_d._`{multipleOf: ${e}}`},JRe={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:ZRe,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,s=t.let("res"),a=i?_d._`Math.abs(Math.round(${s}) - ${s}) > 1e-${i}`:_d._`${s} !== parseInt(${s})`;e.fail$data(_d._`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}};o2.default=JRe});var c2=v(function(a2){Object.defineProperty(a2,"__esModule",{value:!0});function s2(e){let t=e.length,r=0,n=0,o;while(n<t)if(r++,o=e.charCodeAt(n++),o>=55296&&o<=56319&&n<t){if(o=e.charCodeAt(n),(o&64512)===56320)n++}return r}a2.default=s2;s2.code='require("ajv/dist/runtime/ucs2length").default'});var u2=v(function(l2){Object.defineProperty(l2,"__esModule",{value:!0});var _s=pe(),QRe=Te(),eIe=c2(),tIe={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return _s.str`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>_s._`{limit: ${e}}`},rIe={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:tIe,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?_s.operators.GT:_s.operators.LT,s=o.opts.unicode===!1?_s._`${r}.length`:_s._`${(0,QRe.useFunc)(e.gen,eIe.default)}(${r})`;e.fail$data(_s._`${s} ${i} ${n}`)}};l2.default=rIe});var d2=v(function(p2){Object.defineProperty(p2,"__esModule",{value:!0});var oIe=Vr(),iIe=Te(),Rc=pe(),sIe={message:({schemaCode:e})=>Rc.str`must match pattern "${e}"`,params:({schemaCode:e})=>Rc._`{pattern: ${e}}`},aIe={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:sIe,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:s}=e,a=s.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=s.opts.code,u=c.code==="new RegExp"?Rc._`new RegExp`:(0,iIe.useFunc)(t,c),d=t.let("valid");t.try(()=>t.assign(d,Rc._`${u}(${i}, ${a}).test(${r})`),()=>t.assign(d,!1)),e.fail$data(Rc._`!${d}`)}else{let c=(0,oIe.usePattern)(e,o);e.fail$data(Rc._`!${c}.test(${r})`)}}};p2.default=aIe});var m2=v(function(f2){Object.defineProperty(f2,"__esModule",{value:!0});var yd=pe(),lIe={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return yd.str`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>yd._`{limit: ${e}}`},uIe={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:lIe,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?yd.operators.GT:yd.operators.LT;e.fail$data(yd._`Object.keys(${r}).length ${o} ${n}`)}};f2.default=uIe});var h2=v(function(g2){Object.defineProperty(g2,"__esModule",{value:!0});var bd=Vr(),xd=pe(),dIe=Te(),fIe={message:({params:{missingProperty:e}})=>xd.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>xd._`{missingProperty: ${e}}`},mIe={keyword:"required",type:"object",schemaType:"array",$data:!0,error:fIe,code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:i,it:s}=e,{opts:a}=s;if(!i&&r.length===0)return;let c=r.length>=a.loopRequired;if(s.allErrors)u();else d();if(a.strictRequired){let g=e.parentSchema.properties,{definedProperties:h}=e.it;for(let _ of r)if((g===null||g===void 0?void 0:g[_])===void 0&&!h.has(_)){let y=s.schemaEnv.baseId+s.errSchemaPath,b=`required property "${_}" is not defined at "${y}" (strictRequired)`;(0,dIe.checkStrictMode)(s,b,s.opts.strictRequired)}}function u(){if(c||i)e.block$data(xd.nil,f);else for(let g of r)(0,bd.checkReportMissingProp)(e,g)}function d(){let g=t.let("missing");if(c||i){let h=t.let("valid",!0);e.block$data(h,()=>m(g,h)),e.ok(h)}else t.if((0,bd.checkMissingProp)(e,r,g)),(0,bd.reportMissingProp)(e,g),t.else()}function f(){t.forOf("prop",n,(g)=>{e.setParams({missingProperty:g}),t.if((0,bd.noPropertyInData)(t,o,g,a.ownProperties),()=>e.error())})}function m(g,h){e.setParams({missingProperty:g}),t.forOf(g,n,()=>{t.assign(h,(0,bd.propertyInData)(t,o,g,a.ownProperties)),t.if((0,xd.not)(h),()=>{e.error(),t.break()})},xd.nil)}}};g2.default=mIe});var y2=v(function(_2){Object.defineProperty(_2,"__esModule",{value:!0});var vd=pe(),hIe={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return vd.str`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>vd._`{limit: ${e}}`},_Ie={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:hIe,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?vd.operators.GT:vd.operators.LT;e.fail$data(vd._`${r}.length ${o} ${n}`)}};_2.default=_Ie});var oy=v(function(x2){Object.defineProperty(x2,"__esModule",{value:!0});var b2=jA();b2.code='require("ajv/dist/runtime/equal").default';x2.default=b2});var S2=v(function(v2){Object.defineProperty(v2,"__esModule",{value:!0});var rk=ad(),$t=pe(),xIe=Te(),vIe=oy(),SIe={message:({params:{i:e,j:t}})=>$t.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>$t._`{i: ${e}, j: ${t}}`},EIe={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:SIe,code(e){let{gen:t,data:r,$data:n,schema:o,parentSchema:i,schemaCode:s,it:a}=e;if(!n&&!o)return;let c=t.let("valid"),u=i.items?(0,rk.getSchemaTypes)(i.items):[];e.block$data(c,d,$t._`${s} === false`),e.ok(c);function d(){let h=t.let("i",$t._`${r}.length`),_=t.let("j");e.setParams({i:h,j:_}),t.assign(c,!0),t.if($t._`${h} > 1`,()=>(f()?m:g)(h,_))}function f(){return u.length>0&&!u.some((h)=>h==="object"||h==="array")}function m(h,_){let y=t.name("item"),b=(0,rk.checkDataTypes)(u,y,a.opts.strictNumbers,rk.DataType.Wrong),T=t.const("indices",$t._`{}`);t.for($t._`;${h}--;`,()=>{if(t.let(y,$t._`${r}[${h}]`),t.if(b,$t._`continue`),u.length>1)t.if($t._`typeof ${y} == "string"`,$t._`${y} += "_"`);t.if($t._`typeof ${T}[${y}] == "number"`,()=>{t.assign(_,$t._`${T}[${y}]`),e.error(),t.assign(c,!1).break()}).code($t._`${T}[${y}] = ${h}`)})}function g(h,_){let y=(0,xIe.useFunc)(t,vIe.default),b=t.name("outer");t.label(b).for($t._`;${h}--;`,()=>t.for($t._`${_} = ${h}; ${_}--;`,()=>t.if($t._`${y}(${r}[${h}], ${r}[${_}])`,()=>{e.error(),t.assign(c,!1).break(b)})))}}};v2.default=EIe});var w2=v(function(E2){Object.defineProperty(E2,"__esModule",{value:!0});var nk=pe(),TIe=Te(),AIe=oy(),kIe={message:"must be equal to constant",params:({schemaCode:e})=>nk._`{allowedValue: ${e}}`},OIe={keyword:"const",$data:!0,error:kIe,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;if(n||i&&typeof i=="object")e.fail$data(nk._`!${(0,TIe.useFunc)(t,AIe.default)}(${r}, ${o})`);else e.fail(nk._`${i} !== ${r}`)}};E2.default=OIe});var A2=v(function(T2){Object.defineProperty(T2,"__esModule",{value:!0});var Sd=pe(),RIe=Te(),IIe=oy(),PIe={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>Sd._`{allowedValues: ${e}}`},DIe={keyword:"enum",schemaType:"array",$data:!0,error:PIe,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:s}=e;if(!n&&o.length===0)throw Error("enum must have non-empty array");let a=o.length>=s.opts.loopEnum,c,u=()=>c!==null&&c!==void 0?c:c=(0,RIe.useFunc)(t,IIe.default),d;if(a||n)d=t.let("valid"),e.block$data(d,f);else{if(!Array.isArray(o))throw Error("ajv implementation error");let g=t.const("vSchema",i);d=(0,Sd.or)(...o.map((h,_)=>m(g,_)))}e.pass(d);function f(){t.assign(d,!1),t.forOf("v",i,(g)=>t.if(Sd._`${u()}(${r}, ${g})`,()=>t.assign(d,!0).break()))}function m(g,h){let _=o[h];return typeof _==="object"&&_!==null?Sd._`${u()}(${r}, ${g}[${h}])`:Sd._`${r} === ${_}`}}};T2.default=DIe});var O2=v(function(k2){Object.defineProperty(k2,"__esModule",{value:!0});var NIe=n2(),MIe=i2(),UIe=u2(),$Ie=d2(),jIe=m2(),FIe=h2(),zIe=y2(),BIe=S2(),HIe=w2(),qIe=A2(),GIe=[NIe.default,MIe.default,UIe.default,$Ie.default,jIe.default,FIe.default,zIe.default,BIe.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},HIe.default,qIe.default];k2.default=GIe});var ik=v(function(R2){Object.defineProperty(R2,"__esModule",{value:!0});R2.validateAdditionalItems=void 0;var ys=pe(),ok=Te(),VIe={message:({params:{len:e}})=>ys.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ys._`{limit: ${e}}`},KIe={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:VIe,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,ok.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}C2(e,n)}};function C2(e,t){let{gen:r,schema:n,data:o,keyword:i,it:s}=e;s.items=!0;let a=r.const("len",ys._`${o}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(ys._`${a} <= ${t.length}`);else if(typeof n=="object"&&!(0,ok.alwaysValidSchema)(s,n)){let u=r.var("valid",ys._`${a} <= ${t.length}`);r.if((0,ys.not)(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,(d)=>{if(e.subschema({keyword:i,dataProp:d,dataPropType:ok.Type.Num},u),!s.allErrors)r.if((0,ys.not)(u),()=>r.break())})}}R2.validateAdditionalItems=C2;R2.default=KIe});var sk=v(function(L2){Object.defineProperty(L2,"__esModule",{value:!0});L2.validateTuple=void 0;var P2=pe(),iy=Te(),JIe=Vr(),YIe={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return D2(e,"additionalItems",t);if(r.items=!0,(0,iy.alwaysValidSchema)(r,t))return;e.ok((0,JIe.validateArray)(e))}};function D2(e,t,r=e.schema){let{gen:n,parentSchema:o,data:i,keyword:s,it:a}=e;if(d(o),a.opts.unevaluated&&r.length&&a.items!==!0)a.items=iy.mergeEvaluated.items(n,r.length,a.items);let c=n.name("valid"),u=n.const("len",P2._`${i}.length`);r.forEach((f,m)=>{if((0,iy.alwaysValidSchema)(a,f))return;n.if(P2._`${u} > ${m}`,()=>e.subschema({keyword:s,schemaProp:m,dataProp:m},c)),e.ok(c)});function d(f){let{opts:m,errSchemaPath:g}=a,h=r.length,_=h===f.minItems&&(h===f.maxItems||f[t]===!1);if(m.strictTuples&&!_){let y=`"${s}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${g}"`;(0,iy.checkStrictMode)(a,y,m.strictTuples)}}}L2.validateTuple=D2;L2.default=YIe});var U2=v(function(M2){Object.defineProperty(M2,"__esModule",{value:!0});var QIe=sk(),ePe={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>(0,QIe.validateTuple)(e,"items")};M2.default=ePe});var F2=v(function(j2){Object.defineProperty(j2,"__esModule",{value:!0});var $2=pe(),rPe=Te(),nPe=Vr(),oPe=ik(),iPe={message:({params:{len:e}})=>$2.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>$2._`{limit: ${e}}`},sPe={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:iPe,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;if(n.items=!0,(0,rPe.alwaysValidSchema)(n,t))return;if(o)(0,oPe.validateAdditionalItems)(e,o);else e.ok((0,nPe.validateArray)(e))}};j2.default=sPe});var B2=v(function(z2){Object.defineProperty(z2,"__esModule",{value:!0});var Kr=pe(),sy=Te(),cPe={message:({params:{min:e,max:t}})=>t===void 0?Kr.str`must contain at least ${e} valid item(s)`:Kr.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?Kr._`{minContains: ${e}}`:Kr._`{minContains: ${e}, maxContains: ${t}}`},lPe={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:cPe,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e,s,a,{minContains:c,maxContains:u}=n;if(i.opts.next)s=c===void 0?1:c,a=u;else s=1;let d=t.const("len",Kr._`${o}.length`);if(e.setParams({min:s,max:a}),a===void 0&&s===0){(0,sy.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&s>a){(0,sy.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,sy.alwaysValidSchema)(i,r)){let _=Kr._`${d} >= ${s}`;if(a!==void 0)_=Kr._`${_} && ${d} <= ${a}`;e.pass(_);return}i.items=!0;let f=t.name("valid");if(a===void 0&&s===1)g(f,()=>t.if(f,()=>t.break()));else if(s===0){if(t.let(f,!0),a!==void 0)t.if(Kr._`${o}.length > 0`,m)}else t.let(f,!1),m();e.result(f,()=>e.reset());function m(){let _=t.name("_valid"),y=t.let("count",0);g(_,()=>t.if(_,()=>h(y)))}function g(_,y){t.forRange("i",0,d,(b)=>{e.subschema({keyword:"contains",dataProp:b,dataPropType:sy.Type.Num,compositeRule:!0},_),y()})}function h(_){if(t.code(Kr._`${_}++`),a===void 0)t.if(Kr._`${_} >= ${s}`,()=>t.assign(f,!0).break());else if(t.if(Kr._`${_} > ${a}`,()=>t.assign(f,!1).break()),s===1)t.assign(f,!0);else t.if(Kr._`${_} >= ${s}`,()=>t.assign(f,!0))}}};z2.default=lPe});var K2=v(function(G2){Object.defineProperty(G2,"__esModule",{value:!0});G2.validateSchemaDeps=G2.validatePropertyDeps=G2.error=void 0;var ak=pe(),pPe=Te(),Ed=Vr();G2.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return ak.str`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>ak._`{property: ${e},
|
|
32
32
|
missingProperty: ${n},
|
|
33
33
|
depsCount: ${t},
|
|
34
|
-
deps: ${r}}`};var dPe={keyword:"dependencies",type:"object",schemaType:"object",error:G2.error,code(e){let[t,r]=fPe(e);H2(e,t),q2(e,r)}};function fPe({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let o=Array.isArray(e[n])?t:r;o[n]=e[n]}return[t,r]}function H2(e,t=e.schema){let{gen:r,data:n,it:o}=e;if(Object.keys(t).length===0)return;let i=r.let("missing");for(let s in t){let a=t[s];if(a.length===0)continue;let c=(0,Ed.propertyInData)(r,n,s,o.opts.ownProperties);if(e.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),o.allErrors)r.if(c,()=>{for(let u of a)(0,Ed.checkReportMissingProp)(e,u)});else r.if(ak._`${c} && (${(0,Ed.checkMissingProp)(e,a,i)})`),(0,Ed.reportMissingProp)(e,i),r.else()}}G2.validatePropertyDeps=H2;function q2(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,s=r.name("valid");for(let a in t){if((0,pPe.alwaysValidSchema)(i,t[a]))continue;r.if((0,Ed.propertyInData)(r,n,a,i.opts.ownProperties),()=>{let c=e.subschema({keyword:o,schemaProp:a},s);e.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),e.ok(s)}}G2.validateSchemaDeps=q2;G2.default=dPe});var Y2=v(function(J2){Object.defineProperty(J2,"__esModule",{value:!0});var Z2=pe(),hPe=Te(),_Pe={message:"property name must be valid",params:({params:e})=>Z2._`{propertyName: ${e.propertyName}}`},yPe={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:_Pe,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,hPe.alwaysValidSchema)(o,r))return;let i=t.name("valid");t.forIn("key",n,(s)=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,Z2.not)(i),()=>{if(e.error(!0),!o.allErrors)t.break()})}),e.ok(i)}};J2.default=yPe});var ck=v(function(X2){Object.defineProperty(X2,"__esModule",{value:!0});var ay=Vr(),xn=pe(),xPe=lo(),cy=Te(),vPe={message:"must NOT have additional properties",params:({params:e})=>xn._`{additionalProperty: ${e.additionalProperty}}`},SPe={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:vPe,code(e){let{gen:t,schema:r,parentSchema:n,data:o,errsCount:i,it:s}=e;if(!i)throw Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,cy.alwaysValidSchema)(s,r))return;let u=(0,ay.allSchemaProperties)(n.properties),d=(0,ay.allSchemaProperties)(n.patternProperties);f(),e.ok(xn._`${i} === ${xPe.default.errors}`);function f(){t.forIn("key",o,(y)=>{if(!u.length&&!d.length)h(y);else t.if(m(y),()=>h(y))})}function m(y){let b;if(u.length>8){let T=(0,cy.schemaRefOrVal)(s,n.properties,"properties");b=(0,ay.isOwnProperty)(t,T,y)}else if(u.length)b=(0,xn.or)(...u.map((T)=>xn._`${y} === ${T}`));else b=xn.nil;if(d.length)b=(0,xn.or)(b,...d.map((T)=>xn._`${(0,ay.usePattern)(e,T)}.test(${y})`));return(0,xn.not)(b)}function g(y){t.code(xn._`delete ${o}[${y}]`)}function h(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){g(y);return}if(r===!1){if(e.setParams({additionalProperty:y}),e.error(),!a)t.break();return}if(typeof r=="object"&&!(0,cy.alwaysValidSchema)(s,r)){let b=t.name("valid");if(c.removeAdditional==="failing")_(y,b,!1),t.if((0,xn.not)(b),()=>{e.reset(),g(y)});else if(_(y,b),!a)t.if((0,xn.not)(b),()=>t.break())}}function _(y,b,T){let w={keyword:"additionalProperties",dataProp:y,dataPropType:cy.Type.Str};if(T===!1)Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(w,b)}}};X2.default=SPe});var r4=v(function(t4){Object.defineProperty(t4,"__esModule",{value:!0});var wPe=pd(),Q2=Vr(),lk=Te(),e4=ck(),TPe={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e;if(i.opts.removeAdditional==="all"&&n.additionalProperties===void 0)e4.default.code(new wPe.KeywordCxt(i,e4.default,"additionalProperties"));let s=(0,Q2.allSchemaProperties)(r);for(let f of s)i.definedProperties.add(f);if(i.opts.unevaluated&&s.length&&i.props!==!0)i.props=lk.mergeEvaluated.props(t,(0,lk.toHash)(s),i.props);let a=s.filter((f)=>!(0,lk.alwaysValidSchema)(i,r[f]));if(a.length===0)return;let c=t.name("valid");for(let f of a){if(u(f))d(f);else{if(t.if((0,Q2.propertyInData)(t,o,f,i.opts.ownProperties)),d(f),!i.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(f),e.ok(c)}function u(f){return i.opts.useDefaults&&!i.compositeRule&&r[f].default!==void 0}function d(f){e.subschema({keyword:"properties",schemaProp:f,dataProp:f},c)}}};t4.default=TPe});var a4=v(function(s4){Object.defineProperty(s4,"__esModule",{value:!0});var n4=Vr(),ly=pe(),o4=Te(),i4=Te(),kPe={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:o,it:i}=e,{opts:s}=i,a=(0,n4.allSchemaProperties)(r),c=a.filter((_)=>(0,o4.alwaysValidSchema)(i,r[_]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let u=s.strictSchema&&!s.allowMatchingProperties&&o.properties,d=t.name("valid");if(i.props!==!0&&!(i.props instanceof ly.Name))i.props=(0,i4.evaluatedPropsToName)(t,i.props);let{props:f}=i;m();function m(){for(let _ of a){if(u)g(_);if(i.allErrors)h(_);else t.var(d,!0),h(_),t.if(d)}}function g(_){for(let y in u)if(new RegExp(_).test(y))(0,o4.checkStrictMode)(i,`property ${y} matches pattern ${_} (use allowMatchingProperties)`)}function h(_){t.forIn("key",n,(y)=>{t.if(ly._`${(0,n4.usePattern)(e,_)}.test(${y})`,()=>{let b=c.includes(_);if(!b)e.subschema({keyword:"patternProperties",schemaProp:_,dataProp:y,dataPropType:i4.Type.Str},d);if(i.opts.unevaluated&&f!==!0)t.assign(ly._`${f}[${y}]`,!0);else if(!b&&!i.allErrors)t.if((0,ly.not)(d),()=>t.break())})})}}};s4.default=kPe});var l4=v(function(c4){Object.defineProperty(c4,"__esModule",{value:!0});var CPe=Te(),RPe={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,CPe.alwaysValidSchema)(n,r)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};c4.default=RPe});var p4=v(function(u4){Object.defineProperty(u4,"__esModule",{value:!0});var PPe=Vr(),DPe={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:PPe.validateUnion,error:{message:"must match a schema in anyOf"}};u4.default=DPe});var f4=v(function(d4){Object.defineProperty(d4,"__esModule",{value:!0});var uy=pe(),NPe=Te(),MPe={message:"must match exactly one schema in oneOf",params:({params:e})=>uy._`{passingSchemas: ${e.passing}}`},UPe={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:MPe,code(e){let{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let i=r,s=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(s,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((d,f)=>{let m;if((0,NPe.alwaysValidSchema)(o,d))t.var(c,!0);else m=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},c);if(f>0)t.if(uy._`${c} && ${s}`).assign(s,!1).assign(a,uy._`[${a}, ${f}]`).else();t.if(c,()=>{if(t.assign(s,!0),t.assign(a,f),m)e.mergeEvaluated(m,uy.Name)})})}}};d4.default=UPe});var g4=v(function(m4){Object.defineProperty(m4,"__esModule",{value:!0});var jPe=Te(),FPe={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let o=t.name("valid");r.forEach((i,s)=>{if((0,jPe.alwaysValidSchema)(n,i))return;let a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};m4.default=FPe});var b4=v(function(y4){Object.defineProperty(y4,"__esModule",{value:!0});var py=pe(),_4=Te(),BPe={message:({params:e})=>py.str`must match "${e.ifClause}" schema`,params:({params:e})=>py._`{failingKeyword: ${e.ifClause}}`},HPe={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:BPe,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)(0,_4.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=h4(n,"then"),i=h4(n,"else");if(!o&&!i)return;let s=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),o&&i){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(a,u("then",d),u("else",d))}else if(o)t.if(a,u("then"));else t.if((0,py.not)(a),u("else"));e.pass(s,()=>e.error(!0));function c(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(d)}function u(d,f){return()=>{let m=e.subschema({keyword:d},a);if(t.assign(s,a),e.mergeValidEvaluated(m,s),f)t.assign(f,py._`${d}`);else e.setParams({ifClause:d})}}}};function h4(e,t){let r=e.schema[t];return r!==void 0&&!(0,_4.alwaysValidSchema)(e,r)}y4.default=HPe});var v4=v(function(x4){Object.defineProperty(x4,"__esModule",{value:!0});var GPe=Te(),WPe={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)(0,GPe.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};x4.default=WPe});var E4=v(function(S4){Object.defineProperty(S4,"__esModule",{value:!0});var KPe=ik(),ZPe=U2(),JPe=sk(),YPe=F2(),XPe=B2(),QPe=K2(),eDe=Y2(),tDe=ck(),rDe=r4(),nDe=a4(),oDe=l4(),iDe=p4(),sDe=f4(),aDe=g4(),cDe=b4(),lDe=v4();function uDe(e=!1){let t=[oDe.default,iDe.default,sDe.default,aDe.default,cDe.default,lDe.default,eDe.default,tDe.default,QPe.default,rDe.default,nDe.default];if(e)t.push(ZPe.default,YPe.default);else t.push(KPe.default,JPe.default);return t.push(XPe.default),t}S4.default=uDe});var T4=v(function(w4){Object.defineProperty(w4,"__esModule",{value:!0});var ft=pe(),dDe={message:({schemaCode:e})=>ft.str`must match format "${e}"`,params:({schemaCode:e})=>ft._`{format: ${e}}`},fDe={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:dDe,code(e,t){let{gen:r,data:n,$data:o,schema:i,schemaCode:s,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:d,self:f}=a;if(!c.validateFormats)return;if(o)m();else g();function m(){let h=r.scopeValue("formats",{ref:f.formats,code:c.code.formats}),_=r.const("fDef",ft._`${h}[${s}]`),y=r.let("fType"),b=r.let("format");r.if(ft._`typeof ${_} == "object" && !(${_} instanceof RegExp)`,()=>r.assign(y,ft._`${_}.type || "string"`).assign(b,ft._`${_}.validate`),()=>r.assign(y,ft._`"string"`).assign(b,_)),e.fail$data((0,ft.or)(T(),w()));function T(){if(c.strictSchema===!1)return ft.nil;return ft._`${s} && !${b}`}function w(){let k=d.$async?ft._`(${_}.async ? await ${b}(${n}) : ${b}(${n}))`:ft._`${b}(${n})`,P=ft._`(typeof ${b} == "function" ? ${k} : ${b}.test(${n}))`;return ft._`${b} && ${b} !== true && ${y} === ${t} && !${P}`}}function g(){let h=f.formats[i];if(!h){T();return}if(h===!0)return;let[_,y,b]=w(h);if(_===t)e.pass(k());function T(){if(c.strictSchema===!1){f.logger.warn(P());return}throw Error(P());function P(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function w(P){let te=P instanceof RegExp?(0,ft.regexpCode)(P):c.code.formats?ft._`${c.code.formats}${(0,ft.getProperty)(i)}`:void 0,oe=r.scopeValue("formats",{key:i,ref:P,code:te});if(typeof P=="object"&&!(P instanceof RegExp))return[P.type||"string",P.validate,ft._`${oe}.validate`];return["string",P,oe]}function k(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!d.$async)throw Error("async format in sync schema");return ft._`await ${b}(${n})`}return typeof y=="function"?ft._`${b}(${n})`:ft._`${b}.test(${n})`}}}};w4.default=fDe});var k4=v(function(A4){Object.defineProperty(A4,"__esModule",{value:!0});var gDe=T4(),hDe=[gDe.default];A4.default=hDe});var R4=v(function(O4){Object.defineProperty(O4,"__esModule",{value:!0});O4.contentVocabulary=O4.metadataVocabulary=void 0;O4.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];O4.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var D4=v(function(P4){Object.defineProperty(P4,"__esModule",{value:!0});var bDe=t2(),xDe=O2(),vDe=E4(),SDe=k4(),I4=R4(),EDe=[bDe.default,xDe.default,(0,vDe.default)(),SDe.default,I4.metadataVocabulary,I4.contentVocabulary];P4.default=EDe});var U4=v(function(N4){Object.defineProperty(N4,"__esModule",{value:!0});N4.DiscrError=void 0;var L4;(function(e){e.Tag="tag",e.Mapping="mapping"})(L4||(N4.DiscrError=L4={}))});var F4=v(function(j4){Object.defineProperty(j4,"__esModule",{value:!0});var Ic=pe(),uk=U4(),$4=K_(),TDe=dd(),ADe=Te(),kDe={message:({params:{discrError:e,tagName:t}})=>e===uk.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>Ic._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},ODe={keyword:"discriminator",type:"object",schemaType:"object",error:kDe,code(e){let{gen:t,data:r,schema:n,parentSchema:o,it:i}=e,{oneOf:s}=o;if(!i.opts.discriminator)throw Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!s)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",Ic._`${r}${(0,Ic.getProperty)(a)}`);t.if(Ic._`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:uk.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function d(){let g=m();t.if(!1);for(let h in g)t.elseIf(Ic._`${u} === ${h}`),t.assign(c,f(g[h]));t.else(),e.error(!1,{discrError:uk.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function f(g){let h=t.name("valid"),_=e.subschema({keyword:"oneOf",schemaProp:g},h);return e.mergeEvaluated(_,Ic.Name),h}function m(){var g;let h={},_=b(o),y=!0;for(let k=0;k<s.length;k++){let P=s[k];if((P===null||P===void 0?void 0:P.$ref)&&!(0,ADe.schemaHasRulesButRef)(P,i.self.RULES)){let oe=P.$ref;if(P=$4.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,oe),P instanceof $4.SchemaEnv)P=P.schema;if(P===void 0)throw new TDe.default(i.opts.uriResolver,i.baseId,oe)}let te=(g=P===null||P===void 0?void 0:P.properties)===null||g===void 0?void 0:g[a];if(typeof te!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(_||b(P)),T(te,k)}if(!y)throw Error(`discriminator: "${a}" must be required`);return h;function b({required:k}){return Array.isArray(k)&&k.includes(a)}function T(k,P){if(k.const)w(k.const,P);else if(k.enum)for(let te of k.enum)w(te,P);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function w(k,P){if(typeof k!="string"||k in h)throw Error(`discriminator: "${a}" values must be unique strings`);h[k]=P}}}};j4.default=ODe});var z4=v(function(abt,RDe){RDe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var dk=v(function(_r,pk){Object.defineProperty(_r,"__esModule",{value:!0});_r.MissingRefError=_r.ValidationError=_r.CodeGen=_r.Name=_r.nil=_r.stringify=_r.str=_r._=_r.KeywordCxt=_r.Ajv=void 0;var IDe=GH(),PDe=D4(),DDe=F4(),B4=z4(),LDe=["/properties"],dy="http://json-schema.org/draft-07/schema";class wd extends IDe.default{_addVocabularies(){if(super._addVocabularies(),PDe.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(DDe.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(B4,LDe):B4;this.addMetaSchema(e,dy,!1),this.refs["http://json-schema.org/schema"]=dy}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(dy)?dy:void 0)}}_r.Ajv=wd;pk.exports=_r=wd;pk.exports.Ajv=wd;Object.defineProperty(_r,"__esModule",{value:!0});_r.default=wd;var NDe=pd();Object.defineProperty(_r,"KeywordCxt",{enumerable:!0,get:function(){return NDe.KeywordCxt}});var Pc=pe();Object.defineProperty(_r,"_",{enumerable:!0,get:function(){return Pc._}});Object.defineProperty(_r,"str",{enumerable:!0,get:function(){return Pc.str}});Object.defineProperty(_r,"stringify",{enumerable:!0,get:function(){return Pc.stringify}});Object.defineProperty(_r,"nil",{enumerable:!0,get:function(){return Pc.nil}});Object.defineProperty(_r,"Name",{enumerable:!0,get:function(){return Pc.Name}});Object.defineProperty(_r,"CodeGen",{enumerable:!0,get:function(){return Pc.CodeGen}});var MDe=W_();Object.defineProperty(_r,"ValidationError",{enumerable:!0,get:function(){return MDe.default}});var UDe=dd();Object.defineProperty(_r,"MissingRefError",{enumerable:!0,get:function(){return UDe.default}})});var X4=v(function(J4){Object.defineProperty(J4,"__esModule",{value:!0});J4.formatNames=J4.fastFormats=J4.fullFormats=void 0;function Mn(e,t){return{validate:e,compare:t}}J4.fullFormats={date:Mn(W4,hk),time:Mn(mk(!0),_k),"date-time":Mn(H4(!0),K4),"iso-time":Mn(mk(),V4),"iso-date-time":Mn(H4(),Z4),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:GDe,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:XDe,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:WDe,int32:{type:"number",validate:ZDe},int64:{type:"number",validate:JDe},float:{type:"number",validate:G4},double:{type:"number",validate:G4},password:!0,binary:!0};J4.fastFormats={...J4.fullFormats,date:Mn(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,hk),time:Mn(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,_k),"date-time":Mn(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,K4),"iso-time":Mn(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,V4),"iso-date-time":Mn(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Z4),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};J4.formatNames=Object.keys(J4.fullFormats);function FDe(e){return e%4===0&&(e%100!==0||e%400===0)}var zDe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,BDe=[0,31,28,31,30,31,30,31,31,30,31,30,31];function W4(e){let t=zDe.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&FDe(r)?29:BDe[n])}function hk(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var fk=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function mk(e){return function(r){let n=fk.exec(r);if(!n)return!1;let o=+n[1],i=+n[2],s=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),d=+(n[7]||0);if(u>23||d>59||e&&!a)return!1;if(o<=23&&i<=59&&s<60)return!0;let f=i-d*c,m=o-u*c-(f<0?1:0);return(m===23||m===-1)&&(f===59||f===-1)&&s<61}}function _k(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(!(r&&n))return;return r-n}function V4(e,t){if(!(e&&t))return;let r=fk.exec(e),n=fk.exec(t);if(!(r&&n))return;if(e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t)return 1;if(e<t)return-1;return 0}var gk=/t|\s/i;function H4(e){let t=mk(e);return function(n){let o=n.split(gk);return o.length===2&&W4(o[0])&&t(o[1])}}function K4(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(!(r&&n))return;return r-n}function Z4(e,t){if(!(e&&t))return;let[r,n]=e.split(gk),[o,i]=t.split(gk),s=hk(r,o);if(s===void 0)return;return s||_k(n,i)}var HDe=/\/|:/,qDe=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function GDe(e){return HDe.test(e)&&qDe.test(e)}var q4=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function WDe(e){return q4.lastIndex=0,q4.test(e)}var VDe=-2147483648,KDe=2147483647;function ZDe(e){return Number.isInteger(e)&&e<=KDe&&e>=VDe}function JDe(e){return Number.isInteger(e)}function G4(){return!0}var YDe=/[^\\]\\Z/;function XDe(e){if(YDe.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var eq=v(function(Q4){Object.defineProperty(Q4,"__esModule",{value:!0});Q4.formatLimitDefinition=void 0;var e0e=dk(),vn=pe(),ci=vn.operators,fy={formatMaximum:{okStr:"<=",ok:ci.LTE,fail:ci.GT},formatMinimum:{okStr:">=",ok:ci.GTE,fail:ci.LT},formatExclusiveMaximum:{okStr:"<",ok:ci.LT,fail:ci.GTE},formatExclusiveMinimum:{okStr:">",ok:ci.GT,fail:ci.LTE}},t0e={message:({keyword:e,schemaCode:t})=>vn.str`should be ${fy[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>vn._`{comparison: ${fy[e].okStr}, limit: ${t}}`};Q4.formatLimitDefinition={keyword:Object.keys(fy),type:"string",schemaType:"string",$data:!0,error:t0e,code(e){let{gen:t,data:r,schemaCode:n,keyword:o,it:i}=e,{opts:s,self:a}=i;if(!s.validateFormats)return;let c=new e0e.KeywordCxt(i,a.RULES.all.format.definition,"format");if(c.$data)u();else d();function u(){let m=t.scopeValue("formats",{ref:a.formats,code:s.code.formats}),g=t.const("fmt",vn._`${m}[${c.schemaCode}]`);e.fail$data((0,vn.or)(vn._`typeof ${g} != "object"`,vn._`${g} instanceof RegExp`,vn._`typeof ${g}.compare != "function"`,f(g)))}function d(){let m=c.schema,g=a.formats[m];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw Error(`"${o}": format "${m}" does not define "compare" function`);let h=t.scopeValue("formats",{key:m,ref:g,code:s.code.formats?vn._`${s.code.formats}${(0,vn.getProperty)(m)}`:void 0});e.fail$data(f(h))}function f(m){return vn._`${m}.compare(${r}, ${n}) ${fy[o].fail} 0`}},dependencies:["format"]};var r0e=(e)=>(e.addKeyword(Q4.formatLimitDefinition),e);Q4.default=r0e});var oq=v(function(Td,nq){Object.defineProperty(Td,"__esModule",{value:!0});var Dc=X4(),o0e=eq(),xk=pe(),tq=new xk.Name("fullFormats"),i0e=new xk.Name("fastFormats"),vk=(e,t={keywords:!0})=>{if(Array.isArray(t))return rq(e,t,Dc.fullFormats,tq),e;let[r,n]=t.mode==="fast"?[Dc.fastFormats,i0e]:[Dc.fullFormats,tq],o=t.formats||Dc.formatNames;if(rq(e,o,r,n),t.keywords)(0,o0e.default)(e);return e};vk.get=(e,t="full")=>{let n=(t==="fast"?Dc.fastFormats:Dc.fullFormats)[e];if(!n)throw Error(`Unknown format "${e}"`);return n};function rq(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=xk._`require("ajv-formats/dist/formats").${n}`);for(let s of t)e.addFormat(s,r[s])}nq.exports=Td=vk;Object.defineProperty(Td,"__esModule",{value:!0});Td.default=vk});import{execFile as nUe}from"child_process";import{randomUUID as lO}from"crypto";import{createReadStream as oUe,realpathSync as iUe}from"fs";import{copyFile as sUe,mkdir as sO,readdir as aUe,readFile as nW,rm as cUe,writeFile as oW}from"fs/promises";import{createRequire as lUe}from"module";import{homedir as aO,tmpdir as uUe}from"os";import{dirname as eW,isAbsolute as iW,join as Dr,relative as sW,resolve as zd,sep as uO}from"path";import{createInterface as pUe}from"readline";import{fileURLToPath as dUe}from"url";import{setMaxListeners as MW}from"events";var UW=50;function Jc(e=UW){let t=new AbortController;return MW(e,t.signal),t}var LUe=new FinalizationRegistry(({parentSignalRef:e,handler:t})=>{e.deref()?.removeEventListener("abort",t)});var $W="server-fallback-tombstone";var NUe=new DOMException($W,"AbortError");var jW="subagent-park",MUe=new DOMException(jW,"AbortError");import{realpathSync as PO}from"fs";import{dirname as TO,resolve as jy,sep as AO}from"path";function xr(e){return process.platform==="darwin"?e.normalize("NFC"):e}function gi(e){return/^[\\/]{2}/.test(e)}function kO(e){if(/^[\\/]{2}[?.][\\/](?!unc[\\/])/i.test(e))return null;return e.match(/^[\\/]{2}(?:[?.][\\/]unc[\\/])?([^\\/]+)/i)?.[1]?.replace(/[A-Z]/g,(t)=>t.toLowerCase())??null}function Yc(e){return/(^|[\\/])\.{1,2}([\\/]|$)/.test(e)}function DO(e){return/^[\\/]{2}[?.][\\/]/.test(e)}function LO(e,t){if(!gi(e))return!1;if(DO(e))return!0;if(Yc(e))return!0;let r=kO(e);return r===null||r!==kO(t)}function OO(e){if(process.platform==="win32"||!e.startsWith("/"))return null;let t=[];for(let r of e.split("/")){if(r===""||r===".")continue;if(r===".."){t.pop();continue}if(t.push(r),t.length===2&&CO(t[0])==="net")return CO(r)}return null}function CO(e){return e.replace(/[A-Z]/g,(t)=>t.toLowerCase())}function NO(e,t){if(!As(e))return!1;let r=OO(e);return r===null||r!==OO(t)}function As(e){if(process.platform==="win32")return!1;return MO(e)}function MO(e){return zy(e)!==null}function zy(e){if(!e.startsWith("/"))return null;let t=[];for(let r of e.split("/")){if(r===""||r===".")continue;if(r===".."){t.pop();continue}if(t.push(r),t.length===2&&t[0].toLowerCase()==="net")return"/"+t.join("/")}return null}function ks(e){return/^[\\/]{2}wsl(\$|\.localhost)[\\/]/i.test(e)}function By(e){if(e.startsWith("\\\\?\\UNC\\"))return"\\\\"+e.slice(8);if(e.startsWith("\\\\?\\")&&e.length>=7&&e[5]===":")return e.slice(4);return e}function UO(e){if(/^\\\\\?\\volume\{/i.test(e))return RO(e);let t=By(e);if(t!==e&&RO(t))return!0;return gi(t)&&!ks(t)}function RO(e){return Yc(e)||e.includes("/")}function Hy(e){try{return By(PO.native(e))}catch{return null}}var FW=new Set(["EPERM","EBUSY","EACCES"]),zW=4,BW=50,IO;function Fy(e){for(let t=0;;t++)try{return By(PO.native(e))}catch(r){let n=r!=null&&typeof r==="object"&&"code"in r&&typeof r.code==="string"?r.code:void 0;if(n===void 0||!FW.has(n)||t>=zW-1)return null;IO??=new Int32Array(new SharedArrayBuffer(4)),Atomics.wait(IO,0,0,BW)}}function Hd(e,t){let r=jy(t).toLowerCase(),n=jy(e).toLowerCase();if(TO(n)===r||n.startsWith(r+AO))return!0;let o=Fy(t)?.toLowerCase();if(o==null)return!1;let i=Fy(TO(jy(e)))?.toLowerCase();if(i==null)return!0;return i===o||i.startsWith(o+AO)}function jn(e,t,r){return new Promise((n,o)=>{if(t?.aborted){if(r?.throwOnAbort||r?.abortError)o(r.abortError?.()??Error("aborted"));else n();return}let i=setTimeout((a,c,u)=>{a?.removeEventListener("abort",c),u()},e,t,s,n);function s(){if(clearTimeout(i),r?.throwOnAbort||r?.abortError)o(r.abortError?.()??Error("aborted"));else n()}if(t?.addEventListener("abort",s,{once:!0}),r?.unref)i.unref()})}function HW(e,t){e(Error(t))}function Mr(e,t,r){let n,o=new Promise((i,s)=>{n=setTimeout(HW,t,s,r)});return Promise.race([e,o]).finally(()=>{if(n!==void 0)clearTimeout(n)})}import{spawn as cxe}from"child_process";import{existsSync as lxe}from"fs";import{createInterface as uxe}from"readline";import{StringDecoder as pxe}from"string_decoder";var Os=["PreToolUse","PostToolUse","PostToolUseFailure","PostToolBatch","Notification","UserPromptSubmit","UserPromptExpansion","SessionStart","SessionEnd","Stop","StopFailure","SubagentStart","SubagentStop","PreCompact","PostCompact","PermissionRequest","PermissionDenied","Setup","TeammateIdle","TaskCreated","TaskCompleted","Elicitation","ElicitationResult","ConfigChange","WorktreeCreate","WorktreeRemove","InstructionsLoaded","CwdChanged","FileChanged","MessageDisplay"],qW=["clear","resume","logout","prompt_input_exit","other","bypass_permissions_disabled"],GW="__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__";function qy(e){return e.charAt(0).toUpperCase()+e.slice(1)}function jO(e,t,r=t+"s"){return e===1?t:r}function FO(e,t){if(e.length<=t)return e;let r=e.slice(0,t),n=r.charCodeAt(t-1);return zO(n>=55296&&n<=56319?r.slice(0,-1):r)}function Gy(e,t){if(e.length<=t)return e;let r=e.slice(-t),n=r.charCodeAt(0);return zO(n>=56320&&n<=57343?r.slice(1):r)}function zO(e){return Buffer.from(e,"utf16le").toString("utf16le")}var WW=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,$O=typeof String.prototype.isWellFormed==="function"?Function.prototype.call.bind(String.prototype.isWellFormed):void 0,qUe=typeof String.prototype.toWellFormed==="function"?Function.prototype.call.bind(String.prototype.toWellFormed):void 0;function BO(e){if($O&&$O(e))return e;return e.replace(WW,"")}function Wy(e,t){let r=e.indexOf(t);return r===-1?e:e.slice(0,r)}var VW=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,KW=/<command-name>(.*?)<\/command-name>/;function Xc(e,t){if(e.type!=="user")return;if(e.isMeta===!0||e.isCompactSummary===!0)return;let r=e.message;if(!r)return;let n=r.content,o=[];if(typeof n==="string")o.push(n);else if(Array.isArray(n))for(let i of n){if(!i||typeof i!=="object")continue;if(i.type==="tool_result")return;if(i.type==="text"&&typeof i.text==="string")o.push(i.text)}for(let i of o){let s=i.replaceAll(`
|
|
34
|
+
deps: ${r}}`};var dPe={keyword:"dependencies",type:"object",schemaType:"object",error:G2.error,code(e){let[t,r]=fPe(e);H2(e,t),q2(e,r)}};function fPe({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let o=Array.isArray(e[n])?t:r;o[n]=e[n]}return[t,r]}function H2(e,t=e.schema){let{gen:r,data:n,it:o}=e;if(Object.keys(t).length===0)return;let i=r.let("missing");for(let s in t){let a=t[s];if(a.length===0)continue;let c=(0,Ed.propertyInData)(r,n,s,o.opts.ownProperties);if(e.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),o.allErrors)r.if(c,()=>{for(let u of a)(0,Ed.checkReportMissingProp)(e,u)});else r.if(ak._`${c} && (${(0,Ed.checkMissingProp)(e,a,i)})`),(0,Ed.reportMissingProp)(e,i),r.else()}}G2.validatePropertyDeps=H2;function q2(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,s=r.name("valid");for(let a in t){if((0,pPe.alwaysValidSchema)(i,t[a]))continue;r.if((0,Ed.propertyInData)(r,n,a,i.opts.ownProperties),()=>{let c=e.subschema({keyword:o,schemaProp:a},s);e.mergeValidEvaluated(c,s)},()=>r.var(s,!0)),e.ok(s)}}G2.validateSchemaDeps=q2;G2.default=dPe});var Y2=v(function(J2){Object.defineProperty(J2,"__esModule",{value:!0});var Z2=pe(),hPe=Te(),_Pe={message:"property name must be valid",params:({params:e})=>Z2._`{propertyName: ${e.propertyName}}`},yPe={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:_Pe,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,hPe.alwaysValidSchema)(o,r))return;let i=t.name("valid");t.forIn("key",n,(s)=>{e.setParams({propertyName:s}),e.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),t.if((0,Z2.not)(i),()=>{if(e.error(!0),!o.allErrors)t.break()})}),e.ok(i)}};J2.default=yPe});var ck=v(function(X2){Object.defineProperty(X2,"__esModule",{value:!0});var ay=Vr(),xn=pe(),xPe=lo(),cy=Te(),vPe={message:"must NOT have additional properties",params:({params:e})=>xn._`{additionalProperty: ${e.additionalProperty}}`},SPe={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:vPe,code(e){let{gen:t,schema:r,parentSchema:n,data:o,errsCount:i,it:s}=e;if(!i)throw Error("ajv implementation error");let{allErrors:a,opts:c}=s;if(s.props=!0,c.removeAdditional!=="all"&&(0,cy.alwaysValidSchema)(s,r))return;let u=(0,ay.allSchemaProperties)(n.properties),d=(0,ay.allSchemaProperties)(n.patternProperties);f(),e.ok(xn._`${i} === ${xPe.default.errors}`);function f(){t.forIn("key",o,(y)=>{if(!u.length&&!d.length)h(y);else t.if(m(y),()=>h(y))})}function m(y){let b;if(u.length>8){let T=(0,cy.schemaRefOrVal)(s,n.properties,"properties");b=(0,ay.isOwnProperty)(t,T,y)}else if(u.length)b=(0,xn.or)(...u.map((T)=>xn._`${y} === ${T}`));else b=xn.nil;if(d.length)b=(0,xn.or)(b,...d.map((T)=>xn._`${(0,ay.usePattern)(e,T)}.test(${y})`));return(0,xn.not)(b)}function g(y){t.code(xn._`delete ${o}[${y}]`)}function h(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){g(y);return}if(r===!1){if(e.setParams({additionalProperty:y}),e.error(),!a)t.break();return}if(typeof r=="object"&&!(0,cy.alwaysValidSchema)(s,r)){let b=t.name("valid");if(c.removeAdditional==="failing")_(y,b,!1),t.if((0,xn.not)(b),()=>{e.reset(),g(y)});else if(_(y,b),!a)t.if((0,xn.not)(b),()=>t.break())}}function _(y,b,T){let w={keyword:"additionalProperties",dataProp:y,dataPropType:cy.Type.Str};if(T===!1)Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(w,b)}}};X2.default=SPe});var r4=v(function(t4){Object.defineProperty(t4,"__esModule",{value:!0});var wPe=pd(),Q2=Vr(),lk=Te(),e4=ck(),TPe={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e;if(i.opts.removeAdditional==="all"&&n.additionalProperties===void 0)e4.default.code(new wPe.KeywordCxt(i,e4.default,"additionalProperties"));let s=(0,Q2.allSchemaProperties)(r);for(let f of s)i.definedProperties.add(f);if(i.opts.unevaluated&&s.length&&i.props!==!0)i.props=lk.mergeEvaluated.props(t,(0,lk.toHash)(s),i.props);let a=s.filter((f)=>!(0,lk.alwaysValidSchema)(i,r[f]));if(a.length===0)return;let c=t.name("valid");for(let f of a){if(u(f))d(f);else{if(t.if((0,Q2.propertyInData)(t,o,f,i.opts.ownProperties)),d(f),!i.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(f),e.ok(c)}function u(f){return i.opts.useDefaults&&!i.compositeRule&&r[f].default!==void 0}function d(f){e.subschema({keyword:"properties",schemaProp:f,dataProp:f},c)}}};t4.default=TPe});var a4=v(function(s4){Object.defineProperty(s4,"__esModule",{value:!0});var n4=Vr(),ly=pe(),o4=Te(),i4=Te(),kPe={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:o,it:i}=e,{opts:s}=i,a=(0,n4.allSchemaProperties)(r),c=a.filter((_)=>(0,o4.alwaysValidSchema)(i,r[_]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let u=s.strictSchema&&!s.allowMatchingProperties&&o.properties,d=t.name("valid");if(i.props!==!0&&!(i.props instanceof ly.Name))i.props=(0,i4.evaluatedPropsToName)(t,i.props);let{props:f}=i;m();function m(){for(let _ of a){if(u)g(_);if(i.allErrors)h(_);else t.var(d,!0),h(_),t.if(d)}}function g(_){for(let y in u)if(new RegExp(_).test(y))(0,o4.checkStrictMode)(i,`property ${y} matches pattern ${_} (use allowMatchingProperties)`)}function h(_){t.forIn("key",n,(y)=>{t.if(ly._`${(0,n4.usePattern)(e,_)}.test(${y})`,()=>{let b=c.includes(_);if(!b)e.subschema({keyword:"patternProperties",schemaProp:_,dataProp:y,dataPropType:i4.Type.Str},d);if(i.opts.unevaluated&&f!==!0)t.assign(ly._`${f}[${y}]`,!0);else if(!b&&!i.allErrors)t.if((0,ly.not)(d),()=>t.break())})})}}};s4.default=kPe});var l4=v(function(c4){Object.defineProperty(c4,"__esModule",{value:!0});var CPe=Te(),RPe={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,CPe.alwaysValidSchema)(n,r)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};c4.default=RPe});var p4=v(function(u4){Object.defineProperty(u4,"__esModule",{value:!0});var PPe=Vr(),DPe={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:PPe.validateUnion,error:{message:"must match a schema in anyOf"}};u4.default=DPe});var f4=v(function(d4){Object.defineProperty(d4,"__esModule",{value:!0});var uy=pe(),NPe=Te(),MPe={message:"must match exactly one schema in oneOf",params:({params:e})=>uy._`{passingSchemas: ${e.passing}}`},UPe={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:MPe,code(e){let{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let i=r,s=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(s,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((d,f)=>{let m;if((0,NPe.alwaysValidSchema)(o,d))t.var(c,!0);else m=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},c);if(f>0)t.if(uy._`${c} && ${s}`).assign(s,!1).assign(a,uy._`[${a}, ${f}]`).else();t.if(c,()=>{if(t.assign(s,!0),t.assign(a,f),m)e.mergeEvaluated(m,uy.Name)})})}}};d4.default=UPe});var g4=v(function(m4){Object.defineProperty(m4,"__esModule",{value:!0});var jPe=Te(),FPe={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let o=t.name("valid");r.forEach((i,s)=>{if((0,jPe.alwaysValidSchema)(n,i))return;let a=e.subschema({keyword:"allOf",schemaProp:s},o);e.ok(o),e.mergeEvaluated(a)})}};m4.default=FPe});var b4=v(function(y4){Object.defineProperty(y4,"__esModule",{value:!0});var py=pe(),_4=Te(),BPe={message:({params:e})=>py.str`must match "${e.ifClause}" schema`,params:({params:e})=>py._`{failingKeyword: ${e.ifClause}}`},HPe={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:BPe,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)(0,_4.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=h4(n,"then"),i=h4(n,"else");if(!o&&!i)return;let s=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),o&&i){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(a,u("then",d),u("else",d))}else if(o)t.if(a,u("then"));else t.if((0,py.not)(a),u("else"));e.pass(s,()=>e.error(!0));function c(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(d)}function u(d,f){return()=>{let m=e.subschema({keyword:d},a);if(t.assign(s,a),e.mergeValidEvaluated(m,s),f)t.assign(f,py._`${d}`);else e.setParams({ifClause:d})}}}};function h4(e,t){let r=e.schema[t];return r!==void 0&&!(0,_4.alwaysValidSchema)(e,r)}y4.default=HPe});var v4=v(function(x4){Object.defineProperty(x4,"__esModule",{value:!0});var GPe=Te(),WPe={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)(0,GPe.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};x4.default=WPe});var E4=v(function(S4){Object.defineProperty(S4,"__esModule",{value:!0});var KPe=ik(),ZPe=U2(),JPe=sk(),YPe=F2(),XPe=B2(),QPe=K2(),eDe=Y2(),tDe=ck(),rDe=r4(),nDe=a4(),oDe=l4(),iDe=p4(),sDe=f4(),aDe=g4(),cDe=b4(),lDe=v4();function uDe(e=!1){let t=[oDe.default,iDe.default,sDe.default,aDe.default,cDe.default,lDe.default,eDe.default,tDe.default,QPe.default,rDe.default,nDe.default];if(e)t.push(ZPe.default,YPe.default);else t.push(KPe.default,JPe.default);return t.push(XPe.default),t}S4.default=uDe});var T4=v(function(w4){Object.defineProperty(w4,"__esModule",{value:!0});var ft=pe(),dDe={message:({schemaCode:e})=>ft.str`must match format "${e}"`,params:({schemaCode:e})=>ft._`{format: ${e}}`},fDe={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:dDe,code(e,t){let{gen:r,data:n,$data:o,schema:i,schemaCode:s,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:d,self:f}=a;if(!c.validateFormats)return;if(o)m();else g();function m(){let h=r.scopeValue("formats",{ref:f.formats,code:c.code.formats}),_=r.const("fDef",ft._`${h}[${s}]`),y=r.let("fType"),b=r.let("format");r.if(ft._`typeof ${_} == "object" && !(${_} instanceof RegExp)`,()=>r.assign(y,ft._`${_}.type || "string"`).assign(b,ft._`${_}.validate`),()=>r.assign(y,ft._`"string"`).assign(b,_)),e.fail$data((0,ft.or)(T(),w()));function T(){if(c.strictSchema===!1)return ft.nil;return ft._`${s} && !${b}`}function w(){let k=d.$async?ft._`(${_}.async ? await ${b}(${n}) : ${b}(${n}))`:ft._`${b}(${n})`,P=ft._`(typeof ${b} == "function" ? ${k} : ${b}.test(${n}))`;return ft._`${b} && ${b} !== true && ${y} === ${t} && !${P}`}}function g(){let h=f.formats[i];if(!h){T();return}if(h===!0)return;let[_,y,b]=w(h);if(_===t)e.pass(k());function T(){if(c.strictSchema===!1){f.logger.warn(P());return}throw Error(P());function P(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function w(P){let te=P instanceof RegExp?(0,ft.regexpCode)(P):c.code.formats?ft._`${c.code.formats}${(0,ft.getProperty)(i)}`:void 0,oe=r.scopeValue("formats",{key:i,ref:P,code:te});if(typeof P=="object"&&!(P instanceof RegExp))return[P.type||"string",P.validate,ft._`${oe}.validate`];return["string",P,oe]}function k(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!d.$async)throw Error("async format in sync schema");return ft._`await ${b}(${n})`}return typeof y=="function"?ft._`${b}(${n})`:ft._`${b}.test(${n})`}}}};w4.default=fDe});var k4=v(function(A4){Object.defineProperty(A4,"__esModule",{value:!0});var gDe=T4(),hDe=[gDe.default];A4.default=hDe});var R4=v(function(O4){Object.defineProperty(O4,"__esModule",{value:!0});O4.contentVocabulary=O4.metadataVocabulary=void 0;O4.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];O4.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var D4=v(function(P4){Object.defineProperty(P4,"__esModule",{value:!0});var bDe=t2(),xDe=O2(),vDe=E4(),SDe=k4(),I4=R4(),EDe=[bDe.default,xDe.default,(0,vDe.default)(),SDe.default,I4.metadataVocabulary,I4.contentVocabulary];P4.default=EDe});var U4=v(function(N4){Object.defineProperty(N4,"__esModule",{value:!0});N4.DiscrError=void 0;var L4;(function(e){e.Tag="tag",e.Mapping="mapping"})(L4||(N4.DiscrError=L4={}))});var F4=v(function(j4){Object.defineProperty(j4,"__esModule",{value:!0});var Ic=pe(),uk=U4(),$4=K_(),TDe=dd(),ADe=Te(),kDe={message:({params:{discrError:e,tagName:t}})=>e===uk.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>Ic._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},ODe={keyword:"discriminator",type:"object",schemaType:"object",error:kDe,code(e){let{gen:t,data:r,schema:n,parentSchema:o,it:i}=e,{oneOf:s}=o;if(!i.opts.discriminator)throw Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!s)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",Ic._`${r}${(0,Ic.getProperty)(a)}`);t.if(Ic._`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:uk.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function d(){let g=m();t.if(!1);for(let h in g)t.elseIf(Ic._`${u} === ${h}`),t.assign(c,f(g[h]));t.else(),e.error(!1,{discrError:uk.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function f(g){let h=t.name("valid"),_=e.subschema({keyword:"oneOf",schemaProp:g},h);return e.mergeEvaluated(_,Ic.Name),h}function m(){var g;let h={},_=b(o),y=!0;for(let k=0;k<s.length;k++){let P=s[k];if((P===null||P===void 0?void 0:P.$ref)&&!(0,ADe.schemaHasRulesButRef)(P,i.self.RULES)){let oe=P.$ref;if(P=$4.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,oe),P instanceof $4.SchemaEnv)P=P.schema;if(P===void 0)throw new TDe.default(i.opts.uriResolver,i.baseId,oe)}let te=(g=P===null||P===void 0?void 0:P.properties)===null||g===void 0?void 0:g[a];if(typeof te!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(_||b(P)),T(te,k)}if(!y)throw Error(`discriminator: "${a}" must be required`);return h;function b({required:k}){return Array.isArray(k)&&k.includes(a)}function T(k,P){if(k.const)w(k.const,P);else if(k.enum)for(let te of k.enum)w(te,P);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function w(k,P){if(typeof k!="string"||k in h)throw Error(`discriminator: "${a}" values must be unique strings`);h[k]=P}}}};j4.default=ODe});var z4=v(function(abt,RDe){RDe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var dk=v(function(_r,pk){Object.defineProperty(_r,"__esModule",{value:!0});_r.MissingRefError=_r.ValidationError=_r.CodeGen=_r.Name=_r.nil=_r.stringify=_r.str=_r._=_r.KeywordCxt=_r.Ajv=void 0;var IDe=GH(),PDe=D4(),DDe=F4(),B4=z4(),LDe=["/properties"],dy="http://json-schema.org/draft-07/schema";class wd extends IDe.default{_addVocabularies(){if(super._addVocabularies(),PDe.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(DDe.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(B4,LDe):B4;this.addMetaSchema(e,dy,!1),this.refs["http://json-schema.org/schema"]=dy}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(dy)?dy:void 0)}}_r.Ajv=wd;pk.exports=_r=wd;pk.exports.Ajv=wd;Object.defineProperty(_r,"__esModule",{value:!0});_r.default=wd;var NDe=pd();Object.defineProperty(_r,"KeywordCxt",{enumerable:!0,get:function(){return NDe.KeywordCxt}});var Pc=pe();Object.defineProperty(_r,"_",{enumerable:!0,get:function(){return Pc._}});Object.defineProperty(_r,"str",{enumerable:!0,get:function(){return Pc.str}});Object.defineProperty(_r,"stringify",{enumerable:!0,get:function(){return Pc.stringify}});Object.defineProperty(_r,"nil",{enumerable:!0,get:function(){return Pc.nil}});Object.defineProperty(_r,"Name",{enumerable:!0,get:function(){return Pc.Name}});Object.defineProperty(_r,"CodeGen",{enumerable:!0,get:function(){return Pc.CodeGen}});var MDe=W_();Object.defineProperty(_r,"ValidationError",{enumerable:!0,get:function(){return MDe.default}});var UDe=dd();Object.defineProperty(_r,"MissingRefError",{enumerable:!0,get:function(){return UDe.default}})});var X4=v(function(J4){Object.defineProperty(J4,"__esModule",{value:!0});J4.formatNames=J4.fastFormats=J4.fullFormats=void 0;function Mn(e,t){return{validate:e,compare:t}}J4.fullFormats={date:Mn(W4,hk),time:Mn(mk(!0),_k),"date-time":Mn(H4(!0),K4),"iso-time":Mn(mk(),V4),"iso-date-time":Mn(H4(),Z4),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:GDe,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:XDe,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:WDe,int32:{type:"number",validate:ZDe},int64:{type:"number",validate:JDe},float:{type:"number",validate:G4},double:{type:"number",validate:G4},password:!0,binary:!0};J4.fastFormats={...J4.fullFormats,date:Mn(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,hk),time:Mn(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,_k),"date-time":Mn(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,K4),"iso-time":Mn(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,V4),"iso-date-time":Mn(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Z4),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};J4.formatNames=Object.keys(J4.fullFormats);function FDe(e){return e%4===0&&(e%100!==0||e%400===0)}var zDe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,BDe=[0,31,28,31,30,31,30,31,31,30,31,30,31];function W4(e){let t=zDe.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&FDe(r)?29:BDe[n])}function hk(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var fk=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function mk(e){return function(r){let n=fk.exec(r);if(!n)return!1;let o=+n[1],i=+n[2],s=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),d=+(n[7]||0);if(u>23||d>59||e&&!a)return!1;if(o<=23&&i<=59&&s<60)return!0;let f=i-d*c,m=o-u*c-(f<0?1:0);return(m===23||m===-1)&&(f===59||f===-1)&&s<61}}function _k(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(!(r&&n))return;return r-n}function V4(e,t){if(!(e&&t))return;let r=fk.exec(e),n=fk.exec(t);if(!(r&&n))return;if(e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t)return 1;if(e<t)return-1;return 0}var gk=/t|\s/i;function H4(e){let t=mk(e);return function(n){let o=n.split(gk);return o.length===2&&W4(o[0])&&t(o[1])}}function K4(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(!(r&&n))return;return r-n}function Z4(e,t){if(!(e&&t))return;let[r,n]=e.split(gk),[o,i]=t.split(gk),s=hk(r,o);if(s===void 0)return;return s||_k(n,i)}var HDe=/\/|:/,qDe=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function GDe(e){return HDe.test(e)&&qDe.test(e)}var q4=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function WDe(e){return q4.lastIndex=0,q4.test(e)}var VDe=-2147483648,KDe=2147483647;function ZDe(e){return Number.isInteger(e)&&e<=KDe&&e>=VDe}function JDe(e){return Number.isInteger(e)}function G4(){return!0}var YDe=/[^\\]\\Z/;function XDe(e){if(YDe.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var eq=v(function(Q4){Object.defineProperty(Q4,"__esModule",{value:!0});Q4.formatLimitDefinition=void 0;var e0e=dk(),vn=pe(),ci=vn.operators,fy={formatMaximum:{okStr:"<=",ok:ci.LTE,fail:ci.GT},formatMinimum:{okStr:">=",ok:ci.GTE,fail:ci.LT},formatExclusiveMaximum:{okStr:"<",ok:ci.LT,fail:ci.GTE},formatExclusiveMinimum:{okStr:">",ok:ci.GT,fail:ci.LTE}},t0e={message:({keyword:e,schemaCode:t})=>vn.str`should be ${fy[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>vn._`{comparison: ${fy[e].okStr}, limit: ${t}}`};Q4.formatLimitDefinition={keyword:Object.keys(fy),type:"string",schemaType:"string",$data:!0,error:t0e,code(e){let{gen:t,data:r,schemaCode:n,keyword:o,it:i}=e,{opts:s,self:a}=i;if(!s.validateFormats)return;let c=new e0e.KeywordCxt(i,a.RULES.all.format.definition,"format");if(c.$data)u();else d();function u(){let m=t.scopeValue("formats",{ref:a.formats,code:s.code.formats}),g=t.const("fmt",vn._`${m}[${c.schemaCode}]`);e.fail$data((0,vn.or)(vn._`typeof ${g} != "object"`,vn._`${g} instanceof RegExp`,vn._`typeof ${g}.compare != "function"`,f(g)))}function d(){let m=c.schema,g=a.formats[m];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw Error(`"${o}": format "${m}" does not define "compare" function`);let h=t.scopeValue("formats",{key:m,ref:g,code:s.code.formats?vn._`${s.code.formats}${(0,vn.getProperty)(m)}`:void 0});e.fail$data(f(h))}function f(m){return vn._`${m}.compare(${r}, ${n}) ${fy[o].fail} 0`}},dependencies:["format"]};var r0e=(e)=>(e.addKeyword(Q4.formatLimitDefinition),e);Q4.default=r0e});var oq=v(function(Td,nq){Object.defineProperty(Td,"__esModule",{value:!0});var Dc=X4(),o0e=eq(),xk=pe(),tq=new xk.Name("fullFormats"),i0e=new xk.Name("fastFormats"),vk=(e,t={keywords:!0})=>{if(Array.isArray(t))return rq(e,t,Dc.fullFormats,tq),e;let[r,n]=t.mode==="fast"?[Dc.fastFormats,i0e]:[Dc.fullFormats,tq],o=t.formats||Dc.formatNames;if(rq(e,o,r,n),t.keywords)(0,o0e.default)(e);return e};vk.get=(e,t="full")=>{let n=(t==="fast"?Dc.fastFormats:Dc.fullFormats)[e];if(!n)throw Error(`Unknown format "${e}"`);return n};function rq(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=xk._`require("ajv-formats/dist/formats").${n}`);for(let s of t)e.addFormat(s,r[s])}nq.exports=Td=vk;Object.defineProperty(Td,"__esModule",{value:!0});Td.default=vk});import{execFile as nUe}from"child_process";import{randomUUID as lO}from"crypto";import{createReadStream as oUe,realpathSync as iUe}from"fs";import{copyFile as sUe,mkdir as sO,readdir as aUe,readFile as nW,rm as cUe,writeFile as oW}from"fs/promises";import{createRequire as lUe}from"module";import{homedir as aO,tmpdir as uUe}from"os";import{dirname as eW,isAbsolute as iW,join as Dr,relative as sW,resolve as zd,sep as uO}from"path";import{createInterface as pUe}from"readline";import{fileURLToPath as dUe}from"url";import{setMaxListeners as MW}from"events";var UW=50;function Jc(e=UW){let t=new AbortController;return MW(e,t.signal),t}var LUe=new FinalizationRegistry(({parentSignalRef:e,handler:t})=>{e.deref()?.removeEventListener("abort",t)});var $W="server-fallback-tombstone";var NUe=new DOMException($W,"AbortError");var jW="subagent-park",MUe=new DOMException(jW,"AbortError");import{realpathSync as PO}from"fs";import{dirname as TO,resolve as jy,sep as AO}from"path";function xr(e){return process.platform==="darwin"?e.normalize("NFC"):e}function gi(e){return/^[\\/]{2}/.test(e)}function kO(e){if(/^[\\/]{2}[?.][\\/](?!unc[\\/])/i.test(e))return null;return e.match(/^[\\/]{2}(?:[?.][\\/]unc[\\/])?([^\\/]+)/i)?.[1]?.replace(/[A-Z]/g,(t)=>t.toLowerCase())??null}function Yc(e){return/(^|[\\/])\.{1,2}([\\/]|$)/.test(e)}function DO(e){return/^[\\/]{2}[?.][\\/]/.test(e)}function LO(e,t){if(!gi(e))return!1;if(DO(e))return!0;if(Yc(e))return!0;let r=kO(e);return r===null||r!==kO(t)}function OO(e){if(process.platform==="win32"||!e.startsWith("/"))return null;let t=[];for(let r of e.split("/")){if(r===""||r===".")continue;if(r===".."){t.pop();continue}if(t.push(r),t.length===2&&CO(t[0])==="net")return CO(r)}return null}function CO(e){return e.replace(/[A-Z]/g,(t)=>t.toLowerCase())}function NO(e,t){if(!As(e))return!1;let r=OO(e);return r===null||r!==OO(t)}function As(e){if(process.platform==="win32")return!1;return MO(e)}function MO(e){return zy(e)!==null}function zy(e){if(!e.startsWith("/"))return null;let t=[];for(let r of e.split("/")){if(r===""||r===".")continue;if(r===".."){t.pop();continue}if(t.push(r),t.length===2&&t[0].toLowerCase()==="net")return"/"+t.join("/")}return null}function ks(e){return/^[\\/]{2}wsl(\$|\.localhost)[\\/]/i.test(e)}function By(e){if(e.startsWith("\\\\?\\UNC\\"))return"\\\\"+e.slice(8);if(e.startsWith("\\\\?\\")&&e.length>=7&&e[5]===":")return e.slice(4);return e}function UO(e){if(/^\\\\\?\\volume\{/i.test(e))return RO(e);let t=By(e);if(t!==e&&RO(t))return!0;return gi(t)&&!ks(t)}function RO(e){return Yc(e)||e.includes("/")}function Hy(e){try{return By(PO.native(e))}catch{return null}}var FW=new Set(["EPERM","EBUSY","EACCES"]),zW=4,BW=50,IO;function Fy(e){for(let t=0;;t++)try{return By(PO.native(e))}catch(r){let n=r!=null&&typeof r==="object"&&"code"in r&&typeof r.code==="string"?r.code:void 0;if(n===void 0||!FW.has(n)||t>=zW-1)return null;IO??=new Int32Array(new SharedArrayBuffer(4)),Atomics.wait(IO,0,0,BW)}}function Hd(e,t){let r=jy(t).toLowerCase(),n=jy(e).toLowerCase();if(TO(n)===r||n.startsWith(r+AO))return!0;let o=Fy(t)?.toLowerCase();if(o==null)return!1;let i=Fy(TO(jy(e)))?.toLowerCase();if(i==null)return!0;return i===o||i.startsWith(o+AO)}function jn(e,t,r){return new Promise((n,o)=>{if(t?.aborted){if(r?.throwOnAbort||r?.abortError)o(r.abortError?.()??Error("aborted"));else n();return}let i=setTimeout((a,c,u)=>{a?.removeEventListener("abort",c),u()},e,t,s,n);function s(){if(clearTimeout(i),r?.throwOnAbort||r?.abortError)o(r.abortError?.()??Error("aborted"));else n()}if(t?.addEventListener("abort",s,{once:!0}),r?.unref)i.unref()})}function HW(e,t){e(Error(t))}function Mr(e,t,r){let n,o=new Promise((i,s)=>{n=setTimeout(HW,t,s,r)});return Promise.race([e,o]).finally(()=>{if(n!==void 0)clearTimeout(n)})}import{spawn as cxe}from"child_process";import{existsSync as lxe}from"fs";import{createInterface as uxe}from"readline";import{StringDecoder as pxe}from"string_decoder";var Os=["PreToolUse","PostToolUse","PostToolUseFailure","PostToolBatch","Notification","UserPromptSubmit","UserPromptExpansion","SessionStart","SessionEnd","Stop","StopFailure","SubagentStart","SubagentStop","PreCompact","PostCompact","PermissionRequest","PermissionDenied","Setup","TeammateIdle","TaskCreated","TaskCompleted","Elicitation","ElicitationResult","ConfigChange","WorktreeCreate","WorktreeRemove","InstructionsLoaded","CwdChanged","FileChanged","DirectoryAdded","MessageDisplay"],qW=["clear","resume","logout","prompt_input_exit","other","bypass_permissions_disabled"],GW="__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__";function qy(e){return e.charAt(0).toUpperCase()+e.slice(1)}function jO(e,t,r=t+"s"){return e===1?t:r}function FO(e,t){if(e.length<=t)return e;let r=e.slice(0,t),n=r.charCodeAt(t-1);return zO(n>=55296&&n<=56319?r.slice(0,-1):r)}function Gy(e,t){if(e.length<=t)return e;let r=e.slice(-t),n=r.charCodeAt(0);return zO(n>=56320&&n<=57343?r.slice(1):r)}function zO(e){return Buffer.from(e,"utf16le").toString("utf16le")}var WW=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,$O=typeof String.prototype.isWellFormed==="function"?Function.prototype.call.bind(String.prototype.isWellFormed):void 0,qUe=typeof String.prototype.toWellFormed==="function"?Function.prototype.call.bind(String.prototype.toWellFormed):void 0;function BO(e){if($O&&$O(e))return e;return e.replace(WW,"")}function Wy(e,t){let r=e.indexOf(t);return r===-1?e:e.slice(0,r)}var VW=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,KW=/<command-name>(.*?)<\/command-name>/;function Xc(e,t){if(e.type!=="user")return;if(e.isMeta===!0||e.isCompactSummary===!0)return;let r=e.message;if(!r)return;let n=r.content,o=[];if(typeof n==="string")o.push(n);else if(Array.isArray(n))for(let i of n){if(!i||typeof i!=="object")continue;if(i.type==="tool_result")return;if(i.type==="text"&&typeof i.text==="string")o.push(i.text)}for(let i of o){let s=i.replaceAll(`
|
|
35
35
|
`," ").trim();if(!s)continue;let a=KW.exec(s);if(a){if(!t.commandFallback)t.commandFallback=a[1];continue}let c=/<bash-input>([\s\S]*?)<\/bash-input>/.exec(s);if(c)return`! ${c[1].trim()}`;if(VW.test(s))continue;if(s.length>200)s=FO(s,200).trim()+"…";return s}return}var ZW={customTitle:"customTitle",aiTitle:"aiTitle",lastPrompt:"lastPrompt",summary:"summaryHint",gitBranch:"gitBranch"};function qd(e,t,r,n){let o=n?.mtime??e?.mtime??0,i=e!==void 0?{sessionId:e.sessionId,mtime:o,data:{...e.data}}:{sessionId:t.sessionId,mtime:o,data:{}},s=i.data;for(let a of r){let c=YW(a.timestamp);if(s.isSidechain===void 0)s.isSidechain=a.isSidechain===!0;if(s.createdAt===void 0&&c!==void 0)s.createdAt=c;if(s.cwd===void 0){let u=a.cwd;if(typeof u==="string"&&u)s.cwd=u}XW(s,a);for(let[u,d]of Object.entries(ZW)){let f=a[u];if(typeof f==="string")s[d]=f}if(a.type==="tag"){let u=a.tag;if(typeof u==="string"&&u)s.tag=u;else delete s.tag}if(a.type==="relocated"){let u=a.relocatedCwd;if(typeof u==="string"&&u)s.cwd=u}}return i}function HO(e,t){let r=e.data;if(r.isSidechain===!0)return null;let n=go(r.firstPromptLocked===!0?r.firstPrompt:r.commandFallback)||void 0,o=go(r.customTitle)||go(r.aiTitle)||void 0,i=o||go(r.lastPrompt)||go(r.summaryHint)||n;if(!i)return null;return{sessionId:e.sessionId,summary:i,lastModified:e.mtime,fileSize:void 0,customTitle:o,firstPrompt:n,gitBranch:go(r.gitBranch)||void 0,cwd:go(r.cwd)||t||void 0,tag:go(r.tag)||void 0,createdAt:JW(r.createdAt)}}function go(e){return typeof e==="string"?e:void 0}function JW(e){return typeof e==="number"?e:void 0}function YW(e){if(typeof e!=="string")return;let t=Date.parse(e);return Number.isNaN(t)?void 0:t}function XW(e,t){if(e.firstPromptLocked)return;let r={commandFallback:e.commandFallback??""},n=Xc(t,r);if(r.commandFallback&&!e.commandFallback)e.commandFallback=r.commandFallback;if(n!==void 0)e.firstPrompt=n,e.firstPromptLocked=!0}class Vy{store=new Map;mtimes=new Map;summaries=new Map;lastMtime=0;keyToString(e){let t=[e.projectKey,e.sessionId];if(e.subpath)t.push(e.subpath);return t.join("/")}async append(e,t){let r=this.keyToString(e),n=this.store.get(r)??[];n.push(...t),this.store.set(r,n);let o=Math.max(Date.now(),this.lastMtime+1);if(this.lastMtime=o,this.mtimes.set(r,o),e.subpath===void 0){let i=`${e.projectKey}/${e.sessionId}`,s=qd(this.summaries.get(i),e,t,{mtime:o});this.summaries.set(i,s)}}async load(e){let t=this.keyToString(e);return this.store.get(t)??null}async listSessions(e){let t=[],r=e+"/";for(let[n]of this.store)if(n.startsWith(r)){let o=n.slice(r.length);if(!o.includes("/"))t.push({sessionId:o,mtime:this.mtimes.get(n)??0})}return t}async listSessionSummaries(e){let t=[],r=e+"/";for(let[n,o]of this.summaries)if(n.startsWith(r))t.push(o);return t}async delete(e){let t=this.keyToString(e);if(this.store.delete(t),this.mtimes.delete(t),e.subpath===void 0){this.summaries.delete(`${e.projectKey}/${e.sessionId}`);let r=`${e.projectKey}/${e.sessionId}/`;for(let n of this.store.keys())if(n.startsWith(r))this.store.delete(n),this.mtimes.delete(n)}}async listSubkeys(e){let t=`${e.projectKey}/${e.sessionId}/`,r=[];for(let n of this.store.keys())if(n.startsWith(t))r.push(n.slice(t.length));return r}getEntries(e){return this.store.get(this.keyToString(e))??[]}get size(){let e=0;for(let t of this.store.keys()){let r=t.indexOf("/");if(r!==-1&&!t.slice(r+1).includes("/"))e++}return e}clear(){this.store.clear(),this.mtimes.clear(),this.summaries.clear()}}var qO=["You've hit your","You've reached your","You're out of usage credits","Your org is out of usage · add funds to continue","Your org is out of usage · contact your admin","Your seat type doesn't include usage credits","Your seat type doesn't include usage","Your usage allocation has been disabled by your admin","Your group's usage limit is set to $0","Fable 5 requires usage credits","You're out of extra usage","Your seat type doesn't include extra usage"],GO=["This service is disabled for your org"],WO=["You've used","You're close to"],VO=["You're now using usage credits","You're now using your usage allocation","Now using your usage allocation","Now using usage credits","You're now using extra usage","Now using extra usage"];class It extends Error{}function Cs(){return process.versions.bun!==void 0}var KO=globalThis.process?.getBuiltinModule?.("async_hooks"),Ky=KO?(e)=>KO.AsyncResource.bind(e):(e)=>e;function ge(e){if(!e)return!1;if(typeof e==="boolean")return e;let t=String(e).toLowerCase().trim();return["1","true","yes","on"].includes(t)}function Gd(e){if(e===void 0)return!1;if(typeof e==="boolean")return!e;let t=String(e).toLowerCase().trim();return["0","false","no","off"].includes(t)}function ho(){let e=new Set;return{subscribe(t){let r=Ky(t);return e.add(r),()=>{e.delete(r)}},emit(...t){let r;for(let n of e)try{n(...t)}catch(o){(r??=[]).push(o)}if(r)throw r.length===1?r[0]:AggregateError(r,"Signal listener(s) threw")},clear(){e.clear()}}}var QW=typeof global=="object"&&global&&global.Object===Object&&global,Wd=QW;var eV=typeof self=="object"&&self&&self.Object===Object&&self,tV=Wd||eV||Function("return this")(),gt=tV;var rV=gt.Symbol,Zt=rV;var ZO=Object.prototype,nV=ZO.hasOwnProperty,oV=ZO.toString,Qc=Zt?Zt.toStringTag:void 0;function iV(e){var t=nV.call(e,Qc),r=e[Qc];try{e[Qc]=void 0;var n=!0}catch(i){}var o=oV.call(e);if(n)if(t)e[Qc]=r;else delete e[Qc];return o}var JO=iV;var sV=Object.prototype,aV=sV.toString;function cV(e){return aV.call(e)}var YO=cV;var lV="[object Null]",uV="[object Undefined]",XO=Zt?Zt.toStringTag:void 0;function pV(e){if(e==null)return e===void 0?uV:lV;return XO&&XO in Object(e)?JO(e):YO(e)}var vr=pV;function dV(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Et=dV;var fV="[object AsyncFunction]",mV="[object Function]",gV="[object GeneratorFunction]",hV="[object Proxy]";function _V(e){if(!Et(e))return!1;var t=vr(e);return t==mV||t==gV||t==fV||t==hV}var Rs=_V;var yV=gt["__core-js_shared__"],Vd=yV;var QO=function(){var e=/[^.]+$/.exec(Vd&&Vd.keys&&Vd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function bV(e){return!!QO&&QO in e}var eC=bV;var xV=Function.prototype,vV=xV.toString;function SV(e){if(e!=null){try{return vV.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var Fn=SV;var EV=/[\\^$.*+?()[\]{}|]/g,wV=/^\[object .+?Constructor\]$/,TV=Function.prototype,AV=Object.prototype,kV=TV.toString,OV=AV.hasOwnProperty,CV=RegExp("^"+kV.call(OV).replace(EV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function RV(e){if(!Et(e)||eC(e))return!1;var t=Rs(e)?CV:wV;return t.test(Fn(e))}var tC=RV;function IV(e,t){return e==null?void 0:e[t]}var rC=IV;function PV(e,t){var r=rC(e,t);return tC(r)?r:void 0}var or=PV;var DV=or(Object,"create"),zn=DV;function LV(){this.__data__=zn?zn(null):{},this.size=0}var nC=LV;function NV(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var oC=NV;var MV="__lodash_hash_undefined__",UV=Object.prototype,$V=UV.hasOwnProperty;function jV(e){var t=this.__data__;if(zn){var r=t[e];return r===MV?void 0:r}return $V.call(t,e)?t[e]:void 0}var iC=jV;var FV=Object.prototype,zV=FV.hasOwnProperty;function BV(e){var t=this.__data__;return zn?t[e]!==void 0:zV.call(t,e)}var sC=BV;var HV="__lodash_hash_undefined__";function qV(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=zn&&t===void 0?HV:t,this}var aC=qV;function Is(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}Is.prototype.clear=nC;Is.prototype.delete=oC;Is.prototype.get=iC;Is.prototype.has=sC;Is.prototype.set=aC;var Zy=Is;function GV(){this.__data__=[],this.size=0}var cC=GV;function WV(e,t){return e===t||e!==e&&t!==t}var An=WV;function VV(e,t){var r=e.length;while(r--)if(An(e[r][0],t))return r;return-1}var _o=VV;var KV=Array.prototype,ZV=KV.splice;function JV(e){var t=this.__data__,r=_o(t,e);if(r<0)return!1;var n=t.length-1;if(r==n)t.pop();else ZV.call(t,r,1);return--this.size,!0}var lC=JV;function YV(e){var t=this.__data__,r=_o(t,e);return r<0?void 0:t[r][1]}var uC=YV;function XV(e){return _o(this.__data__,e)>-1}var pC=XV;function QV(e,t){var r=this.__data__,n=_o(r,e);if(n<0)++this.size,r.push([e,t]);else r[n][1]=t;return this}var dC=QV;function Ps(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}Ps.prototype.clear=cC;Ps.prototype.delete=lC;Ps.prototype.get=uC;Ps.prototype.has=pC;Ps.prototype.set=dC;var yo=Ps;var eK=or(gt,"Map"),bo=eK;function tK(){this.size=0,this.__data__={hash:new Zy,map:new(bo||yo),string:new Zy}}var fC=tK;function rK(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var mC=rK;function nK(e,t){var r=e.__data__;return mC(t)?r[typeof t=="string"?"string":"hash"]:r.map}var xo=nK;function oK(e){var t=xo(this,e).delete(e);return this.size-=t?1:0,t}var gC=oK;function iK(e){return xo(this,e).get(e)}var hC=iK;function sK(e){return xo(this,e).has(e)}var _C=sK;function aK(e,t){var r=xo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var yC=aK;function Ds(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}Ds.prototype.clear=fC;Ds.prototype.delete=gC;Ds.prototype.get=hC;Ds.prototype.has=_C;Ds.prototype.set=yC;var hi=Ds;var cK="Expected a function";function Jy(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw TypeError(cK);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var s=e.apply(this,n);return r.cache=i.set(o,s)||i,s};return r.cache=new(Jy.Cache||hi),r}Jy.Cache=hi;var re=Jy;import{homedir as d3}from"os";import{basename as D9e,dirname as L9e,join as f3,resolve as N9e}from"path";var lK=/^[+-]?(\d+(\.\d*)?|\.\d+)[eE][+-]?\d+$/,uK=/^[+-]?\d{1,3}([_,\u00A0\u202F ])\d{3}(?:\1\d{3})*$/,pK=/[_,\u00A0\u202F ]/g;function dK(e){if(e.length<=32){if(lK.test(e)){let t=Number(e);return Number.isInteger(t)?t:NaN}if(uK.test(e))return parseInt(e.replace(pK,""),10)}return}function Yy(e){let t=String(e).trim();return dK(t)??parseInt(t,10)}var l={};lt(l,{xid:()=>d9,void:()=>D9,uuidv7:()=>i9,uuidv6:()=>o9,uuidv4:()=>n9,uuid:()=>r9,url:()=>s9,uppercase:()=>Fl,unknown:()=>Ke,union:()=>$e,undefined:()=>I9,ulid:()=>p9,uint64:()=>C9,uint32:()=>A9,tuple:()=>U9,trim:()=>Wl,treeifyError:()=>Yd,transform:()=>jv,toUpperCase:()=>Kl,toLowerCase:()=>Vl,toJSONSchema:()=>Zs,templateLiteral:()=>W9,symbol:()=>R9,superRefine:()=>AR,success:()=>q9,stringbool:()=>Z9,stringFormat:()=>S9,string:()=>A,strictObject:()=>M9,startsWith:()=>Bl,size:()=>Ul,setErrorMap:()=>X9,set:()=>F9,safeParseAsync:()=>gv,safeParse:()=>mv,registry:()=>gl,regexes:()=>wo,regex:()=>$l,refine:()=>TR,record:()=>je,readonly:()=>bR,property:()=>iv,promise:()=>V9,prettifyError:()=>Xd,preprocess:()=>Km,prefault:()=>dR,positive:()=>tv,pipe:()=>zm,partialRecord:()=>$9,parseAsync:()=>fv,parse:()=>dv,overwrite:()=>Wn,optional:()=>We,object:()=>G,number:()=>Ce,nullish:()=>H9,nullable:()=>Fm,null:()=>Bm,normalize:()=>Gl,nonpositive:()=>nv,nonoptional:()=>fR,nonnegative:()=>ov,never:()=>Hm,negative:()=>rv,nativeEnum:()=>z9,nanoid:()=>c9,nan:()=>G9,multipleOf:()=>wi,minSize:()=>Ti,minLength:()=>ko,mime:()=>ql,maxSize:()=>Ws,maxLength:()=>Vs,map:()=>j9,lte:()=>Ur,lt:()=>qn,lowercase:()=>jl,looseObject:()=>Bt,locales:()=>qs,literal:()=>Z,length:()=>Ks,lazy:()=>SR,ksuid:()=>f9,keyof:()=>N9,jwt:()=>v9,json:()=>J9,iso:()=>Js,ipv6:()=>g9,ipv4:()=>m9,intersection:()=>tu,int64:()=>O9,int32:()=>T9,int:()=>hv,instanceof:()=>K9,includes:()=>zl,guid:()=>t9,gte:()=>ar,gt:()=>Gn,globalRegistry:()=>sr,getErrorMap:()=>Q9,function:()=>Dm,formatError:()=>$s,float64:()=>w9,float32:()=>E9,flattenError:()=>Us,file:()=>B9,enum:()=>Jt,endsWith:()=>Hl,emoji:()=>a9,email:()=>e9,e164:()=>x9,discriminatedUnion:()=>Wm,date:()=>L9,custom:()=>Hv,cuid2:()=>u9,cuid:()=>l9,core:()=>Qr,config:()=>ut,coerce:()=>qv,clone:()=>zt,cidrv6:()=>_9,cidrv4:()=>h9,check:()=>wR,catch:()=>hR,boolean:()=>ht,bigint:()=>k9,base64url:()=>b9,base64:()=>y9,array:()=>he,any:()=>P9,_default:()=>uR,_ZodString:()=>_v,ZodXID:()=>Tv,ZodVoid:()=>QC,ZodUnknown:()=>YC,ZodUnion:()=>Mv,ZodUndefined:()=>KC,ZodUUID:()=>Vn,ZodURL:()=>bv,ZodULID:()=>wv,ZodType:()=>de,ZodTuple:()=>nR,ZodTransform:()=>$v,ZodTemplateLiteral:()=>xR,ZodSymbol:()=>VC,ZodSuccess:()=>mR,ZodStringFormat:()=>Ge,ZodString:()=>Yl,ZodSet:()=>iR,ZodRecord:()=>Uv,ZodRealError:()=>Ys,ZodReadonly:()=>yR,ZodPromise:()=>ER,ZodPrefault:()=>pR,ZodPipe:()=>Bv,ZodOptional:()=>Fv,ZodObject:()=>Gm,ZodNumberFormat:()=>Xs,ZodNumber:()=>Xl,ZodNullable:()=>cR,ZodNull:()=>ZC,ZodNonOptional:()=>zv,ZodNever:()=>XC,ZodNanoID:()=>vv,ZodNaN:()=>_R,ZodMap:()=>oR,ZodLiteral:()=>sR,ZodLazy:()=>vR,ZodKSUID:()=>Av,ZodJWT:()=>Lv,ZodIssueCode:()=>Y9,ZodIntersection:()=>rR,ZodISOTime:()=>Um,ZodISODuration:()=>$m,ZodISODateTime:()=>Nm,ZodISODate:()=>Mm,ZodIPv6:()=>Ov,ZodIPv4:()=>kv,ZodGUID:()=>jm,ZodFile:()=>aR,ZodError:()=>XZ,ZodEnum:()=>Jl,ZodEmoji:()=>xv,ZodEmail:()=>yv,ZodE164:()=>Dv,ZodDiscriminatedUnion:()=>tR,ZodDefault:()=>lR,ZodDate:()=>qm,ZodCustomStringFormat:()=>WC,ZodCustom:()=>Vm,ZodCatch:()=>gR,ZodCUID2:()=>Ev,ZodCUID:()=>Sv,ZodCIDRv6:()=>Rv,ZodCIDRv4:()=>Cv,ZodBoolean:()=>Ql,ZodBigIntFormat:()=>Nv,ZodBigInt:()=>eu,ZodBase64URL:()=>Pv,ZodBase64:()=>Iv,ZodArray:()=>eR,ZodAny:()=>JC,TimePrecision:()=>lm,NEVER:()=>Kd,$output:()=>sm,$input:()=>am,$brand:()=>Zd});var Qr={};lt(Qr,{version:()=>tx,util:()=>M,treeifyError:()=>Yd,toJSONSchema:()=>Zs,toDotPath:()=>vC,safeParseAsync:()=>Eo,safeParse:()=>So,registry:()=>gl,regexes:()=>wo,prettifyError:()=>Xd,parseAsync:()=>xi,parse:()=>bi,locales:()=>qs,isValidJWT:()=>jC,isValidBase64URL:()=>$C,isValidBase64:()=>ax,globalRegistry:()=>sr,globalConfig:()=>el,function:()=>Dm,formatError:()=>$s,flattenError:()=>Us,config:()=>ut,clone:()=>zt,_xid:()=>kl,_void:()=>Tm,_uuidv7:()=>xl,_uuidv6:()=>bl,_uuidv4:()=>yl,_uuid:()=>_l,_url:()=>vl,_uppercase:()=>Fl,_unknown:()=>Ei,_union:()=>RZ,_undefined:()=>vm,_ulid:()=>Al,_uint64:()=>bm,_uint32:()=>gm,_tuple:()=>sv,_trim:()=>Wl,_transform:()=>jZ,_toUpperCase:()=>Kl,_toLowerCase:()=>Vl,_templateLiteral:()=>KZ,_symbol:()=>xm,_success:()=>qZ,_stringbool:()=>Im,_stringFormat:()=>Pm,_string:()=>cm,_startsWith:()=>Bl,_size:()=>Ul,_set:()=>NZ,_safeParseAsync:()=>rf,_safeParse:()=>tf,_regex:()=>$l,_refine:()=>Rm,_record:()=>DZ,_readonly:()=>VZ,_property:()=>iv,_promise:()=>JZ,_positive:()=>tv,_pipe:()=>WZ,_parseAsync:()=>ef,_parse:()=>Qd,_overwrite:()=>Wn,_optional:()=>FZ,_number:()=>um,_nullable:()=>zZ,_null:()=>Sm,_normalize:()=>Gl,_nonpositive:()=>nv,_nonoptional:()=>HZ,_nonnegative:()=>ov,_never:()=>wm,_negative:()=>rv,_nativeEnum:()=>UZ,_nanoid:()=>El,_nan:()=>km,_multipleOf:()=>wi,_minSize:()=>Ti,_minLength:()=>ko,_min:()=>ar,_mime:()=>ql,_maxSize:()=>Ws,_maxLength:()=>Vs,_max:()=>Ur,_map:()=>LZ,_lte:()=>Ur,_lt:()=>qn,_lowercase:()=>jl,_literal:()=>$Z,_length:()=>Ks,_lazy:()=>ZZ,_ksuid:()=>Ol,_jwt:()=>Ml,_isoTime:()=>Zx,_isoDuration:()=>Jx,_isoDateTime:()=>Vx,_isoDate:()=>Kx,_ipv6:()=>Rl,_ipv4:()=>Cl,_intersection:()=>PZ,_int64:()=>ym,_int32:()=>mm,_int:()=>pm,_includes:()=>zl,_guid:()=>Gs,_gte:()=>ar,_gt:()=>Gn,_float64:()=>fm,_float32:()=>dm,_file:()=>Om,_enum:()=>MZ,_endsWith:()=>Hl,_emoji:()=>Sl,_email:()=>hl,_e164:()=>Nl,_discriminatedUnion:()=>IZ,_default:()=>BZ,_date:()=>Am,_custom:()=>Cm,_cuid2:()=>Tl,_cuid:()=>wl,_coercedString:()=>Wx,_coercedNumber:()=>Yx,_coercedDate:()=>ev,_coercedBoolean:()=>Xx,_coercedBigint:()=>Qx,_cidrv6:()=>Pl,_cidrv4:()=>Il,_catch:()=>GZ,_boolean:()=>hm,_bigint:()=>_m,_base64url:()=>Ll,_base64:()=>Dl,_array:()=>Zl,_any:()=>Em,TimePrecision:()=>lm,NEVER:()=>Kd,JSONSchemaGenerator:()=>Lm,JSONSchema:()=>HC,Doc:()=>af,$output:()=>sm,$input:()=>am,$constructor:()=>S,$brand:()=>Zd,$ZodXID:()=>bf,$ZodVoid:()=>Uf,$ZodUnknown:()=>Si,$ZodUnion:()=>dl,$ZodUndefined:()=>Df,$ZodUUID:()=>pf,$ZodURL:()=>ff,$ZodULID:()=>yf,$ZodType:()=>ie,$ZodTuple:()=>Ao,$ZodTransform:()=>Bs,$ZodTemplateLiteral:()=>rm,$ZodSymbol:()=>Pf,$ZodSuccess:()=>Xf,$ZodStringFormat:()=>Ue,$ZodString:()=>To,$ZodSet:()=>Hf,$ZodRegistry:()=>ml,$ZodRecord:()=>zf,$ZodRealError:()=>Ms,$ZodReadonly:()=>tm,$ZodPromise:()=>nm,$ZodPrefault:()=>Jf,$ZodPipe:()=>Hs,$ZodOptional:()=>Vf,$ZodObject:()=>pl,$ZodNumberFormat:()=>Rf,$ZodNumber:()=>ll,$ZodNullable:()=>Kf,$ZodNull:()=>Lf,$ZodNonOptional:()=>Yf,$ZodNever:()=>Mf,$ZodNanoID:()=>gf,$ZodNaN:()=>em,$ZodMap:()=>Bf,$ZodLiteral:()=>Gf,$ZodLazy:()=>om,$ZodKSUID:()=>xf,$ZodJWT:()=>Of,$ZodIntersection:()=>Ff,$ZodISOTime:()=>ix,$ZodISODuration:()=>sx,$ZodISODateTime:()=>nx,$ZodISODate:()=>ox,$ZodIPv6:()=>Sf,$ZodIPv4:()=>vf,$ZodGUID:()=>uf,$ZodFunction:()=>av,$ZodFile:()=>Wf,$ZodError:()=>cl,$ZodEnum:()=>qf,$ZodEmoji:()=>mf,$ZodEmail:()=>df,$ZodE164:()=>kf,$ZodDiscriminatedUnion:()=>jf,$ZodDefault:()=>Zf,$ZodDate:()=>$f,$ZodCustomStringFormat:()=>Cf,$ZodCustom:()=>im,$ZodCheckUpperCase:()=>Kb,$ZodCheckStringFormat:()=>js,$ZodCheckStartsWith:()=>Jb,$ZodCheckSizeEquals:()=>Bb,$ZodCheckRegex:()=>Wb,$ZodCheckProperty:()=>Xb,$ZodCheckOverwrite:()=>ex,$ZodCheckNumberFormat:()=>$b,$ZodCheckMultipleOf:()=>Ub,$ZodCheckMinSize:()=>zb,$ZodCheckMinLength:()=>qb,$ZodCheckMimeType:()=>Qb,$ZodCheckMaxSize:()=>Fb,$ZodCheckMaxLength:()=>Hb,$ZodCheckLowerCase:()=>Vb,$ZodCheckLessThan:()=>of,$ZodCheckLengthEquals:()=>Gb,$ZodCheckIncludes:()=>Zb,$ZodCheckGreaterThan:()=>sf,$ZodCheckEndsWith:()=>Yb,$ZodCheckBigIntFormat:()=>jb,$ZodCheck:()=>Xe,$ZodCatch:()=>Qf,$ZodCUID2:()=>_f,$ZodCUID:()=>hf,$ZodCIDRv6:()=>wf,$ZodCIDRv4:()=>Ef,$ZodBoolean:()=>Fs,$ZodBigIntFormat:()=>If,$ZodBigInt:()=>ul,$ZodBase64URL:()=>Af,$ZodBase64:()=>Tf,$ZodAsyncError:()=>Bn,$ZodArray:()=>zs,$ZodAny:()=>Nf});var Kd=Object.freeze({status:"aborted"});function S(e,t,r){function n(a,c){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,c);for(let d in s.prototype)if(!(d in a))Object.defineProperty(a,d,{value:s.prototype[d].bind(a)});a._zod.constr=s,a._zod.def=c}let o=r?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var c;let u=r?.Parent?new i:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:(a)=>{if(r?.Parent&&a instanceof r.Parent)return!0;return a?._zod?.traits?.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}var Zd=Symbol("zod_brand");class Bn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var el={};function ut(e){if(e)Object.assign(el,e);return el}var M={};lt(M,{unwrapMessage:()=>tl,stringifyPrimitive:()=>j,required:()=>CK,randomString:()=>xK,propertyKeyTypes:()=>il,promiseAllObject:()=>bK,primitiveTypes:()=>nb,prefixIssues:()=>ir,pick:()=>wK,partial:()=>OK,optionalKeys:()=>ob,omit:()=>TK,numKeys:()=>vK,nullish:()=>vo,normalizeParams:()=>L,merge:()=>kK,jsonStringifyReplacer:()=>Qy,joinValues:()=>O,issue:()=>ab,isPlainObject:()=>Ns,isObject:()=>Ls,getSizableOrigin:()=>sl,getParsedType:()=>SK,getLengthableOrigin:()=>al,getEnumValues:()=>rl,getElementAtPath:()=>yK,floatSafeRemainder:()=>eb,finalizeIssue:()=>Sr,extend:()=>AK,escapeRegex:()=>Hn,esc:()=>_i,defineLazy:()=>Pe,createTransparentProxy:()=>EK,clone:()=>zt,cleanRegex:()=>ol,cleanEnum:()=>RK,captureStackTrace:()=>Jd,cached:()=>nl,assignProp:()=>tb,assertNotEqual:()=>mK,assertNever:()=>hK,assertIs:()=>gK,assertEqual:()=>fK,assert:()=>_K,allowsEval:()=>rb,aborted:()=>yi,NUMBER_FORMAT_RANGES:()=>ib,Class:()=>bC,BIGINT_FORMAT_RANGES:()=>sb});function fK(e){return e}function mK(e){return e}function gK(e){}function hK(e){throw Error()}function _K(e){}function rl(e){let t=Object.values(e).filter((n)=>typeof n==="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function O(e,t="|"){return e.map((r)=>j(r)).join(t)}function Qy(e,t){if(typeof t==="bigint")return t.toString();return t}function nl(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw Error("cached value already set")}}}function vo(e){return e===null||e===void 0}function ol(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function eb(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}function Pe(e,t,r){Object.defineProperty(e,t,{get(){{let o=r();return e[t]=o,o}throw Error("cached value already set")},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function tb(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function yK(e,t){if(!t)return e;return t.reduce((r,n)=>r?.[n],e)}function bK(e){let t=Object.keys(e),r=t.map((n)=>e[n]);return Promise.all(r).then((n)=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}function xK(e=10){let r="";for(let n=0;n<e;n++)r+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return r}function _i(e){return JSON.stringify(e)}var Jd=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Ls(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var rb=nl(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Ns(e){if(Ls(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;if(Ls(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function vK(e){let t=0;for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r))t++;return t}var SK=(e)=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(e===null)return"null";if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return"promise";if(typeof Map<"u"&&e instanceof Map)return"map";if(typeof Set<"u"&&e instanceof Set)return"set";if(typeof Date<"u"&&e instanceof Date)return"date";if(typeof File<"u"&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},il=new Set(["string","number","symbol"]),nb=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Hn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function zt(e,t,r){let n=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)n._zod.parent=e;return n}function L(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function EK(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function j(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function ob(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var ib={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},sb={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function wK(e,t){let r={},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw Error(`Unrecognized key: "${o}"`);if(!t[o])continue;r[o]=n.shape[o]}return zt(e,{...e._zod.def,shape:r,checks:[]})}function TK(e,t){let r={...e._zod.def.shape},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw Error(`Unrecognized key: "${o}"`);if(!t[o])continue;delete r[o]}return zt(e,{...e._zod.def,shape:r,checks:[]})}function AK(e,t){if(!Ns(t))throw Error("Invalid input to extend: expected a plain object");let r={...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return tb(this,"shape",n),n},checks:[]};return zt(e,r)}function kK(e,t){return zt(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return tb(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function OK(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let i in r){if(!(i in n))throw Error(`Unrecognized key: "${i}"`);if(!r[i])continue;o[i]=e?new e({type:"optional",innerType:n[i]}):n[i]}else for(let i in n)o[i]=e?new e({type:"optional",innerType:n[i]}):n[i];return zt(t,{...t._zod.def,shape:o,checks:[]})}function CK(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let i in r){if(!(i in o))throw Error(`Unrecognized key: "${i}"`);if(!r[i])continue;o[i]=new e({type:"nonoptional",innerType:n[i]})}else for(let i in n)o[i]=new e({type:"nonoptional",innerType:n[i]});return zt(t,{...t._zod.def,shape:o,checks:[]})}function yi(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function ir(e,t){return t.map((r)=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function tl(e){return typeof e==="string"?e:e?.message}function Sr(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=tl(e.inst?._zod.def?.error?.(e))??tl(t?.error?.(e))??tl(r.customError?.(e))??tl(r.localeError?.(e))??"Invalid input";n.message=o}if(delete n.inst,delete n.continue,!t?.reportInput)delete n.input;return n}function sl(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map";if(e instanceof File)return"file";return"unknown"}function al(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function ab(...e){let[t,r,n]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:n};return{...t}}function RK(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map((t)=>t[1])}class bC{constructor(...e){}}var xC=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,Qy,2)},enumerable:!0})},cl=S("$ZodError",xC),Ms=S("$ZodError",xC,{Parent:Error});function Us(e,t=(r)=>r.message){let r={},n=[];for(let o of e.issues)if(o.path.length>0)r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o));else n.push(t(o));return{formErrors:n,fieldErrors:r}}function $s(e,t){let r=t||function(i){return i.message},n={_errors:[]},o=(i)=>{for(let s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((a)=>o({issues:a}));else if(s.code==="invalid_key")o({issues:s.issues});else if(s.code==="invalid_element")o({issues:s.issues});else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;while(c<s.path.length){let u=s.path[c];if(c!==s.path.length-1)a[u]=a[u]||{_errors:[]};else a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s));a=a[u],c++}}};return o(e),n}function Yd(e,t){let r=t||function(i){return i.message},n={errors:[]},o=(i,s=[])=>{var a,c;for(let u of i.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map((d)=>o({issues:d},u.path));else if(u.code==="invalid_key")o({issues:u.issues},u.path);else if(u.code==="invalid_element")o({issues:u.issues},u.path);else{let d=[...s,...u.path];if(d.length===0){n.errors.push(r(u));continue}let f=n,m=0;while(m<d.length){let g=d[m],h=m===d.length-1;if(typeof g==="string")f.properties??(f.properties={}),(a=f.properties)[g]??(a[g]={errors:[]}),f=f.properties[g];else f.items??(f.items=[]),(c=f.items)[g]??(c[g]={errors:[]}),f=f.items[g];if(h)f.errors.push(r(u));m++}}};return o(e),n}function vC(e){let t=[];for(let r of e)if(typeof r==="number")t.push(`[${r}]`);else if(typeof r==="symbol")t.push(`[${JSON.stringify(String(r))}]`);else if(/[^\w$]/.test(r))t.push(`[${JSON.stringify(r)}]`);else{if(t.length)t.push(".");t.push(r)}return t.join("")}function Xd(e){let t=[],r=[...e.issues].sort((n,o)=>n.path.length-o.path.length);for(let n of r)if(t.push(`✖ ${n.message}`),n.path?.length)t.push(` → at ${vC(n.path)}`);return t.join(`
|
|
36
36
|
`)}var Qd=(e)=>(t,r,n,o)=>{let i=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new Bn;if(s.issues.length){let a=new(o?.Err??e)(s.issues.map((c)=>Sr(c,i,ut())));throw Jd(a,o?.callee),a}return s.value},bi=Qd(Ms),ef=(e)=>async(t,r,n,o)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)s=await s;if(s.issues.length){let a=new(o?.Err??e)(s.issues.map((c)=>Sr(c,i,ut())));throw Jd(a,o?.callee),a}return s.value},xi=ef(Ms),tf=(e)=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new Bn;return i.issues.length?{success:!1,error:new(e??cl)(i.issues.map((s)=>Sr(s,o,ut())))}:{success:!0,data:i.value}},So=tf(Ms),rf=(e)=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)i=await i;return i.issues.length?{success:!1,error:new e(i.issues.map((s)=>Sr(s,o,ut())))}:{success:!0,data:i.value}},Eo=rf(Ms);var wo={};lt(wo,{xid:()=>pb,uuid7:()=>NK,uuid6:()=>LK,uuid4:()=>DK,uuid:()=>vi,uppercase:()=>Mb,unicodeEmail:()=>$K,undefined:()=>Lb,ulid:()=>ub,time:()=>Ab,string:()=>Ob,rfc5322Email:()=>UK,number:()=>Ib,null:()=>Db,nanoid:()=>fb,lowercase:()=>Nb,ksuid:()=>db,ipv6:()=>bb,ipv4:()=>yb,integer:()=>Rb,html5Email:()=>MK,hostname:()=>Eb,guid:()=>gb,extendedDuration:()=>PK,emoji:()=>_b,email:()=>hb,e164:()=>wb,duration:()=>mb,domain:()=>zK,datetime:()=>kb,date:()=>Tb,cuid2:()=>lb,cuid:()=>cb,cidrv6:()=>vb,cidrv4:()=>xb,browserEmail:()=>jK,boolean:()=>Pb,bigint:()=>Cb,base64url:()=>nf,base64:()=>Sb,_emoji:()=>FK});var cb=/^[cC][^\s-]{8,}$/,lb=/^[0-9a-z]+$/,ub=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,pb=/^[0-9a-vA-V]{20}$/,db=/^[A-Za-z0-9]{27}$/,fb=/^[a-zA-Z0-9_-]{21}$/,mb=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,PK=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,gb=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,vi=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},DK=vi(4),LK=vi(6),NK=vi(7),hb=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,MK=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,UK=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,$K=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,jK=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,FK="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function _b(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var yb=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,bb=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,xb=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,vb=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Sb=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,nf=/^[A-Za-z0-9_-]*$/,Eb=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,zK=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,wb=/^\+(?:[0-9]){6,14}[0-9]$/,SC="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Tb=new RegExp(`^${SC}$`);function EC(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Ab(e){return new RegExp(`^${EC(e)}$`)}function kb(e){let t=EC({precision:e.precision}),r=["Z"];if(e.local)r.push("");if(e.offset)r.push("([+-]\\d{2}:\\d{2})");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${SC}T(?:${n})$`)}var Ob=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Cb=/^\d+n?$/,Rb=/^\d+$/,Ib=/^-?\d+(?:\.\d+)?/i,Pb=/true|false/i,Db=/null/i;var Lb=/undefined/i;var Nb=/^[^A-Z]*$/,Mb=/^[^a-z]*$/;var Xe=S("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),TC={number:"number",bigint:"bigint",object:"date"},of=S("$ZodCheckLessThan",(e,t)=>{Xe.init(e,t);let r=TC[typeof t.value];e._zod.onattach.push((n)=>{let o=n._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<i)if(t.inclusive)o.maximum=t.value;else o.exclusiveMaximum=t.value}),e._zod.check=(n)=>{if(t.inclusive?n.value<=t.value:n.value<t.value)return;n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),sf=S("$ZodCheckGreaterThan",(e,t)=>{Xe.init(e,t);let r=TC[typeof t.value];e._zod.onattach.push((n)=>{let o=n._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>i)if(t.inclusive)o.minimum=t.value;else o.exclusiveMinimum=t.value}),e._zod.check=(n)=>{if(t.inclusive?n.value>=t.value:n.value>t.value)return;n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ub=S("$ZodCheckMultipleOf",(e,t)=>{Xe.init(e,t),e._zod.onattach.push((r)=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?r.value%t.value===BigInt(0):eb(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),$b=S("$ZodCheckNumberFormat",(e,t)=>{Xe.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=ib[t.format];e._zod.onattach.push((s)=>{let a=s._zod.bag;if(a.format=t.format,a.minimum=o,a.maximum=i,r)a.pattern=Rb}),e._zod.check=(s)=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});else s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}if(a<o)s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort});if(a>i)s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inst:e})}}),jb=S("$ZodCheckBigIntFormat",(e,t)=>{Xe.init(e,t);let[r,n]=sb[t.format];e._zod.onattach.push((o)=>{let i=o._zod.bag;i.format=t.format,i.minimum=r,i.maximum=n}),e._zod.check=(o)=>{let i=o.value;if(i<r)o.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort});if(i>n)o.issues.push({origin:"bigint",input:i,code:"too_big",maximum:n,inst:e})}}),Fb=S("$ZodCheckMaxSize",(e,t)=>{Xe.init(e,t),e._zod.when=(r)=>{let n=r.value;return!vo(n)&&n.size!==void 0},e._zod.onattach.push((r)=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<n)r._zod.bag.maximum=t.maximum}),e._zod.check=(r)=>{let n=r.value;if(n.size<=t.maximum)return;r.issues.push({origin:sl(n),code:"too_big",maximum:t.maximum,input:n,inst:e,continue:!t.abort})}}),zb=S("$ZodCheckMinSize",(e,t)=>{Xe.init(e,t),e._zod.when=(r)=>{let n=r.value;return!vo(n)&&n.size!==void 0},e._zod.onattach.push((r)=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>n)r._zod.bag.minimum=t.minimum}),e._zod.check=(r)=>{let n=r.value;if(n.size>=t.minimum)return;r.issues.push({origin:sl(n),code:"too_small",minimum:t.minimum,input:n,inst:e,continue:!t.abort})}}),Bb=S("$ZodCheckSizeEquals",(e,t)=>{Xe.init(e,t),e._zod.when=(r)=>{let n=r.value;return!vo(n)&&n.size!==void 0},e._zod.onattach.push((r)=>{let n=r._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=(r)=>{let n=r.value,o=n.size;if(o===t.size)return;let i=o>t.size;r.issues.push({origin:sl(n),...i?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Hb=S("$ZodCheckMaxLength",(e,t)=>{Xe.init(e,t),e._zod.when=(r)=>{let n=r.value;return!vo(n)&&n.length!==void 0},e._zod.onattach.push((r)=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<n)r._zod.bag.maximum=t.maximum}),e._zod.check=(r)=>{let n=r.value;if(n.length<=t.maximum)return;let i=al(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),qb=S("$ZodCheckMinLength",(e,t)=>{Xe.init(e,t),e._zod.when=(r)=>{let n=r.value;return!vo(n)&&n.length!==void 0},e._zod.onattach.push((r)=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>n)r._zod.bag.minimum=t.minimum}),e._zod.check=(r)=>{let n=r.value;if(n.length>=t.minimum)return;let i=al(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Gb=S("$ZodCheckLengthEquals",(e,t)=>{Xe.init(e,t),e._zod.when=(r)=>{let n=r.value;return!vo(n)&&n.length!==void 0},e._zod.onattach.push((r)=>{let n=r._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=(r)=>{let n=r.value,o=n.length;if(o===t.length)return;let i=al(n),s=o>t.length;r.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),js=S("$ZodCheckStringFormat",(e,t)=>{var r,n;if(Xe.init(e,t),e._zod.onattach.push((o)=>{let i=o._zod.bag;if(i.format=t.format,t.pattern)i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern)}),t.pattern)(r=e._zod).check??(r.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(n=e._zod).check??(n.check=()=>{})}),Wb=S("$ZodCheckRegex",(e,t)=>{js.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Vb=S("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Nb),js.init(e,t)}),Kb=S("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Mb),js.init(e,t)}),Zb=S("$ZodCheckIncludes",(e,t)=>{Xe.init(e,t);let r=Hn(t.includes),n=new RegExp(typeof t.position==="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push((o)=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=(o)=>{if(o.value.includes(t.includes,t.position))return;o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Jb=S("$ZodCheckStartsWith",(e,t)=>{Xe.init(e,t);let r=new RegExp(`^${Hn(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=(n)=>{if(n.value.startsWith(t.prefix))return;n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Yb=S("$ZodCheckEndsWith",(e,t)=>{Xe.init(e,t);let r=new RegExp(`.*${Hn(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=(n)=>{if(n.value.endsWith(t.suffix))return;n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function wC(e,t,r){if(e.issues.length)t.issues.push(...ir(r,e.issues))}var Xb=S("$ZodCheckProperty",(e,t)=>{Xe.init(e,t),e._zod.check=(r)=>{let n=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then((o)=>wC(o,r,t.property));wC(n,r,t.property);return}}),Qb=S("$ZodCheckMimeType",(e,t)=>{Xe.init(e,t);let r=new Set(t.mime);e._zod.onattach.push((n)=>{n._zod.bag.mime=t.mime}),e._zod.check=(n)=>{if(r.has(n.value.type))return;n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e})}}),ex=S("$ZodCheckOverwrite",(e,t)=>{Xe.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class af{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
|
|
37
37
|
`).filter((i)=>i),n=Math.min(...r.map((i)=>i.length-i.trimStart().length)),o=r.map((i)=>i.slice(n)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of o)this.content.push(i)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[""]).map((o)=>` ${o}`)];return new e(...t,n.join(`
|
|
@@ -60,7 +60,7 @@ import{createRequire as DW}from"node:module";var wW=Object.create;var{getPrototy
|
|
|
60
60
|
path: iss.path ? [${_i(T)}, ...iss.path] : [${_i(T)}]
|
|
61
61
|
})));`),m.write(`newResult[${_i(T)}] = ${w}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");let b=m.compile();return(T,w)=>b(f,T,w)},o,i=Ls,s=!el.jitless,c=s&&rb.value,u=t.catchall,d;e._zod.parse=(f,m)=>{d??(d=r.value);let g=f.value;if(!i(g))return f.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),f;let h=[];if(s&&c&&m?.async===!1&&m.jitless!==!0){if(!o)o=n(t.shape);f=o(f,m)}else{f.value={};let w=d.shape;for(let k of d.keys){let P=w[k],te=P._zod.run({value:g[k],issues:[]},m),oe=P._zod.optin==="optional"&&P._zod.optout==="optional";if(te instanceof Promise)h.push(te.then((Oe)=>oe?OC(Oe,f,k,g):cf(Oe,f,k)));else if(oe)OC(te,f,k,g);else cf(te,f,k)}}if(!u)return h.length?Promise.all(h).then(()=>f):f;let _=[],y=d.keySet,b=u._zod,T=b.def.type;for(let w of Object.keys(g)){if(y.has(w))continue;if(T==="never"){_.push(w);continue}let k=b.run({value:g[w],issues:[]},m);if(k instanceof Promise)h.push(k.then((P)=>cf(P,f,w)));else cf(k,f,w)}if(_.length)f.issues.push({code:"unrecognized_keys",keys:_,input:g,inst:e});if(!h.length)return f;return Promise.all(h).then(()=>f)}});function CC(e,t,r,n){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((o)=>o.issues.map((i)=>Sr(i,n,ut())))}),t}var dl=S("$ZodUnion",(e,t)=>{ie.init(e,t),Pe(e._zod,"optin",()=>t.options.some((r)=>r._zod.optin==="optional")?"optional":void 0),Pe(e._zod,"optout",()=>t.options.some((r)=>r._zod.optout==="optional")?"optional":void 0),Pe(e._zod,"values",()=>{if(t.options.every((r)=>r._zod.values))return new Set(t.options.flatMap((r)=>Array.from(r._zod.values)));return}),Pe(e._zod,"pattern",()=>{if(t.options.every((r)=>r._zod.pattern)){let r=t.options.map((n)=>n._zod.pattern);return new RegExp(`^(${r.map((n)=>ol(n.source)).join("|")})$`)}return}),e._zod.parse=(r,n)=>{let o=!1,i=[];for(let s of t.options){let a=s._zod.run({value:r.value,issues:[]},n);if(a instanceof Promise)i.push(a),o=!0;else{if(a.issues.length===0)return a;i.push(a)}}if(!o)return CC(i,r,e,n);return Promise.all(i).then((s)=>CC(s,r,e,n))}}),jf=S("$ZodDiscriminatedUnion",(e,t)=>{dl.init(e,t);let r=e._zod.parse;Pe(e._zod,"propValues",()=>{let o={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[a,c]of Object.entries(s)){if(!o[a])o[a]=new Set;for(let u of c)o[a].add(u)}}return o});let n=nl(()=>{let o=t.options,i=new Map;for(let s of o){let a=s._zod.propValues[t.discriminator];if(!a||a.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let c of a){if(i.has(c))throw Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,s)}}return i});e._zod.parse=(o,i)=>{let s=o.value;if(!Ls(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let a=n.value.get(s?.[t.discriminator]);if(a)return a._zod.run(o,i);if(t.unionFallback)return r(o,i);return o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),o}}),Ff=S("$ZodIntersection",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);if(i instanceof Promise||s instanceof Promise)return Promise.all([i,s]).then(([c,u])=>RC(r,c,u));return RC(r,i,s)}});function rx(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Ns(e)&&Ns(t)){let r=Object.keys(t),n=Object.keys(e).filter((i)=>r.indexOf(i)!==-1),o={...e,...t};for(let i of n){let s=rx(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],s=rx(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function RC(e,t,r){if(t.issues.length)e.issues.push(...t.issues);if(r.issues.length)e.issues.push(...r.issues);if(yi(e))return e;let n=rx(t.value,r.value);if(!n.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}var Ao=S("$ZodTuple",(e,t)=>{ie.init(e,t);let r=t.items,n=r.length-[...r].reverse().findIndex((o)=>o._zod.optin!=="optional");e._zod.parse=(o,i)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let a=[];if(!t.rest){let u=s.length>r.length,d=s.length<n-1;if(u||d)return o.issues.push({input:s,inst:e,origin:"array",...u?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length}}),o}let c=-1;for(let u of r){if(c++,c>=s.length){if(c>=n)continue}let d=u._zod.run({value:s[c],issues:[]},i);if(d instanceof Promise)a.push(d.then((f)=>lf(f,o,c)));else lf(d,o,c)}if(t.rest){let u=s.slice(r.length);for(let d of u){c++;let f=t.rest._zod.run({value:d,issues:[]},i);if(f instanceof Promise)a.push(f.then((m)=>lf(m,o,c)));else lf(f,o,c)}}if(a.length)return Promise.all(a).then(()=>o);return o}});function lf(e,t,r){if(e.issues.length)t.issues.push(...ir(r,e.issues));t.value[r]=e.value}var zf=S("$ZodRecord",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Ns(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let i=[];if(t.keyType._zod.values){let s=t.keyType._zod.values;r.value={};for(let c of s)if(typeof c==="string"||typeof c==="number"||typeof c==="symbol"){let u=t.valueType._zod.run({value:o[c],issues:[]},n);if(u instanceof Promise)i.push(u.then((d)=>{if(d.issues.length)r.issues.push(...ir(c,d.issues));r.value[c]=d.value}));else{if(u.issues.length)r.issues.push(...ir(c,u.issues));r.value[c]=u.value}}let a;for(let c in o)if(!s.has(c))a=a??[],a.push(c);if(a&&a.length>0)r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{r.value={};for(let s of Reflect.ownKeys(o)){if(s==="__proto__")continue;let a=t.keyType._zod.run({value:s,issues:[]},n);if(a instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map((u)=>Sr(u,n,ut())),input:s,path:[s],inst:e}),r.value[a.value]=a.value;continue}let c=t.valueType._zod.run({value:o[s],issues:[]},n);if(c instanceof Promise)i.push(c.then((u)=>{if(u.issues.length)r.issues.push(...ir(s,u.issues));r.value[a.value]=u.value}));else{if(c.issues.length)r.issues.push(...ir(s,c.issues));r.value[a.value]=c.value}}}if(i.length)return Promise.all(i).then(()=>r);return r}}),Bf=S("$ZodMap",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:o,inst:e}),r;let i=[];r.value=new Map;for(let[s,a]of o){let c=t.keyType._zod.run({value:s,issues:[]},n),u=t.valueType._zod.run({value:a,issues:[]},n);if(c instanceof Promise||u instanceof Promise)i.push(Promise.all([c,u]).then(([d,f])=>{IC(d,f,r,s,o,e,n)}));else IC(c,u,r,s,o,e,n)}if(i.length)return Promise.all(i).then(()=>r);return r}});function IC(e,t,r,n,o,i,s){if(e.issues.length)if(il.has(typeof n))r.issues.push(...ir(n,e.issues));else r.issues.push({origin:"map",code:"invalid_key",input:o,inst:i,issues:e.issues.map((a)=>Sr(a,s,ut()))});if(t.issues.length)if(il.has(typeof n))r.issues.push(...ir(n,t.issues));else r.issues.push({origin:"map",code:"invalid_element",input:o,inst:i,key:n,issues:t.issues.map((a)=>Sr(a,s,ut()))});r.value.set(e.value,t.value)}var Hf=S("$ZodSet",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let s of o){let a=t.valueType._zod.run({value:s,issues:[]},n);if(a instanceof Promise)i.push(a.then((c)=>PC(c,r)));else PC(a,r)}if(i.length)return Promise.all(i).then(()=>r);return r}});function PC(e,t){if(e.issues.length)t.issues.push(...e.issues);t.value.add(e.value)}var qf=S("$ZodEnum",(e,t)=>{ie.init(e,t);let r=rl(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter((n)=>il.has(typeof n)).map((n)=>typeof n==="string"?Hn(n):n.toString()).join("|")})$`),e._zod.parse=(n,o)=>{let i=n.value;if(e._zod.values.has(i))return n;return n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),Gf=S("$ZodLiteral",(e,t)=>{ie.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map((r)=>typeof r==="string"?Hn(r):r?r.toString():String(r)).join("|")})$`),e._zod.parse=(r,n)=>{let o=r.value;if(e._zod.values.has(o))return r;return r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),Wf=S("$ZodFile",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(o instanceof File)return r;return r.issues.push({expected:"file",code:"invalid_type",input:o,inst:e}),r}}),Bs=S("$ZodTransform",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then((s)=>(r.value=s,r));if(o instanceof Promise)throw new Bn;return r.value=o,r}}),Vf=S("$ZodOptional",(e,t)=>{ie.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Pe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Pe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ol(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional")return t.innerType._zod.run(r,n);if(r.value===void 0)return r;return t.innerType._zod.run(r,n)}}),Kf=S("$ZodNullable",(e,t)=>{ie.init(e,t),Pe(e._zod,"optin",()=>t.innerType._zod.optin),Pe(e._zod,"optout",()=>t.innerType._zod.optout),Pe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ol(r.source)}|null)$`):void 0}),Pe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>{if(r.value===null)return r;return t.innerType._zod.run(r,n)}}),Zf=S("$ZodDefault",(e,t)=>{ie.init(e,t),e._zod.optin="optional",Pe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>DC(i,t));return DC(o,t)}});function DC(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var Jf=S("$ZodPrefault",(e,t)=>{ie.init(e,t),e._zod.optin="optional",Pe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,n)}}),Yf=S("$ZodNonOptional",(e,t)=>{ie.init(e,t),Pe(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter((n)=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>LC(i,e));return LC(o,e)}});function LC(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}var Xf=S("$ZodSuccess",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>(r.value=i.issues.length===0,r));return r.value=o.issues.length===0,r}}),Qf=S("$ZodCatch",(e,t)=>{ie.init(e,t),e._zod.optin="optional",Pe(e._zod,"optout",()=>t.innerType._zod.optout),Pe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>{if(r.value=i.value,i.issues.length)r.value=t.catchValue({...r,error:{issues:i.issues.map((s)=>Sr(s,n,ut()))},input:r.value}),r.issues=[];return r});if(r.value=o.value,o.issues.length)r.value=t.catchValue({...r,error:{issues:o.issues.map((i)=>Sr(i,n,ut()))},input:r.value}),r.issues=[];return r}}),em=S("$ZodNaN",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{if(typeof r.value!=="number"||!Number.isNaN(r.value))return r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r;return r}}),Hs=S("$ZodPipe",(e,t)=>{ie.init(e,t),Pe(e._zod,"values",()=>t.in._zod.values),Pe(e._zod,"optin",()=>t.in._zod.optin),Pe(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,n)=>{let o=t.in._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>NC(i,t,n));return NC(o,t,n)}});function NC(e,t,r){if(yi(e))return e;return t.out._zod.run({value:e.value,issues:e.issues},r)}var tm=S("$ZodReadonly",(e,t)=>{ie.init(e,t),Pe(e._zod,"propValues",()=>t.innerType._zod.propValues),Pe(e._zod,"values",()=>t.innerType._zod.values),Pe(e._zod,"optin",()=>t.innerType._zod.optin),Pe(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then(MC);return MC(o)}});function MC(e){return e.value=Object.freeze(e.value),e}var rm=S("$ZodTemplateLiteral",(e,t)=>{ie.init(e,t);let r=[];for(let n of t.parts)if(n instanceof ie){if(!n._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let o=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!o)throw Error(`Invalid template literal part: ${n._zod.traits}`);let i=o.startsWith("^")?1:0,s=o.endsWith("$")?o.length-1:o.length;r.push(o.slice(i,s))}else if(n===null||nb.has(typeof n))r.push(Hn(`${n}`));else throw Error(`Invalid template literal part: ${n}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(n,o)=>{if(typeof n.value!=="string")return n.issues.push({input:n.value,inst:e,expected:"template_literal",code:"invalid_type"}),n;if(e._zod.pattern.lastIndex=0,!e._zod.pattern.test(n.value))return n.issues.push({input:n.value,inst:e,code:"invalid_format",format:"template_literal",pattern:e._zod.pattern.source}),n;return n}}),nm=S("$ZodPromise",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>Promise.resolve(r.value).then((o)=>t.innerType._zod.run({value:o,issues:[]},n))}),om=S("$ZodLazy",(e,t)=>{ie.init(e,t),Pe(e._zod,"innerType",()=>t.getter()),Pe(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),Pe(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),Pe(e._zod,"optin",()=>e._zod.innerType._zod.optin),Pe(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),im=S("$ZodCustom",(e,t)=>{Xe.init(e,t),ie.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=(r)=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then((i)=>UC(i,r,n,e));UC(o,r,n,e);return}});function UC(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};if(n._zod.def.params)o.params=n._zod.def.params;t.issues.push(ab(o))}}var qs={};lt(qs,{zhTW:()=>Gx,zhCN:()=>qx,vi:()=>Hx,ur:()=>Bx,ua:()=>zx,tr:()=>Fx,th:()=>jx,ta:()=>$x,sv:()=>Ux,sl:()=>Mx,ru:()=>Nx,pt:()=>Lx,ps:()=>Px,pl:()=>Dx,ota:()=>Ix,no:()=>Rx,nl:()=>Cx,ms:()=>Ox,mk:()=>kx,ko:()=>Ax,kh:()=>Tx,ja:()=>wx,it:()=>Ex,id:()=>Sx,hu:()=>vx,he:()=>xx,frCA:()=>bx,fr:()=>yx,fi:()=>_x,fa:()=>hx,es:()=>gx,eo:()=>mx,en:()=>fl,de:()=>fx,cs:()=>dx,ca:()=>px,be:()=>ux,az:()=>lx,ar:()=>cx});var BK=()=>{let e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return(o)=>{switch(o.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${o.expected}، ولكن تم إدخال ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${j(o.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return` أكبر من اللازم: يفترض أن تكون ${o.origin??"القيمة"} ${i} ${o.maximum.toString()} ${s.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${o.origin??"القيمة"} ${i} ${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`أصغر من اللازم: يفترض لـ ${o.origin} أن يكون ${i} ${o.minimum.toString()} ${s.unit}`;return`أصغر من اللازم: يفترض لـ ${o.origin} أن يكون ${i} ${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${o.prefix}"`;if(i.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${i.suffix}"`;if(i.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${i.includes}"`;if(i.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${i.pattern}`;return`${n[i.format]??o.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${o.divisor}`;case"unrecognized_keys":return`معرف${o.keys.length>1?"ات":""} غريب${o.keys.length>1?"ة":""}: ${O(o.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${o.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${o.origin}`;default:return"مدخل غير مقبول"}}};function cx(){return{localeError:BK()}}var HK=()=>{let e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(o)=>{switch(o.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${o.expected}, daxil olan ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Yanlış dəyər: gözlənilən ${j(o.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Çox böyük: gözlənilən ${o.origin??"dəyər"} ${i}${o.maximum.toString()} ${s.unit??"element"}`;return`Çox böyük: gözlənilən ${o.origin??"dəyər"} ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Çox kiçik: gözlənilən ${o.origin} ${i}${o.minimum.toString()} ${s.unit}`;return`Çox kiçik: gözlənilən ${o.origin} ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Yanlış mətn: "${i.prefix}" ilə başlamalıdır`;if(i.format==="ends_with")return`Yanlış mətn: "${i.suffix}" ilə bitməlidir`;if(i.format==="includes")return`Yanlış mətn: "${i.includes}" daxil olmalıdır`;if(i.format==="regex")return`Yanlış mətn: ${i.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${n[i.format]??o.format}`}case"not_multiple_of":return`Yanlış ədəd: ${o.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${o.keys.length>1?"lar":""}: ${O(o.keys,", ")}`;case"invalid_key":return`${o.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${o.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function lx(){return{localeError:HK()}}function zC(e,t,r,n){let o=Math.abs(e),i=o%10,s=o%100;if(s>=11&&s<=19)return n;if(i===1)return t;if(i>=2&&i<=4)return r;return n}var qK=()=>{let e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"лік";case"object":{if(Array.isArray(o))return"масіў";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return(o)=>{switch(o.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${o.expected}, атрымана ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Няправільны ўвод: чакалася ${j(o.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s){let a=Number(o.maximum),c=zC(a,s.unit.one,s.unit.few,s.unit.many);return`Занадта вялікі: чакалася, што ${o.origin??"значэнне"} павінна ${s.verb} ${i}${o.maximum.toString()} ${c}`}return`Занадта вялікі: чакалася, што ${o.origin??"значэнне"} павінна быць ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s){let a=Number(o.minimum),c=zC(a,s.unit.one,s.unit.few,s.unit.many);return`Занадта малы: чакалася, што ${o.origin} павінна ${s.verb} ${i}${o.minimum.toString()} ${c}`}return`Занадта малы: чакалася, што ${o.origin} павінна быць ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${i.prefix}"`;if(i.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${i.suffix}"`;if(i.format==="includes")return`Няправільны радок: павінен змяшчаць "${i.includes}"`;if(i.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${i.pattern}`;return`Няправільны ${n[i.format]??o.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${o.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${o.keys.length>1?"ключы":"ключ"}: ${O(o.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${o.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${o.origin}`;default:return"Няправільны ўвод"}}};function ux(){return{localeError:qK()}}var GK=()=>{let e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(o)=>{switch(o.code){case"invalid_type":return`Tipus invàlid: s'esperava ${o.expected}, s'ha rebut ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Valor invàlid: s'esperava ${j(o.values[0])}`;return`Opció invàlida: s'esperava una de ${O(o.values," o ")}`;case"too_big":{let i=o.inclusive?"com a màxim":"menys de",s=t(o.origin);if(s)return`Massa gran: s'esperava que ${o.origin??"el valor"} contingués ${i} ${o.maximum.toString()} ${s.unit??"elements"}`;return`Massa gran: s'esperava que ${o.origin??"el valor"} fos ${i} ${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?"com a mínim":"més de",s=t(o.origin);if(s)return`Massa petit: s'esperava que ${o.origin} contingués ${i} ${o.minimum.toString()} ${s.unit}`;return`Massa petit: s'esperava que ${o.origin} fos ${i} ${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Format invàlid: ha de començar amb "${i.prefix}"`;if(i.format==="ends_with")return`Format invàlid: ha d'acabar amb "${i.suffix}"`;if(i.format==="includes")return`Format invàlid: ha d'incloure "${i.includes}"`;if(i.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${i.pattern}`;return`Format invàlid per a ${n[i.format]??o.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${o.divisor}`;case"unrecognized_keys":return`Clau${o.keys.length>1?"s":""} no reconeguda${o.keys.length>1?"s":""}: ${O(o.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${o.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${o.origin}`;default:return"Entrada invàlida"}}};function px(){return{localeError:GK()}}var WK=()=>{let e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(o))return"pole";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return(o)=>{switch(o.code){case"invalid_type":return`Neplatný vstup: očekáváno ${o.expected}, obdrženo ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Neplatný vstup: očekáváno ${j(o.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Hodnota je příliš velká: ${o.origin??"hodnota"} musí mít ${i}${o.maximum.toString()} ${s.unit??"prvků"}`;return`Hodnota je příliš velká: ${o.origin??"hodnota"} musí být ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Hodnota je příliš malá: ${o.origin??"hodnota"} musí mít ${i}${o.minimum.toString()} ${s.unit??"prvků"}`;return`Hodnota je příliš malá: ${o.origin??"hodnota"} musí být ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Neplatný řetězec: musí začínat na "${i.prefix}"`;if(i.format==="ends_with")return`Neplatný řetězec: musí končit na "${i.suffix}"`;if(i.format==="includes")return`Neplatný řetězec: musí obsahovat "${i.includes}"`;if(i.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${i.pattern}`;return`Neplatný formát ${n[i.format]??o.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${o.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${O(o.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${o.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${o.origin}`;default:return"Neplatný vstup"}}};function dx(){return{localeError:WK()}}var VK=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"Zahl";case"object":{if(Array.isArray(o))return"Array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return(o)=>{switch(o.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${o.expected}, erhalten ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Ungültige Eingabe: erwartet ${j(o.values[0])}`;return`Ungültige Option: erwartet eine von ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Zu groß: erwartet, dass ${o.origin??"Wert"} ${i}${o.maximum.toString()} ${s.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${o.origin??"Wert"} ${i}${o.maximum.toString()} ist`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Zu klein: erwartet, dass ${o.origin} ${i}${o.minimum.toString()} ${s.unit} hat`;return`Zu klein: erwartet, dass ${o.origin} ${i}${o.minimum.toString()} ist`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Ungültiger String: muss mit "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ungültiger String: muss mit "${i.suffix}" enden`;if(i.format==="includes")return`Ungültiger String: muss "${i.includes}" enthalten`;if(i.format==="regex")return`Ungültiger String: muss dem Muster ${i.pattern} entsprechen`;return`Ungültig: ${n[i.format]??o.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${o.divisor} sein`;case"unrecognized_keys":return`${o.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${O(o.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${o.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${o.origin}`;default:return"Ungültige Eingabe"}}};function fx(){return{localeError:VK()}}var KK=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},ZK=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(n)=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${KK(n.input)}`;case"invalid_value":if(n.values.length===1)return`Invalid input: expected ${j(n.values[0])}`;return`Invalid option: expected one of ${O(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",i=t(n.origin);if(i)return`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${i.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",i=t(n.origin);if(i)return`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${i.unit}`;return`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Invalid string: must start with "${o.prefix}"`;if(o.format==="ends_with")return`Invalid string: must end with "${o.suffix}"`;if(o.format==="includes")return`Invalid string: must include "${o.includes}"`;if(o.format==="regex")return`Invalid string: must match pattern ${o.pattern}`;return`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${O(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function fl(){return{localeError:ZK()}}var JK=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},YK=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return(n)=>{switch(n.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${n.expected}, riceviĝis ${JK(n.input)}`;case"invalid_value":if(n.values.length===1)return`Nevalida enigo: atendiĝis ${j(n.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${O(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",i=t(n.origin);if(i)return`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${i.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",i=t(n.origin);if(i)return`Tro malgranda: atendiĝis ke ${n.origin} havu ${o}${n.minimum.toString()} ${i.unit}`;return`Tro malgranda: atendiĝis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${o.prefix}"`;if(o.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${o.suffix}"`;if(o.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${o.includes}"`;if(o.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`;return`Nevalida ${r[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} ŝlosilo${n.keys.length>1?"j":""}: ${O(n.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function mx(){return{localeError:YK()}}var XK=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"número";case"object":{if(Array.isArray(o))return"arreglo";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype)return o.constructor.name}}return i},n={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(o)=>{switch(o.code){case"invalid_type":return`Entrada inválida: se esperaba ${o.expected}, recibido ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Entrada inválida: se esperaba ${j(o.values[0])}`;return`Opción inválida: se esperaba una de ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Demasiado grande: se esperaba que ${o.origin??"valor"} tuviera ${i}${o.maximum.toString()} ${s.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${o.origin??"valor"} fuera ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Demasiado pequeño: se esperaba que ${o.origin} tuviera ${i}${o.minimum.toString()} ${s.unit}`;return`Demasiado pequeño: se esperaba que ${o.origin} fuera ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Cadena inválida: debe comenzar con "${i.prefix}"`;if(i.format==="ends_with")return`Cadena inválida: debe terminar en "${i.suffix}"`;if(i.format==="includes")return`Cadena inválida: debe incluir "${i.includes}"`;if(i.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${i.pattern}`;return`Inválido ${n[i.format]??o.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${o.divisor}`;case"unrecognized_keys":return`Llave${o.keys.length>1?"s":""} desconocida${o.keys.length>1?"s":""}: ${O(o.keys,", ")}`;case"invalid_key":return`Llave inválida en ${o.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${o.origin}`;default:return"Entrada inválida"}}};function gx(){return{localeError:XK()}}var QK=()=>{let e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"عدد";case"object":{if(Array.isArray(o))return"آرایه";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return(o)=>{switch(o.code){case"invalid_type":return`ورودی نامعتبر: میبایست ${o.expected} میبود، ${r(o.input)} دریافت شد`;case"invalid_value":if(o.values.length===1)return`ورودی نامعتبر: میبایست ${j(o.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${O(o.values,"|")} میبود`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`خیلی بزرگ: ${o.origin??"مقدار"} باید ${i}${o.maximum.toString()} ${s.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${o.origin??"مقدار"} باید ${i}${o.maximum.toString()} باشد`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`خیلی کوچک: ${o.origin} باید ${i}${o.minimum.toString()} ${s.unit} باشد`;return`خیلی کوچک: ${o.origin} باید ${i}${o.minimum.toString()} باشد`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`رشته نامعتبر: باید با "${i.prefix}" شروع شود`;if(i.format==="ends_with")return`رشته نامعتبر: باید با "${i.suffix}" تمام شود`;if(i.format==="includes")return`رشته نامعتبر: باید شامل "${i.includes}" باشد`;if(i.format==="regex")return`رشته نامعتبر: باید با الگوی ${i.pattern} مطابقت داشته باشد`;return`${n[i.format]??o.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${o.divisor} باشد`;case"unrecognized_keys":return`کلید${o.keys.length>1?"های":""} ناشناس: ${O(o.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${o.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${o.origin}`;default:return"ورودی نامعتبر"}}};function hx(){return{localeError:QK()}}var eZ=()=>{let e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return(o)=>{switch(o.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${o.expected}, oli ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Virheellinen syöte: täytyy olla ${j(o.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Liian suuri: ${s.subject} täytyy olla ${i}${o.maximum.toString()} ${s.unit}`.trim();return`Liian suuri: arvon täytyy olla ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Liian pieni: ${s.subject} täytyy olla ${i}${o.minimum.toString()} ${s.unit}`.trim();return`Liian pieni: arvon täytyy olla ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${i.prefix}"`;if(i.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${i.suffix}"`;if(i.format==="includes")return`Virheellinen syöte: täytyy sisältää "${i.includes}"`;if(i.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${i.pattern}`;return`Virheellinen ${n[i.format]??o.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${o.divisor} monikerta`;case"unrecognized_keys":return`${o.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${O(o.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function _x(){return{localeError:eZ()}}var tZ=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"nombre";case"object":{if(Array.isArray(o))return"tableau";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(o)=>{switch(o.code){case"invalid_type":return`Entrée invalide : ${o.expected} attendu, ${r(o.input)} reçu`;case"invalid_value":if(o.values.length===1)return`Entrée invalide : ${j(o.values[0])} attendu`;return`Option invalide : une valeur parmi ${O(o.values,"|")} attendue`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Trop grand : ${o.origin??"valeur"} doit ${s.verb} ${i}${o.maximum.toString()} ${s.unit??"élément(s)"}`;return`Trop grand : ${o.origin??"valeur"} doit être ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Trop petit : ${o.origin} doit ${s.verb} ${i}${o.minimum.toString()} ${s.unit}`;return`Trop petit : ${o.origin} doit être ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${i.pattern}`;return`${n[i.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${o.divisor}`;case"unrecognized_keys":return`Clé${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${O(o.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${o.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entrée invalide"}}};function yx(){return{localeError:tZ()}}var rZ=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(o)=>{switch(o.code){case"invalid_type":return`Entrée invalide : attendu ${o.expected}, reçu ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Entrée invalide : attendu ${j(o.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"≤":"<",s=t(o.origin);if(s)return`Trop grand : attendu que ${o.origin??"la valeur"} ait ${i}${o.maximum.toString()} ${s.unit}`;return`Trop grand : attendu que ${o.origin??"la valeur"} soit ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?"≥":">",s=t(o.origin);if(s)return`Trop petit : attendu que ${o.origin} ait ${i}${o.minimum.toString()} ${s.unit}`;return`Trop petit : attendu que ${o.origin} soit ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au motif ${i.pattern}`;return`${n[i.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${o.divisor}`;case"unrecognized_keys":return`Clé${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${O(o.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${o.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entrée invalide"}}};function bx(){return{localeError:rZ()}}var nZ=()=>{let e={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"קלט",email:"כתובת אימייל",url:"כתובת רשת",emoji:"אימוג'י",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"תאריך וזמן ISO",date:"תאריך ISO",time:"זמן ISO",duration:"משך זמן ISO",ipv4:"כתובת IPv4",ipv6:"כתובת IPv6",cidrv4:"טווח IPv4",cidrv6:"טווח IPv6",base64:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"};return(o)=>{switch(o.code){case"invalid_type":return`קלט לא תקין: צריך ${o.expected}, התקבל ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`קלט לא תקין: צריך ${j(o.values[0])}`;return`קלט לא תקין: צריך אחת מהאפשרויות ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`גדול מדי: ${o.origin??"value"} צריך להיות ${i}${o.maximum.toString()} ${s.unit??"elements"}`;return`גדול מדי: ${o.origin??"value"} צריך להיות ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`קטן מדי: ${o.origin} צריך להיות ${i}${o.minimum.toString()} ${s.unit}`;return`קטן מדי: ${o.origin} צריך להיות ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`מחרוזת לא תקינה: חייבת להתחיל ב"${i.prefix}"`;if(i.format==="ends_with")return`מחרוזת לא תקינה: חייבת להסתיים ב "${i.suffix}"`;if(i.format==="includes")return`מחרוזת לא תקינה: חייבת לכלול "${i.includes}"`;if(i.format==="regex")return`מחרוזת לא תקינה: חייבת להתאים לתבנית ${i.pattern}`;return`${n[i.format]??o.format} לא תקין`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${o.divisor}`;case"unrecognized_keys":return`מפתח${o.keys.length>1?"ות":""} לא מזוה${o.keys.length>1?"ים":"ה"}: ${O(o.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${o.origin}`;case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${o.origin}`;default:return"קלט לא תקין"}}};function xx(){return{localeError:nZ()}}var oZ=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"szám";case"object":{if(Array.isArray(o))return"tömb";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return(o)=>{switch(o.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${o.expected}, a kapott érték ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Érvénytelen bemenet: a várt érték ${j(o.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Túl nagy: ${o.origin??"érték"} mérete túl nagy ${i}${o.maximum.toString()} ${s.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${o.origin??"érték"} túl nagy: ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Túl kicsi: a bemeneti érték ${o.origin} mérete túl kicsi ${i}${o.minimum.toString()} ${s.unit}`;return`Túl kicsi: a bemeneti érték ${o.origin} túl kicsi ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Érvénytelen string: "${i.prefix}" értékkel kell kezdődnie`;if(i.format==="ends_with")return`Érvénytelen string: "${i.suffix}" értékkel kell végződnie`;if(i.format==="includes")return`Érvénytelen string: "${i.includes}" értéket kell tartalmaznia`;if(i.format==="regex")return`Érvénytelen string: ${i.pattern} mintának kell megfelelnie`;return`Érvénytelen ${n[i.format]??o.format}`}case"not_multiple_of":return`Érvénytelen szám: ${o.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${o.keys.length>1?"s":""}: ${O(o.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${o.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${o.origin}`;default:return"Érvénytelen bemenet"}}};function vx(){return{localeError:oZ()}}var iZ=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return(o)=>{switch(o.code){case"invalid_type":return`Input tidak valid: diharapkan ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Input tidak valid: diharapkan ${j(o.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Terlalu besar: diharapkan ${o.origin??"value"} memiliki ${i}${o.maximum.toString()} ${s.unit??"elemen"}`;return`Terlalu besar: diharapkan ${o.origin??"value"} menjadi ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Terlalu kecil: diharapkan ${o.origin} memiliki ${i}${o.minimum.toString()} ${s.unit}`;return`Terlalu kecil: diharapkan ${o.origin} menjadi ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`String tidak valid: harus dimulai dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak valid: harus berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak valid: harus menyertakan "${i.includes}"`;if(i.format==="regex")return`String tidak valid: harus sesuai pola ${i.pattern}`;return`${n[i.format]??o.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${o.keys.length>1?"s":""}: ${O(o.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${o.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${o.origin}`;default:return"Input tidak valid"}}};function Sx(){return{localeError:iZ()}}var sZ=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"numero";case"object":{if(Array.isArray(o))return"vettore";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return(o)=>{switch(o.code){case"invalid_type":return`Input non valido: atteso ${o.expected}, ricevuto ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Input non valido: atteso ${j(o.values[0])}`;return`Opzione non valida: atteso uno tra ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Troppo grande: ${o.origin??"valore"} deve avere ${i}${o.maximum.toString()} ${s.unit??"elementi"}`;return`Troppo grande: ${o.origin??"valore"} deve essere ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Troppo piccolo: ${o.origin} deve avere ${i}${o.minimum.toString()} ${s.unit}`;return`Troppo piccolo: ${o.origin} deve essere ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Stringa non valida: deve iniziare con "${i.prefix}"`;if(i.format==="ends_with")return`Stringa non valida: deve terminare con "${i.suffix}"`;if(i.format==="includes")return`Stringa non valida: deve includere "${i.includes}"`;if(i.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${i.pattern}`;return`Invalid ${n[i.format]??o.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${o.divisor}`;case"unrecognized_keys":return`Chiav${o.keys.length>1?"i":"e"} non riconosciut${o.keys.length>1?"e":"a"}: ${O(o.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${o.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${o.origin}`;default:return"Input non valido"}}};function Ex(){return{localeError:sZ()}}var aZ=()=>{let e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"数値";case"object":{if(Array.isArray(o))return"配列";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return(o)=>{switch(o.code){case"invalid_type":return`無効な入力: ${o.expected}が期待されましたが、${r(o.input)}が入力されました`;case"invalid_value":if(o.values.length===1)return`無効な入力: ${j(o.values[0])}が期待されました`;return`無効な選択: ${O(o.values,"、")}のいずれかである必要があります`;case"too_big":{let i=o.inclusive?"以下である":"より小さい",s=t(o.origin);if(s)return`大きすぎる値: ${o.origin??"値"}は${o.maximum.toString()}${s.unit??"要素"}${i}必要があります`;return`大きすぎる値: ${o.origin??"値"}は${o.maximum.toString()}${i}必要があります`}case"too_small":{let i=o.inclusive?"以上である":"より大きい",s=t(o.origin);if(s)return`小さすぎる値: ${o.origin}は${o.minimum.toString()}${s.unit}${i}必要があります`;return`小さすぎる値: ${o.origin}は${o.minimum.toString()}${i}必要があります`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`無効な文字列: "${i.prefix}"で始まる必要があります`;if(i.format==="ends_with")return`無効な文字列: "${i.suffix}"で終わる必要があります`;if(i.format==="includes")return`無効な文字列: "${i.includes}"を含む必要があります`;if(i.format==="regex")return`無効な文字列: パターン${i.pattern}に一致する必要があります`;return`無効な${n[i.format]??o.format}`}case"not_multiple_of":return`無効な数値: ${o.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${o.keys.length>1?"群":""}: ${O(o.keys,"、")}`;case"invalid_key":return`${o.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${o.origin}内の無効な値`;default:return"無効な入力"}}};function wx(){return{localeError:aZ()}}var cZ=()=>{let e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(o))return"អារេ (Array)";if(o===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return(o)=>{switch(o.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${o.expected} ប៉ុន្តែទទួលបាន ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${j(o.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`ធំពេក៖ ត្រូវការ ${o.origin??"តម្លៃ"} ${i} ${o.maximum.toString()} ${s.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${o.origin??"តម្លៃ"} ${i} ${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`តូចពេក៖ ត្រូវការ ${o.origin} ${i} ${o.minimum.toString()} ${s.unit}`;return`តូចពេក៖ ត្រូវការ ${o.origin} ${i} ${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${i.prefix}"`;if(i.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${i.suffix}"`;if(i.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${i.includes}"`;if(i.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${i.pattern}`;return`មិនត្រឹមត្រូវ៖ ${n[i.format]??o.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${o.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${O(o.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${o.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${o.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function Tx(){return{localeError:cZ()}}var lZ=()=>{let e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return(o)=>{switch(o.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${o.expected}, 받은 타입은 ${r(o.input)}입니다`;case"invalid_value":if(o.values.length===1)return`잘못된 입력: 값은 ${j(o.values[0])} 이어야 합니다`;return`잘못된 옵션: ${O(o.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let i=o.inclusive?"이하":"미만",s=i==="미만"?"이어야 합니다":"여야 합니다",a=t(o.origin),c=a?.unit??"요소";if(a)return`${o.origin??"값"}이 너무 큽니다: ${o.maximum.toString()}${c} ${i}${s}`;return`${o.origin??"값"}이 너무 큽니다: ${o.maximum.toString()} ${i}${s}`}case"too_small":{let i=o.inclusive?"이상":"초과",s=i==="이상"?"이어야 합니다":"여야 합니다",a=t(o.origin),c=a?.unit??"요소";if(a)return`${o.origin??"값"}이 너무 작습니다: ${o.minimum.toString()}${c} ${i}${s}`;return`${o.origin??"값"}이 너무 작습니다: ${o.minimum.toString()} ${i}${s}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`잘못된 문자열: "${i.prefix}"(으)로 시작해야 합니다`;if(i.format==="ends_with")return`잘못된 문자열: "${i.suffix}"(으)로 끝나야 합니다`;if(i.format==="includes")return`잘못된 문자열: "${i.includes}"을(를) 포함해야 합니다`;if(i.format==="regex")return`잘못된 문자열: 정규식 ${i.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${n[i.format]??o.format}`}case"not_multiple_of":return`잘못된 숫자: ${o.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${O(o.keys,", ")}`;case"invalid_key":return`잘못된 키: ${o.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${o.origin}`;default:return"잘못된 입력"}}};function Ax(){return{localeError:lZ()}}var uZ=()=>{let e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"број";case"object":{if(Array.isArray(o))return"низа";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return(o)=>{switch(o.code){case"invalid_type":return`Грешен внес: се очекува ${o.expected}, примено ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Invalid input: expected ${j(o.values[0])}`;return`Грешана опција: се очекува една ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Премногу голем: се очекува ${o.origin??"вредноста"} да има ${i}${o.maximum.toString()} ${s.unit??"елементи"}`;return`Премногу голем: се очекува ${o.origin??"вредноста"} да биде ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Премногу мал: се очекува ${o.origin} да има ${i}${o.minimum.toString()} ${s.unit}`;return`Премногу мал: се очекува ${o.origin} да биде ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Неважечка низа: мора да започнува со "${i.prefix}"`;if(i.format==="ends_with")return`Неважечка низа: мора да завршува со "${i.suffix}"`;if(i.format==="includes")return`Неважечка низа: мора да вклучува "${i.includes}"`;if(i.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${i.pattern}`;return`Invalid ${n[i.format]??o.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${O(o.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${o.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${o.origin}`;default:return"Грешен внес"}}};function kx(){return{localeError:uZ()}}var pZ=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"nombor";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return(o)=>{switch(o.code){case"invalid_type":return`Input tidak sah: dijangka ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Input tidak sah: dijangka ${j(o.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Terlalu besar: dijangka ${o.origin??"nilai"} ${s.verb} ${i}${o.maximum.toString()} ${s.unit??"elemen"}`;return`Terlalu besar: dijangka ${o.origin??"nilai"} adalah ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Terlalu kecil: dijangka ${o.origin} ${s.verb} ${i}${o.minimum.toString()} ${s.unit}`;return`Terlalu kecil: dijangka ${o.origin} adalah ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`String tidak sah: mesti bermula dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak sah: mesti mengandungi "${i.includes}"`;if(i.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${i.pattern}`;return`${n[i.format]??o.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${O(o.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${o.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${o.origin}`;default:return"Input tidak sah"}}};function Ox(){return{localeError:pZ()}}var dZ=()=>{let e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"getal";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return(o)=>{switch(o.code){case"invalid_type":return`Ongeldige invoer: verwacht ${o.expected}, ontving ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Ongeldige invoer: verwacht ${j(o.values[0])}`;return`Ongeldige optie: verwacht één van ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Te lang: verwacht dat ${o.origin??"waarde"} ${i}${o.maximum.toString()} ${s.unit??"elementen"} bevat`;return`Te lang: verwacht dat ${o.origin??"waarde"} ${i}${o.maximum.toString()} is`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Te kort: verwacht dat ${o.origin} ${i}${o.minimum.toString()} ${s.unit} bevat`;return`Te kort: verwacht dat ${o.origin} ${i}${o.minimum.toString()} is`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Ongeldige tekst: moet met "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ongeldige tekst: moet op "${i.suffix}" eindigen`;if(i.format==="includes")return`Ongeldige tekst: moet "${i.includes}" bevatten`;if(i.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`;return`Ongeldig: ${n[i.format]??o.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${o.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${o.keys.length>1?"s":""}: ${O(o.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${o.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${o.origin}`;default:return"Ongeldige invoer"}}};function Cx(){return{localeError:dZ()}}var fZ=()=>{let e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"tall";case"object":{if(Array.isArray(o))return"liste";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(o)=>{switch(o.code){case"invalid_type":return`Ugyldig input: forventet ${o.expected}, fikk ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Ugyldig verdi: forventet ${j(o.values[0])}`;return`Ugyldig valg: forventet en av ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`For stor(t): forventet ${o.origin??"value"} til å ha ${i}${o.maximum.toString()} ${s.unit??"elementer"}`;return`For stor(t): forventet ${o.origin??"value"} til å ha ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`For lite(n): forventet ${o.origin} til å ha ${i}${o.minimum.toString()} ${s.unit}`;return`For lite(n): forventet ${o.origin} til å ha ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Ugyldig streng: må starte med "${i.prefix}"`;if(i.format==="ends_with")return`Ugyldig streng: må ende med "${i.suffix}"`;if(i.format==="includes")return`Ugyldig streng: må inneholde "${i.includes}"`;if(i.format==="regex")return`Ugyldig streng: må matche mønsteret ${i.pattern}`;return`Ugyldig ${n[i.format]??o.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${O(o.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${o.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${o.origin}`;default:return"Ugyldig input"}}};function Rx(){return{localeError:fZ()}}var mZ=()=>{let e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"numara";case"object":{if(Array.isArray(o))return"saf";if(o===null)return"gayb";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return(o)=>{switch(o.code){case"invalid_type":return`Fâsit giren: umulan ${o.expected}, alınan ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Fâsit giren: umulan ${j(o.values[0])}`;return`Fâsit tercih: mûteberler ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Fazla büyük: ${o.origin??"value"}, ${i}${o.maximum.toString()} ${s.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${o.origin??"value"}, ${i}${o.maximum.toString()} olmalıydı.`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Fazla küçük: ${o.origin}, ${i}${o.minimum.toString()} ${s.unit} sahip olmalıydı.`;return`Fazla küçük: ${o.origin}, ${i}${o.minimum.toString()} olmalıydı.`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Fâsit metin: "${i.prefix}" ile başlamalı.`;if(i.format==="ends_with")return`Fâsit metin: "${i.suffix}" ile bitmeli.`;if(i.format==="includes")return`Fâsit metin: "${i.includes}" ihtivâ etmeli.`;if(i.format==="regex")return`Fâsit metin: ${i.pattern} nakşına uymalı.`;return`Fâsit ${n[i.format]??o.format}`}case"not_multiple_of":return`Fâsit sayı: ${o.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${o.keys.length>1?"s":""}: ${O(o.keys,", ")}`;case"invalid_key":return`${o.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${o.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function Ix(){return{localeError:mZ()}}var gZ=()=>{let e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"عدد";case"object":{if(Array.isArray(o))return"ارې";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return(o)=>{switch(o.code){case"invalid_type":return`ناسم ورودي: باید ${o.expected} وای, مګر ${r(o.input)} ترلاسه شو`;case"invalid_value":if(o.values.length===1)return`ناسم ورودي: باید ${j(o.values[0])} وای`;return`ناسم انتخاب: باید یو له ${O(o.values,"|")} څخه وای`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`ډیر لوی: ${o.origin??"ارزښت"} باید ${i}${o.maximum.toString()} ${s.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${o.origin??"ارزښت"} باید ${i}${o.maximum.toString()} وي`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`ډیر کوچنی: ${o.origin} باید ${i}${o.minimum.toString()} ${s.unit} ولري`;return`ډیر کوچنی: ${o.origin} باید ${i}${o.minimum.toString()} وي`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`ناسم متن: باید د "${i.prefix}" سره پیل شي`;if(i.format==="ends_with")return`ناسم متن: باید د "${i.suffix}" سره پای ته ورسيږي`;if(i.format==="includes")return`ناسم متن: باید "${i.includes}" ولري`;if(i.format==="regex")return`ناسم متن: باید د ${i.pattern} سره مطابقت ولري`;return`${n[i.format]??o.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${o.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${o.keys.length>1?"کلیډونه":"کلیډ"}: ${O(o.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${o.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${o.origin} کې`;default:return"ناسمه ورودي"}}};function Px(){return{localeError:gZ()}}var hZ=()=>{let e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"liczba";case"object":{if(Array.isArray(o))return"tablica";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return(o)=>{switch(o.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${o.expected}, otrzymano ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${j(o.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Za duża wartość: oczekiwano, że ${o.origin??"wartość"} będzie mieć ${i}${o.maximum.toString()} ${s.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${o.origin??"wartość"} będzie wynosić ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Za mała wartość: oczekiwano, że ${o.origin??"wartość"} będzie mieć ${i}${o.minimum.toString()} ${s.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${o.origin??"wartość"} będzie wynosić ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${i.prefix}"`;if(i.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${i.suffix}"`;if(i.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${i.includes}"`;if(i.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${i.pattern}`;return`Nieprawidłow(y/a/e) ${n[i.format]??o.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${o.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${o.keys.length>1?"s":""}: ${O(o.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${o.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${o.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function Dx(){return{localeError:hZ()}}var _Z=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"número";case"object":{if(Array.isArray(o))return"array";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(o)=>{switch(o.code){case"invalid_type":return`Tipo inválido: esperado ${o.expected}, recebido ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Entrada inválida: esperado ${j(o.values[0])}`;return`Opção inválida: esperada uma das ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Muito grande: esperado que ${o.origin??"valor"} tivesse ${i}${o.maximum.toString()} ${s.unit??"elementos"}`;return`Muito grande: esperado que ${o.origin??"valor"} fosse ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Muito pequeno: esperado que ${o.origin} tivesse ${i}${o.minimum.toString()} ${s.unit}`;return`Muito pequeno: esperado que ${o.origin} fosse ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Texto inválido: deve começar com "${i.prefix}"`;if(i.format==="ends_with")return`Texto inválido: deve terminar com "${i.suffix}"`;if(i.format==="includes")return`Texto inválido: deve incluir "${i.includes}"`;if(i.format==="regex")return`Texto inválido: deve corresponder ao padrão ${i.pattern}`;return`${n[i.format]??o.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${o.divisor}`;case"unrecognized_keys":return`Chave${o.keys.length>1?"s":""} desconhecida${o.keys.length>1?"s":""}: ${O(o.keys,", ")}`;case"invalid_key":return`Chave inválida em ${o.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${o.origin}`;default:return"Campo inválido"}}};function Lx(){return{localeError:_Z()}}function BC(e,t,r,n){let o=Math.abs(e),i=o%10,s=o%100;if(s>=11&&s<=19)return n;if(i===1)return t;if(i>=2&&i<=4)return r;return n}var yZ=()=>{let e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"число";case"object":{if(Array.isArray(o))return"массив";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return(o)=>{switch(o.code){case"invalid_type":return`Неверный ввод: ожидалось ${o.expected}, получено ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Неверный ввод: ожидалось ${j(o.values[0])}`;return`Неверный вариант: ожидалось одно из ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s){let a=Number(o.maximum),c=BC(a,s.unit.one,s.unit.few,s.unit.many);return`Слишком большое значение: ожидалось, что ${o.origin??"значение"} будет иметь ${i}${o.maximum.toString()} ${c}`}return`Слишком большое значение: ожидалось, что ${o.origin??"значение"} будет ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s){let a=Number(o.minimum),c=BC(a,s.unit.one,s.unit.few,s.unit.many);return`Слишком маленькое значение: ожидалось, что ${o.origin} будет иметь ${i}${o.minimum.toString()} ${c}`}return`Слишком маленькое значение: ожидалось, что ${o.origin} будет ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Неверная строка: должна начинаться с "${i.prefix}"`;if(i.format==="ends_with")return`Неверная строка: должна заканчиваться на "${i.suffix}"`;if(i.format==="includes")return`Неверная строка: должна содержать "${i.includes}"`;if(i.format==="regex")return`Неверная строка: должна соответствовать шаблону ${i.pattern}`;return`Неверный ${n[i.format]??o.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${o.divisor}`;case"unrecognized_keys":return`Нераспознанн${o.keys.length>1?"ые":"ый"} ключ${o.keys.length>1?"и":""}: ${O(o.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${o.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${o.origin}`;default:return"Неверные входные данные"}}};function Nx(){return{localeError:yZ()}}var bZ=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"število";case"object":{if(Array.isArray(o))return"tabela";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"};return(o)=>{switch(o.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${o.expected}, prejeto ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Neveljaven vnos: pričakovano ${j(o.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Preveliko: pričakovano, da bo ${o.origin??"vrednost"} imelo ${i}${o.maximum.toString()} ${s.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${o.origin??"vrednost"} ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Premajhno: pričakovano, da bo ${o.origin} imelo ${i}${o.minimum.toString()} ${s.unit}`;return`Premajhno: pričakovano, da bo ${o.origin} ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Neveljaven niz: mora se začeti z "${i.prefix}"`;if(i.format==="ends_with")return`Neveljaven niz: mora se končati z "${i.suffix}"`;if(i.format==="includes")return`Neveljaven niz: mora vsebovati "${i.includes}"`;if(i.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`;return`Neveljaven ${n[i.format]??o.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${o.divisor}`;case"unrecognized_keys":return`Neprepoznan${o.keys.length>1?"i ključi":" ključ"}: ${O(o.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${o.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${o.origin}`;default:return"Neveljaven vnos"}}};function Mx(){return{localeError:bZ()}}var xZ=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"antal";case"object":{if(Array.isArray(o))return"lista";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return(o)=>{switch(o.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${o.expected}, fick ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Ogiltig inmatning: förväntat ${j(o.values[0])}`;return`Ogiltigt val: förväntade en av ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`För stor(t): förväntade ${o.origin??"värdet"} att ha ${i}${o.maximum.toString()} ${s.unit??"element"}`;return`För stor(t): förväntat ${o.origin??"värdet"} att ha ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`För lite(t): förväntade ${o.origin??"värdet"} att ha ${i}${o.minimum.toString()} ${s.unit}`;return`För lite(t): förväntade ${o.origin??"värdet"} att ha ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Ogiltig sträng: måste börja med "${i.prefix}"`;if(i.format==="ends_with")return`Ogiltig sträng: måste sluta med "${i.suffix}"`;if(i.format==="includes")return`Ogiltig sträng: måste innehålla "${i.includes}"`;if(i.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${i.pattern}"`;return`Ogiltig(t) ${n[i.format]??o.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${O(o.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${o.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${o.origin??"värdet"}`;default:return"Ogiltig input"}}};function Ux(){return{localeError:xZ()}}var vZ=()=>{let e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(o))return"அணி";if(o===null)return"வெறுமை";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return(o)=>{switch(o.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${o.expected}, பெறப்பட்டது ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${j(o.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${O(o.values,"|")} இல் ஒன்று`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${o.origin??"மதிப்பு"} ${i}${o.maximum.toString()} ${s.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${o.origin??"மதிப்பு"} ${i}${o.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${o.origin} ${i}${o.minimum.toString()} ${s.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${o.origin} ${i}${o.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`தவறான சரம்: "${i.prefix}" இல் தொடங்க வேண்டும்`;if(i.format==="ends_with")return`தவறான சரம்: "${i.suffix}" இல் முடிவடைய வேண்டும்`;if(i.format==="includes")return`தவறான சரம்: "${i.includes}" ஐ உள்ளடக்க வேண்டும்`;if(i.format==="regex")return`தவறான சரம்: ${i.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${n[i.format]??o.format}`}case"not_multiple_of":return`தவறான எண்: ${o.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${o.keys.length>1?"கள்":""}: ${O(o.keys,", ")}`;case"invalid_key":return`${o.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${o.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function $x(){return{localeError:vZ()}}var SZ=()=>{let e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(o))return"อาร์เรย์ (Array)";if(o===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return(o)=>{switch(o.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${o.expected} แต่ได้รับ ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${j(o.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"ไม่เกิน":"น้อยกว่า",s=t(o.origin);if(s)return`เกินกำหนด: ${o.origin??"ค่า"} ควรมี${i} ${o.maximum.toString()} ${s.unit??"รายการ"}`;return`เกินกำหนด: ${o.origin??"ค่า"} ควรมี${i} ${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?"อย่างน้อย":"มากกว่า",s=t(o.origin);if(s)return`น้อยกว่ากำหนด: ${o.origin} ควรมี${i} ${o.minimum.toString()} ${s.unit}`;return`น้อยกว่ากำหนด: ${o.origin} ควรมี${i} ${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${i.prefix}"`;if(i.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${i.suffix}"`;if(i.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${i.includes}" อยู่ในข้อความ`;if(i.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${i.pattern}`;return`รูปแบบไม่ถูกต้อง: ${n[i.format]??o.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${o.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${O(o.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${o.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${o.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function jx(){return{localeError:SZ()}}var EZ=(e)=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},wZ=()=>{let e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(n){return e[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return(n)=>{switch(n.code){case"invalid_type":return`Geçersiz değer: beklenen ${n.expected}, alınan ${EZ(n.input)}`;case"invalid_value":if(n.values.length===1)return`Geçersiz değer: beklenen ${j(n.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${O(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",i=t(n.origin);if(i)return`Çok büyük: beklenen ${n.origin??"değer"} ${o}${n.maximum.toString()} ${i.unit??"öğe"}`;return`Çok büyük: beklenen ${n.origin??"değer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",i=t(n.origin);if(i)return`Çok küçük: beklenen ${n.origin} ${o}${n.minimum.toString()} ${i.unit}`;return`Çok küçük: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Geçersiz metin: "${o.prefix}" ile başlamalı`;if(o.format==="ends_with")return`Geçersiz metin: "${o.suffix}" ile bitmeli`;if(o.format==="includes")return`Geçersiz metin: "${o.includes}" içermeli`;if(o.format==="regex")return`Geçersiz metin: ${o.pattern} desenine uymalı`;return`Geçersiz ${r[o.format]??n.format}`}case"not_multiple_of":return`Geçersiz sayı: ${n.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${n.keys.length>1?"lar":""}: ${O(n.keys,", ")}`;case"invalid_key":return`${n.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${n.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function Fx(){return{localeError:wZ()}}var TZ=()=>{let e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"число";case"object":{if(Array.isArray(o))return"масив";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return(o)=>{switch(o.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${o.expected}, отримано ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Неправильні вхідні дані: очікується ${j(o.values[0])}`;return`Неправильна опція: очікується одне з ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Занадто велике: очікується, що ${o.origin??"значення"} ${s.verb} ${i}${o.maximum.toString()} ${s.unit??"елементів"}`;return`Занадто велике: очікується, що ${o.origin??"значення"} буде ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Занадто мале: очікується, що ${o.origin} ${s.verb} ${i}${o.minimum.toString()} ${s.unit}`;return`Занадто мале: очікується, що ${o.origin} буде ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Неправильний рядок: повинен починатися з "${i.prefix}"`;if(i.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${i.suffix}"`;if(i.format==="includes")return`Неправильний рядок: повинен містити "${i.includes}"`;if(i.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${i.pattern}`;return`Неправильний ${n[i.format]??o.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${o.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${o.keys.length>1?"і":""}: ${O(o.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${o.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${o.origin}`;default:return"Неправильні вхідні дані"}}};function zx(){return{localeError:TZ()}}var AZ=()=>{let e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"نمبر";case"object":{if(Array.isArray(o))return"آرے";if(o===null)return"نل";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return(o)=>{switch(o.code){case"invalid_type":return`غلط ان پٹ: ${o.expected} متوقع تھا، ${r(o.input)} موصول ہوا`;case"invalid_value":if(o.values.length===1)return`غلط ان پٹ: ${j(o.values[0])} متوقع تھا`;return`غلط آپشن: ${O(o.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`بہت بڑا: ${o.origin??"ویلیو"} کے ${i}${o.maximum.toString()} ${s.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${o.origin??"ویلیو"} کا ${i}${o.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`بہت چھوٹا: ${o.origin} کے ${i}${o.minimum.toString()} ${s.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${o.origin} کا ${i}${o.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`غلط سٹرنگ: "${i.prefix}" سے شروع ہونا چاہیے`;if(i.format==="ends_with")return`غلط سٹرنگ: "${i.suffix}" پر ختم ہونا چاہیے`;if(i.format==="includes")return`غلط سٹرنگ: "${i.includes}" شامل ہونا چاہیے`;if(i.format==="regex")return`غلط سٹرنگ: پیٹرن ${i.pattern} سے میچ ہونا چاہیے`;return`غلط ${n[i.format]??o.format}`}case"not_multiple_of":return`غلط نمبر: ${o.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${o.keys.length>1?"ز":""}: ${O(o.keys,"، ")}`;case"invalid_key":return`${o.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${o.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function Bx(){return{localeError:AZ()}}var kZ=()=>{let e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"số";case"object":{if(Array.isArray(o))return"mảng";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return(o)=>{switch(o.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${o.expected}, nhận được ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${j(o.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`Quá lớn: mong đợi ${o.origin??"giá trị"} ${s.verb} ${i}${o.maximum.toString()} ${s.unit??"phần tử"}`;return`Quá lớn: mong đợi ${o.origin??"giá trị"} ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`Quá nhỏ: mong đợi ${o.origin} ${s.verb} ${i}${o.minimum.toString()} ${s.unit}`;return`Quá nhỏ: mong đợi ${o.origin} ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${i.prefix}"`;if(i.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${i.suffix}"`;if(i.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${i.includes}"`;if(i.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${i.pattern}`;return`${n[i.format]??o.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${o.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${O(o.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${o.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${o.origin}`;default:return"Đầu vào không hợp lệ"}}};function Hx(){return{localeError:kZ()}}var OZ=()=>{let e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(o))return"数组";if(o===null)return"空值(null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return(o)=>{switch(o.code){case"invalid_type":return`无效输入:期望 ${o.expected},实际接收 ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`无效输入:期望 ${j(o.values[0])}`;return`无效选项:期望以下之一 ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`数值过大:期望 ${o.origin??"值"} ${i}${o.maximum.toString()} ${s.unit??"个元素"}`;return`数值过大:期望 ${o.origin??"值"} ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`数值过小:期望 ${o.origin} ${i}${o.minimum.toString()} ${s.unit}`;return`数值过小:期望 ${o.origin} ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`无效字符串:必须以 "${i.prefix}" 开头`;if(i.format==="ends_with")return`无效字符串:必须以 "${i.suffix}" 结尾`;if(i.format==="includes")return`无效字符串:必须包含 "${i.includes}"`;if(i.format==="regex")return`无效字符串:必须满足正则表达式 ${i.pattern}`;return`无效${n[i.format]??o.format}`}case"not_multiple_of":return`无效数字:必须是 ${o.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${O(o.keys,", ")}`;case"invalid_key":return`${o.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${o.origin} 中包含无效值(value)`;default:return"无效输入"}}};function qx(){return{localeError:OZ()}}var CZ=()=>{let e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(o){return e[o]??null}let r=(o)=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return(o)=>{switch(o.code){case"invalid_type":return`無效的輸入值:預期為 ${o.expected},但收到 ${r(o.input)}`;case"invalid_value":if(o.values.length===1)return`無效的輸入值:預期為 ${j(o.values[0])}`;return`無效的選項:預期為以下其中之一 ${O(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",s=t(o.origin);if(s)return`數值過大:預期 ${o.origin??"值"} 應為 ${i}${o.maximum.toString()} ${s.unit??"個元素"}`;return`數值過大:預期 ${o.origin??"值"} 應為 ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",s=t(o.origin);if(s)return`數值過小:預期 ${o.origin} 應為 ${i}${o.minimum.toString()} ${s.unit}`;return`數值過小:預期 ${o.origin} 應為 ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.format==="starts_with")return`無效的字串:必須以 "${i.prefix}" 開頭`;if(i.format==="ends_with")return`無效的字串:必須以 "${i.suffix}" 結尾`;if(i.format==="includes")return`無效的字串:必須包含 "${i.includes}"`;if(i.format==="regex")return`無效的字串:必須符合格式 ${i.pattern}`;return`無效的 ${n[i.format]??o.format}`}case"not_multiple_of":return`無效的數字:必須為 ${o.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${o.keys.length>1?"們":""}:${O(o.keys,"、")}`;case"invalid_key":return`${o.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${o.origin} 中有無效的值`;default:return"無效的輸入值"}}};function Gx(){return{localeError:CZ()}}var sm=Symbol("ZodOutput"),am=Symbol("ZodInput");class ml{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r){if(this._idmap.has(r.id))throw Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}remove(e){return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};return delete r.id,{...r,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function gl(){return new ml}var sr=gl();function cm(e,t){return new e({type:"string",...L(t)})}function Wx(e,t){return new e({type:"string",coerce:!0,...L(t)})}function hl(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...L(t)})}function Gs(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...L(t)})}function _l(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...L(t)})}function yl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...L(t)})}function bl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...L(t)})}function xl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...L(t)})}function vl(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...L(t)})}function Sl(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...L(t)})}function El(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...L(t)})}function wl(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...L(t)})}function Tl(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...L(t)})}function Al(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...L(t)})}function kl(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...L(t)})}function Ol(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...L(t)})}function Cl(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...L(t)})}function Rl(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...L(t)})}function Il(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...L(t)})}function Pl(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...L(t)})}function Dl(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...L(t)})}function Ll(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...L(t)})}function Nl(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...L(t)})}function Ml(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...L(t)})}var lm={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Vx(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...L(t)})}function Kx(e,t){return new e({type:"string",format:"date",check:"string_format",...L(t)})}function Zx(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...L(t)})}function Jx(e,t){return new e({type:"string",format:"duration",check:"string_format",...L(t)})}function um(e,t){return new e({type:"number",checks:[],...L(t)})}function Yx(e,t){return new e({type:"number",coerce:!0,checks:[],...L(t)})}function pm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...L(t)})}function dm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...L(t)})}function fm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...L(t)})}function mm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...L(t)})}function gm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...L(t)})}function hm(e,t){return new e({type:"boolean",...L(t)})}function Xx(e,t){return new e({type:"boolean",coerce:!0,...L(t)})}function _m(e,t){return new e({type:"bigint",...L(t)})}function Qx(e,t){return new e({type:"bigint",coerce:!0,...L(t)})}function ym(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...L(t)})}function bm(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...L(t)})}function xm(e,t){return new e({type:"symbol",...L(t)})}function vm(e,t){return new e({type:"undefined",...L(t)})}function Sm(e,t){return new e({type:"null",...L(t)})}function Em(e){return new e({type:"any"})}function Ei(e){return new e({type:"unknown"})}function wm(e,t){return new e({type:"never",...L(t)})}function Tm(e,t){return new e({type:"void",...L(t)})}function Am(e,t){return new e({type:"date",...L(t)})}function ev(e,t){return new e({type:"date",coerce:!0,...L(t)})}function km(e,t){return new e({type:"nan",...L(t)})}function qn(e,t){return new of({check:"less_than",...L(t),value:e,inclusive:!1})}function Ur(e,t){return new of({check:"less_than",...L(t),value:e,inclusive:!0})}function Gn(e,t){return new sf({check:"greater_than",...L(t),value:e,inclusive:!1})}function ar(e,t){return new sf({check:"greater_than",...L(t),value:e,inclusive:!0})}function tv(e){return Gn(0,e)}function rv(e){return qn(0,e)}function nv(e){return Ur(0,e)}function ov(e){return ar(0,e)}function wi(e,t){return new Ub({check:"multiple_of",...L(t),value:e})}function Ws(e,t){return new Fb({check:"max_size",...L(t),maximum:e})}function Ti(e,t){return new zb({check:"min_size",...L(t),minimum:e})}function Ul(e,t){return new Bb({check:"size_equals",...L(t),size:e})}function Vs(e,t){return new Hb({check:"max_length",...L(t),maximum:e})}function ko(e,t){return new qb({check:"min_length",...L(t),minimum:e})}function Ks(e,t){return new Gb({check:"length_equals",...L(t),length:e})}function $l(e,t){return new Wb({check:"string_format",format:"regex",...L(t),pattern:e})}function jl(e){return new Vb({check:"string_format",format:"lowercase",...L(e)})}function Fl(e){return new Kb({check:"string_format",format:"uppercase",...L(e)})}function zl(e,t){return new Zb({check:"string_format",format:"includes",...L(t),includes:e})}function Bl(e,t){return new Jb({check:"string_format",format:"starts_with",...L(t),prefix:e})}function Hl(e,t){return new Yb({check:"string_format",format:"ends_with",...L(t),suffix:e})}function iv(e,t,r){return new Xb({check:"property",property:e,schema:t,...L(r)})}function ql(e,t){return new Qb({check:"mime_type",mime:e,...L(t)})}function Wn(e){return new ex({check:"overwrite",tx:e})}function Gl(e){return Wn((t)=>t.normalize(e))}function Wl(){return Wn((e)=>e.trim())}function Vl(){return Wn((e)=>e.toLowerCase())}function Kl(){return Wn((e)=>e.toUpperCase())}function Zl(e,t,r){return new e({type:"array",element:t,...L(r)})}function RZ(e,t,r){return new e({type:"union",options:t,...L(r)})}function IZ(e,t,r,n){return new e({type:"union",options:r,discriminator:t,...L(n)})}function PZ(e,t,r){return new e({type:"intersection",left:t,right:r})}function sv(e,t,r,n){let o=r instanceof ie;return new e({type:"tuple",items:t,rest:o?r:null,...L(o?n:r)})}function DZ(e,t,r,n){return new e({type:"record",keyType:t,valueType:r,...L(n)})}function LZ(e,t,r,n){return new e({type:"map",keyType:t,valueType:r,...L(n)})}function NZ(e,t,r){return new e({type:"set",valueType:t,...L(r)})}function MZ(e,t,r){let n=Array.isArray(t)?Object.fromEntries(t.map((o)=>[o,o])):t;return new e({type:"enum",entries:n,...L(r)})}function UZ(e,t,r){return new e({type:"enum",entries:t,...L(r)})}function $Z(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...L(r)})}function Om(e,t){return new e({type:"file",...L(t)})}function jZ(e,t){return new e({type:"transform",transform:t})}function FZ(e,t){return new e({type:"optional",innerType:t})}function zZ(e,t){return new e({type:"nullable",innerType:t})}function BZ(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r==="function"?r():r}})}function HZ(e,t,r){return new e({type:"nonoptional",innerType:t,...L(r)})}function qZ(e,t){return new e({type:"success",innerType:t})}function GZ(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r==="function"?r:()=>r})}function WZ(e,t,r){return new e({type:"pipe",in:t,out:r})}function VZ(e,t){return new e({type:"readonly",innerType:t})}function KZ(e,t,r){return new e({type:"template_literal",parts:t,...L(r)})}function ZZ(e,t){return new e({type:"lazy",getter:t})}function JZ(e,t){return new e({type:"promise",innerType:t})}function Cm(e,t,r){let n=L(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function Rm(e,t,r){return new e({type:"custom",check:"custom",fn:t,...L(r)})}function Im(e,t){let r=L(t),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];if(r.case!=="sensitive")n=n.map((h)=>typeof h==="string"?h.toLowerCase():h),o=o.map((h)=>typeof h==="string"?h.toLowerCase():h);let i=new Set(n),s=new Set(o),a=e.Pipe??Hs,c=e.Boolean??Fs,u=e.String??To,f=new(e.Transform??Bs)({type:"transform",transform:(h,_)=>{let y=h;if(r.case!=="sensitive")y=y.toLowerCase();if(i.has(y))return!0;else if(s.has(y))return!1;else return _.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:_.value,inst:f}),{}},error:r.error}),m=new a({type:"pipe",in:new u({type:"string",error:r.error}),out:f,error:r.error});return new a({type:"pipe",in:m,out:new c({type:"boolean",error:r.error}),error:r.error})}function Pm(e,t,r,n={}){let o=L(n),i={...L(n),check:"string_format",type:"string",format:t,fn:typeof r==="function"?r:(a)=>r.test(a),...o};if(r instanceof RegExp)i.pattern=r;return new e(i)}class av{constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!=="function")throw Error("implement() must be called with a function");let t=(...r)=>{let n=this._def.input?bi(this._def.input,r,void 0,{callee:t}):r;if(!Array.isArray(n))throw Error("Invalid arguments schema: not an array or tuple schema.");let o=e(...n);return this._def.output?bi(this._def.output,o,void 0,{callee:t}):o};return t}implementAsync(e){if(typeof e!=="function")throw Error("implement() must be called with a function");let t=async(...r)=>{let n=this._def.input?await xi(this._def.input,r,void 0,{callee:t}):r;if(!Array.isArray(n))throw Error("Invalid arguments schema: not an array or tuple schema.");let o=await e(...n);return this._def.output?xi(this._def.output,o,void 0,{callee:t}):o};return t}input(...e){let t=this.constructor;if(Array.isArray(e[0]))return new t({type:"function",input:new Ao({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output});return new t({type:"function",input:e[0],output:this._def.output})}output(e){return new this.constructor({type:"function",input:this._def.input,output:e})}}function Dm(e){return new av({type:"function",input:Array.isArray(e?.input)?sv(Ao,e?.input):e?.input??Zl(zs,Ei(Si)),output:e?.output??Ei(Si)})}class Lm{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??sr,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var r;let n=e._zod.def,o={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},i=this.seen.get(e);if(i){if(i.count++,t.schemaPath.includes(e))i.cycle=t.path;return i.schema}let s={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,s);let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let d={...t,schemaPath:[...t.schemaPath,e],path:t.path},f=e._zod.parent;if(f)s.ref=f,this.process(f,d),this.seen.get(f).isParent=!0;else{let m=s.schema;switch(n.type){case"string":{let g=m;g.type="string";let{minimum:h,maximum:_,format:y,patterns:b,contentEncoding:T}=e._zod.bag;if(typeof h==="number")g.minLength=h;if(typeof _==="number")g.maxLength=_;if(y){if(g.format=o[y]??y,g.format==="")delete g.format}if(T)g.contentEncoding=T;if(b&&b.size>0){let w=[...b];if(w.length===1)g.pattern=w[0].source;else if(w.length>1)s.schema.allOf=[...w.map((k)=>({...this.target==="draft-7"?{type:"string"}:{},pattern:k.source}))]}break}case"number":{let g=m,{minimum:h,maximum:_,format:y,multipleOf:b,exclusiveMaximum:T,exclusiveMinimum:w}=e._zod.bag;if(typeof y==="string"&&y.includes("int"))g.type="integer";else g.type="number";if(typeof w==="number")g.exclusiveMinimum=w;if(typeof h==="number"){if(g.minimum=h,typeof w==="number")if(w>=h)delete g.minimum;else delete g.exclusiveMinimum}if(typeof T==="number")g.exclusiveMaximum=T;if(typeof _==="number"){if(g.maximum=_,typeof T==="number")if(T<=_)delete g.maximum;else delete g.exclusiveMaximum}if(typeof b==="number")g.multipleOf=b;break}case"boolean":{let g=m;g.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{m.type="null";break}case"any":break;case"unknown":break;case"undefined":case"never":{m.not={};break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let g=m,{minimum:h,maximum:_}=e._zod.bag;if(typeof h==="number")g.minItems=h;if(typeof _==="number")g.maxItems=_;g.type="array",g.items=this.process(n.element,{...d,path:[...d.path,"items"]});break}case"object":{let g=m;g.type="object",g.properties={};let h=n.shape;for(let b in h)g.properties[b]=this.process(h[b],{...d,path:[...d.path,"properties",b]});let _=new Set(Object.keys(h)),y=new Set([..._].filter((b)=>{let T=n.shape[b]._zod;if(this.io==="input")return T.optin===void 0;else return T.optout===void 0}));if(y.size>0)g.required=Array.from(y);if(n.catchall?._zod.def.type==="never")g.additionalProperties=!1;else if(!n.catchall){if(this.io==="output")g.additionalProperties=!1}else if(n.catchall)g.additionalProperties=this.process(n.catchall,{...d,path:[...d.path,"additionalProperties"]});break}case"union":{let g=m;g.anyOf=n.options.map((h,_)=>this.process(h,{...d,path:[...d.path,"anyOf",_]}));break}case"intersection":{let g=m,h=this.process(n.left,{...d,path:[...d.path,"allOf",0]}),_=this.process(n.right,{...d,path:[...d.path,"allOf",1]}),y=(T)=>("allOf"in T)&&Object.keys(T).length===1,b=[...y(h)?h.allOf:[h],...y(_)?_.allOf:[_]];g.allOf=b;break}case"tuple":{let g=m;g.type="array";let h=n.items.map((b,T)=>this.process(b,{...d,path:[...d.path,"prefixItems",T]}));if(this.target==="draft-2020-12")g.prefixItems=h;else g.items=h;if(n.rest){let b=this.process(n.rest,{...d,path:[...d.path,"items"]});if(this.target==="draft-2020-12")g.items=b;else g.additionalItems=b}if(n.rest)g.items=this.process(n.rest,{...d,path:[...d.path,"items"]});let{minimum:_,maximum:y}=e._zod.bag;if(typeof _==="number")g.minItems=_;if(typeof y==="number")g.maxItems=y;break}case"record":{let g=m;g.type="object",g.propertyNames=this.process(n.keyType,{...d,path:[...d.path,"propertyNames"]}),g.additionalProperties=this.process(n.valueType,{...d,path:[...d.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let g=m,h=rl(n.entries);if(h.every((_)=>typeof _==="number"))g.type="number";if(h.every((_)=>typeof _==="string"))g.type="string";g.enum=h;break}case"literal":{let g=m,h=[];for(let _ of n.values)if(_===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof _==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else h.push(Number(_));else h.push(_);if(h.length===0);else if(h.length===1){let _=h[0];g.type=_===null?"null":typeof _,g.const=_}else{if(h.every((_)=>typeof _==="number"))g.type="number";if(h.every((_)=>typeof _==="string"))g.type="string";if(h.every((_)=>typeof _==="boolean"))g.type="string";if(h.every((_)=>_===null))g.type="null";g.enum=h}break}case"file":{let g=m,h={type:"string",format:"binary",contentEncoding:"binary"},{minimum:_,maximum:y,mime:b}=e._zod.bag;if(_!==void 0)h.minLength=_;if(y!==void 0)h.maxLength=y;if(b)if(b.length===1)h.contentMediaType=b[0],Object.assign(g,h);else g.anyOf=b.map((T)=>({...h,contentMediaType:T}));else Object.assign(g,h);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let g=this.process(n.innerType,d);m.anyOf=[g,{type:"null"}];break}case"nonoptional":{this.process(n.innerType,d),s.ref=n.innerType;break}case"success":{let g=m;g.type="boolean";break}case"default":{this.process(n.innerType,d),s.ref=n.innerType,m.default=JSON.parse(JSON.stringify(n.defaultValue));break}case"prefault":{if(this.process(n.innerType,d),s.ref=n.innerType,this.io==="input")m._prefault=JSON.parse(JSON.stringify(n.defaultValue));break}case"catch":{this.process(n.innerType,d),s.ref=n.innerType;let g;try{g=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}m.default=g;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let g=m,h=e._zod.pattern;if(!h)throw Error("Pattern not found in template literal");g.type="string",g.pattern=h.source;break}case"pipe":{let g=this.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;this.process(g,d),s.ref=g;break}case"readonly":{this.process(n.innerType,d),s.ref=n.innerType,m.readOnly=!0;break}case"promise":{this.process(n.innerType,d),s.ref=n.innerType;break}case"optional":{this.process(n.innerType,d),s.ref=n.innerType;break}case"lazy":{let g=e._zod.innerType;this.process(g,d),s.ref=g;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}default:}}}let c=this.metadataRegistry.get(e);if(c)Object.assign(s.schema,c);if(this.io==="input"&&wt(e))delete s.schema.examples,delete s.schema.default;if(this.io==="input"&&s.schema._prefault)(r=s.schema).default??(r.default=s.schema._prefault);return delete s.schema._prefault,this.seen.get(e).schema}emit(e,t){let r={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},n=this.seen.get(e);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(u)=>{let d=this.target==="draft-2020-12"?"$defs":"definitions";if(r.external){let h=r.external.registry.get(u[0])?.id;if(h)return{ref:r.external.uri(h)};let _=u[1].defId??u[1].schema.id??`schema${this.counter++}`;return u[1].defId=_,{defId:_,ref:`${r.external.uri("__shared")}#/${d}/${_}`}}if(u[1]===n)return{ref:"#"};let m=`${"#"}/${d}/`,g=u[1].schema.id??`__schema${this.counter++}`;return{defId:g,ref:m+g}},i=(u)=>{if(u[1].schema.$ref)return;let d=u[1],{ref:f,defId:m}=o(u);if(d.def={...d.schema},m)d.defId=m;let g=d.schema;for(let h in g)delete g[h];g.$ref=f};for(let u of this.seen.entries()){let d=u[1];if(e===u[0]){i(u);continue}if(r.external){let m=r.external.registry.get(u[0])?.id;if(e!==u[0]&&m){i(u);continue}}if(this.metadataRegistry.get(u[0])?.id){i(u);continue}if(d.cycle){if(r.cycles==="throw")throw Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
|
|
62
62
|
|
|
63
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);else if(r.cycles==="ref")i(u);continue}if(d.count>1){if(r.reused==="ref"){i(u);continue}}}let s=(u,d)=>{let f=this.seen.get(u),m=f.def??f.schema,g={...m};if(f.ref===null)return;let h=f.ref;if(f.ref=null,h){s(h,d);let _=this.seen.get(h).schema;if(_.$ref&&d.target==="draft-7")m.allOf=m.allOf??[],m.allOf.push(_);else Object.assign(m,_),Object.assign(m,g)}if(!f.isParent)this.override({zodSchema:u,jsonSchema:m,path:f.path??[]})};for(let u of[...this.seen.entries()].reverse())s(u[0],{target:this.target});let a={};if(this.target==="draft-2020-12")a.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")a.$schema="http://json-schema.org/draft-07/schema#";else console.warn(`Invalid target: ${this.target}`);Object.assign(a,n.def);let c=r.external?.defs??{};for(let u of this.seen.entries()){let d=u[1];if(d.def&&d.defId)c[d.defId]=d.def}if(!r.external&&Object.keys(c).length>0)if(this.target==="draft-2020-12")a.$defs=c;else a.definitions=c;try{return JSON.parse(JSON.stringify(a))}catch(u){throw Error("Error converting schema to JSON.")}}}function Zs(e,t){if(e instanceof ml){let n=new Lm(t),o={};for(let a of e._idmap.entries()){let[c,u]=a;n.process(u)}let i={},s={registry:e,uri:t?.uri||((a)=>a),defs:o};for(let a of e._idmap.entries()){let[c,u]=a;i[c]=n.emit(u,{...t,external:s})}if(Object.keys(o).length>0){let a=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[a]:o}}return{schemas:i}}let r=new Lm(t);return r.process(e),r.emit(e,t)}function wt(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;switch(o.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return wt(o.element,r);case"object":{for(let i in o.shape)if(wt(o.shape[i],r))return!0;return!1}case"union":{for(let i of o.options)if(wt(i,r))return!0;return!1}case"intersection":return wt(o.left,r)||wt(o.right,r);case"tuple":{for(let i of o.items)if(wt(i,r))return!0;if(o.rest&&wt(o.rest,r))return!0;return!1}case"record":return wt(o.keyType,r)||wt(o.valueType,r);case"map":return wt(o.keyType,r)||wt(o.valueType,r);case"set":return wt(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return wt(o.innerType,r);case"lazy":return wt(o.getter(),r);case"default":return wt(o.innerType,r);case"prefault":return wt(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return wt(o.in,r)||wt(o.out,r);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${o.type}`)}var HC={};var Js={};lt(Js,{time:()=>uv,duration:()=>pv,datetime:()=>cv,date:()=>lv,ZodISOTime:()=>Um,ZodISODuration:()=>$m,ZodISODateTime:()=>Nm,ZodISODate:()=>Mm});var Nm=S("ZodISODateTime",(e,t)=>{nx.init(e,t),Ge.init(e,t)});function cv(e){return Vx(Nm,e)}var Mm=S("ZodISODate",(e,t)=>{ox.init(e,t),Ge.init(e,t)});function lv(e){return Kx(Mm,e)}var Um=S("ZodISOTime",(e,t)=>{ix.init(e,t),Ge.init(e,t)});function uv(e){return Zx(Um,e)}var $m=S("ZodISODuration",(e,t)=>{sx.init(e,t),Ge.init(e,t)});function pv(e){return Jx($m,e)}var GC=(e,t)=>{cl.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(r)=>$s(e,r)},flatten:{value:(r)=>Us(e,r)},addIssue:{value:(r)=>e.issues.push(r)},addIssues:{value:(r)=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},XZ=S("ZodError",GC),Ys=S("ZodError",GC,{Parent:Error});var dv=Qd(Ys),fv=ef(Ys),mv=tf(Ys),gv=rf(Ys);var de=S("ZodType",(e,t)=>(ie.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map((n)=>typeof n==="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(r,n)=>zt(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.parse=(r,n)=>dv(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>mv(e,r,n),e.parseAsync=async(r,n)=>fv(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>gv(e,r,n),e.spa=e.safeParseAsync,e.refine=(r,n)=>e.check(TR(r,n)),e.superRefine=(r)=>e.check(AR(r)),e.overwrite=(r)=>e.check(Wn(r)),e.optional=()=>We(e),e.nullable=()=>Fm(e),e.nullish=()=>We(Fm(e)),e.nonoptional=(r)=>fR(e,r),e.array=()=>he(e),e.or=(r)=>$e([e,r]),e.and=(r)=>tu(e,r),e.transform=(r)=>zm(e,jv(r)),e.default=(r)=>uR(e,r),e.prefault=(r)=>dR(e,r),e.catch=(r)=>hR(e,r),e.pipe=(r)=>zm(e,r),e.readonly=()=>bR(e),e.describe=(r)=>{let n=e.clone();return sr.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return sr.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return sr.get(e);let n=e.clone();return sr.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),_v=S("_ZodString",(e,t)=>{To.init(e,t),de.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check($l(...n)),e.includes=(...n)=>e.check(zl(...n)),e.startsWith=(...n)=>e.check(Bl(...n)),e.endsWith=(...n)=>e.check(Hl(...n)),e.min=(...n)=>e.check(ko(...n)),e.max=(...n)=>e.check(Vs(...n)),e.length=(...n)=>e.check(Ks(...n)),e.nonempty=(...n)=>e.check(ko(1,...n)),e.lowercase=(n)=>e.check(jl(n)),e.uppercase=(n)=>e.check(Fl(n)),e.trim=()=>e.check(Wl()),e.normalize=(...n)=>e.check(Gl(...n)),e.toLowerCase=()=>e.check(Vl()),e.toUpperCase=()=>e.check(Kl())}),Yl=S("ZodString",(e,t)=>{To.init(e,t),_v.init(e,t),e.email=(r)=>e.check(hl(yv,r)),e.url=(r)=>e.check(vl(bv,r)),e.jwt=(r)=>e.check(Ml(Lv,r)),e.emoji=(r)=>e.check(Sl(xv,r)),e.guid=(r)=>e.check(Gs(jm,r)),e.uuid=(r)=>e.check(_l(Vn,r)),e.uuidv4=(r)=>e.check(yl(Vn,r)),e.uuidv6=(r)=>e.check(bl(Vn,r)),e.uuidv7=(r)=>e.check(xl(Vn,r)),e.nanoid=(r)=>e.check(El(vv,r)),e.guid=(r)=>e.check(Gs(jm,r)),e.cuid=(r)=>e.check(wl(Sv,r)),e.cuid2=(r)=>e.check(Tl(Ev,r)),e.ulid=(r)=>e.check(Al(wv,r)),e.base64=(r)=>e.check(Dl(Iv,r)),e.base64url=(r)=>e.check(Ll(Pv,r)),e.xid=(r)=>e.check(kl(Tv,r)),e.ksuid=(r)=>e.check(Ol(Av,r)),e.ipv4=(r)=>e.check(Cl(kv,r)),e.ipv6=(r)=>e.check(Rl(Ov,r)),e.cidrv4=(r)=>e.check(Il(Cv,r)),e.cidrv6=(r)=>e.check(Pl(Rv,r)),e.e164=(r)=>e.check(Nl(Dv,r)),e.datetime=(r)=>e.check(cv(r)),e.date=(r)=>e.check(lv(r)),e.time=(r)=>e.check(uv(r)),e.duration=(r)=>e.check(pv(r))});function A(e){return cm(Yl,e)}var Ge=S("ZodStringFormat",(e,t)=>{Ue.init(e,t),_v.init(e,t)}),yv=S("ZodEmail",(e,t)=>{df.init(e,t),Ge.init(e,t)});function e9(e){return hl(yv,e)}var jm=S("ZodGUID",(e,t)=>{uf.init(e,t),Ge.init(e,t)});function t9(e){return Gs(jm,e)}var Vn=S("ZodUUID",(e,t)=>{pf.init(e,t),Ge.init(e,t)});function r9(e){return _l(Vn,e)}function n9(e){return yl(Vn,e)}function o9(e){return bl(Vn,e)}function i9(e){return xl(Vn,e)}var bv=S("ZodURL",(e,t)=>{ff.init(e,t),Ge.init(e,t)});function s9(e){return vl(bv,e)}var xv=S("ZodEmoji",(e,t)=>{mf.init(e,t),Ge.init(e,t)});function a9(e){return Sl(xv,e)}var vv=S("ZodNanoID",(e,t)=>{gf.init(e,t),Ge.init(e,t)});function c9(e){return El(vv,e)}var Sv=S("ZodCUID",(e,t)=>{hf.init(e,t),Ge.init(e,t)});function l9(e){return wl(Sv,e)}var Ev=S("ZodCUID2",(e,t)=>{_f.init(e,t),Ge.init(e,t)});function u9(e){return Tl(Ev,e)}var wv=S("ZodULID",(e,t)=>{yf.init(e,t),Ge.init(e,t)});function p9(e){return Al(wv,e)}var Tv=S("ZodXID",(e,t)=>{bf.init(e,t),Ge.init(e,t)});function d9(e){return kl(Tv,e)}var Av=S("ZodKSUID",(e,t)=>{xf.init(e,t),Ge.init(e,t)});function f9(e){return Ol(Av,e)}var kv=S("ZodIPv4",(e,t)=>{vf.init(e,t),Ge.init(e,t)});function m9(e){return Cl(kv,e)}var Ov=S("ZodIPv6",(e,t)=>{Sf.init(e,t),Ge.init(e,t)});function g9(e){return Rl(Ov,e)}var Cv=S("ZodCIDRv4",(e,t)=>{Ef.init(e,t),Ge.init(e,t)});function h9(e){return Il(Cv,e)}var Rv=S("ZodCIDRv6",(e,t)=>{wf.init(e,t),Ge.init(e,t)});function _9(e){return Pl(Rv,e)}var Iv=S("ZodBase64",(e,t)=>{Tf.init(e,t),Ge.init(e,t)});function y9(e){return Dl(Iv,e)}var Pv=S("ZodBase64URL",(e,t)=>{Af.init(e,t),Ge.init(e,t)});function b9(e){return Ll(Pv,e)}var Dv=S("ZodE164",(e,t)=>{kf.init(e,t),Ge.init(e,t)});function x9(e){return Nl(Dv,e)}var Lv=S("ZodJWT",(e,t)=>{Of.init(e,t),Ge.init(e,t)});function v9(e){return Ml(Lv,e)}var WC=S("ZodCustomStringFormat",(e,t)=>{Cf.init(e,t),Ge.init(e,t)});function S9(e,t,r={}){return Pm(WC,e,t,r)}var Xl=S("ZodNumber",(e,t)=>{ll.init(e,t),de.init(e,t),e.gt=(n,o)=>e.check(Gn(n,o)),e.gte=(n,o)=>e.check(ar(n,o)),e.min=(n,o)=>e.check(ar(n,o)),e.lt=(n,o)=>e.check(qn(n,o)),e.lte=(n,o)=>e.check(Ur(n,o)),e.max=(n,o)=>e.check(Ur(n,o)),e.int=(n)=>e.check(hv(n)),e.safe=(n)=>e.check(hv(n)),e.positive=(n)=>e.check(Gn(0,n)),e.nonnegative=(n)=>e.check(ar(0,n)),e.negative=(n)=>e.check(qn(0,n)),e.nonpositive=(n)=>e.check(Ur(0,n)),e.multipleOf=(n,o)=>e.check(wi(n,o)),e.step=(n,o)=>e.check(wi(n,o)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??0.5),e.isFinite=!0,e.format=r.format??null});function Ce(e){return um(Xl,e)}var Xs=S("ZodNumberFormat",(e,t)=>{Rf.init(e,t),Xl.init(e,t)});function hv(e){return pm(Xs,e)}function E9(e){return dm(Xs,e)}function w9(e){return fm(Xs,e)}function T9(e){return mm(Xs,e)}function A9(e){return gm(Xs,e)}var Ql=S("ZodBoolean",(e,t)=>{Fs.init(e,t),de.init(e,t)});function ht(e){return hm(Ql,e)}var eu=S("ZodBigInt",(e,t)=>{ul.init(e,t),de.init(e,t),e.gte=(n,o)=>e.check(ar(n,o)),e.min=(n,o)=>e.check(ar(n,o)),e.gt=(n,o)=>e.check(Gn(n,o)),e.gte=(n,o)=>e.check(ar(n,o)),e.min=(n,o)=>e.check(ar(n,o)),e.lt=(n,o)=>e.check(qn(n,o)),e.lte=(n,o)=>e.check(Ur(n,o)),e.max=(n,o)=>e.check(Ur(n,o)),e.positive=(n)=>e.check(Gn(BigInt(0),n)),e.negative=(n)=>e.check(qn(BigInt(0),n)),e.nonpositive=(n)=>e.check(Ur(BigInt(0),n)),e.nonnegative=(n)=>e.check(ar(BigInt(0),n)),e.multipleOf=(n,o)=>e.check(wi(n,o));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function k9(e){return _m(eu,e)}var Nv=S("ZodBigIntFormat",(e,t)=>{If.init(e,t),eu.init(e,t)});function O9(e){return ym(Nv,e)}function C9(e){return bm(Nv,e)}var VC=S("ZodSymbol",(e,t)=>{Pf.init(e,t),de.init(e,t)});function R9(e){return xm(VC,e)}var KC=S("ZodUndefined",(e,t)=>{Df.init(e,t),de.init(e,t)});function I9(e){return vm(KC,e)}var ZC=S("ZodNull",(e,t)=>{Lf.init(e,t),de.init(e,t)});function Bm(e){return Sm(ZC,e)}var JC=S("ZodAny",(e,t)=>{Nf.init(e,t),de.init(e,t)});function P9(){return Em(JC)}var YC=S("ZodUnknown",(e,t)=>{Si.init(e,t),de.init(e,t)});function Ke(){return Ei(YC)}var XC=S("ZodNever",(e,t)=>{Mf.init(e,t),de.init(e,t)});function Hm(e){return wm(XC,e)}var QC=S("ZodVoid",(e,t)=>{Uf.init(e,t),de.init(e,t)});function D9(e){return Tm(QC,e)}var qm=S("ZodDate",(e,t)=>{$f.init(e,t),de.init(e,t),e.min=(n,o)=>e.check(ar(n,o)),e.max=(n,o)=>e.check(Ur(n,o));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function L9(e){return Am(qm,e)}var eR=S("ZodArray",(e,t)=>{zs.init(e,t),de.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(ko(r,n)),e.nonempty=(r)=>e.check(ko(1,r)),e.max=(r,n)=>e.check(Vs(r,n)),e.length=(r,n)=>e.check(Ks(r,n)),e.unwrap=()=>e.element});function he(e,t){return Zl(eR,e,t)}function N9(e){let t=e._zod.def.shape;return Z(Object.keys(t))}var Gm=S("ZodObject",(e,t)=>{pl.init(e,t),de.init(e,t),M.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Jt(Object.keys(e._zod.def.shape)),e.catchall=(r)=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ke()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ke()}),e.strict=()=>e.clone({...e._zod.def,catchall:Hm()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=(r)=>M.extend(e,r),e.merge=(r)=>M.merge(e,r),e.pick=(r)=>M.pick(e,r),e.omit=(r)=>M.omit(e,r),e.partial=(...r)=>M.partial(Fv,e,r[0]),e.required=(...r)=>M.required(zv,e,r[0])});function G(e,t){let r={type:"object",get shape(){return M.assignProp(this,"shape",{...e}),this.shape},...M.normalizeParams(t)};return new Gm(r)}function M9(e,t){return new Gm({type:"object",get shape(){return M.assignProp(this,"shape",{...e}),this.shape},catchall:Hm(),...M.normalizeParams(t)})}function Bt(e,t){return new Gm({type:"object",get shape(){return M.assignProp(this,"shape",{...e}),this.shape},catchall:Ke(),...M.normalizeParams(t)})}var Mv=S("ZodUnion",(e,t)=>{dl.init(e,t),de.init(e,t),e.options=t.options});function $e(e,t){return new Mv({type:"union",options:e,...M.normalizeParams(t)})}var tR=S("ZodDiscriminatedUnion",(e,t)=>{Mv.init(e,t),jf.init(e,t)});function Wm(e,t,r){return new tR({type:"union",options:t,discriminator:e,...M.normalizeParams(r)})}var rR=S("ZodIntersection",(e,t)=>{Ff.init(e,t),de.init(e,t)});function tu(e,t){return new rR({type:"intersection",left:e,right:t})}var nR=S("ZodTuple",(e,t)=>{Ao.init(e,t),de.init(e,t),e.rest=(r)=>e.clone({...e._zod.def,rest:r})});function U9(e,t,r){let n=t instanceof ie,o=n?r:t;return new nR({type:"tuple",items:e,rest:n?t:null,...M.normalizeParams(o)})}var Uv=S("ZodRecord",(e,t)=>{zf.init(e,t),de.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function je(e,t,r){return new Uv({type:"record",keyType:e,valueType:t,...M.normalizeParams(r)})}function $9(e,t,r){return new Uv({type:"record",keyType:$e([e,Hm()]),valueType:t,...M.normalizeParams(r)})}var oR=S("ZodMap",(e,t)=>{Bf.init(e,t),de.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function j9(e,t,r){return new oR({type:"map",keyType:e,valueType:t,...M.normalizeParams(r)})}var iR=S("ZodSet",(e,t)=>{Hf.init(e,t),de.init(e,t),e.min=(...r)=>e.check(Ti(...r)),e.nonempty=(r)=>e.check(Ti(1,r)),e.max=(...r)=>e.check(Ws(...r)),e.size=(...r)=>e.check(Ul(...r))});function F9(e,t){return new iR({type:"set",valueType:e,...M.normalizeParams(t)})}var Jl=S("ZodEnum",(e,t)=>{qf.init(e,t),de.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new Jl({...t,checks:[],...M.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw Error(`Key ${s} not found in enum`);return new Jl({...t,checks:[],...M.normalizeParams(o),entries:i})}});function Jt(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((n)=>[n,n])):e;return new Jl({type:"enum",entries:r,...M.normalizeParams(t)})}function z9(e,t){return new Jl({type:"enum",entries:e,...M.normalizeParams(t)})}var sR=S("ZodLiteral",(e,t)=>{Gf.init(e,t),de.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Z(e,t){return new sR({type:"literal",values:Array.isArray(e)?e:[e],...M.normalizeParams(t)})}var aR=S("ZodFile",(e,t)=>{Wf.init(e,t),de.init(e,t),e.min=(r,n)=>e.check(Ti(r,n)),e.max=(r,n)=>e.check(Ws(r,n)),e.mime=(r,n)=>e.check(ql(Array.isArray(r)?r:[r],n))});function B9(e){return Om(aR,e)}var $v=S("ZodTransform",(e,t)=>{Bs.init(e,t),de.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=(i)=>{if(typeof i==="string")r.issues.push(M.issue(i,r.value,t));else{let s=i;if(s.fatal)s.continue=!1;s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),r.issues.push(M.issue(s))}};let o=t.transform(r.value,r);if(o instanceof Promise)return o.then((i)=>(r.value=i,r));return r.value=o,r}});function jv(e){return new $v({type:"transform",transform:e})}var Fv=S("ZodOptional",(e,t)=>{Vf.init(e,t),de.init(e,t),e.unwrap=()=>e._zod.def.innerType});function We(e){return new Fv({type:"optional",innerType:e})}var cR=S("ZodNullable",(e,t)=>{Kf.init(e,t),de.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Fm(e){return new cR({type:"nullable",innerType:e})}function H9(e){return We(Fm(e))}var lR=S("ZodDefault",(e,t)=>{Zf.init(e,t),de.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function uR(e,t){return new lR({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():t}})}var pR=S("ZodPrefault",(e,t)=>{Jf.init(e,t),de.init(e,t),e.unwrap=()=>e._zod.def.innerType});function dR(e,t){return new pR({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():t}})}var zv=S("ZodNonOptional",(e,t)=>{Yf.init(e,t),de.init(e,t),e.unwrap=()=>e._zod.def.innerType});function fR(e,t){return new zv({type:"nonoptional",innerType:e,...M.normalizeParams(t)})}var mR=S("ZodSuccess",(e,t)=>{Xf.init(e,t),de.init(e,t),e.unwrap=()=>e._zod.def.innerType});function q9(e){return new mR({type:"success",innerType:e})}var gR=S("ZodCatch",(e,t)=>{Qf.init(e,t),de.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function hR(e,t){return new gR({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var _R=S("ZodNaN",(e,t)=>{em.init(e,t),de.init(e,t)});function G9(e){return km(_R,e)}var Bv=S("ZodPipe",(e,t)=>{Hs.init(e,t),de.init(e,t),e.in=t.in,e.out=t.out});function zm(e,t){return new Bv({type:"pipe",in:e,out:t})}var yR=S("ZodReadonly",(e,t)=>{tm.init(e,t),de.init(e,t)});function bR(e){return new yR({type:"readonly",innerType:e})}var xR=S("ZodTemplateLiteral",(e,t)=>{rm.init(e,t),de.init(e,t)});function W9(e,t){return new xR({type:"template_literal",parts:e,...M.normalizeParams(t)})}var vR=S("ZodLazy",(e,t)=>{om.init(e,t),de.init(e,t),e.unwrap=()=>e._zod.def.getter()});function SR(e){return new vR({type:"lazy",getter:e})}var ER=S("ZodPromise",(e,t)=>{nm.init(e,t),de.init(e,t),e.unwrap=()=>e._zod.def.innerType});function V9(e){return new ER({type:"promise",innerType:e})}var Vm=S("ZodCustom",(e,t)=>{im.init(e,t),de.init(e,t)});function wR(e,t){let r=new Xe({check:"custom",...M.normalizeParams(t)});return r._zod.check=e,r}function Hv(e,t){return Cm(Vm,e??(()=>!0),t)}function TR(e,t={}){return Rm(Vm,e,t)}function AR(e,t){let r=wR((n)=>(n.addIssue=(o)=>{if(typeof o==="string")n.issues.push(M.issue(o,n.value,r._zod.def));else{let i=o;if(i.fatal)i.continue=!1;i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(M.issue(i))}},e(n.value,n)),t);return r}function K9(e,t={error:`Input not instance of ${e.name}`}){let r=new Vm({type:"custom",check:"custom",fn:(n)=>n instanceof e,abort:!0,...M.normalizeParams(t)});return r._zod.bag.Class=e,r}var Z9=(...e)=>Im({Pipe:Bv,Boolean:Ql,String:Yl,Transform:$v},...e);function J9(e){let t=SR(()=>$e([A(e),Ce(),ht(),Bm(),he(t),je(A(),t)]));return t}function Km(e,t){return zm(jv(e),t)}var Y9={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 X9(e){ut({customError:e})}function Q9(){return ut().customError}var qv={};lt(qv,{string:()=>e3,number:()=>t3,date:()=>o3,boolean:()=>r3,bigint:()=>n3});function e3(e){return Wx(Yl,e)}function t3(e){return Yx(Xl,e)}function r3(e){return Xx(Ql,e)}function n3(e){return Qx(eu,e)}function o3(e){return ev(qm,e)}ut(fl());var kR=l;var ru=kR;var OR={"//":"Hand-maintained baked-in model catalog — the source of truth for per-model provider IDs and metadata. On model launch add one entry to `models` below; `bun run generate:model-catalog` validates this file against the schema and formats it.",schema_version:1,pricing_tiers:{tier_3_15:{input:3,output:15,cache_write_5m:3.75,cache_write_1h:6,cache_read:0.3,web_search:0.01},tier_5_25:{input:5,output:25,cache_write_5m:6.25,cache_write_1h:10,cache_read:0.5,web_search:0.01},tier_15_75:{input:15,output:75,cache_write_5m:18.75,cache_write_1h:30,cache_read:1.5,web_search:0.01},tier_10_50:{input:10,output:50,cache_write_5m:12.5,cache_write_1h:20,cache_read:1,web_search:0.01},haiku_35:{input:0.8,output:4,cache_write_5m:1,cache_write_1h:1.6,cache_read:0.08,web_search:0.01},haiku_45:{input:1,output:5,cache_write_5m:1.25,cache_write_1h:2,cache_read:0.1,web_search:0.01}},models:[{id:"claude-3-5-haiku",family:"haiku",display_name:"Haiku 3.5",provider_ids:{first_party:"claude-3-5-haiku-20241022",bedrock:"us.anthropic.claude-3-5-haiku-20241022-v1:0",vertex:"claude-3-5-haiku@20241022",foundry:"claude-3-5-haiku",anthropic_aws:"claude-3-5-haiku-20241022",anthropic_google_cloud:null,mantle:null,gateway:"claude-3-5-haiku-20241022"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_3_5_HAIKU",max_output_tokens:{default:8192,upper:8192},pricing:"haiku_35",capabilities:[]},{id:"claude-haiku-4-5",family:"haiku",display_name:"Haiku 4.5",knowledge_cutoff:"February 2025",provider_ids:{first_party:"claude-haiku-4-5-20251001",bedrock:"us.anthropic.claude-haiku-4-5-20251001-v1:0",vertex:"claude-haiku-4-5@20251001",foundry:"claude-haiku-4-5",anthropic_aws:"claude-haiku-4-5-20251001",anthropic_google_cloud:"claude-haiku-4-5-20251001",mantle:"anthropic.claude-haiku-4-5",gateway:"claude-haiku-4-5-20251001"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_HAIKU_4_5",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"haiku_45",capabilities:["context_management"],advisor_rank:1},{id:"claude-3-5-sonnet",family:"sonnet",display_name:"Sonnet 3.5",provider_ids:{first_party:"claude-3-5-sonnet-20241022",bedrock:"us.anthropic.claude-3-5-sonnet-20241022-v2:0",vertex:"claude-3-5-sonnet-v2@20241022",foundry:"claude-3-5-sonnet",anthropic_aws:"claude-3-5-sonnet-20241022",anthropic_google_cloud:null,mantle:null,gateway:"claude-3-5-sonnet-20241022"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_3_5_SONNET",max_output_tokens:{default:8192,upper:8192},pricing:"tier_3_15",capabilities:[]},{id:"claude-3-7-sonnet",family:"sonnet",display_name:"Sonnet 3.7",provider_ids:{first_party:"claude-3-7-sonnet-20250219",bedrock:"us.anthropic.claude-3-7-sonnet-20250219-v1:0",vertex:"claude-3-7-sonnet@20250219",foundry:"claude-3-7-sonnet",anthropic_aws:"claude-3-7-sonnet-20250219",anthropic_google_cloud:null,mantle:null,gateway:"claude-3-7-sonnet-20250219"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_3_7_SONNET",max_output_tokens:{default:32000,upper:64000},pricing:"tier_3_15",capabilities:[]},{id:"claude-sonnet-4-0",family:"sonnet",display_name:"Sonnet 4",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-sonnet-4-20250514",bedrock:"us.anthropic.claude-sonnet-4-20250514-v1:0",vertex:"claude-sonnet-4@20250514",foundry:"claude-sonnet-4",anthropic_aws:"claude-sonnet-4-20250514",anthropic_google_cloud:null,mantle:null,gateway:"claude-sonnet-4-20250514"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_0_SONNET",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"tier_3_15",capabilities:["context_management"]},{id:"claude-sonnet-4-5",family:"sonnet",display_name:"Sonnet 4.5",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-sonnet-4-5-20250929",bedrock:"us.anthropic.claude-sonnet-4-5-20250929-v1:0",vertex:"claude-sonnet-4-5@20250929",foundry:"claude-sonnet-4-5",anthropic_aws:"claude-sonnet-4-5-20250929",anthropic_google_cloud:"claude-sonnet-4-5-20250929",mantle:null,gateway:"claude-sonnet-4-5-20250929"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_5_SONNET",fallback_3p:"claude-sonnet-4-0",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"tier_3_15",capabilities:["context_management"]},{id:"claude-sonnet-4-6",family:"sonnet",display_name:"Sonnet 4.6",knowledge_cutoff:"August 2025",provider_ids:{first_party:"claude-sonnet-4-6",bedrock:"us.anthropic.claude-sonnet-4-6",vertex:"claude-sonnet-4-6",foundry:"claude-sonnet-4-6",anthropic_aws:"claude-sonnet-4-6",anthropic_google_cloud:"claude-sonnet-4-6",mantle:null,gateway:"claude-sonnet-4-6"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_6_SONNET",fallback_3p:"claude-sonnet-4-5",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:128000},pricing:"tier_3_15",capabilities:["effort","max_effort","adaptive_thinking","context_management"],advisor_rank:2},{id:"claude-sonnet-5",family:"sonnet",display_name:"Sonnet 5",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-sonnet-5",bedrock:"us.anthropic.claude-sonnet-5",vertex:"claude-sonnet-5",foundry:"claude-sonnet-5",anthropic_aws:"claude-sonnet-5",anthropic_google_cloud:"claude-sonnet-5",mantle:"anthropic.claude-sonnet-5",gateway:"claude-sonnet-5"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_5_SONNET",fallback_3p:"claude-sonnet-4-6",context:{window:1e6,native_1m:!0,native_1m_3p:{bedrock:!0,vertex:!0,foundry:!0},supports_1m_beta:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_3_15",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","mid_conv_system","context_management"],default_effort:"high",image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:3},{id:"claude-opus-4-0",family:"opus",display_name:"Opus 4",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-opus-4-20250514",bedrock:"us.anthropic.claude-opus-4-20250514-v1:0",vertex:"claude-opus-4@20250514",foundry:"claude-opus-4",anthropic_aws:"claude-opus-4-20250514",anthropic_google_cloud:null,mantle:null,gateway:"claude-opus-4-20250514"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_0_OPUS",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:32000},pricing:"tier_15_75",capabilities:["context_management"]},{id:"claude-opus-4-1",family:"opus",display_name:"Opus 4.1",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-opus-4-1-20250805",bedrock:"us.anthropic.claude-opus-4-1-20250805-v1:0",vertex:"claude-opus-4-1@20250805",foundry:"claude-opus-4-1",anthropic_aws:"claude-opus-4-1-20250805",anthropic_google_cloud:null,mantle:null,gateway:"claude-opus-4-1-20250805"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_1_OPUS",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:32000},pricing:"tier_15_75",capabilities:["context_management"]},{id:"claude-opus-4-5",family:"opus",display_name:"Opus 4.5",knowledge_cutoff:"May 2025",provider_ids:{first_party:"claude-opus-4-5-20251101",bedrock:"us.anthropic.claude-opus-4-5-20251101-v1:0",vertex:"claude-opus-4-5@20251101",foundry:"claude-opus-4-5",anthropic_aws:"claude-opus-4-5-20251101",anthropic_google_cloud:"claude-opus-4-5-20251101",mantle:null,gateway:"claude-opus-4-5-20251101"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_5_OPUS",fallback_3p:"claude-opus-4-1",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"tier_5_25",capabilities:["context_management"]},{id:"claude-opus-4-6",family:"opus",display_name:"Opus 4.6",knowledge_cutoff:"May 2025",provider_ids:{first_party:"claude-opus-4-6",bedrock:"us.anthropic.claude-opus-4-6-v1",vertex:"claude-opus-4-6",foundry:"claude-opus-4-6",anthropic_aws:"claude-opus-4-6",anthropic_google_cloud:"claude-opus-4-6",mantle:null,gateway:"claude-opus-4-6"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_6_OPUS",fallback_3p:"claude-opus-4-5",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_5_25",capabilities:["effort","max_effort","adaptive_thinking","context_management"],advisor_rank:3},{id:"claude-opus-4-7",family:"opus",display_name:"Opus 4.7",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-opus-4-7",bedrock:"us.anthropic.claude-opus-4-7",vertex:"claude-opus-4-7",foundry:"claude-opus-4-7",anthropic_aws:"claude-opus-4-7",anthropic_google_cloud:"claude-opus-4-7",mantle:"anthropic.claude-opus-4-7",gateway:"claude-opus-4-7"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_7_OPUS",fallback_3p:"claude-opus-4-6",context:{window:1e6,native_1m:!0,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_5_25",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","context_management","fast_mode"],default_effort:"xhigh",image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:4},{id:"claude-opus-4-8",family:"opus",display_name:"Opus 4.8",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-opus-4-8",bedrock:"us.anthropic.claude-opus-4-8",vertex:"claude-opus-4-8",foundry:"claude-opus-4-8",anthropic_aws:"claude-opus-4-8",anthropic_google_cloud:"claude-opus-4-8",mantle:"anthropic.claude-opus-4-8",gateway:"claude-opus-4-8"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_8_OPUS",fallback_3p:"claude-opus-4-7",context:{window:1e6,native_1m:!0,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_5_25",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","mid_conv_system","context_management","fast_mode","lean_prompt"],default_effort:"high",image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:4},{id:"claude-fable-5",family:"fable",display_name:"Fable 5",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-fable-5",bedrock:"us.anthropic.claude-fable-5",vertex:"claude-fable-5",foundry:"claude-fable-5",anthropic_aws:"claude-fable-5",anthropic_google_cloud:"claude-fable-5",mantle:"anthropic.claude-fable-5",gateway:"claude-fable-5"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_FABLE_5",fallback_3p:"claude-opus-4-8",context:{window:1e6,native_1m:!0,supports_1m_beta:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_10_50",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","rejects_disabled_thinking","mid_conv_system","context_management","lean_prompt","fable_5_mitigations","refusal_fallback"],default_effort:"high",image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:5},{id:"claude-mythos-5",family:"mythos",display_name:"Mythos 5",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-mythos-5",bedrock:null,vertex:null,foundry:null,anthropic_aws:null,anthropic_google_cloud:null,mantle:null,gateway:null},context:{window:1e6,native_1m:!0,supports_1m_beta:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_10_50",capabilities:[],image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:5}],aliases:{opus:{default:"claude-opus-4-8",per_provider:{bedrock:"claude-opus-4-8",vertex:"claude-opus-4-8",foundry:"claude-opus-4-6",mantle:"claude-opus-4-8",anthropic_aws:"claude-opus-4-8",gateway:"claude-opus-4-7"}},sonnet:{default:"claude-sonnet-5",per_provider:{bedrock:"claude-sonnet-4-5",vertex:"claude-sonnet-4-5",foundry:"claude-sonnet-4-5",mantle:"claude-sonnet-4-5",anthropic_aws:"claude-sonnet-4-6",gateway:"claude-sonnet-4-6"}},haiku:{default:"claude-haiku-4-5"},fable:{default:"claude-fable-5"}},defaults:{},best:"fable",latest_per_family:{fable:"claude-fable-5",opus:"claude-opus-4-8",sonnet:"claude-sonnet-5",haiku:"claude-haiku-4-5"},alias_migration:{}};function C(e){let t;return()=>t??=e()}var a3=C(()=>l.object({first_party:l.string(),bedrock:l.string().nullish(),vertex:l.string().nullish(),foundry:l.string().nullish(),anthropic_aws:l.string().nullish(),anthropic_google_cloud:l.string().nullish(),mantle:l.string().nullish(),gateway:l.string().nullish()}).loose()),CR=C(()=>l.object({input:l.number(),output:l.number(),cache_write_5m:l.number().optional(),cache_write_1h:l.number().optional(),cache_read:l.number().optional(),web_search:l.number().optional()}).loose()),c3=C(()=>l.object({id:l.string(),family:l.string(),display_name:l.string(),slogan:l.string().optional(),knowledge_cutoff:l.string().optional(),provider_ids:a3(),eager_input_streaming:l.object({bedrock:l.literal(!0).optional(),vertex:l.literal(!0).optional()}).loose().optional(),vertex_region_env_var:l.string().optional(),fallback_3p:l.string().optional(),context:l.object({window:l.number(),native_1m:l.boolean().optional(),native_1m_3p:l.object({bedrock:l.literal(!0).optional(),vertex:l.literal(!0).optional(),foundry:l.literal(!0).optional()}).loose().optional(),supports_1m_beta:l.boolean().optional(),supports_1m_suffix:l.boolean().optional()}).loose().optional(),max_output_tokens:l.object({default:l.number(),upper:l.number()}).loose().optional(),pricing:l.union([l.string(),CR()]).optional(),capabilities:l.array(l.string()).default([]),default_effort:l.enum(["low","medium","high","xhigh","max"]).optional(),image_limits:l.object({maxWidth:l.number().optional(),maxHeight:l.number().optional(),maxBase64Size:l.number().optional()}).loose().optional(),advisor_rank:l.number().optional(),fallback_chain:l.array(l.string()).optional(),picker:l.object({section:l.enum(["main","overflow","deprecated"]).optional(),badge:l.string().optional(),disabled_reason:l.string().optional(),tiers:l.array(l.string()).optional()}).loose().optional(),deprecation:l.object({retirement_dates:l.record(l.string(),l.string()).optional(),remapped_to:l.string().optional()}).loose().optional(),min_cli_version:l.string().optional()}).loose()),l3=C(()=>l.object({default:l.string(),per_provider:l.record(l.string(),l.string()).optional()}).loose()),u3=C(()=>l.object({schema_version:l.number(),pricing_tiers:l.record(l.string(),CR()).default({}),models:l.array(c3()),aliases:l.record(l.string(),l3()).default({}),defaults:l.record(l.string(),l.string()).default({}),best:l.string().optional(),latest_per_family:l.record(l.string(),l.string()).default({}),alias_migration:l.record(l.string(),l.string()).default({})}).loose()),p3={schema_version:0,pricing_tiers:{},models:[],aliases:{},defaults:{},latest_per_family:{},alias_migration:{}},Gv=re(()=>{let e=u3().safeParse(OR);return e.success?e.data:p3}),RR=Gv;function IR(e){return e.replace(/-0$/,"")}var T9e=re(()=>{let e=new Map;for(let t of RR().models)e.set(t.id,t);return e}),A9e=re(()=>{let e=new Map;for(let t of RR().models)for(let r of Object.values(t.provider_ids)){if(typeof r!=="string")continue;let n=r.toLowerCase(),o=e.get(n);if(o!==void 0&&o!==t.id)throw Error("model catalog: provider id collision across distinct entries");e.set(n,t.id)}return e});function PR(){return process.env.CLAUDE_CONFIG_DIR}var Yt=re(()=>(PR()??f3(d3(),".claude")).normalize("NFC"),PR);var j9e=re(()=>ge(process.env.CLAUDE_CODE_SUPERVISED));var F9e=re(()=>Gv().models.flatMap((e)=>e.vertex_region_env_var&&/^VERTEX_REGION_[A-Z0-9_]+$/.test(e.vertex_region_env_var)?[[IR(e.id),e.vertex_region_env_var]]:[]).sort(([e],[t])=>t.length-e.length||(e<t?-1:e>t?1:0)));function F(e,t,r,n,o){if(n==="m")throw TypeError("Private method is not writable");if(n==="a"&&!o)throw TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r}function E(e,t,r,n){if(r==="a"&&!n)throw TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}var Wv=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return Wv=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),r=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(n)=>(+n^r()&15>>+n/4).toString(16))};function Kn(e){return typeof e==="object"&&e!==null&&(("name"in e)&&e.name==="AbortError"||("message"in e)&&String(e.message).includes("FetchRequestCanceledException"))}var nu=(e)=>{if(e instanceof Error)return e;if(typeof e==="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){let t=Error(e.message,e.cause?{cause:e.cause}:{});if(e.stack)t.stack=e.stack;if(e.cause&&!t.cause)t.cause=e.cause;if(e.name)t.name=e.name;return t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)};class B extends Error{}class Tt extends B{constructor(e,t,r,n,o){super(`${Tt.makeMessage(e,t,r)}`);this.status=e,this.headers=n,this.requestID=n?.get("request-id"),this.error=t,this.type=o??null}static makeMessage(e,t,r){let n=t?.message?typeof t.message==="string"?t.message:JSON.stringify(t.message):t?JSON.stringify(t):r;if(e&&n)return`${e} ${n}`;if(e)return`${e} status code (no body)`;if(n)return n;return"(no status code or body)"}static generate(e,t,r,n){if(!e||!n)return new Ai({message:r,cause:nu(t)});let o=t,i=o?.error?.type;if(e===400)return new iu(e,o,r,n,i);if(e===401)return new su(e,o,r,n,i);if(e===403)return new au(e,o,r,n,i);if(e===404)return new cu(e,o,r,n,i);if(e===409)return new lu(e,o,r,n,i);if(e===422)return new uu(e,o,r,n,i);if(e===429)return new pu(e,o,r,n,i);if(e>=500)return new du(e,o,r,n,i);return new Tt(e,o,r,n,i)}}class Pt extends Tt{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class Ai extends Tt{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0);if(t)this.cause=t}}class ou extends Ai{constructor({message:e}={}){super({message:e??"Request timed out."})}}class iu extends Tt{}class su extends Tt{}class au extends Tt{}class cu extends Tt{}class lu extends Tt{}class uu extends Tt{}class pu extends Tt{}class du extends Tt{}var g3=/^[a-z][a-z0-9+.-]*:/i,DR=(e)=>g3.test(e),Vv=(e)=>(Vv=Array.isArray,Vv(e)),Kv=Vv;function Zm(e){if(typeof e!=="object")return{};return e??{}}function Zv(e){if(!e)return!0;for(let t in e)return!1;return!0}function LR(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var NR=(e,t)=>{if(typeof t!=="number"||!Number.isInteger(t))throw new B(`${e} must be an integer`);if(t<0)throw new B(`${e} must be a positive integer`);return t};var Jm=(e)=>{try{return JSON.parse(e)}catch(t){return}};var MR=(e)=>new Promise((t)=>setTimeout(t,e));var $r="0.94.0";var FR=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function h3(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}var _3=()=>{let e=h3();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":$r,"X-Stainless-OS":$R(Deno.build.os),"X-Stainless-Arch":UR(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":$r,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":$r,"X-Stainless-OS":$R(globalThis.process.platform??"unknown"),"X-Stainless-Arch":UR(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=y3();if(t)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":$r,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":$r,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function y3(){if(typeof navigator>"u"||!navigator)return null;let e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:t,pattern:r}of e){let n=r.exec(navigator.userAgent);if(n){let o=n[1]||0,i=n[2]||0,s=n[3]||0;return{browser:t,version:`${o}.${i}.${s}`}}}return null}var UR=(e)=>{if(e==="x32")return"x32";if(e==="x86_64"||e==="x64")return"x64";if(e==="arm")return"arm";if(e==="aarch64"||e==="arm64")return"arm64";if(e)return`other:${e}`;return"unknown"},$R=(e)=>{if(e=e.toLowerCase(),e.includes("ios"))return"iOS";if(e==="android")return"Android";if(e==="darwin")return"MacOS";if(e==="win32")return"Windows";if(e==="freebsd")return"FreeBSD";if(e==="openbsd")return"OpenBSD";if(e==="linux")return"Linux";if(e)return`Other:${e}`;return"Unknown"},jR,fu=()=>jR??(jR=_3());function zR(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function Jv(...e){let t=globalThis.ReadableStream;if(typeof t>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function Ym(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return Jv({start(){},async pull(r){let{done:n,value:o}=await t.next();if(n)r.close();else r.enqueue(o)},async cancel(){await t.return?.()}})}function mu(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let r=await t.read();if(r?.done)t.releaseLock();return r}catch(r){throw t.releaseLock(),r}},async return(){let r=t.cancel();return t.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function BR(e){if(e===null||typeof e!=="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),r=t.cancel();t.releaseLock(),await r}var HR=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});function qR(e){return Object.entries(e).filter(([t,r])=>typeof r<"u").map(([t,r])=>{if(typeof r==="string"||typeof r==="number"||typeof r==="boolean")return`${encodeURIComponent(t)}=${encodeURIComponent(r)}`;if(r===null)return`${encodeURIComponent(t)}=`;throw new B(`Cannot stringify type ${typeof r}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}var WR="urn:ietf:params:oauth:grant-type:jwt-bearer",VR="refresh_token",Xm="/v1/oauth/token",ki="oauth-2025-04-20",KR="oidc-federation-2026-04-01",ZR=120,Qs=30,JR=5,GR=1048576;function Qm(e){if(!e)return;let t;try{t=new URL(e)}catch(n){throw new Le(`Invalid token endpoint base URL "${e}": ${n}`)}if(t.protocol==="https:")return;let r=t.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(t.protocol==="http:"&&(r==="localhost"||r==="127.0.0.1"||r==="::1"))return;throw new Le(`Refusing to send credential over non-https token endpoint "${e}"`)}async function eg(e,t){let r=await S3(e),n;try{n=JSON.parse(r)}catch{throw new Le(`Token endpoint returned non-JSON response (status ${e.status})`,e.status,cr(r),t)}if(!n.access_token)throw new Le(`Token endpoint response missing access_token: ${JSON.stringify(cr(n))}`,e.status,cr(n),t);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new Le(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,e.status,cr(n),t);return n}var Yv=2000,v3=new Set(["error","error_description","error_uri"]);function cr(e){if(e==null)return e;if(typeof e==="string"){let t;try{t=JSON.parse(e)}catch{if(e.length<=Yv)return e;return e.slice(0,Yv)+`... <${e.length-Yv} more chars>`}return JSON.stringify(cr(t))}if(typeof e==="object"&&!Array.isArray(e)){let t={};for(let[r,n]of Object.entries(e))if(v3.has(r))t[r]=n;return t}return null}async function tg(e,t=(r)=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await import("node:fs"),n=e,o;try{n=await r.promises.realpath(e),o=await r.promises.stat(n)}catch{return}let i=o.mode&511;if(i&18)throw new Le(`Credentials file at ${n} is group/world-writable (mode 0o${i.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${n}\`.`);if(i&36)throw new Le(`Credentials file at ${n} is group/world-readable (mode 0o${i.toString(8)}); run \`chmod 600 ${n}\` before retrying.`);if(typeof process.getuid==="function"&&o.uid!==process.getuid())t(`credentials file at ${n} is owned by uid ${o.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function rg(e,t){let r=await import("node:fs"),o=(await import("node:path")).dirname(e);await r.promises.mkdir(o,{recursive:!0,mode:448});let i=`${e}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await r.promises.open(i,"w",384);try{await s.writeFile(JSON.stringify(t,null,2)),await s.sync()}finally{await s.close()}await r.promises.rename(i,e)}catch(s){throw await r.promises.unlink(i).catch(()=>{}),s}try{let s=await r.promises.open(o,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function S3(e){if(!e.body)return"";let t=e.body.getReader(),r=[],n=0;for(;;){let{done:i,value:s}=await t.read();if(i)break;if(n+s.length>GR){let a=GR-n;if(a>0)r.push(s.subarray(0,a));await t.cancel();break}r.push(s),n+=s.length}let o;if(r.length===1)o=r[0];else{o=new Uint8Array(r.reduce((s,a)=>s+a.length,0));let i=0;for(let s of r)o.set(s,i),i+=s.length}return new TextDecoder("utf-8").decode(o)}class Le extends B{constructor(e,t=null,r=null,n=null){super(e);this.statusCode=t,this.body=r,this.requestId=n}}function en(){return Math.floor(Date.now()/1000)}class Xv{constructor(e,t){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=t}async getToken(){let e=this.nextForce;this.nextForce=!1;let t=this.cached;if(e||t==null)return(await this.refresh(e)).token;if(t.expiresAt==null)return t.token;let r=t.expiresAt-en();if(r>ZR)return t.token;if(r>Qs)return this.backgroundRefresh(),t.token;return(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){if(this.pendingRefresh&&!e)return this.pendingRefresh;return this.doRefresh(e)}backgroundRefresh(){if(this.pendingRefresh)return;if(en()-this.lastAdvisoryError<JR)return;this.doRefresh().catch((e)=>{this.lastAdvisoryError=en(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then((t)=>(this.cached=t,this.pendingRefresh=null,t),(t)=>{throw this.pendingRefresh=null,t}),this.pendingRefresh}}var De=(e)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[e]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()||void 0;return};function QR(e){let t=0;for(let o of e)t+=o.length;let r=new Uint8Array(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return r}var YR;function ea(e){let t;return(YR??(t=new globalThis.TextEncoder,YR=t.encode.bind(t)))(e)}var XR;function Qv(e){let t;return(XR??(t=new globalThis.TextDecoder,XR=t.decode.bind(t)))(e)}var og={off:0,error:200,warn:300,info:400,debug:500},eS=(e,t,r)=>{if(!e)return;if(LR(og,e))return e;pt(r).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(og))}`);return};function gu(){}function ng(e,t,r){if(!t||og[e]>og[r])return gu;else return t[e].bind(t)}var E3={error:gu,warn:gu,info:gu,debug:gu},eI=new WeakMap;function pt(e){let t=e.logger,r=e.logLevel??"off";if(!t)return E3;let n=eI.get(t);if(n&&n[0]===r)return n[1];let o={error:ng("error",t,r),warn:ng("warn",t,r),info:ng("info",t,r),debug:ng("debug",t,r)};return eI.set(t,[r,o]),o}var Zn=(e)=>{if(e.options)e.options={...e.options},delete e.options.headers;if(e.headers)e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,r])=>[t,t.toLowerCase()==="x-api-key"||t.toLowerCase()==="authorization"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":r]));if("retryOfRequestLogID"in e){if(e.retryOfRequestLogID)e.retryOf=e.retryOfRequestLogID;delete e.retryOfRequestLogID}return e};var ig="1.0",w3=/^[A-Za-z0-9_.-]+$/;function tI(e){if(!e)throw Error("profile name is empty");if(e==="."||e==="..")throw Error(`profile name "${e}" is not allowed`);if(e.includes("/")||e.includes("\\"))throw Error(`profile name "${e}" must not contain path separators`);if(!w3.test(e))throw Error(`profile name "${e}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var rI=async(e)=>{var t,r;let n=await tS();if(n===null)return null;let o=e??await oI();if(o===null)return null;tI(o);let i=await import("node:fs"),a=(await import("node:path")).join(n,"configs",`${o}.json`),c;try{c=await i.promises.readFile(a,"utf-8")}catch(f){if(f?.code!=="ENOENT")throw Error(`failed to read config file ${a}: ${f}`);c=null}if(c===null){let f=De("ANTHROPIC_ORGANIZATION_ID"),m=De("ANTHROPIC_IDENTITY_TOKEN_FILE"),g=De("ANTHROPIC_FEDERATION_RULE_ID");if(g&&f)return{fromFile:!1,config:{organization_id:f,workspace_id:De("ANTHROPIC_WORKSPACE_ID"),base_url:De("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:g,service_account_id:De("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:m?{source:"file",path:m}:void 0,scope:De("ANTHROPIC_SCOPE")}}};return null}let u;try{u=JSON.parse(c)}catch(f){throw Error(`failed to parse config file ${a}: ${f}`)}if(!u.authentication)throw Error(`config file ${a} is missing "authentication"`);let d=u.authentication.type;if(d!=="oidc_federation"&&d!=="user_oauth")throw Error(`authentication.type "${d}" is not a known authentication type`);if(u.organization_id??(u.organization_id=De("ANTHROPIC_ORGANIZATION_ID")),u.workspace_id??(u.workspace_id=De("ANTHROPIC_WORKSPACE_ID")),u.base_url??(u.base_url=De("ANTHROPIC_BASE_URL")),(t=u.authentication).scope??(t.scope=De("ANTHROPIC_SCOPE")),u.authentication.type==="oidc_federation"){if(!u.authentication.identity_token){let f=De("ANTHROPIC_IDENTITY_TOKEN_FILE");if(f)u.authentication.identity_token={source:"file",path:f}}if(!u.authentication.federation_rule_id)u.authentication.federation_rule_id=De("ANTHROPIC_FEDERATION_RULE_ID")??"";(r=u.authentication).service_account_id??(r.service_account_id=De("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:u,fromFile:!0}};var nI=async(e,t)=>{if(e?.authentication.credentials_path)return e.authentication.credentials_path;let r=await tS();if(!r)return null;let n=t??await oI();if(!n)return null;return tI(n),(await import("node:path")).join(r,"credentials",`${n}.json`)},tS=async()=>{if(!T3())return null;let e=await import("node:path"),t=De("ANTHROPIC_CONFIG_DIR");if(t)return t;if(fu()["X-Stainless-OS"]==="Windows"){let i=De("APPDATA");if(i)return e.join(i,"Anthropic");let s=De("USERPROFILE");if(s)return e.join(s,"AppData","Roaming","Anthropic");return null}let n=De("XDG_CONFIG_HOME");if(n)return e.join(n,"anthropic");let o=De("HOME");if(o)return e.join(o,".config","anthropic");return null},T3=()=>{let e=fu()["X-Stainless-Runtime"];return e==="node"||e==="deno"},oI=async()=>{let e=await tS();if(!e)return null;let t=De("ANTHROPIC_PROFILE");if(t)return t;let r=await import("node:fs"),o=(await import("node:path")).join(e,"active_config");try{return(await r.promises.readFile(o,"utf-8")).trim()||"default"}catch(i){if(i?.code!=="ENOENT")throw Error(`failed to read ${o}: ${i}`);return"default"}};function rS(e){if(!e)throw new B("Identity token file path is empty");return async()=>{let t=await import("node:fs"),r;try{r=await t.promises.readFile(e,"utf-8")}catch(o){throw new B(`Failed to read identity token file at ${e}: ${o}`)}let n=r.trim();if(!n)throw new B(`Identity token file at ${e} is empty`);return n}}function iI(e){if(!e)throw new B("Identity token value is empty");return()=>e}function sI(e){return async()=>{Qm(e.baseURL);let t=await e.identityTokenProvider();if(t.length>16384)throw new Le(`Identity token is ${Math.ceil(t.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:WR,assertion:t,federation_rule_id:e.federationRuleId,organization_id:e.organizationId};if(e.serviceAccountId)r.service_account_id=e.serviceAccountId;if(e.workspaceId)r.workspace_id=e.workspaceId;let n=`${e.baseURL}${Xm}`,o;try{o=await e.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${ki},${KR}`,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${$r} oidcFederationProvider`},body:JSON.stringify(r)})}catch(c){throw new Le(`Failed to reach token endpoint ${n}: ${c}`)}let i=o.headers.get("Request-Id");if(!o.ok){let c=await o.text().catch(()=>""),u=cr(c),d="";if(o.status===401)d=` Ensure your federation rule matches your identity token. ${e.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`;throw new Le(`Token exchange failed with status ${o.status}${i?` (request-id ${i})`:""}: ${u}${d}`,o.status,u,i)}let s=await eg(o,i),a=Number(s.expires_in);if(!Number.isFinite(a))throw new Le(`Token endpoint response missing required fields: ${JSON.stringify(cr(s))}`,o.status,cr(s),i);return{token:s.access_token,expiresAt:en()+a}}}function aI(e){return async(t)=>{let r=await import("node:fs");await tg(e.credentialsPath,e.onSafetyWarning);let n;try{n=await r.promises.readFile(e.credentialsPath,"utf-8")}catch(y){throw new Le(`Credentials file not found at ${e.credentialsPath}: ${y}`)}let o;try{o=JSON.parse(n)}catch(y){throw new Le(`Credentials file at ${e.credentialsPath} is not valid JSON: ${y}`)}let i=o.access_token;if(!i)throw new Le(`Credentials file at ${e.credentialsPath} must include 'access_token'`);let s=o.expires_at;if(!t?.forceRefresh&&(s==null||en()<s-Qs))return{token:i,expiresAt:s??null};let a=o.refresh_token;if(!e.clientId||!a)throw new Le(`Access token at ${e.credentialsPath} has expired and no refresh is available (client_id ${e.clientId?"set":"empty"}, refresh_token ${a?"set":"empty"})`);Qm(e.baseURL);let c={grant_type:VR,refresh_token:a,client_id:e.clientId},u=`${e.baseURL}${Xm}`,d;try{d=await e.fetch(u,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":ki,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${$r} userOAuthProvider`},body:JSON.stringify(c)})}catch(y){throw new Le(`User OAuth refresh failed to reach token endpoint: ${y}`)}let f=d.headers.get("Request-Id");if(!d.ok){let y=await d.text().catch(()=>"");throw new Le(`User OAuth refresh failed (HTTP ${d.status}): ${cr(y)}`,d.status,cr(y),f)}let m=await eg(d,f),g=Number(m.expires_in);if(!Number.isFinite(g))throw new Le(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(cr(m))}`,d.status,cr(m),f);let h=en()+g,_=m.refresh_token||a;return await rg(e.credentialsPath,{...o,version:ig,type:"oauth_token",access_token:m.access_token,expires_at:h,refresh_token:_}),{token:m.access_token,expiresAt:h}}}function nS(e,t){let r=e.authentication.credentials_path??null,n=(e.base_url||t.baseURL).replace(/\/+$/,""),o=A3(e,r,n,t),i={};if(e.workspace_id&&e.authentication.type==="user_oauth")i["anthropic-workspace-id"]=e.workspace_id;return{provider:o,extraHeaders:i,baseURL:e.base_url||void 0}}async function cI(e,t){let r=await rI(t);if(!r)return null;let{config:n,fromFile:o}=r,i=n.authentication.credentials_path||!o?n:{...n,authentication:{...n.authentication,credentials_path:await nI(n,t)??void 0}};return nS(i,e)}function A3(e,t,r,n){switch(e.authentication.type){case"oidc_federation":{let o=e.authentication,i=k3(o);if(!i)throw new Le("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!o.federation_rule_id)throw new Le("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!e.organization_id)throw new Le("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let s=sI({identityTokenProvider:i,federationRuleId:o.federation_rule_id,organizationId:e.organization_id,serviceAccountId:o.service_account_id,workspaceId:e.workspace_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent});if(t)return O3(s,t,n.onCacheWriteError,n.onSafetyWarning);return s}case"user_oauth":{if(!t)throw new Le("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to <config_dir>/credentials/<profile>.json)");return aI({credentialsPath:t,clientId:e.authentication.client_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent,onSafetyWarning:n.onSafetyWarning})}default:{let o=e.authentication.type;throw new Le(`authentication.type "${o}" is not a known authentication type`)}}}function k3(e){if(e.identity_token){let n=e.identity_token.source;if(n!=="file")throw new Le(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!e.identity_token.path)throw new Le('identity_token.source "file" requires a non-empty path');return rS(e.identity_token.path)}let t=De("ANTHROPIC_IDENTITY_TOKEN_FILE");if(t)return rS(t);let r=De("ANTHROPIC_IDENTITY_TOKEN");if(r)return iI(r);return null}function O3(e,t,r,n){return async(o)=>{let i=await import("node:fs");await tg(t,n);let s;try{let c=await i.promises.readFile(t,"utf-8");s=JSON.parse(c);let u=s?.access_token;if(u&&!o?.forceRefresh){let d=s?.expires_at;if(d==null||en()<d-Qs)return{token:u,expiresAt:d??null}}}catch(c){if(c?.code!=="ENOENT"&&!(c instanceof SyntaxError))r?.(c)}let a=await e(o);try{await rg(t,{...s??{},version:ig,type:"oauth_token",access_token:a.token,expires_at:a.expiresAt})}catch(c){r?.(c)}return a}}var Er,wr;class Oo{constructor(){Er.set(this,void 0),wr.set(this,void 0),F(this,Er,new Uint8Array,"f"),F(this,wr,null,"f")}decode(e){if(e==null)return[];let t=e instanceof ArrayBuffer?new Uint8Array(e):typeof e==="string"?ea(e):e;F(this,Er,QR([E(this,Er,"f"),t]),"f");let r=[],n;while((n=C3(E(this,Er,"f"),E(this,wr,"f")))!=null){if(n.carriage&&E(this,wr,"f")==null){F(this,wr,n.index,"f");continue}if(E(this,wr,"f")!=null&&(n.index!==E(this,wr,"f")+1||n.carriage)){r.push(Qv(E(this,Er,"f").subarray(0,E(this,wr,"f")-1))),F(this,Er,E(this,Er,"f").subarray(E(this,wr,"f")),"f"),F(this,wr,null,"f");continue}let o=E(this,wr,"f")!==null?n.preceding-1:n.preceding,i=Qv(E(this,Er,"f").subarray(0,o));r.push(i),F(this,Er,E(this,Er,"f").subarray(n.index),"f"),F(this,wr,null,"f")}return r}flush(){if(!E(this,Er,"f").length)return[];return this.decode(`
|
|
63
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);else if(r.cycles==="ref")i(u);continue}if(d.count>1){if(r.reused==="ref"){i(u);continue}}}let s=(u,d)=>{let f=this.seen.get(u),m=f.def??f.schema,g={...m};if(f.ref===null)return;let h=f.ref;if(f.ref=null,h){s(h,d);let _=this.seen.get(h).schema;if(_.$ref&&d.target==="draft-7")m.allOf=m.allOf??[],m.allOf.push(_);else Object.assign(m,_),Object.assign(m,g)}if(!f.isParent)this.override({zodSchema:u,jsonSchema:m,path:f.path??[]})};for(let u of[...this.seen.entries()].reverse())s(u[0],{target:this.target});let a={};if(this.target==="draft-2020-12")a.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")a.$schema="http://json-schema.org/draft-07/schema#";else console.warn(`Invalid target: ${this.target}`);Object.assign(a,n.def);let c=r.external?.defs??{};for(let u of this.seen.entries()){let d=u[1];if(d.def&&d.defId)c[d.defId]=d.def}if(!r.external&&Object.keys(c).length>0)if(this.target==="draft-2020-12")a.$defs=c;else a.definitions=c;try{return JSON.parse(JSON.stringify(a))}catch(u){throw Error("Error converting schema to JSON.")}}}function Zs(e,t){if(e instanceof ml){let n=new Lm(t),o={};for(let a of e._idmap.entries()){let[c,u]=a;n.process(u)}let i={},s={registry:e,uri:t?.uri||((a)=>a),defs:o};for(let a of e._idmap.entries()){let[c,u]=a;i[c]=n.emit(u,{...t,external:s})}if(Object.keys(o).length>0){let a=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[a]:o}}return{schemas:i}}let r=new Lm(t);return r.process(e),r.emit(e,t)}function wt(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;switch(o.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return wt(o.element,r);case"object":{for(let i in o.shape)if(wt(o.shape[i],r))return!0;return!1}case"union":{for(let i of o.options)if(wt(i,r))return!0;return!1}case"intersection":return wt(o.left,r)||wt(o.right,r);case"tuple":{for(let i of o.items)if(wt(i,r))return!0;if(o.rest&&wt(o.rest,r))return!0;return!1}case"record":return wt(o.keyType,r)||wt(o.valueType,r);case"map":return wt(o.keyType,r)||wt(o.valueType,r);case"set":return wt(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return wt(o.innerType,r);case"lazy":return wt(o.getter(),r);case"default":return wt(o.innerType,r);case"prefault":return wt(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return wt(o.in,r)||wt(o.out,r);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${o.type}`)}var HC={};var Js={};lt(Js,{time:()=>uv,duration:()=>pv,datetime:()=>cv,date:()=>lv,ZodISOTime:()=>Um,ZodISODuration:()=>$m,ZodISODateTime:()=>Nm,ZodISODate:()=>Mm});var Nm=S("ZodISODateTime",(e,t)=>{nx.init(e,t),Ge.init(e,t)});function cv(e){return Vx(Nm,e)}var Mm=S("ZodISODate",(e,t)=>{ox.init(e,t),Ge.init(e,t)});function lv(e){return Kx(Mm,e)}var Um=S("ZodISOTime",(e,t)=>{ix.init(e,t),Ge.init(e,t)});function uv(e){return Zx(Um,e)}var $m=S("ZodISODuration",(e,t)=>{sx.init(e,t),Ge.init(e,t)});function pv(e){return Jx($m,e)}var GC=(e,t)=>{cl.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(r)=>$s(e,r)},flatten:{value:(r)=>Us(e,r)},addIssue:{value:(r)=>e.issues.push(r)},addIssues:{value:(r)=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},XZ=S("ZodError",GC),Ys=S("ZodError",GC,{Parent:Error});var dv=Qd(Ys),fv=ef(Ys),mv=tf(Ys),gv=rf(Ys);var de=S("ZodType",(e,t)=>(ie.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map((n)=>typeof n==="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(r,n)=>zt(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.parse=(r,n)=>dv(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>mv(e,r,n),e.parseAsync=async(r,n)=>fv(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>gv(e,r,n),e.spa=e.safeParseAsync,e.refine=(r,n)=>e.check(TR(r,n)),e.superRefine=(r)=>e.check(AR(r)),e.overwrite=(r)=>e.check(Wn(r)),e.optional=()=>We(e),e.nullable=()=>Fm(e),e.nullish=()=>We(Fm(e)),e.nonoptional=(r)=>fR(e,r),e.array=()=>he(e),e.or=(r)=>$e([e,r]),e.and=(r)=>tu(e,r),e.transform=(r)=>zm(e,jv(r)),e.default=(r)=>uR(e,r),e.prefault=(r)=>dR(e,r),e.catch=(r)=>hR(e,r),e.pipe=(r)=>zm(e,r),e.readonly=()=>bR(e),e.describe=(r)=>{let n=e.clone();return sr.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return sr.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return sr.get(e);let n=e.clone();return sr.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),_v=S("_ZodString",(e,t)=>{To.init(e,t),de.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check($l(...n)),e.includes=(...n)=>e.check(zl(...n)),e.startsWith=(...n)=>e.check(Bl(...n)),e.endsWith=(...n)=>e.check(Hl(...n)),e.min=(...n)=>e.check(ko(...n)),e.max=(...n)=>e.check(Vs(...n)),e.length=(...n)=>e.check(Ks(...n)),e.nonempty=(...n)=>e.check(ko(1,...n)),e.lowercase=(n)=>e.check(jl(n)),e.uppercase=(n)=>e.check(Fl(n)),e.trim=()=>e.check(Wl()),e.normalize=(...n)=>e.check(Gl(...n)),e.toLowerCase=()=>e.check(Vl()),e.toUpperCase=()=>e.check(Kl())}),Yl=S("ZodString",(e,t)=>{To.init(e,t),_v.init(e,t),e.email=(r)=>e.check(hl(yv,r)),e.url=(r)=>e.check(vl(bv,r)),e.jwt=(r)=>e.check(Ml(Lv,r)),e.emoji=(r)=>e.check(Sl(xv,r)),e.guid=(r)=>e.check(Gs(jm,r)),e.uuid=(r)=>e.check(_l(Vn,r)),e.uuidv4=(r)=>e.check(yl(Vn,r)),e.uuidv6=(r)=>e.check(bl(Vn,r)),e.uuidv7=(r)=>e.check(xl(Vn,r)),e.nanoid=(r)=>e.check(El(vv,r)),e.guid=(r)=>e.check(Gs(jm,r)),e.cuid=(r)=>e.check(wl(Sv,r)),e.cuid2=(r)=>e.check(Tl(Ev,r)),e.ulid=(r)=>e.check(Al(wv,r)),e.base64=(r)=>e.check(Dl(Iv,r)),e.base64url=(r)=>e.check(Ll(Pv,r)),e.xid=(r)=>e.check(kl(Tv,r)),e.ksuid=(r)=>e.check(Ol(Av,r)),e.ipv4=(r)=>e.check(Cl(kv,r)),e.ipv6=(r)=>e.check(Rl(Ov,r)),e.cidrv4=(r)=>e.check(Il(Cv,r)),e.cidrv6=(r)=>e.check(Pl(Rv,r)),e.e164=(r)=>e.check(Nl(Dv,r)),e.datetime=(r)=>e.check(cv(r)),e.date=(r)=>e.check(lv(r)),e.time=(r)=>e.check(uv(r)),e.duration=(r)=>e.check(pv(r))});function A(e){return cm(Yl,e)}var Ge=S("ZodStringFormat",(e,t)=>{Ue.init(e,t),_v.init(e,t)}),yv=S("ZodEmail",(e,t)=>{df.init(e,t),Ge.init(e,t)});function e9(e){return hl(yv,e)}var jm=S("ZodGUID",(e,t)=>{uf.init(e,t),Ge.init(e,t)});function t9(e){return Gs(jm,e)}var Vn=S("ZodUUID",(e,t)=>{pf.init(e,t),Ge.init(e,t)});function r9(e){return _l(Vn,e)}function n9(e){return yl(Vn,e)}function o9(e){return bl(Vn,e)}function i9(e){return xl(Vn,e)}var bv=S("ZodURL",(e,t)=>{ff.init(e,t),Ge.init(e,t)});function s9(e){return vl(bv,e)}var xv=S("ZodEmoji",(e,t)=>{mf.init(e,t),Ge.init(e,t)});function a9(e){return Sl(xv,e)}var vv=S("ZodNanoID",(e,t)=>{gf.init(e,t),Ge.init(e,t)});function c9(e){return El(vv,e)}var Sv=S("ZodCUID",(e,t)=>{hf.init(e,t),Ge.init(e,t)});function l9(e){return wl(Sv,e)}var Ev=S("ZodCUID2",(e,t)=>{_f.init(e,t),Ge.init(e,t)});function u9(e){return Tl(Ev,e)}var wv=S("ZodULID",(e,t)=>{yf.init(e,t),Ge.init(e,t)});function p9(e){return Al(wv,e)}var Tv=S("ZodXID",(e,t)=>{bf.init(e,t),Ge.init(e,t)});function d9(e){return kl(Tv,e)}var Av=S("ZodKSUID",(e,t)=>{xf.init(e,t),Ge.init(e,t)});function f9(e){return Ol(Av,e)}var kv=S("ZodIPv4",(e,t)=>{vf.init(e,t),Ge.init(e,t)});function m9(e){return Cl(kv,e)}var Ov=S("ZodIPv6",(e,t)=>{Sf.init(e,t),Ge.init(e,t)});function g9(e){return Rl(Ov,e)}var Cv=S("ZodCIDRv4",(e,t)=>{Ef.init(e,t),Ge.init(e,t)});function h9(e){return Il(Cv,e)}var Rv=S("ZodCIDRv6",(e,t)=>{wf.init(e,t),Ge.init(e,t)});function _9(e){return Pl(Rv,e)}var Iv=S("ZodBase64",(e,t)=>{Tf.init(e,t),Ge.init(e,t)});function y9(e){return Dl(Iv,e)}var Pv=S("ZodBase64URL",(e,t)=>{Af.init(e,t),Ge.init(e,t)});function b9(e){return Ll(Pv,e)}var Dv=S("ZodE164",(e,t)=>{kf.init(e,t),Ge.init(e,t)});function x9(e){return Nl(Dv,e)}var Lv=S("ZodJWT",(e,t)=>{Of.init(e,t),Ge.init(e,t)});function v9(e){return Ml(Lv,e)}var WC=S("ZodCustomStringFormat",(e,t)=>{Cf.init(e,t),Ge.init(e,t)});function S9(e,t,r={}){return Pm(WC,e,t,r)}var Xl=S("ZodNumber",(e,t)=>{ll.init(e,t),de.init(e,t),e.gt=(n,o)=>e.check(Gn(n,o)),e.gte=(n,o)=>e.check(ar(n,o)),e.min=(n,o)=>e.check(ar(n,o)),e.lt=(n,o)=>e.check(qn(n,o)),e.lte=(n,o)=>e.check(Ur(n,o)),e.max=(n,o)=>e.check(Ur(n,o)),e.int=(n)=>e.check(hv(n)),e.safe=(n)=>e.check(hv(n)),e.positive=(n)=>e.check(Gn(0,n)),e.nonnegative=(n)=>e.check(ar(0,n)),e.negative=(n)=>e.check(qn(0,n)),e.nonpositive=(n)=>e.check(Ur(0,n)),e.multipleOf=(n,o)=>e.check(wi(n,o)),e.step=(n,o)=>e.check(wi(n,o)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??0.5),e.isFinite=!0,e.format=r.format??null});function Ce(e){return um(Xl,e)}var Xs=S("ZodNumberFormat",(e,t)=>{Rf.init(e,t),Xl.init(e,t)});function hv(e){return pm(Xs,e)}function E9(e){return dm(Xs,e)}function w9(e){return fm(Xs,e)}function T9(e){return mm(Xs,e)}function A9(e){return gm(Xs,e)}var Ql=S("ZodBoolean",(e,t)=>{Fs.init(e,t),de.init(e,t)});function ht(e){return hm(Ql,e)}var eu=S("ZodBigInt",(e,t)=>{ul.init(e,t),de.init(e,t),e.gte=(n,o)=>e.check(ar(n,o)),e.min=(n,o)=>e.check(ar(n,o)),e.gt=(n,o)=>e.check(Gn(n,o)),e.gte=(n,o)=>e.check(ar(n,o)),e.min=(n,o)=>e.check(ar(n,o)),e.lt=(n,o)=>e.check(qn(n,o)),e.lte=(n,o)=>e.check(Ur(n,o)),e.max=(n,o)=>e.check(Ur(n,o)),e.positive=(n)=>e.check(Gn(BigInt(0),n)),e.negative=(n)=>e.check(qn(BigInt(0),n)),e.nonpositive=(n)=>e.check(Ur(BigInt(0),n)),e.nonnegative=(n)=>e.check(ar(BigInt(0),n)),e.multipleOf=(n,o)=>e.check(wi(n,o));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function k9(e){return _m(eu,e)}var Nv=S("ZodBigIntFormat",(e,t)=>{If.init(e,t),eu.init(e,t)});function O9(e){return ym(Nv,e)}function C9(e){return bm(Nv,e)}var VC=S("ZodSymbol",(e,t)=>{Pf.init(e,t),de.init(e,t)});function R9(e){return xm(VC,e)}var KC=S("ZodUndefined",(e,t)=>{Df.init(e,t),de.init(e,t)});function I9(e){return vm(KC,e)}var ZC=S("ZodNull",(e,t)=>{Lf.init(e,t),de.init(e,t)});function Bm(e){return Sm(ZC,e)}var JC=S("ZodAny",(e,t)=>{Nf.init(e,t),de.init(e,t)});function P9(){return Em(JC)}var YC=S("ZodUnknown",(e,t)=>{Si.init(e,t),de.init(e,t)});function Ke(){return Ei(YC)}var XC=S("ZodNever",(e,t)=>{Mf.init(e,t),de.init(e,t)});function Hm(e){return wm(XC,e)}var QC=S("ZodVoid",(e,t)=>{Uf.init(e,t),de.init(e,t)});function D9(e){return Tm(QC,e)}var qm=S("ZodDate",(e,t)=>{$f.init(e,t),de.init(e,t),e.min=(n,o)=>e.check(ar(n,o)),e.max=(n,o)=>e.check(Ur(n,o));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function L9(e){return Am(qm,e)}var eR=S("ZodArray",(e,t)=>{zs.init(e,t),de.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(ko(r,n)),e.nonempty=(r)=>e.check(ko(1,r)),e.max=(r,n)=>e.check(Vs(r,n)),e.length=(r,n)=>e.check(Ks(r,n)),e.unwrap=()=>e.element});function he(e,t){return Zl(eR,e,t)}function N9(e){let t=e._zod.def.shape;return Z(Object.keys(t))}var Gm=S("ZodObject",(e,t)=>{pl.init(e,t),de.init(e,t),M.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Jt(Object.keys(e._zod.def.shape)),e.catchall=(r)=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ke()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ke()}),e.strict=()=>e.clone({...e._zod.def,catchall:Hm()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=(r)=>M.extend(e,r),e.merge=(r)=>M.merge(e,r),e.pick=(r)=>M.pick(e,r),e.omit=(r)=>M.omit(e,r),e.partial=(...r)=>M.partial(Fv,e,r[0]),e.required=(...r)=>M.required(zv,e,r[0])});function G(e,t){let r={type:"object",get shape(){return M.assignProp(this,"shape",{...e}),this.shape},...M.normalizeParams(t)};return new Gm(r)}function M9(e,t){return new Gm({type:"object",get shape(){return M.assignProp(this,"shape",{...e}),this.shape},catchall:Hm(),...M.normalizeParams(t)})}function Bt(e,t){return new Gm({type:"object",get shape(){return M.assignProp(this,"shape",{...e}),this.shape},catchall:Ke(),...M.normalizeParams(t)})}var Mv=S("ZodUnion",(e,t)=>{dl.init(e,t),de.init(e,t),e.options=t.options});function $e(e,t){return new Mv({type:"union",options:e,...M.normalizeParams(t)})}var tR=S("ZodDiscriminatedUnion",(e,t)=>{Mv.init(e,t),jf.init(e,t)});function Wm(e,t,r){return new tR({type:"union",options:t,discriminator:e,...M.normalizeParams(r)})}var rR=S("ZodIntersection",(e,t)=>{Ff.init(e,t),de.init(e,t)});function tu(e,t){return new rR({type:"intersection",left:e,right:t})}var nR=S("ZodTuple",(e,t)=>{Ao.init(e,t),de.init(e,t),e.rest=(r)=>e.clone({...e._zod.def,rest:r})});function U9(e,t,r){let n=t instanceof ie,o=n?r:t;return new nR({type:"tuple",items:e,rest:n?t:null,...M.normalizeParams(o)})}var Uv=S("ZodRecord",(e,t)=>{zf.init(e,t),de.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function je(e,t,r){return new Uv({type:"record",keyType:e,valueType:t,...M.normalizeParams(r)})}function $9(e,t,r){return new Uv({type:"record",keyType:$e([e,Hm()]),valueType:t,...M.normalizeParams(r)})}var oR=S("ZodMap",(e,t)=>{Bf.init(e,t),de.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function j9(e,t,r){return new oR({type:"map",keyType:e,valueType:t,...M.normalizeParams(r)})}var iR=S("ZodSet",(e,t)=>{Hf.init(e,t),de.init(e,t),e.min=(...r)=>e.check(Ti(...r)),e.nonempty=(r)=>e.check(Ti(1,r)),e.max=(...r)=>e.check(Ws(...r)),e.size=(...r)=>e.check(Ul(...r))});function F9(e,t){return new iR({type:"set",valueType:e,...M.normalizeParams(t)})}var Jl=S("ZodEnum",(e,t)=>{qf.init(e,t),de.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new Jl({...t,checks:[],...M.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw Error(`Key ${s} not found in enum`);return new Jl({...t,checks:[],...M.normalizeParams(o),entries:i})}});function Jt(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((n)=>[n,n])):e;return new Jl({type:"enum",entries:r,...M.normalizeParams(t)})}function z9(e,t){return new Jl({type:"enum",entries:e,...M.normalizeParams(t)})}var sR=S("ZodLiteral",(e,t)=>{Gf.init(e,t),de.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Z(e,t){return new sR({type:"literal",values:Array.isArray(e)?e:[e],...M.normalizeParams(t)})}var aR=S("ZodFile",(e,t)=>{Wf.init(e,t),de.init(e,t),e.min=(r,n)=>e.check(Ti(r,n)),e.max=(r,n)=>e.check(Ws(r,n)),e.mime=(r,n)=>e.check(ql(Array.isArray(r)?r:[r],n))});function B9(e){return Om(aR,e)}var $v=S("ZodTransform",(e,t)=>{Bs.init(e,t),de.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=(i)=>{if(typeof i==="string")r.issues.push(M.issue(i,r.value,t));else{let s=i;if(s.fatal)s.continue=!1;s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),r.issues.push(M.issue(s))}};let o=t.transform(r.value,r);if(o instanceof Promise)return o.then((i)=>(r.value=i,r));return r.value=o,r}});function jv(e){return new $v({type:"transform",transform:e})}var Fv=S("ZodOptional",(e,t)=>{Vf.init(e,t),de.init(e,t),e.unwrap=()=>e._zod.def.innerType});function We(e){return new Fv({type:"optional",innerType:e})}var cR=S("ZodNullable",(e,t)=>{Kf.init(e,t),de.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Fm(e){return new cR({type:"nullable",innerType:e})}function H9(e){return We(Fm(e))}var lR=S("ZodDefault",(e,t)=>{Zf.init(e,t),de.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function uR(e,t){return new lR({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():t}})}var pR=S("ZodPrefault",(e,t)=>{Jf.init(e,t),de.init(e,t),e.unwrap=()=>e._zod.def.innerType});function dR(e,t){return new pR({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():t}})}var zv=S("ZodNonOptional",(e,t)=>{Yf.init(e,t),de.init(e,t),e.unwrap=()=>e._zod.def.innerType});function fR(e,t){return new zv({type:"nonoptional",innerType:e,...M.normalizeParams(t)})}var mR=S("ZodSuccess",(e,t)=>{Xf.init(e,t),de.init(e,t),e.unwrap=()=>e._zod.def.innerType});function q9(e){return new mR({type:"success",innerType:e})}var gR=S("ZodCatch",(e,t)=>{Qf.init(e,t),de.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function hR(e,t){return new gR({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}var _R=S("ZodNaN",(e,t)=>{em.init(e,t),de.init(e,t)});function G9(e){return km(_R,e)}var Bv=S("ZodPipe",(e,t)=>{Hs.init(e,t),de.init(e,t),e.in=t.in,e.out=t.out});function zm(e,t){return new Bv({type:"pipe",in:e,out:t})}var yR=S("ZodReadonly",(e,t)=>{tm.init(e,t),de.init(e,t)});function bR(e){return new yR({type:"readonly",innerType:e})}var xR=S("ZodTemplateLiteral",(e,t)=>{rm.init(e,t),de.init(e,t)});function W9(e,t){return new xR({type:"template_literal",parts:e,...M.normalizeParams(t)})}var vR=S("ZodLazy",(e,t)=>{om.init(e,t),de.init(e,t),e.unwrap=()=>e._zod.def.getter()});function SR(e){return new vR({type:"lazy",getter:e})}var ER=S("ZodPromise",(e,t)=>{nm.init(e,t),de.init(e,t),e.unwrap=()=>e._zod.def.innerType});function V9(e){return new ER({type:"promise",innerType:e})}var Vm=S("ZodCustom",(e,t)=>{im.init(e,t),de.init(e,t)});function wR(e,t){let r=new Xe({check:"custom",...M.normalizeParams(t)});return r._zod.check=e,r}function Hv(e,t){return Cm(Vm,e??(()=>!0),t)}function TR(e,t={}){return Rm(Vm,e,t)}function AR(e,t){let r=wR((n)=>(n.addIssue=(o)=>{if(typeof o==="string")n.issues.push(M.issue(o,n.value,r._zod.def));else{let i=o;if(i.fatal)i.continue=!1;i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(M.issue(i))}},e(n.value,n)),t);return r}function K9(e,t={error:`Input not instance of ${e.name}`}){let r=new Vm({type:"custom",check:"custom",fn:(n)=>n instanceof e,abort:!0,...M.normalizeParams(t)});return r._zod.bag.Class=e,r}var Z9=(...e)=>Im({Pipe:Bv,Boolean:Ql,String:Yl,Transform:$v},...e);function J9(e){let t=SR(()=>$e([A(e),Ce(),ht(),Bm(),he(t),je(A(),t)]));return t}function Km(e,t){return zm(jv(e),t)}var Y9={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 X9(e){ut({customError:e})}function Q9(){return ut().customError}var qv={};lt(qv,{string:()=>e3,number:()=>t3,date:()=>o3,boolean:()=>r3,bigint:()=>n3});function e3(e){return Wx(Yl,e)}function t3(e){return Yx(Xl,e)}function r3(e){return Xx(Ql,e)}function n3(e){return Qx(eu,e)}function o3(e){return ev(qm,e)}ut(fl());var kR=l;var ru=kR;var OR={"//":"Hand-maintained baked-in model catalog — the source of truth for per-model provider IDs and metadata. On model launch add one entry to `models` below; `bun run generate:model-catalog` validates this file against the schema and formats it.",schema_version:1,pricing_tiers:{tier_3_15:{input:3,output:15,cache_write_5m:3.75,cache_write_1h:6,cache_read:0.3,web_search:0.01},tier_5_25:{input:5,output:25,cache_write_5m:6.25,cache_write_1h:10,cache_read:0.5,web_search:0.01},tier_15_75:{input:15,output:75,cache_write_5m:18.75,cache_write_1h:30,cache_read:1.5,web_search:0.01},tier_10_50:{input:10,output:50,cache_write_5m:12.5,cache_write_1h:20,cache_read:1,web_search:0.01},haiku_35:{input:0.8,output:4,cache_write_5m:1,cache_write_1h:1.6,cache_read:0.08,web_search:0.01},haiku_45:{input:1,output:5,cache_write_5m:1.25,cache_write_1h:2,cache_read:0.1,web_search:0.01}},models:[{id:"claude-3-5-haiku",family:"haiku",display_name:"Haiku 3.5",provider_ids:{first_party:"claude-3-5-haiku-20241022",bedrock:"us.anthropic.claude-3-5-haiku-20241022-v1:0",vertex:"claude-3-5-haiku@20241022",foundry:"claude-3-5-haiku",anthropic_aws:"claude-3-5-haiku-20241022",anthropic_google_cloud:null,mantle:null,gateway:"claude-3-5-haiku-20241022"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_3_5_HAIKU",max_output_tokens:{default:8192,upper:8192},pricing:"haiku_35",capabilities:[]},{id:"claude-haiku-4-5",family:"haiku",display_name:"Haiku 4.5",knowledge_cutoff:"February 2025",provider_ids:{first_party:"claude-haiku-4-5-20251001",bedrock:"us.anthropic.claude-haiku-4-5-20251001-v1:0",vertex:"claude-haiku-4-5@20251001",foundry:"claude-haiku-4-5",anthropic_aws:"claude-haiku-4-5-20251001",anthropic_google_cloud:"claude-haiku-4-5-20251001",mantle:"anthropic.claude-haiku-4-5",gateway:"claude-haiku-4-5-20251001"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_HAIKU_4_5",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"haiku_45",capabilities:["context_management"],advisor_rank:1},{id:"claude-3-5-sonnet",family:"sonnet",display_name:"Sonnet 3.5",provider_ids:{first_party:"claude-3-5-sonnet-20241022",bedrock:"us.anthropic.claude-3-5-sonnet-20241022-v2:0",vertex:"claude-3-5-sonnet-v2@20241022",foundry:"claude-3-5-sonnet",anthropic_aws:"claude-3-5-sonnet-20241022",anthropic_google_cloud:null,mantle:null,gateway:"claude-3-5-sonnet-20241022"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_3_5_SONNET",max_output_tokens:{default:8192,upper:8192},pricing:"tier_3_15",capabilities:[]},{id:"claude-3-7-sonnet",family:"sonnet",display_name:"Sonnet 3.7",provider_ids:{first_party:"claude-3-7-sonnet-20250219",bedrock:"us.anthropic.claude-3-7-sonnet-20250219-v1:0",vertex:"claude-3-7-sonnet@20250219",foundry:"claude-3-7-sonnet",anthropic_aws:"claude-3-7-sonnet-20250219",anthropic_google_cloud:null,mantle:null,gateway:"claude-3-7-sonnet-20250219"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_3_7_SONNET",max_output_tokens:{default:32000,upper:64000},pricing:"tier_3_15",capabilities:[]},{id:"claude-sonnet-4-0",family:"sonnet",display_name:"Sonnet 4",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-sonnet-4-20250514",bedrock:"us.anthropic.claude-sonnet-4-20250514-v1:0",vertex:"claude-sonnet-4@20250514",foundry:"claude-sonnet-4",anthropic_aws:"claude-sonnet-4-20250514",anthropic_google_cloud:null,mantle:null,gateway:"claude-sonnet-4-20250514"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_0_SONNET",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"tier_3_15",capabilities:["context_management"]},{id:"claude-sonnet-4-5",family:"sonnet",display_name:"Sonnet 4.5",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-sonnet-4-5-20250929",bedrock:"us.anthropic.claude-sonnet-4-5-20250929-v1:0",vertex:"claude-sonnet-4-5@20250929",foundry:"claude-sonnet-4-5",anthropic_aws:"claude-sonnet-4-5-20250929",anthropic_google_cloud:"claude-sonnet-4-5-20250929",mantle:null,gateway:"claude-sonnet-4-5-20250929"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_5_SONNET",fallback_3p:"claude-sonnet-4-0",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"tier_3_15",capabilities:["context_management"]},{id:"claude-sonnet-4-6",family:"sonnet",display_name:"Sonnet 4.6",knowledge_cutoff:"August 2025",provider_ids:{first_party:"claude-sonnet-4-6",bedrock:"us.anthropic.claude-sonnet-4-6",vertex:"claude-sonnet-4-6",foundry:"claude-sonnet-4-6",anthropic_aws:"claude-sonnet-4-6",anthropic_google_cloud:"claude-sonnet-4-6",mantle:null,gateway:"claude-sonnet-4-6"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_6_SONNET",fallback_3p:"claude-sonnet-4-5",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:128000},pricing:"tier_3_15",capabilities:["effort","max_effort","adaptive_thinking","context_management"],advisor_rank:2},{id:"claude-sonnet-5",family:"sonnet",display_name:"Sonnet 5",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-sonnet-5",bedrock:"us.anthropic.claude-sonnet-5",vertex:"claude-sonnet-5",foundry:"claude-sonnet-5",anthropic_aws:"claude-sonnet-5",anthropic_google_cloud:"claude-sonnet-5",mantle:"anthropic.claude-sonnet-5",gateway:"claude-sonnet-5"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_5_SONNET",fallback_3p:"claude-sonnet-4-6",context:{window:1e6,native_1m:!0,native_1m_3p:{bedrock:!0,vertex:!0,foundry:!0},supports_1m_beta:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_3_15",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","mid_conv_system","context_management"],default_effort:"high",image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:3},{id:"claude-opus-4-0",family:"opus",display_name:"Opus 4",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-opus-4-20250514",bedrock:"us.anthropic.claude-opus-4-20250514-v1:0",vertex:"claude-opus-4@20250514",foundry:"claude-opus-4",anthropic_aws:"claude-opus-4-20250514",anthropic_google_cloud:null,mantle:null,gateway:"claude-opus-4-20250514"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_0_OPUS",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:32000},pricing:"tier_15_75",capabilities:["context_management"]},{id:"claude-opus-4-1",family:"opus",display_name:"Opus 4.1",knowledge_cutoff:"January 2025",provider_ids:{first_party:"claude-opus-4-1-20250805",bedrock:"us.anthropic.claude-opus-4-1-20250805-v1:0",vertex:"claude-opus-4-1@20250805",foundry:"claude-opus-4-1",anthropic_aws:"claude-opus-4-1-20250805",anthropic_google_cloud:null,mantle:null,gateway:"claude-opus-4-1-20250805"},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_1_OPUS",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:32000},pricing:"tier_15_75",capabilities:["context_management"]},{id:"claude-opus-4-5",family:"opus",display_name:"Opus 4.5",knowledge_cutoff:"May 2025",provider_ids:{first_party:"claude-opus-4-5-20251101",bedrock:"us.anthropic.claude-opus-4-5-20251101-v1:0",vertex:"claude-opus-4-5@20251101",foundry:"claude-opus-4-5",anthropic_aws:"claude-opus-4-5-20251101",anthropic_google_cloud:"claude-opus-4-5-20251101",mantle:null,gateway:"claude-opus-4-5-20251101"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_5_OPUS",fallback_3p:"claude-opus-4-1",context:{window:200000,supports_1m_suffix:!0},max_output_tokens:{default:32000,upper:64000},pricing:"tier_5_25",capabilities:["context_management"]},{id:"claude-opus-4-6",family:"opus",display_name:"Opus 4.6",knowledge_cutoff:"May 2025",provider_ids:{first_party:"claude-opus-4-6",bedrock:"us.anthropic.claude-opus-4-6-v1",vertex:"claude-opus-4-6",foundry:"claude-opus-4-6",anthropic_aws:"claude-opus-4-6",anthropic_google_cloud:"claude-opus-4-6",mantle:null,gateway:"claude-opus-4-6"},eager_input_streaming:{vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_6_OPUS",fallback_3p:"claude-opus-4-5",context:{window:200000,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_5_25",capabilities:["effort","max_effort","adaptive_thinking","context_management"],advisor_rank:3},{id:"claude-opus-4-7",family:"opus",display_name:"Opus 4.7",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-opus-4-7",bedrock:"us.anthropic.claude-opus-4-7",vertex:"claude-opus-4-7",foundry:"claude-opus-4-7",anthropic_aws:"claude-opus-4-7",anthropic_google_cloud:"claude-opus-4-7",mantle:"anthropic.claude-opus-4-7",gateway:"claude-opus-4-7"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_7_OPUS",fallback_3p:"claude-opus-4-6",context:{window:1e6,native_1m:!0,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_5_25",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","context_management","fast_mode"],default_effort:"xhigh",image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:4},{id:"claude-opus-4-8",family:"opus",display_name:"Opus 4.8",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-opus-4-8",bedrock:"us.anthropic.claude-opus-4-8",vertex:"claude-opus-4-8",foundry:"claude-opus-4-8",anthropic_aws:"claude-opus-4-8",anthropic_google_cloud:"claude-opus-4-8",mantle:"anthropic.claude-opus-4-8",gateway:"claude-opus-4-8"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_4_8_OPUS",fallback_3p:"claude-opus-4-7",context:{window:1e6,native_1m:!0,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_5_25",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","mid_conv_system","context_management","fast_mode","lean_prompt"],default_effort:"high",image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:4},{id:"claude-opus-5",family:"opus",display_name:"Opus 5",knowledge_cutoff:"May 2026",provider_ids:{first_party:"claude-opus-5",bedrock:"us.anthropic.claude-opus-5",vertex:"claude-opus-5",foundry:"claude-opus-5",anthropic_aws:"claude-opus-5",anthropic_google_cloud:"claude-opus-5",mantle:"anthropic.claude-opus-5",gateway:"claude-opus-5"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_5_OPUS",fallback_3p:"claude-opus-4-8",context:{window:1e6,native_1m:!0,supports_1m_beta:!0,supports_1m_suffix:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_5_25",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","mid_conv_system","context_management","fast_mode","lean_prompt","refusal_fallback","opus_5_prompt_bundle"],default_effort:"high",image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:4},{id:"claude-fable-5",family:"fable",display_name:"Fable 5",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-fable-5",bedrock:"us.anthropic.claude-fable-5",vertex:"claude-fable-5",foundry:"claude-fable-5",anthropic_aws:"claude-fable-5",anthropic_google_cloud:"claude-fable-5",mantle:"anthropic.claude-fable-5",gateway:"claude-fable-5"},eager_input_streaming:{bedrock:!0,vertex:!0},vertex_region_env_var:"VERTEX_REGION_CLAUDE_FABLE_5",fallback_3p:"claude-opus-5",context:{window:1e6,native_1m:!0,supports_1m_beta:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_10_50",capabilities:["effort","max_effort","xhigh_effort","adaptive_thinking","rejects_disabled_thinking","mid_conv_system","context_management","lean_prompt","fable_5_mitigations","refusal_fallback"],default_effort:"high",image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:5},{id:"claude-mythos-5",family:"mythos",display_name:"Mythos 5",knowledge_cutoff:"January 2026",provider_ids:{first_party:"claude-mythos-5",bedrock:null,vertex:null,foundry:null,anthropic_aws:null,anthropic_google_cloud:null,mantle:null,gateway:null},context:{window:1e6,native_1m:!0,supports_1m_beta:!0},max_output_tokens:{default:64000,upper:128000},pricing:"tier_10_50",capabilities:[],image_limits:{maxWidth:2000,maxHeight:2000},advisor_rank:5}],aliases:{opus:{default:"claude-opus-5",per_provider:{bedrock:"claude-opus-5",vertex:"claude-opus-5",foundry:"claude-opus-4-6",mantle:"claude-opus-5",anthropic_aws:"claude-opus-5",gateway:"claude-opus-4-7"}},sonnet:{default:"claude-sonnet-5",per_provider:{bedrock:"claude-sonnet-4-5",vertex:"claude-sonnet-4-5",foundry:"claude-sonnet-4-5",mantle:"claude-sonnet-4-5",anthropic_aws:"claude-sonnet-4-6",gateway:"claude-sonnet-4-6"}},haiku:{default:"claude-haiku-4-5"},fable:{default:"claude-fable-5"}},defaults:{},best:"fable",latest_per_family:{fable:"claude-fable-5",opus:"claude-opus-5",sonnet:"claude-sonnet-5",haiku:"claude-haiku-4-5"},alias_migration:{}};function C(e){let t;return()=>t??=e()}var a3=C(()=>l.object({first_party:l.string(),bedrock:l.string().nullish(),vertex:l.string().nullish(),foundry:l.string().nullish(),anthropic_aws:l.string().nullish(),anthropic_google_cloud:l.string().nullish(),mantle:l.string().nullish(),gateway:l.string().nullish()}).loose()),CR=C(()=>l.object({input:l.number(),output:l.number(),cache_write_5m:l.number().optional(),cache_write_1h:l.number().optional(),cache_read:l.number().optional(),web_search:l.number().optional()}).loose()),c3=C(()=>l.object({id:l.string(),family:l.string(),display_name:l.string(),slogan:l.string().optional(),knowledge_cutoff:l.string().optional(),provider_ids:a3(),eager_input_streaming:l.object({bedrock:l.literal(!0).optional(),vertex:l.literal(!0).optional()}).loose().optional(),vertex_region_env_var:l.string().optional(),fallback_3p:l.string().optional(),context:l.object({window:l.number(),native_1m:l.boolean().optional(),native_1m_3p:l.object({bedrock:l.literal(!0).optional(),vertex:l.literal(!0).optional(),foundry:l.literal(!0).optional()}).loose().optional(),supports_1m_beta:l.boolean().optional(),supports_1m_suffix:l.boolean().optional()}).loose().optional(),max_output_tokens:l.object({default:l.number(),upper:l.number()}).loose().optional(),pricing:l.union([l.string(),CR()]).optional(),capabilities:l.array(l.string()).default([]),default_effort:l.enum(["low","medium","high","xhigh","max"]).optional(),image_limits:l.object({maxWidth:l.number().optional(),maxHeight:l.number().optional(),maxBase64Size:l.number().optional()}).loose().optional(),advisor_rank:l.number().optional(),fallback_chain:l.array(l.string()).optional(),picker:l.object({section:l.enum(["main","overflow","deprecated"]).optional(),badge:l.string().optional(),disabled_reason:l.string().optional(),tiers:l.array(l.string()).optional()}).loose().optional(),deprecation:l.object({retirement_dates:l.record(l.string(),l.string()).optional(),remapped_to:l.string().optional()}).loose().optional(),min_cli_version:l.string().optional()}).loose()),l3=C(()=>l.object({default:l.string(),per_provider:l.record(l.string(),l.string()).optional()}).loose()),u3=C(()=>l.object({schema_version:l.number(),pricing_tiers:l.record(l.string(),CR()).default({}),models:l.array(c3()),aliases:l.record(l.string(),l3()).default({}),defaults:l.record(l.string(),l.string()).default({}),best:l.string().optional(),latest_per_family:l.record(l.string(),l.string()).default({}),alias_migration:l.record(l.string(),l.string()).default({})}).loose()),p3={schema_version:0,pricing_tiers:{},models:[],aliases:{},defaults:{},latest_per_family:{},alias_migration:{}},Gv=re(()=>{let e=u3().safeParse(OR);return e.success?e.data:p3}),RR=Gv;function IR(e){return e.replace(/-0$/,"")}var T9e=re(()=>{let e=new Map;for(let t of RR().models)e.set(t.id,t);return e}),A9e=re(()=>{let e=new Map;for(let t of RR().models)for(let r of Object.values(t.provider_ids)){if(typeof r!=="string")continue;let n=r.toLowerCase(),o=e.get(n);if(o!==void 0&&o!==t.id)throw Error("model catalog: provider id collision across distinct entries");e.set(n,t.id)}return e});function PR(){return process.env.CLAUDE_CONFIG_DIR}var Yt=re(()=>(PR()??f3(d3(),".claude")).normalize("NFC"),PR);var j9e=re(()=>ge(process.env.CLAUDE_CODE_SUPERVISED));var F9e=re(()=>Gv().models.flatMap((e)=>e.vertex_region_env_var&&/^VERTEX_REGION_[A-Z0-9_]+$/.test(e.vertex_region_env_var)?[[IR(e.id),e.vertex_region_env_var]]:[]).sort(([e],[t])=>t.length-e.length||(e<t?-1:e>t?1:0)));function F(e,t,r,n,o){if(n==="m")throw TypeError("Private method is not writable");if(n==="a"&&!o)throw TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r}function E(e,t,r,n){if(r==="a"&&!n)throw TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}var Wv=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return Wv=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),r=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(n)=>(+n^r()&15>>+n/4).toString(16))};function Kn(e){return typeof e==="object"&&e!==null&&(("name"in e)&&e.name==="AbortError"||("message"in e)&&String(e.message).includes("FetchRequestCanceledException"))}var nu=(e)=>{if(e instanceof Error)return e;if(typeof e==="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){let t=Error(e.message,e.cause?{cause:e.cause}:{});if(e.stack)t.stack=e.stack;if(e.cause&&!t.cause)t.cause=e.cause;if(e.name)t.name=e.name;return t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)};class B extends Error{}class Tt extends B{constructor(e,t,r,n,o){super(`${Tt.makeMessage(e,t,r)}`);this.status=e,this.headers=n,this.requestID=n?.get("request-id"),this.error=t,this.type=o??null}static makeMessage(e,t,r){let n=t?.message?typeof t.message==="string"?t.message:JSON.stringify(t.message):t?JSON.stringify(t):r;if(e&&n)return`${e} ${n}`;if(e)return`${e} status code (no body)`;if(n)return n;return"(no status code or body)"}static generate(e,t,r,n){if(!e||!n)return new Ai({message:r,cause:nu(t)});let o=t,i=o?.error?.type;if(e===400)return new iu(e,o,r,n,i);if(e===401)return new su(e,o,r,n,i);if(e===403)return new au(e,o,r,n,i);if(e===404)return new cu(e,o,r,n,i);if(e===409)return new lu(e,o,r,n,i);if(e===422)return new uu(e,o,r,n,i);if(e===429)return new pu(e,o,r,n,i);if(e>=500)return new du(e,o,r,n,i);return new Tt(e,o,r,n,i)}}class Pt extends Tt{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}}class Ai extends Tt{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0);if(t)this.cause=t}}class ou extends Ai{constructor({message:e}={}){super({message:e??"Request timed out."})}}class iu extends Tt{}class su extends Tt{}class au extends Tt{}class cu extends Tt{}class lu extends Tt{}class uu extends Tt{}class pu extends Tt{}class du extends Tt{}var g3=/^[a-z][a-z0-9+.-]*:/i,DR=(e)=>g3.test(e),Vv=(e)=>(Vv=Array.isArray,Vv(e)),Kv=Vv;function Zm(e){if(typeof e!=="object")return{};return e??{}}function Zv(e){if(!e)return!0;for(let t in e)return!1;return!0}function LR(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var NR=(e,t)=>{if(typeof t!=="number"||!Number.isInteger(t))throw new B(`${e} must be an integer`);if(t<0)throw new B(`${e} must be a positive integer`);return t};var Jm=(e)=>{try{return JSON.parse(e)}catch(t){return}};var MR=(e)=>new Promise((t)=>setTimeout(t,e));var $r="0.94.0";var FR=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function h3(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}var _3=()=>{let e=h3();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":$r,"X-Stainless-OS":$R(Deno.build.os),"X-Stainless-Arch":UR(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":$r,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":$r,"X-Stainless-OS":$R(globalThis.process.platform??"unknown"),"X-Stainless-Arch":UR(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=y3();if(t)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":$r,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":$r,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function y3(){if(typeof navigator>"u"||!navigator)return null;let e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:t,pattern:r}of e){let n=r.exec(navigator.userAgent);if(n){let o=n[1]||0,i=n[2]||0,s=n[3]||0;return{browser:t,version:`${o}.${i}.${s}`}}}return null}var UR=(e)=>{if(e==="x32")return"x32";if(e==="x86_64"||e==="x64")return"x64";if(e==="arm")return"arm";if(e==="aarch64"||e==="arm64")return"arm64";if(e)return`other:${e}`;return"unknown"},$R=(e)=>{if(e=e.toLowerCase(),e.includes("ios"))return"iOS";if(e==="android")return"Android";if(e==="darwin")return"MacOS";if(e==="win32")return"Windows";if(e==="freebsd")return"FreeBSD";if(e==="openbsd")return"OpenBSD";if(e==="linux")return"Linux";if(e)return`Other:${e}`;return"Unknown"},jR,fu=()=>jR??(jR=_3());function zR(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function Jv(...e){let t=globalThis.ReadableStream;if(typeof t>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function Ym(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return Jv({start(){},async pull(r){let{done:n,value:o}=await t.next();if(n)r.close();else r.enqueue(o)},async cancel(){await t.return?.()}})}function mu(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let r=await t.read();if(r?.done)t.releaseLock();return r}catch(r){throw t.releaseLock(),r}},async return(){let r=t.cancel();return t.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function BR(e){if(e===null||typeof e!=="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),r=t.cancel();t.releaseLock(),await r}var HR=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});function qR(e){return Object.entries(e).filter(([t,r])=>typeof r<"u").map(([t,r])=>{if(typeof r==="string"||typeof r==="number"||typeof r==="boolean")return`${encodeURIComponent(t)}=${encodeURIComponent(r)}`;if(r===null)return`${encodeURIComponent(t)}=`;throw new B(`Cannot stringify type ${typeof r}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}var WR="urn:ietf:params:oauth:grant-type:jwt-bearer",VR="refresh_token",Xm="/v1/oauth/token",ki="oauth-2025-04-20",KR="oidc-federation-2026-04-01",ZR=120,Qs=30,JR=5,GR=1048576;function Qm(e){if(!e)return;let t;try{t=new URL(e)}catch(n){throw new Le(`Invalid token endpoint base URL "${e}": ${n}`)}if(t.protocol==="https:")return;let r=t.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(t.protocol==="http:"&&(r==="localhost"||r==="127.0.0.1"||r==="::1"))return;throw new Le(`Refusing to send credential over non-https token endpoint "${e}"`)}async function eg(e,t){let r=await S3(e),n;try{n=JSON.parse(r)}catch{throw new Le(`Token endpoint returned non-JSON response (status ${e.status})`,e.status,cr(r),t)}if(!n.access_token)throw new Le(`Token endpoint response missing access_token: ${JSON.stringify(cr(n))}`,e.status,cr(n),t);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new Le(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,e.status,cr(n),t);return n}var Yv=2000,v3=new Set(["error","error_description","error_uri"]);function cr(e){if(e==null)return e;if(typeof e==="string"){let t;try{t=JSON.parse(e)}catch{if(e.length<=Yv)return e;return e.slice(0,Yv)+`... <${e.length-Yv} more chars>`}return JSON.stringify(cr(t))}if(typeof e==="object"&&!Array.isArray(e)){let t={};for(let[r,n]of Object.entries(e))if(v3.has(r))t[r]=n;return t}return null}async function tg(e,t=(r)=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await import("node:fs"),n=e,o;try{n=await r.promises.realpath(e),o=await r.promises.stat(n)}catch{return}let i=o.mode&511;if(i&18)throw new Le(`Credentials file at ${n} is group/world-writable (mode 0o${i.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${n}\`.`);if(i&36)throw new Le(`Credentials file at ${n} is group/world-readable (mode 0o${i.toString(8)}); run \`chmod 600 ${n}\` before retrying.`);if(typeof process.getuid==="function"&&o.uid!==process.getuid())t(`credentials file at ${n} is owned by uid ${o.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function rg(e,t){let r=await import("node:fs"),o=(await import("node:path")).dirname(e);await r.promises.mkdir(o,{recursive:!0,mode:448});let i=`${e}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await r.promises.open(i,"w",384);try{await s.writeFile(JSON.stringify(t,null,2)),await s.sync()}finally{await s.close()}await r.promises.rename(i,e)}catch(s){throw await r.promises.unlink(i).catch(()=>{}),s}try{let s=await r.promises.open(o,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function S3(e){if(!e.body)return"";let t=e.body.getReader(),r=[],n=0;for(;;){let{done:i,value:s}=await t.read();if(i)break;if(n+s.length>GR){let a=GR-n;if(a>0)r.push(s.subarray(0,a));await t.cancel();break}r.push(s),n+=s.length}let o;if(r.length===1)o=r[0];else{o=new Uint8Array(r.reduce((s,a)=>s+a.length,0));let i=0;for(let s of r)o.set(s,i),i+=s.length}return new TextDecoder("utf-8").decode(o)}class Le extends B{constructor(e,t=null,r=null,n=null){super(e);this.statusCode=t,this.body=r,this.requestId=n}}function en(){return Math.floor(Date.now()/1000)}class Xv{constructor(e,t){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=t}async getToken(){let e=this.nextForce;this.nextForce=!1;let t=this.cached;if(e||t==null)return(await this.refresh(e)).token;if(t.expiresAt==null)return t.token;let r=t.expiresAt-en();if(r>ZR)return t.token;if(r>Qs)return this.backgroundRefresh(),t.token;return(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){if(this.pendingRefresh&&!e)return this.pendingRefresh;return this.doRefresh(e)}backgroundRefresh(){if(this.pendingRefresh)return;if(en()-this.lastAdvisoryError<JR)return;this.doRefresh().catch((e)=>{this.lastAdvisoryError=en(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then((t)=>(this.cached=t,this.pendingRefresh=null,t),(t)=>{throw this.pendingRefresh=null,t}),this.pendingRefresh}}var De=(e)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[e]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()||void 0;return};function QR(e){let t=0;for(let o of e)t+=o.length;let r=new Uint8Array(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return r}var YR;function ea(e){let t;return(YR??(t=new globalThis.TextEncoder,YR=t.encode.bind(t)))(e)}var XR;function Qv(e){let t;return(XR??(t=new globalThis.TextDecoder,XR=t.decode.bind(t)))(e)}var og={off:0,error:200,warn:300,info:400,debug:500},eS=(e,t,r)=>{if(!e)return;if(LR(og,e))return e;pt(r).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(og))}`);return};function gu(){}function ng(e,t,r){if(!t||og[e]>og[r])return gu;else return t[e].bind(t)}var E3={error:gu,warn:gu,info:gu,debug:gu},eI=new WeakMap;function pt(e){let t=e.logger,r=e.logLevel??"off";if(!t)return E3;let n=eI.get(t);if(n&&n[0]===r)return n[1];let o={error:ng("error",t,r),warn:ng("warn",t,r),info:ng("info",t,r),debug:ng("debug",t,r)};return eI.set(t,[r,o]),o}var Zn=(e)=>{if(e.options)e.options={...e.options},delete e.options.headers;if(e.headers)e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,r])=>[t,t.toLowerCase()==="x-api-key"||t.toLowerCase()==="authorization"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":r]));if("retryOfRequestLogID"in e){if(e.retryOfRequestLogID)e.retryOf=e.retryOfRequestLogID;delete e.retryOfRequestLogID}return e};var ig="1.0",w3=/^[A-Za-z0-9_.-]+$/;function tI(e){if(!e)throw Error("profile name is empty");if(e==="."||e==="..")throw Error(`profile name "${e}" is not allowed`);if(e.includes("/")||e.includes("\\"))throw Error(`profile name "${e}" must not contain path separators`);if(!w3.test(e))throw Error(`profile name "${e}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var rI=async(e)=>{var t,r;let n=await tS();if(n===null)return null;let o=e??await oI();if(o===null)return null;tI(o);let i=await import("node:fs"),a=(await import("node:path")).join(n,"configs",`${o}.json`),c;try{c=await i.promises.readFile(a,"utf-8")}catch(f){if(f?.code!=="ENOENT")throw Error(`failed to read config file ${a}: ${f}`);c=null}if(c===null){let f=De("ANTHROPIC_ORGANIZATION_ID"),m=De("ANTHROPIC_IDENTITY_TOKEN_FILE"),g=De("ANTHROPIC_FEDERATION_RULE_ID");if(g&&f)return{fromFile:!1,config:{organization_id:f,workspace_id:De("ANTHROPIC_WORKSPACE_ID"),base_url:De("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:g,service_account_id:De("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:m?{source:"file",path:m}:void 0,scope:De("ANTHROPIC_SCOPE")}}};return null}let u;try{u=JSON.parse(c)}catch(f){throw Error(`failed to parse config file ${a}: ${f}`)}if(!u.authentication)throw Error(`config file ${a} is missing "authentication"`);let d=u.authentication.type;if(d!=="oidc_federation"&&d!=="user_oauth")throw Error(`authentication.type "${d}" is not a known authentication type`);if(u.organization_id??(u.organization_id=De("ANTHROPIC_ORGANIZATION_ID")),u.workspace_id??(u.workspace_id=De("ANTHROPIC_WORKSPACE_ID")),u.base_url??(u.base_url=De("ANTHROPIC_BASE_URL")),(t=u.authentication).scope??(t.scope=De("ANTHROPIC_SCOPE")),u.authentication.type==="oidc_federation"){if(!u.authentication.identity_token){let f=De("ANTHROPIC_IDENTITY_TOKEN_FILE");if(f)u.authentication.identity_token={source:"file",path:f}}if(!u.authentication.federation_rule_id)u.authentication.federation_rule_id=De("ANTHROPIC_FEDERATION_RULE_ID")??"";(r=u.authentication).service_account_id??(r.service_account_id=De("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:u,fromFile:!0}};var nI=async(e,t)=>{if(e?.authentication.credentials_path)return e.authentication.credentials_path;let r=await tS();if(!r)return null;let n=t??await oI();if(!n)return null;return tI(n),(await import("node:path")).join(r,"credentials",`${n}.json`)},tS=async()=>{if(!T3())return null;let e=await import("node:path"),t=De("ANTHROPIC_CONFIG_DIR");if(t)return t;if(fu()["X-Stainless-OS"]==="Windows"){let i=De("APPDATA");if(i)return e.join(i,"Anthropic");let s=De("USERPROFILE");if(s)return e.join(s,"AppData","Roaming","Anthropic");return null}let n=De("XDG_CONFIG_HOME");if(n)return e.join(n,"anthropic");let o=De("HOME");if(o)return e.join(o,".config","anthropic");return null},T3=()=>{let e=fu()["X-Stainless-Runtime"];return e==="node"||e==="deno"},oI=async()=>{let e=await tS();if(!e)return null;let t=De("ANTHROPIC_PROFILE");if(t)return t;let r=await import("node:fs"),o=(await import("node:path")).join(e,"active_config");try{return(await r.promises.readFile(o,"utf-8")).trim()||"default"}catch(i){if(i?.code!=="ENOENT")throw Error(`failed to read ${o}: ${i}`);return"default"}};function rS(e){if(!e)throw new B("Identity token file path is empty");return async()=>{let t=await import("node:fs"),r;try{r=await t.promises.readFile(e,"utf-8")}catch(o){throw new B(`Failed to read identity token file at ${e}: ${o}`)}let n=r.trim();if(!n)throw new B(`Identity token file at ${e} is empty`);return n}}function iI(e){if(!e)throw new B("Identity token value is empty");return()=>e}function sI(e){return async()=>{Qm(e.baseURL);let t=await e.identityTokenProvider();if(t.length>16384)throw new Le(`Identity token is ${Math.ceil(t.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:WR,assertion:t,federation_rule_id:e.federationRuleId,organization_id:e.organizationId};if(e.serviceAccountId)r.service_account_id=e.serviceAccountId;if(e.workspaceId)r.workspace_id=e.workspaceId;let n=`${e.baseURL}${Xm}`,o;try{o=await e.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${ki},${KR}`,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${$r} oidcFederationProvider`},body:JSON.stringify(r)})}catch(c){throw new Le(`Failed to reach token endpoint ${n}: ${c}`)}let i=o.headers.get("Request-Id");if(!o.ok){let c=await o.text().catch(()=>""),u=cr(c),d="";if(o.status===401)d=` Ensure your federation rule matches your identity token. ${e.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`;throw new Le(`Token exchange failed with status ${o.status}${i?` (request-id ${i})`:""}: ${u}${d}`,o.status,u,i)}let s=await eg(o,i),a=Number(s.expires_in);if(!Number.isFinite(a))throw new Le(`Token endpoint response missing required fields: ${JSON.stringify(cr(s))}`,o.status,cr(s),i);return{token:s.access_token,expiresAt:en()+a}}}function aI(e){return async(t)=>{let r=await import("node:fs");await tg(e.credentialsPath,e.onSafetyWarning);let n;try{n=await r.promises.readFile(e.credentialsPath,"utf-8")}catch(y){throw new Le(`Credentials file not found at ${e.credentialsPath}: ${y}`)}let o;try{o=JSON.parse(n)}catch(y){throw new Le(`Credentials file at ${e.credentialsPath} is not valid JSON: ${y}`)}let i=o.access_token;if(!i)throw new Le(`Credentials file at ${e.credentialsPath} must include 'access_token'`);let s=o.expires_at;if(!t?.forceRefresh&&(s==null||en()<s-Qs))return{token:i,expiresAt:s??null};let a=o.refresh_token;if(!e.clientId||!a)throw new Le(`Access token at ${e.credentialsPath} has expired and no refresh is available (client_id ${e.clientId?"set":"empty"}, refresh_token ${a?"set":"empty"})`);Qm(e.baseURL);let c={grant_type:VR,refresh_token:a,client_id:e.clientId},u=`${e.baseURL}${Xm}`,d;try{d=await e.fetch(u,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":ki,"User-Agent":e.userAgent||`anthropic-sdk-typescript/${$r} userOAuthProvider`},body:JSON.stringify(c)})}catch(y){throw new Le(`User OAuth refresh failed to reach token endpoint: ${y}`)}let f=d.headers.get("Request-Id");if(!d.ok){let y=await d.text().catch(()=>"");throw new Le(`User OAuth refresh failed (HTTP ${d.status}): ${cr(y)}`,d.status,cr(y),f)}let m=await eg(d,f),g=Number(m.expires_in);if(!Number.isFinite(g))throw new Le(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(cr(m))}`,d.status,cr(m),f);let h=en()+g,_=m.refresh_token||a;return await rg(e.credentialsPath,{...o,version:ig,type:"oauth_token",access_token:m.access_token,expires_at:h,refresh_token:_}),{token:m.access_token,expiresAt:h}}}function nS(e,t){let r=e.authentication.credentials_path??null,n=(e.base_url||t.baseURL).replace(/\/+$/,""),o=A3(e,r,n,t),i={};if(e.workspace_id&&e.authentication.type==="user_oauth")i["anthropic-workspace-id"]=e.workspace_id;return{provider:o,extraHeaders:i,baseURL:e.base_url||void 0}}async function cI(e,t){let r=await rI(t);if(!r)return null;let{config:n,fromFile:o}=r,i=n.authentication.credentials_path||!o?n:{...n,authentication:{...n.authentication,credentials_path:await nI(n,t)??void 0}};return nS(i,e)}function A3(e,t,r,n){switch(e.authentication.type){case"oidc_federation":{let o=e.authentication,i=k3(o);if(!i)throw new Le("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!o.federation_rule_id)throw new Le("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!e.organization_id)throw new Le("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let s=sI({identityTokenProvider:i,federationRuleId:o.federation_rule_id,organizationId:e.organization_id,serviceAccountId:o.service_account_id,workspaceId:e.workspace_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent});if(t)return O3(s,t,n.onCacheWriteError,n.onSafetyWarning);return s}case"user_oauth":{if(!t)throw new Le("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to <config_dir>/credentials/<profile>.json)");return aI({credentialsPath:t,clientId:e.authentication.client_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent,onSafetyWarning:n.onSafetyWarning})}default:{let o=e.authentication.type;throw new Le(`authentication.type "${o}" is not a known authentication type`)}}}function k3(e){if(e.identity_token){let n=e.identity_token.source;if(n!=="file")throw new Le(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!e.identity_token.path)throw new Le('identity_token.source "file" requires a non-empty path');return rS(e.identity_token.path)}let t=De("ANTHROPIC_IDENTITY_TOKEN_FILE");if(t)return rS(t);let r=De("ANTHROPIC_IDENTITY_TOKEN");if(r)return iI(r);return null}function O3(e,t,r,n){return async(o)=>{let i=await import("node:fs");await tg(t,n);let s;try{let c=await i.promises.readFile(t,"utf-8");s=JSON.parse(c);let u=s?.access_token;if(u&&!o?.forceRefresh){let d=s?.expires_at;if(d==null||en()<d-Qs)return{token:u,expiresAt:d??null}}}catch(c){if(c?.code!=="ENOENT"&&!(c instanceof SyntaxError))r?.(c)}let a=await e(o);try{await rg(t,{...s??{},version:ig,type:"oauth_token",access_token:a.token,expires_at:a.expiresAt})}catch(c){r?.(c)}return a}}var Er,wr;class Oo{constructor(){Er.set(this,void 0),wr.set(this,void 0),F(this,Er,new Uint8Array,"f"),F(this,wr,null,"f")}decode(e){if(e==null)return[];let t=e instanceof ArrayBuffer?new Uint8Array(e):typeof e==="string"?ea(e):e;F(this,Er,QR([E(this,Er,"f"),t]),"f");let r=[],n;while((n=C3(E(this,Er,"f"),E(this,wr,"f")))!=null){if(n.carriage&&E(this,wr,"f")==null){F(this,wr,n.index,"f");continue}if(E(this,wr,"f")!=null&&(n.index!==E(this,wr,"f")+1||n.carriage)){r.push(Qv(E(this,Er,"f").subarray(0,E(this,wr,"f")-1))),F(this,Er,E(this,Er,"f").subarray(E(this,wr,"f")),"f"),F(this,wr,null,"f");continue}let o=E(this,wr,"f")!==null?n.preceding-1:n.preceding,i=Qv(E(this,Er,"f").subarray(0,o));r.push(i),F(this,Er,E(this,Er,"f").subarray(n.index),"f"),F(this,wr,null,"f")}return r}flush(){if(!E(this,Er,"f").length)return[];return this.decode(`
|
|
64
64
|
`)}}Er=new WeakMap,wr=new WeakMap;Oo.NEWLINE_CHARS=new Set([`
|
|
65
65
|
`,"\r"]);Oo.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function C3(e,t){for(let o=t??0;o<e.length;o++){if(e[o]===10)return{preceding:o,index:o+1,carriage:!1};if(e[o]===13)return{preceding:o,index:o+1,carriage:!0}}return null}function lI(e){for(let n=0;n<e.length-1;n++){if(e[n]===10&&e[n+1]===10)return n+2;if(e[n]===13&&e[n+1]===13)return n+2;if(e[n]===13&&e[n+1]===10&&n+3<e.length&&e[n+2]===13&&e[n+3]===10)return n+4}return-1}var hu;class Tr{constructor(e,t,r){this.iterator=e,hu.set(this,void 0),this.controller=t,F(this,hu,r,"f")}static fromSSEResponse(e,t,r){let n=!1,o=r?pt(r):console;async function*i(){if(n)throw new B("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let s=!1;try{for await(let a of R3(e,t)){if(a.event==="completion")try{yield JSON.parse(a.data)}catch(c){throw o.error("Could not parse message into JSON:",a.data),o.error("From chunk:",a.raw),c}if(a.event==="message_start"||a.event==="message_delta"||a.event==="message_stop"||a.event==="content_block_start"||a.event==="content_block_delta"||a.event==="content_block_stop"||a.event==="message"||a.event==="user.message"||a.event==="user.interrupt"||a.event==="user.tool_confirmation"||a.event==="user.custom_tool_result"||a.event==="agent.message"||a.event==="agent.thinking"||a.event==="agent.tool_use"||a.event==="agent.tool_result"||a.event==="agent.mcp_tool_use"||a.event==="agent.mcp_tool_result"||a.event==="agent.custom_tool_use"||a.event==="agent.thread_context_compacted"||a.event==="session.status_running"||a.event==="session.status_idle"||a.event==="session.status_rescheduled"||a.event==="session.status_terminated"||a.event==="session.error"||a.event==="session.deleted"||a.event==="span.model_request_start"||a.event==="span.model_request_end")try{yield JSON.parse(a.data)}catch(c){throw o.error("Could not parse message into JSON:",a.data),o.error("From chunk:",a.raw),c}if(a.event==="ping")continue;if(a.event==="error"){let c=Jm(a.data)??a.data,u=c?.error?.type;throw new Tt(void 0,c,void 0,e.headers,u)}}s=!0}catch(a){if(Kn(a))return;throw a}finally{if(!s)t.abort()}}return new Tr(i,t,r)}static fromReadableStream(e,t,r){let n=!1;async function*o(){let s=new Oo,a=mu(e);for await(let c of a)for(let u of s.decode(c))yield u;for(let c of s.flush())yield c}async function*i(){if(n)throw new B("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let s=!1;try{for await(let a of o()){if(s)continue;if(a)yield JSON.parse(a)}s=!0}catch(a){if(Kn(a))return;throw a}finally{if(!s)t.abort()}}return new Tr(i,t,r)}[(hu=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],t=[],r=this.iterator(),n=(o)=>({next:()=>{if(o.length===0){let i=r.next();e.push(i),t.push(i)}return o.shift()}});return[new Tr(()=>n(e),this.controller,E(this,hu,"f")),new Tr(()=>n(t),this.controller,E(this,hu,"f"))]}toReadableStream(){let e=this,t;return Jv({async start(){t=e[Symbol.asyncIterator]()},async pull(r){try{let{value:n,done:o}=await t.next();if(o)return r.close();let i=ea(JSON.stringify(n)+`
|
|
66
66
|
`);r.enqueue(i)}catch(n){r.error(n)}},async cancel(){await t.return?.()}})}}async function*R3(e,t){if(!e.body){if(t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new B("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new B("Attempted to iterate over a response with no body")}let r=new uI,n=new Oo,o=mu(e.body);for await(let i of I3(o))for(let s of n.decode(i)){let a=r.decode(s);if(a)yield a}for(let i of n.flush()){let s=r.decode(i);if(s)yield s}}async function*I3(e){let t=new Uint8Array;for await(let r of e){if(r==null)continue;let n=r instanceof ArrayBuffer?new Uint8Array(r):typeof r==="string"?ea(r):r,o=new Uint8Array(t.length+n.length);o.set(t),o.set(n,t.length),t=o;let i;while((i=lI(t))!==-1)yield t.slice(0,i),t=t.slice(i)}if(t.length>0)yield t}class uI{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r"))e=e.substring(0,e.length-1);if(!e){if(!this.event&&!this.data.length)return null;let o={event:this.event,data:this.data.join(`
|
|
@@ -133,7 +133,7 @@ new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
|
|
|
133
133
|
`+" ".repeat(t)),"\r":Array(200).fill(0).map((e,t)=>"\r"+" ".repeat(t)),"\r\n":Array(200).fill(0).map((e,t)=>`\r
|
|
134
134
|
`+" ".repeat(t))},"\t":{"\n":Array(200).fill(0).map((e,t)=>`
|
|
135
135
|
`+"\t".repeat(t)),"\r":Array(200).fill(0).map((e,t)=>"\r"+"\t".repeat(t)),"\r\n":Array(200).fill(0).map((e,t)=>`\r
|
|
136
|
-
`+"\t".repeat(t))}};var Eq;(function(e){e.DEFAULT={allowTrailingComma:!1}})(Eq||(Eq={}));var wq;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(wq||(wq={}));var Tq;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(Tq||(Tq={}));var Aq;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(Aq||(Aq={}));function my(e){return e.startsWith("\uFEFF")?e.slice(1):e}var Lc=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,Oq=new Set,Ik=typeof process==="object"&&!!process?process:{},Cq=(e,t,r,n)=>{typeof Ik.emitWarning==="function"?Ik.emitWarning(e,t,r,n):console.error(`[${r}] ${t}: ${e}`)},gy=globalThis.AbortController,kq=globalThis.AbortSignal;if(typeof gy>"u"){kq=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,o){this._onabort.push(o)}},gy=class{constructor(){t()}signal=new kq;abort(n){if(this.signal.aborted)return;this.signal.reason=n,this.signal.aborted=!0;for(let o of this.signal._onabort)o(n);this.signal.onabort?.(n)}};let e=Ik.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{if(!e)return;e=!1,Cq("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t)}}var N0e=(e)=>!Oq.has(e),Rxt=Symbol("type"),ui=(e)=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Rq=(e)=>!ui(e)?null:e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?Od:null;class Od extends Array{constructor(e){super(e);this.fill(0)}}class Nc{heap;length;static#n=!1;static create(e){let t=Rq(e);if(!t)return[];Nc.#n=!0;let r=new Nc(e,t);return Nc.#n=!1,r}constructor(e,t){if(!Nc.#n)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class hy{#n;#p;#g;#h;#R;#I;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#_;#o;#r;#e;#l;#d;#c;#s;#y;#a;#b;#x;#f;#v;#A;#u;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#f,sizes:e.#b,keyMap:e.#o,keyList:e.#r,valList:e.#e,next:e.#l,prev:e.#d,get head(){return e.#c},get tail(){return e.#s},free:e.#y,isBackgroundFetch:(t)=>e.#t(t),backgroundFetch:(t,r,n,o)=>e.#L(t,r,n,o),moveToTail:(t)=>e.#C(t),indexes:(t)=>e.#S(t),rindexes:(t)=>e.#E(t),isStale:(t)=>e.#m(t)}}get max(){return this.#n}get maxSize(){return this.#p}get calculatedSize(){return this.#_}get size(){return this.#i}get fetchMethod(){return this.#R}get memoMethod(){return this.#I}get dispose(){return this.#g}get disposeAfter(){return this.#h}constructor(e){let{max:t=0,ttl:r,ttlResolution:n=1,ttlAutopurge:o,updateAgeOnGet:i,updateAgeOnHas:s,allowStale:a,dispose:c,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:m=0,maxEntrySize:g=0,sizeCalculation:h,fetchMethod:_,memoMethod:y,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:k,ignoreFetchAbort:P}=e;if(t!==0&&!ui(t))throw TypeError("max option must be a nonnegative integer");let te=t?Rq(t):Array;if(!te)throw Error("invalid max value: "+t);if(this.#n=t,this.#p=m,this.maxEntrySize=g||this.#p,this.sizeCalculation=h,this.sizeCalculation){if(!this.#p&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!=="function")throw TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!=="function")throw TypeError("memoMethod must be a function if defined");if(this.#I=y,_!==void 0&&typeof _!=="function")throw TypeError("fetchMethod must be a function if specified");if(this.#R=_,this.#A=!!_,this.#o=new Map,this.#r=Array(t).fill(void 0),this.#e=Array(t).fill(void 0),this.#l=new te(t),this.#d=new te(t),this.#c=0,this.#s=0,this.#y=Nc.create(t),this.#i=0,this.#_=0,typeof c==="function")this.#g=c;if(typeof u==="function")this.#h=u,this.#a=[];else this.#h=void 0,this.#a=void 0;if(this.#v=!!this.#g,this.#u=!!this.#h,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(this.#p!==0){if(!ui(this.#p))throw TypeError("maxSize must be a positive integer if specified")}if(!ui(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#z()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!i,this.updateAgeOnHas=!!s,this.ttlResolution=ui(n)||n===0?n:1,this.ttlAutopurge=!!o,this.ttl=r||0,this.ttl){if(!ui(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#N()}if(this.#n===0&&this.ttl===0&&this.#p===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#n&&!this.#p){if(N0e("LRU_CACHE_UNBOUNDED"))Oq.add("LRU_CACHE_UNBOUNDED"),Cq("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",hy)}}getRemainingTTL(e){return this.#o.has(e)?1/0:0}#N(){let e=new Od(this.#n),t=new Od(this.#n);this.#f=e,this.#x=t,this.#M=(o,i,s=Lc.now())=>{if(t[o]=i!==0?s:0,e[o]=i,i!==0&&this.ttlAutopurge){let a=setTimeout(()=>{if(this.#m(o))this.#w(this.#r[o],"expire")},i+1);if(a.unref)a.unref()}},this.#k=(o)=>{t[o]=e[o]!==0?Lc.now():0},this.#T=(o,i)=>{if(e[i]){let s=e[i],a=t[i];if(!s||!a)return;o.ttl=s,o.start=a,o.now=r||n();let c=o.now-a;o.remainingTTL=s-c}};let r=0,n=()=>{let o=Lc.now();if(this.ttlResolution>0){r=o;let i=setTimeout(()=>r=0,this.ttlResolution);if(i.unref)i.unref()}return o};this.getRemainingTTL=(o)=>{let i=this.#o.get(o);if(i===void 0)return 0;let s=e[i],a=t[i];if(!s||!a)return 1/0;let c=(r||n())-a;return s-c},this.#m=(o)=>{let i=t[o],s=e[o];return!!s&&!!i&&(r||n())-i>s}}#k=()=>{};#T=()=>{};#M=()=>{};#m=()=>!1;#z(){let e=new Od(this.#n);this.#_=0,this.#b=e,this.#O=(t)=>{this.#_-=e[t],e[t]=0},this.#U=(t,r,n,o)=>{if(this.#t(r))return 0;if(!ui(n))if(o){if(typeof o!=="function")throw TypeError("sizeCalculation must be a function");if(n=o(r,t),!ui(n))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return n},this.#P=(t,r,n)=>{if(e[t]=r,this.#p){let o=this.#p-e[t];while(this.#_>o)this.#D(!0)}if(this.#_+=e[t],n)n.entrySize=r,n.totalCalculatedSize=this.#_}}#O=(e)=>{};#P=(e,t,r)=>{};#U=(e,t,r,n)=>{if(r||n)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#S({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#s;;){if(!this.#$(t))break;if(e||!this.#m(t))yield t;if(t===this.#c)break;else t=this.#d[t]}}*#E({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#c;;){if(!this.#$(t))break;if(e||!this.#m(t))yield t;if(t===this.#s)break;else t=this.#l[t]}}#$(e){return e!==void 0&&this.#o.get(this.#r[e])===e}*entries(){for(let e of this.#S())if(this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e]))yield[this.#r[e],this.#e[e]]}*rentries(){for(let e of this.#E())if(this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e]))yield[this.#r[e],this.#e[e]]}*keys(){for(let e of this.#S()){let t=this.#r[e];if(t!==void 0&&!this.#t(this.#e[e]))yield t}}*rkeys(){for(let e of this.#E()){let t=this.#r[e];if(t!==void 0&&!this.#t(this.#e[e]))yield t}}*values(){for(let e of this.#S())if(this.#e[e]!==void 0&&!this.#t(this.#e[e]))yield this.#e[e]}*rvalues(){for(let e of this.#E())if(this.#e[e]!==void 0&&!this.#t(this.#e[e]))yield this.#e[e]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#S()){let n=this.#e[r],o=this.#t(n)?n.__staleWhileFetching:n;if(o===void 0)continue;if(e(o,this.#r[r],this))return this.get(this.#r[r],t)}}forEach(e,t=this){for(let r of this.#S()){let n=this.#e[r],o=this.#t(n)?n.__staleWhileFetching:n;if(o===void 0)continue;e.call(t,o,this.#r[r],this)}}rforEach(e,t=this){for(let r of this.#E()){let n=this.#e[r],o=this.#t(n)?n.__staleWhileFetching:n;if(o===void 0)continue;e.call(t,o,this.#r[r],this)}}purgeStale(){let e=!1;for(let t of this.#E({allowStale:!0}))if(this.#m(t))this.#w(this.#r[t],"expire"),e=!0;return e}info(e){let t=this.#o.get(e);if(t===void 0)return;let r=this.#e[t],n=this.#t(r)?r.__staleWhileFetching:r;if(n===void 0)return;let o={value:n};if(this.#f&&this.#x){let i=this.#f[t],s=this.#x[t];if(i&&s){let a=i-(Lc.now()-s);o.ttl=a,o.start=Date.now()}}if(this.#b)o.size=this.#b[t];return o}dump(){let e=[];for(let t of this.#S({allowStale:!0})){let r=this.#r[t],n=this.#e[t],o=this.#t(n)?n.__staleWhileFetching:n;if(o===void 0||r===void 0)continue;let i={value:o};if(this.#f&&this.#x){i.ttl=this.#f[t];let s=Lc.now()-this.#x[t];i.start=Math.floor(Date.now()-s)}if(this.#b)i.size=this.#b[t];e.unshift([r,i])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let n=Date.now()-r.start;r.start=Lc.now()-n}this.set(t,r.value,r)}}set(e,t,r={}){if(t===void 0)return this.delete(e),this;let{ttl:n=this.ttl,start:o,noDisposeOnSet:i=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r,{noUpdateTTL:c=this.noUpdateTTL}=r,u=this.#U(e,t,r.size||0,s);if(this.maxEntrySize&&u>this.maxEntrySize){if(a)a.set="miss",a.maxEntrySizeExceeded=!0;return this.#w(e,"set"),this}let d=this.#i===0?void 0:this.#o.get(e);if(d===void 0){if(d=this.#i===0?this.#s:this.#y.length!==0?this.#y.pop():this.#i===this.#n?this.#D(!1):this.#i,this.#r[d]=e,this.#e[d]=t,this.#o.set(e,d),this.#l[this.#s]=d,this.#d[d]=this.#s,this.#s=d,this.#i++,this.#P(d,u,a),a)a.set="add";c=!1}else{this.#C(d);let f=this.#e[d];if(t!==f){if(this.#A&&this.#t(f)){f.__abortController.abort(Error("replaced"));let{__staleWhileFetching:m}=f;if(m!==void 0&&!i){if(this.#v)this.#g?.(m,e,"set");if(this.#u)this.#a?.push([m,e,"set"])}}else if(!i){if(this.#v)this.#g?.(f,e,"set");if(this.#u)this.#a?.push([f,e,"set"])}if(this.#O(d),this.#P(d,u,a),this.#e[d]=t,a){a.set="replace";let m=f&&this.#t(f)?f.__staleWhileFetching:f;if(m!==void 0)a.oldValue=m}}else if(a)a.set="update"}if(n!==0&&!this.#f)this.#N();if(this.#f){if(!c)this.#M(d,n,o);if(a)this.#T(a,d)}if(!i&&this.#u&&this.#a){let f=this.#a,m;while(m=f?.shift())this.#h?.(...m)}return this}pop(){try{while(this.#i){let e=this.#e[this.#c];if(this.#D(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#u&&this.#a){let e=this.#a,t;while(t=e?.shift())this.#h?.(...t)}}}#D(e){let t=this.#c,r=this.#r[t],n=this.#e[t];if(this.#A&&this.#t(n))n.__abortController.abort(Error("evicted"));else if(this.#v||this.#u){if(this.#v)this.#g?.(n,r,"evict");if(this.#u)this.#a?.push([n,r,"evict"])}if(this.#O(t),e)this.#r[t]=void 0,this.#e[t]=void 0,this.#y.push(t);if(this.#i===1)this.#c=this.#s=0,this.#y.length=0;else this.#c=this.#l[t];return this.#o.delete(r),this.#i--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=t,o=this.#o.get(e);if(o!==void 0){let i=this.#e[o];if(this.#t(i)&&i.__staleWhileFetching===void 0)return!1;if(!this.#m(o)){if(r)this.#k(o);if(n)n.has="hit",this.#T(n,o);return!0}else if(n)n.has="stale",this.#T(n,o)}else if(n)n.has="miss";return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,n=this.#o.get(e);if(n===void 0||!r&&this.#m(n))return;let o=this.#e[n];return this.#t(o)?o.__staleWhileFetching:o}#L(e,t,r,n){let o=t===void 0?void 0:this.#e[t];if(this.#t(o))return o;let i=new gy,{signal:s}=r;s?.addEventListener("abort",()=>i.abort(s.reason),{signal:i.signal});let a={signal:i.signal,options:r,context:n},c=(h,_=!1)=>{let{aborted:y}=i.signal,b=r.ignoreFetchAbort&&h!==void 0;if(r.status)if(y&&!_){if(r.status.fetchAborted=!0,r.status.fetchError=i.signal.reason,b)r.status.fetchAbortIgnored=!0}else r.status.fetchResolved=!0;if(y&&!b&&!_)return d(i.signal.reason);let T=m;if(this.#e[t]===m)if(h===void 0)if(T.__staleWhileFetching)this.#e[t]=T.__staleWhileFetching;else this.#w(e,"fetch");else{if(r.status)r.status.fetchUpdated=!0;this.set(e,h,a.options)}return h},u=(h)=>{if(r.status)r.status.fetchRejected=!0,r.status.fetchError=h;return d(h)},d=(h)=>{let{aborted:_}=i.signal,y=_&&r.allowStaleOnFetchAbort,b=y||r.allowStaleOnFetchRejection,T=b||r.noDeleteOnFetchRejection,w=m;if(this.#e[t]===m){if(!T||w.__staleWhileFetching===void 0)this.#w(e,"fetch");else if(!y)this.#e[t]=w.__staleWhileFetching}if(b){if(r.status&&w.__staleWhileFetching!==void 0)r.status.returnedStale=!0;return w.__staleWhileFetching}else if(w.__returned===w)throw h},f=(h,_)=>{let y=this.#R?.(e,o,a);if(y&&y instanceof Promise)y.then((b)=>h(b===void 0?void 0:b),_);i.signal.addEventListener("abort",()=>{if(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort){if(h(void 0),r.allowStaleOnFetchAbort)h=(b)=>c(b,!0)}})};if(r.status)r.status.fetchDispatched=!0;let m=new Promise(f).then(c,u),g=Object.assign(m,{__abortController:i,__staleWhileFetching:o,__returned:void 0});if(t===void 0)this.set(e,g,{...a.options,status:void 0}),t=this.#o.get(e);else this.#e[t]=g;return g}#t(e){if(!this.#A)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof gy}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:h,forceRefresh:_=!1,status:y,signal:b}=t;if(!this.#A){if(y)y.fetch="get";return this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,status:y})}let T={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:i,noDisposeOnSet:s,size:a,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:g,ignoreFetchAbort:m,status:y,signal:b},w=this.#o.get(e);if(w===void 0){if(y)y.fetch="miss";let k=this.#L(e,w,T,h);return k.__returned=k}else{let k=this.#e[w];if(this.#t(k)){let ke=r&&k.__staleWhileFetching!==void 0;if(y){if(y.fetch="inflight",ke)y.returnedStale=!0}return ke?k.__staleWhileFetching:k.__returned=k}let P=this.#m(w);if(!_&&!P){if(y)y.fetch="hit";if(this.#C(w),n)this.#k(w);if(y)this.#T(y,w);return k}let te=this.#L(e,w,T,h),Oe=te.__staleWhileFetching!==void 0&&r;if(y){if(y.fetch=P?"stale":"refresh",Oe&&P)y.returnedStale=!0}return Oe?te.__staleWhileFetching:te.__returned=te}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#I;if(!r)throw Error("no memoMethod provided to constructor");let{context:n,forceRefresh:o,...i}=t,s=this.get(e,i);if(!o&&s!==void 0)return s;let a=r(e,s,{options:i,context:n});return this.set(e,a,i),a}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:i}=t,s=this.#o.get(e);if(s!==void 0){let a=this.#e[s],c=this.#t(a);if(i)this.#T(i,s);if(this.#m(s)){if(i)i.get="stale";if(!c){if(!o)this.#w(e,"expire");if(i&&r)i.returnedStale=!0;return r?a:void 0}else{if(i&&r&&a.__staleWhileFetching!==void 0)i.returnedStale=!0;return r?a.__staleWhileFetching:void 0}}else{if(i)i.get="hit";if(c)return a.__staleWhileFetching;if(this.#C(s),n)this.#k(s);return a}}else if(i)i.get="miss"}#j(e,t){this.#d[t]=e,this.#l[e]=t}#C(e){if(e!==this.#s){if(e===this.#c)this.#c=this.#l[e];else this.#j(this.#d[e],this.#l[e]);this.#j(this.#s,e),this.#s=e}}delete(e){return this.#w(e,"delete")}#w(e,t){let r=!1;if(this.#i!==0){let n=this.#o.get(e);if(n!==void 0)if(r=!0,this.#i===1)this.#F(t);else{this.#O(n);let o=this.#e[n];if(this.#t(o))o.__abortController.abort(Error("deleted"));else if(this.#v||this.#u){if(this.#v)this.#g?.(o,e,t);if(this.#u)this.#a?.push([o,e,t])}if(this.#o.delete(e),this.#r[n]=void 0,this.#e[n]=void 0,n===this.#s)this.#s=this.#d[n];else if(n===this.#c)this.#c=this.#l[n];else{let i=this.#d[n];this.#l[i]=this.#l[n];let s=this.#l[n];this.#d[s]=this.#d[n]}this.#i--,this.#y.push(n)}}if(this.#u&&this.#a?.length){let n=this.#a,o;while(o=n?.shift())this.#h?.(...o)}return r}clear(){return this.#F("delete")}#F(e){for(let t of this.#E({allowStale:!0})){let r=this.#e[t];if(this.#t(r))r.__abortController.abort(Error("deleted"));else{let n=this.#r[t];if(this.#v)this.#g?.(r,n,e);if(this.#u)this.#a?.push([r,n,e])}}if(this.#o.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#f&&this.#x)this.#f.fill(0),this.#x.fill(0);if(this.#b)this.#b.fill(0);if(this.#c=0,this.#s=0,this.#y.length=0,this.#_=0,this.#i=0,this.#u&&this.#a){let t=this.#a,r;while(r=t?.shift())this.#h?.(...r)}}}function Iq(e,t,r=100){let n=new hy({max:r}),o=(...i)=>{let s=t(...i),a=n.get(s);if(a!==void 0)return a;let c=e(...i);return n.set(s,c),c};return o.cache={clear:()=>n.clear(),size:()=>n.size,delete:(i)=>n.delete(i),get:(i)=>n.peek(i),has:(i)=>n.has(i)},o}var M0e=8192;function Dq(e,t){try{return{ok:!0,value:JSON.parse(my(e))}}catch(r){if(t)sh(FI(r,`safeParseJSON: invalid JSON (${r instanceof Error?r.constructor.name:typeof r}, ${e.length} bytes)`));return{ok:!1}}}var Pq=Iq(Dq,(e)=>e,50);var Mc=Object.assign(function(t,r=!0){if(!t)return null;let n=t.length>M0e?Dq(t,r):Pq(t,r);return n.ok?n.value:null},{cache:Pq.cache});import{join as U0e}from"path";var xs=re(function(){switch(no()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),Qxt=re(function(){return U0e(xs(),"managed-settings.d")});var $0e=function(){try{var e=or(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),Uc=$0e;function j0e(e,t,r){if(t=="__proto__"&&Uc)Uc(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0});else e[t]=r}var $c=j0e;function F0e(e,t,r){if(r!==void 0&&!An(e[t],r)||r===void 0&&!(t in e))$c(e,t,r)}var Cd=F0e;function z0e(e){return function(t,r,n){var o=-1,i=Object(t),s=n(t),a=s.length;while(a--){var c=s[e?a:++o];if(r(i[c],c,i)===!1)break}return t}}var Lq=z0e;var B0e=Lq(),Nq=B0e;var yy={};lt(yy,{default:()=>Pk});var jq=typeof yy=="object"&&yy&&!yy.nodeType&&yy,Mq=jq&&typeof _y=="object"&&_y&&!_y.nodeType&&_y,H0e=Mq&&Mq.exports===jq,Uq=H0e?gt.Buffer:void 0,$q=Uq?Uq.allocUnsafe:void 0;function q0e(e,t){if(t)return e.slice();var r=e.length,n=$q?$q(r):new e.constructor(r);return e.copy(n),n}var Pk=q0e;function G0e(e){var t=new e.constructor(e.byteLength);return new Pa(t).set(new Pa(e)),t}var Fq=G0e;function W0e(e,t){var r=t?Fq(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var zq=W0e;function V0e(e,t){var r=-1,n=e.length;t||(t=Array(n));while(++r<n)t[r]=e[r];return t}var Bq=V0e;var Hq=Object.create,K0e=function(){function e(){}return function(t){if(!Et(t))return{};if(Hq)return Hq(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),qq=K0e;var Z0e=Hg(Object.getPrototypeOf,Object),jc=Z0e;function J0e(e){return typeof e.constructor=="function"&&!Ma(e)?qq(jc(e)):{}}var Gq=J0e;function Y0e(e){return Qt(e)&&zo(e)}var Wq=Y0e;var X0e="[object Object]",Q0e=Function.prototype,eLe=Object.prototype,Vq=Q0e.toString,tLe=eLe.hasOwnProperty,rLe=Vq.call(Object);function nLe(e){if(!Qt(e)||vr(e)!=X0e)return!1;var t=jc(e);if(t===null)return!0;var r=tLe.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Vq.call(r)==rLe}var Kq=nLe;function oLe(e,t){if(t==="constructor"&&typeof e[t]==="function")return;if(t=="__proto__")return;return e[t]}var Rd=oLe;var iLe=Object.prototype,sLe=iLe.hasOwnProperty;function aLe(e,t,r){var n=e[t];if(!(sLe.call(e,t)&&An(n,r))||r===void 0&&!(t in e))$c(e,t,r)}var by=aLe;function cLe(e,t,r,n){var o=!r;r||(r={});var i=-1,s=t.length;while(++i<s){var a=t[i],c=n?n(r[a],e[a],a,r,e):void 0;if(c===void 0)c=e[a];if(o)$c(r,a,c);else by(r,a,c)}return r}var Zq=cLe;function lLe(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var Jq=lLe;var uLe=Object.prototype,pLe=uLe.hasOwnProperty;function dLe(e){if(!Et(e))return Jq(e);var t=Ma(e),r=[];for(var n in e)if(!(n=="constructor"&&(t||!pLe.call(e,n))))r.push(n);return r}var Yq=dLe;function fLe(e){return zo(e)?Bg(e,!0):Yq(e)}var Fc=fLe;function mLe(e){return Zq(e,Fc(e))}var Xq=mLe;function gLe(e,t,r,n,o,i,s){var a=Rd(e,r),c=Rd(t,r),u=s.get(c);if(u){Cd(e,r,u);return}var d=i?i(a,c,r+"",e,t,s):void 0,f=d===void 0;if(f){var m=at(c),g=!m&&jo(c),h=!m&&!g&&Na(c);if(d=c,m||g||h)if(at(a))d=a;else if(Wq(a))d=Bq(a);else if(g)f=!1,d=Pk(c,!0);else if(h)f=!1,d=zq(c,!0);else d=[];else if(Kq(c)||ro(c)){if(d=a,ro(a))d=Xq(a);else if(!Et(a)||Rs(a))d=Gq(c)}else f=!1}if(f)s.set(c,d),o(d,c,n,i,s),s.delete(c);Cd(e,r,d)}var Qq=gLe;function eG(e,t,r,n,o){if(e===t)return;Nq(t,function(i,s){if(o||(o=new $o),Et(i))Qq(e,t,s,r,eG,n,o);else{var a=n?n(Rd(e,s),i,s+"",e,t,o):void 0;if(a===void 0)a=i;Cd(e,s,a)}},Fc)}var tG=eG;function hLe(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var rG=hLe;var nG=Math.max;function _Le(e,t,r){return t=nG(t===void 0?e.length-1:t,0),function(){var n=arguments,o=-1,i=nG(n.length-t,0),s=Array(i);while(++o<i)s[o]=n[t+o];o=-1;var a=Array(t+1);while(++o<t)a[o]=n[o];return a[t]=r(s),rG(e,this,a)}}var xy=_Le;function yLe(e){return function(){return e}}var oG=yLe;var bLe=!Uc?Fa:function(e,t){return Uc(e,"toString",{configurable:!0,enumerable:!1,value:oG(t),writable:!0})},iG=bLe;var xLe=800,vLe=16,SLe=Date.now;function ELe(e){var t=0,r=0;return function(){var n=SLe(),o=vLe-(n-r);if(r=n,o>0){if(++t>=xLe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var sG=ELe;var wLe=sG(iG),vy=wLe;function TLe(e,t){return vy(xy(e,t,Fa),e+"")}var aG=TLe;function ALe(e,t,r){if(!Et(r))return!1;var n=typeof t;if(n=="number"?zo(r)&&Fo(t,r.length):n=="string"&&(t in r))return An(r[t],e);return!1}var cG=ALe;function kLe(e){return aG(function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;if(i=e.length>3&&typeof i=="function"?(o--,i):void 0,s&&cG(r[0],r[1],s))i=o<3?void 0:i,o=1;t=Object(t);while(++n<o){var a=r[n];if(a)e(t,a,n,i)}return t})}var lG=kLe;var OLe=lG(function(e,t,r,n){tG(e,t,r,n)}),En=OLe;function CLe(e,t,r,n){if(!Et(e))return e;t=Bo(t,e);var o=-1,i=t.length,s=i-1,a=e;while(a!=null&&++o<i){var c=Pn(t[o]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(o!=s){var d=a[c];if(u=n?n(d,c,a):void 0,u===void 0)u=Et(d)?d:Fo(t[o+1])?[]:{}}by(a,c,u),a=a[c]}return e}var uG=CLe;function RLe(e,t,r){var n=-1,o=t.length,i={};while(++n<o){var s=t[n],a=ja(e,s);if(r(a,s))uG(i,Bo(s,e),a)}return i}var Sy=RLe;function ILe(e,t){return Sy(e,t,function(r,n){return eh(e,n)})}var pG=ILe;var dG=Zt?Zt.isConcatSpreadable:void 0;function PLe(e){return at(e)||ro(e)||!!(dG&&e&&e[dG])}var fG=PLe;function mG(e,t,r,n,o){var i=-1,s=e.length;r||(r=fG),o||(o=[]);while(++i<s){var a=e[i];if(t>0&&r(a))if(t>1)mG(a,t-1,r,n,o);else Da(o,a);else if(!n)o[o.length]=a}return o}var gG=mG;function DLe(e){var t=e==null?0:e.length;return t?gG(e,1):[]}var hG=DLe;function LLe(e){return vy(xy(e,void 0,hG),e+"")}var _G=LLe;var NLe=_G(function(e,t){return e==null?{}:pG(e,t)}),Ey=NLe;import{homedir as kMe}from"os";import{dirname as OMe,join as Tn,resolve as Zr}from"path";var MLe="Expected a function";function ULe(e){if(typeof e!="function")throw TypeError(MLe);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}var yG=ULe;var $Le=Object.getOwnPropertySymbols,jLe=!$Le?Ng:function(e){var t=[];while(e)Da(t,Mg(e)),e=jc(e);return t},bG=jLe;function FLe(e){return Lg(e,Fc,bG)}var xG=FLe;function zLe(e,t){if(e==null)return{};var r=Qg(xG(e),function(n){return[n]});return t=th(t),Sy(e,r,function(n,o){return t(n,o[0])})}var vG=zLe;function BLe(e,t){return vG(e,yG(th(t)))}var SG=BLe;import{join as VLe}from"path";var Dk=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_VERTEX","CLAUDE_CODE_USE_FOUNDRY","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD","CLAUDE_CODE_USE_MANTLE","CLAUDE_CODE_USE_GATEWAY","ANTHROPIC_FOUNDRY_RESOURCE","ANTHROPIC_VERTEX_PROJECT_ID","ANTHROPIC_AWS_WORKSPACE_ID","ANTHROPIC_GOOGLE_CLOUD_PROJECT","ANTHROPIC_GOOGLE_CLOUD_LOCATION","ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID","CLOUD_ML_REGION"];var Lk=["ANTHROPIC_BASE_URL","_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL","ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_VERTEX_BASE_URL","ANTHROPIC_FOUNDRY_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_GOOGLE_CLOUD_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL","CLAUDE_CODE_ARTIFACTS_API_BASE_URL"];var Nk=["ANTHROPIC_API_KEY","ANTHROPIC_AUTH_TOKEN","CLAUDE_CODE_OAUTH_TOKEN","AWS_BEARER_TOKEN_BEDROCK","ANTHROPIC_FOUNDRY_API_KEY","ANTHROPIC_FOUNDRY_AUTH_TOKEN","ANTHROPIC_AWS_API_KEY"],HLe=["CLAUDE_CODE_SKIP_BEDROCK_AUTH","CLAUDE_CODE_SKIP_VERTEX_AUTH","CLAUDE_CODE_SKIP_FOUNDRY_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH","CLAUDE_CODE_SKIP_MANTLE_AUTH"],qLe=["ANTHROPIC_MODEL","ANTHROPIC_DEFAULT_FABLE_MODEL","ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_FABLE_MODEL_NAME","ANTHROPIC_DEFAULT_FABLE_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_HAIKU_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME","ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_OPUS_MODEL","ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_OPUS_MODEL_NAME","ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_SONNET_MODEL","ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_SONNET_MODEL_NAME","ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_SMALL_FAST_MODEL","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION","CLAUDE_CODE_SUBAGENT_MODEL","CLAUDE_CODE_3P_PROBE_WROTE_SONNET_DEFAULT","CLAUDE_CODE_3P_PROBE_WROTE_OPUS_DEFAULT"];var GLe=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"],WLe=[...GLe,"AWS_PROFILE","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","GOOGLE_APPLICATION_CREDENTIALS","GOOGLE_CLOUD_PROJECT"];var qEt=new Set(["CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST",...Dk,...Lk,...Nk,...HLe,"CLAUDE_CODE_HOST_AUTH_ENV_VAR","CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH","CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS","CLAUDE_CODE_HOST_CREDS_FILE",...WLe,"GCLOUD_PROJECT","GOOGLE_CLOUD_QUOTA_PROJECT","GCE_METADATA_HOST","GCE_METADATA_IP","METADATA_SERVER_DETECTION","AWS_CONTAINER_CREDENTIALS_FULL_URI","AWS_CONTAINER_CREDENTIALS_RELATIVE_URI","AWS_CONTAINER_AUTHORIZATION_TOKEN","AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE","AWS_EC2_METADATA_SERVICE_ENDPOINT","AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE","AWS_REGION","AWS_DEFAULT_REGION",...qLe,"ANTHROPIC_BEDROCK_SERVICE_TIER","CLAUDE_CODE_CERT_STORE","DISABLE_GROWTHBOOK"]);var KLe="remote-settings.json",Mk=null,ZLe;var JLe=null,YLe=null;function Uk(){return}function XLe(){return Uk()??VLe(Yt(),KLe)}function QLe(){try{let e=bs(XLe()),t=yt(my(e));if(!t||typeof t!=="object"||Array.isArray(t))return null;return t}catch{return null}}var eNe=new Set(["HTTPS_PROXY","HTTP_PROXY","NO_PROXY","CLAUDE_CODE_PROXY_RESOLVES_HOSTS","CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER","CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS","API_FORCE_IDLE_TIMEOUT","ANTHROPIC_UNIX_SOCKET","NODE_EXTRA_CA_CERTS","CLAUDE_CODE_CERT_STORE","CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE","ALL_PROXY","NODE_OPTIONS","NODE_TLS_REJECT_UNAUTHORIZED",...Dk,...Lk,"CLAUDE_CODE_CUSTOM_OAUTH_URL",...Nk,"ANTHROPIC_CUSTOM_HEADERS","CLAUDE_CODE_HOST_CREDS_FILE","CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST","CLAUDE_CODE_HOST_AUTH_ENV_VAR","CLAUDE_CONFIG_DIR","CLAUDE_SECURESTORAGE_CONFIG_DIR","CLAUDE_CODE_REMOTE_SETTINGS_PATH","CLAUDE_CODE_MOCK_REMOTE_SETTINGS","USE_LOCAL_OAUTH","USE_STAGING_OAUTH","CLAUDE_LOCAL_OAUTH_API_BASE"].map((e)=>e.toUpperCase()));function tNe(e){if(!e?.env)return e;let t=SG(e.env,(r,n)=>eNe.has(n.toUpperCase()));return{...e,env:t}}function rNe(){if(!Uk()&&ZLe!==!0)return null;if(Mk)return Mk;let e=QLe();if(e)return Mk=e,YLe??=e,qi(),e;return null}function EG(){let e=rNe();if(e===JLe||Uk())return e;return tNe(e)}var wG=["userSettings","projectSettings","localSettings","flagSettings","policySettings"];import{userInfo as nNe}from"os";var TG="com.anthropic.claudecode",Id="HKLM\\SOFTWARE\\Policies\\ClaudeCode",Pd="HKCU\\SOFTWARE\\Policies\\ClaudeCode",pi="Settings",AG="/usr/bin/plutil",kG=["-convert","json","-o","-","--"],OG=5000,$k="/mnt/c/Windows/System32/reg.exe",zc="/mnt/c/Program Files/ClaudeCode";function wy(){if(process.platform!=="linux")return!1;if(process.env.WSL_DISTRO_NAME)return!0;try{let e=be("fs").readFileSync("/proc/version","utf8").toLowerCase();return e.includes("microsoft")||e.includes("wsl")}catch{return!1}}function CG(){let e="";try{e=nNe().username}catch{}let t=[];if(e)t.push({path:`/Library/Managed Preferences/${e}/${TG}.plist`,label:"per-user managed preferences"});return t.push({path:`/Library/Managed Preferences/${TG}.plist`,label:"device-level managed preferences"}),t}import{isAbsolute as RG}from"path";var oNe=C(()=>l.object({allowedDomains:l.array(l.string()).optional(),deniedDomains:l.array(l.string()).optional().describe("Domains that are always blocked, even if matched by allowedDomains. Supports the same wildcard syntax as allowedDomains. Merged from all settings sources regardless of allowManagedDomainsOnly."),allowManagedDomainsOnly:l.boolean().optional().describe("When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources."),allowUnixSockets:l.array(l.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:l.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:l.boolean().optional(),allowMachLookup:l.array(l.string().refine((e)=>!(e.endsWith("*")?e.slice(0,-1):e).includes("*"),{message:'Wildcards are only allowed as a single trailing "*" (e.g., "com.example.*" or "*" for all services).'})).optional().describe('macOS only: Additional XPC/Mach service names to allow looking up. Supports trailing-wildcard prefix matching (e.g., "com.apple.coresimulator.*"). Needed for tools that communicate via XPC such as the iOS Simulator or Playwright.'),httpProxyPort:l.number().optional(),socksProxyPort:l.number().optional(),tlsTerminate:l.object({caCertPath:l.string().min(1).optional(),caKeyPath:l.string().min(1).optional()}).optional().describe("[EXPERIMENTAL] Enable in-process TLS termination so the per-request filter can see HTTPS request bodies. Provide a CA cert+key, or omit both to have sandbox-runtime generate an ephemeral one for the session. "+"Only honored from user, managed/policy, or CLI (`--settings`) settings — project settings "+"(.claude/settings.json and .claude/settings.local.json) are ignored.")}).optional()),iNe=C(()=>l.object({allowWrite:l.array(l.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules."),denyWrite:l.array(l.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:l.array(l.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:l.array(l.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths."),allowManagedReadPathsOnly:l.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used."),disabled:l.boolean().optional().describe("macOS and Linux/WSL only: skip filesystem isolation entirely while keeping network and seccomp isolation. Ignored on native Windows, where the sandboxed process runs as a separate user with no inherent rights, so skipping the filesystem rules would "+"withhold every access grant rather than loosen them — filesystem isolation stays on there. "+"Sandboxed commands get unrestricted read/write access to the host filesystem; network egress is still confined to network.allowedDomains. Intended for deployments whose goal is egress control rather than filesystem containment. Does not change Bash prompting: sandbox.autoAllowBashIfSandboxed is independent and still defaults to true, so set it to false to keep prompting for sandboxed commands. Drops the read protection from filesystem.denyRead and credentials.files for sandboxed commands, since both are enforced by the filesystem layer this turns off; credentials.envVars deny/mask is unaffected. "+"Only honored from user, managed/policy, or CLI (`--settings`) settings — "+"project settings (.claude/settings.json and .claude/settings.local.json) are ignored. If managed settings configure sandbox.filesystem at all, or list any sandbox.credentials.files entry, only managed settings can set this: an admin who deployed filesystem restrictions must not have them switched off by a user-writable "+"file. (sandbox.credentials.envVars does not pin it — env scrubbing is independent of "+"the filesystem layer and survives this setting.) When unset, filesystem isolation stays on.")}).optional()),jk=C(()=>l.object({path:l.string().min(1).describe("Path to a credential file or directory. Same resolution as sandbox.filesystem.* paths: absolute, ~ expanded, or relative to the settings file root (project root for project settings, ~/.claude for user settings)."),mode:l.literal("deny").describe("Access mode for this path. Only `deny` is supported.")})),Fk=C(()=>l.object({name:l.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/,"Environment variable name must start with a letter or underscore and contain only letters, digits, and underscores").describe("Environment variable name."),mode:l.enum(["deny","mask"]).describe("Access mode for this environment variable. `deny` unsets the variable for sandboxed commands; `mask` shows sandboxed commands a sentinel value and the "+"host proxy swaps sentinel→real on egress to `injectHosts`."),injectHosts:l.array(l.string()).optional().describe("Optional narrowing of where the proxy substitutes this credential. Only meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, defaults to "+"`network.allowedDomains` — the credential is injected at "+"every reachable host. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).")})),sNe=C(()=>l.object({files:l.array(jk()).optional().describe("Credential files or directories to protect. `deny` blocks reads inside the sandbox."),envVars:l.array(Fk()).optional().describe("Environment variables to protect. `deny` unsets the variable for sandboxed commands; `mask` substitutes a sentinel inside the sandbox and injects the real value at the proxy."),allowPlaintextInject:l.boolean().optional().describe("Allow sentinel→real substitution on the plain-HTTP proxy path. "+"Defaults to false: without TLS termination the upstream identity is unverified and the credential travels in cleartext. Set only for trusted-network test fixtures. Only honored from user, managed/policy, or CLI (`--settings`) "+"settings — project settings (.claude/settings.json and "+".claude/settings.local.json) are ignored.")}).optional()),zk=C(()=>l.object({enabled:l.boolean().optional(),failIfUnavailable:l.boolean().optional().describe("Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies or unsupported platform). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate."),autoAllowBashIfSandboxed:l.boolean().optional(),allowUnsandboxedCommands:l.boolean().optional().describe("Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."),network:oNe(),filesystem:iNe(),credentials:sNe(),ignoreViolations:l.record(l.string(),l.array(l.string())).optional(),enableWeakerNestedSandbox:l.boolean().optional(),enableWeakerNetworkIsolation:l.boolean().optional().describe("macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. "+"**Reduces security** — opens a potential data exfiltration vector through the trustd service. Default: false"),allowAppleEvents:l.boolean().optional().describe("macOS only: Allow sandboxed commands to send Apple Events (and look up the appleeventsd Mach service). Needed for `open`, `osascript`, and browser-based auth flows that open URLs. "+"**Removes code-execution isolation** — sandboxed commands can launch other applications "+"unsandboxed with no user prompt, and can script running apps (e.g. Terminal) subject to the user's per-app TCC automation consent. "+"Only honored from user, managed/policy, or CLI (--settings) settings — "+"project settings (.claude/settings.json and .claude/settings.local.json) are ignored. Default: false"),excludedCommands:l.array(l.string()).optional(),ripgrep:l.object({command:l.string(),args:l.array(l.string()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support"),bwrapPath:l.preprocess((e)=>typeof e==="string"&&RG(e)?e:void 0,l.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the bwrap (bubblewrap) binary. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings."),socatPath:l.preprocess((e)=>typeof e==="string"&&RG(e)?e:void 0,l.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the socat binary used for the sandbox network proxy. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings.")}).passthrough());var Dd=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],IG=[...Dd],PG=IG;function Ld(e){return e==="manual"?"default":e}var pwt=`Cannot set permission mode: must be one of ${IG.join(", ")}`;var DG=["auto","iterm2","terminal_bell","iterm2_with_bell","kitty","ghostty","notifications_disabled"],LG=["normal","vim"],NG=["auto","tmux","iterm2","in-process"],aNe=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],MG=["auto",...aNe];var gwt=no()==="macos"?"⏺":"●";var Ewt=C(()=>ru.preprocess(Ld,ru.enum(PG))),wwt=C(()=>ru.preprocess(Ld,ru.enum(Dd)));var UG=["bash","powershell"];var Nd=C(()=>l.string().optional().describe('Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.'));function cNe(){let e=l.object({type:l.literal("command").describe("Shell command hook type"),command:l.string().describe("Shell command to execute"),args:l.array(l.string()).optional().describe("Argument list for exec form. When present, `command` is resolved as "+"an executable and spawned directly with these arguments — no shell. "+"Path placeholders like ${CLAUDE_PLUGIN_ROOT} are substituted per-element as plain strings, so paths with quotes, $, or backticks never reach a shell parser. When absent, `command` runs through a shell (bash on POSIX, PowerShell on Windows without Git Bash)."),if:Nd(),shell:l.enum(UG).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."),timeout:l.number().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:l.string().optional().describe("Custom status message to display in spinner while hook runs"),once:l.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:l.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:l.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),rewakeMessage:l.string().min(1).optional().describe("@internal Custom prefix for the system-reminder shown to the model when an asyncRewake hook exits with code 2. The hook output is appended after this prefix."),rewakeSummary:l.string().min(1).optional().describe('@internal One-line summary shown to the user in the terminal when an asyncRewake hook exits with code 2. Defaults to "Stop hook feedback".')}),t=l.object({type:l.literal("prompt").describe("LLM prompt hook type"),prompt:l.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:Nd(),timeout:l.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:l.string().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-5"). If not specified, uses the default small fast model.'),continueOnBlock:l.boolean().optional().describe(`Sets the continue value for the decision:"block" produced when ok is false. Default false (turn ends). Whether continue:true lets the turn proceed depends on the event's decision:"block" semantics. On PostToolUse, the reason is fed back to Claude and the turn continues.`),statusMessage:l.string().optional().describe("Custom status message to display in spinner while hook runs"),once:l.boolean().optional().describe("If true, hook runs once and is removed after execution")}),r=l.object({type:l.literal("mcp_tool").describe("MCP tool hook type"),server:l.string().describe("Name of an already-configured MCP server to invoke"),tool:l.string().describe("Name of the tool on that server to call"),input:l.record(l.string(),l.unknown()).optional().describe('Arguments passed to the MCP tool. String values support ${path} interpolation from the hook input JSON (e.g. "${tool_input.file_path}").'),if:Nd(),timeout:l.number().positive().optional().describe("Timeout in seconds for this specific tool call"),statusMessage:l.string().optional().describe("Custom status message to display in spinner while hook runs"),once:l.boolean().optional().describe("If true, hook runs once and is removed after execution")}),n=l.object({type:l.literal("http").describe("HTTP hook type"),url:l.string().url().describe("URL to POST the hook input JSON to"),if:Nd(),timeout:l.number().positive().optional().describe("Timeout in seconds for this specific request"),headers:l.record(l.string(),l.string()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:l.array(l.string()).optional().describe("Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work."),statusMessage:l.string().optional().describe("Custom status message to display in spinner while hook runs"),once:l.boolean().optional().describe("If true, hook runs once and is removed after execution")}),o=l.object({type:l.literal("agent").describe("Agentic verifier hook type"),prompt:l.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:Nd(),timeout:l.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:l.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-5"). If not specified, uses Haiku.'),statusMessage:l.string().optional().describe("Custom status message to display in spinner while hook runs"),once:l.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:e,PromptHookSchema:t,HttpHookSchema:n,AgentHookSchema:o,McpToolHookSchema:r}}var $G=C(()=>{let{BashCommandHookSchema:e,PromptHookSchema:t,AgentHookSchema:r,HttpHookSchema:n,McpToolHookSchema:o}=cNe();return l.discriminatedUnion("type",[e,t,r,n,o])}),jG=C(()=>l.object({matcher:l.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:l.array($G()).describe("List of hooks to execute when the matcher matches")})),vs=C(()=>l.partialRecord(l.enum(Os),l.array(jG())));var Lwt=C(()=>l.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),Nwt=C(()=>l.enum(["stdio","sse","sse-ide","http","ws","sdk"])),Bc=C(()=>l.literal("comms").optional().catch(void 0)),di=C(()=>l.number().int().positive()),lNe=300000,FG=C(()=>l.number().int().positive().optional().catch(void 0).describe("@internal CCR backend wire hint; folded into timeout at parse."));function zG({request_timeout_ms:e,...t}){return{...t,...t.timeout===void 0&&e!==void 0&&{timeout:Math.min(e,lNe)}}}var uNe=C(()=>l.object({type:l.literal("stdio").optional(),command:l.string().min(1,"Command cannot be empty"),args:l.array(l.string()).default([]),env:l.record(l.string(),l.string()).optional(),timeout:di().optional(),alwaysLoad:l.boolean().optional(),role:Bc()})),pNe=C(()=>l.boolean()),BG=C(()=>l.object({clientId:l.string().optional(),callbackPort:l.number().int().positive().optional(),authServerMetadataUrl:l.string().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:l.string().min(1).optional(),xaa:pNe().optional()})),HG=C(()=>l.object({name:l.string(),permission_policy:l.enum(["always_allow","always_ask","always_deny"]).optional()})),dNe=C(()=>l.object({type:l.literal("sse"),url:l.string(),headers:l.record(l.string(),l.string()).optional(),headersHelper:l.string().optional(),oauth:BG().optional(),timeout:di().optional(),request_timeout_ms:FG(),tools:l.array(HG()).optional(),alwaysLoad:l.boolean().optional(),role:Bc(),toolPermissions:l.record(l.string(),Bk()).optional(),discoveryCache:l.boolean().optional()}).transform(zG)),fNe=C(()=>l.object({type:l.literal("sse-ide"),url:l.string(),ideName:l.string(),ideRunningInWindows:l.boolean().optional(),timeout:di().optional(),alwaysLoad:l.boolean().optional(),role:Bc()})),mNe=C(()=>l.object({type:l.literal("ws-ide"),url:l.string(),ideName:l.string(),authToken:l.string().optional(),ideRunningInWindows:l.boolean().optional(),timeout:di().optional(),alwaysLoad:l.boolean().optional(),role:Bc()})),gNe=C(()=>l.object({type:l.enum(["http","streamable-http"]).transform(()=>"http"),url:l.string(),headers:l.record(l.string(),l.string()).optional(),headersHelper:l.string().optional(),oauth:BG().optional(),timeout:di().optional(),request_timeout_ms:FG(),tools:l.array(HG()).optional(),alwaysLoad:l.boolean().optional(),role:Bc(),toolPermissions:l.record(l.string(),Bk()).optional(),discoveryCache:l.boolean().optional()}).transform(zG)),hNe=C(()=>l.object({type:l.literal("ws"),url:l.string(),headers:l.record(l.string(),l.string()).optional(),headersHelper:l.string().optional(),timeout:di().optional(),alwaysLoad:l.boolean().optional(),role:Bc()})),_Ne=C(()=>l.object({type:l.literal("sdk"),name:l.string(),timeout:di().optional(),alwaysLoad:l.boolean().optional()})),Bk=C(()=>l.enum(["allow","ask","blocked"])),yNe=C(()=>l.object({type:l.literal("claudeai-proxy"),url:l.string(),id:l.string(),displayName:l.string().optional(),iconUrl:l.string().optional(),timeout:di().optional(),alwaysLoad:l.boolean().optional(),toolPermissions:l.record(l.string(),Bk()).optional(),stateless:l.boolean().optional(),cachedInitResponse:l.record(l.string(),l.unknown()).nullish(),eligible:l.boolean().nullish(),ineligibleReason:l.string().nullish()})),Ty=C(()=>l.union([uNe(),dNe(),fNe(),mNe(),gNe(),hNe(),_Ne(),yNe()]));var Mwt=C(()=>l.object({mcpServers:l.record(l.string(),Ty())}));var bNe=new Set(["claude-community","claude-plugins-community","healthcare"]),xNe=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","anthropic-agent-skills","life-sciences","knowledge-work-plugins","claude-for-legal","claude-for-financial-services","financial-services-plugins","first-party-plugins"]),VG=new Set([...xNe,...bNe]);var vNe=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,SNe=/[^\u0020-\u007E]/;function ENe(e){if(VG.has(e.toLowerCase()))return!1;if(SNe.test(e))return!0;return vNe.test(e)}var wn=C(()=>l.string().startsWith("./")),Ss=C(()=>wn().endsWith(".json")),qG=C(()=>l.union([wn().refine((e)=>e.endsWith(".mcpb")||e.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),l.string().url().refine((e)=>e.endsWith(".mcpb")||e.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),qk=C(()=>wn().endsWith(".md")),Gk=C(()=>l.union([qk(),wn()])),KG=C(()=>l.string().min(1,"Marketplace must have a name").refine((e)=>!e.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine((e)=>!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&e!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine((e)=>!ENe(e),{message:"Marketplace name impersonates an official Anthropic/Claude marketplace"}).refine((e)=>e.toLowerCase()!=="inline",{message:'Marketplace name "inline" is reserved for --plugin-dir session plugins'}).refine((e)=>e.toLowerCase()!=="builtin",{message:'Marketplace name "builtin" is reserved for built-in plugins'}).refine((e)=>e.toLowerCase()!=="skills-dir",{message:'Marketplace name "skills-dir" is reserved for plugins auto-loaded from .claude/skills/'})),Wk=C(()=>l.object({name:l.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:l.string().optional().describe("Contact email for support or feedback"),url:l.string().optional().describe("Website, GitHub profile, or organization URL")})),wNe=C(()=>l.object({$schema:l.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:l.string().min(1,"Plugin name cannot be empty").refine((e)=>!e.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),displayName:l.string().optional().describe('Human-readable name shown in UI (e.g., "GitHub Utils"). Falls back to `name` when omitted. Unlike `name`, may contain spaces and any casing; not used for namespacing or lookup.'),version:l.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:l.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:Wk().optional().describe("Information about the plugin creator or maintainer"),homepage:l.string().url().optional().describe("Plugin homepage or documentation URL"),repository:l.string().optional().describe("Source code repository URL"),license:l.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:l.array(l.string()).optional().describe("Tags for plugin discovery and categorization"),defaultEnabled:l.boolean().optional().describe("Whether the plugin starts enabled when the user has no explicit enabled/disabled setting for it (default: true). Explicit enabledPlugins values always win, and a plugin required by an enabled dependent is enabled regardless of this value."),dependencies:l.array(oMe()).optional().describe(`Plugins that must be enabled for this plugin to function. Bare names (no "@marketplace") are resolved against the declaring plugin's own marketplace.`)})),Kwt=C(()=>l.object({description:l.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:l.lazy(()=>vs()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),TNe=C(()=>l.object({hooks:l.union([Ss().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),l.lazy(()=>vs()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),l.array(l.union([Ss().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),l.lazy(()=>vs()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),ANe=C(()=>l.object({source:Gk().optional().describe("Path to command markdown file, relative to plugin root"),content:l.string().optional().describe("Inline markdown content for the command"),description:l.string().optional().describe("Command description override"),argumentHint:l.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:l.string().optional().describe("Default model for this command"),allowedTools:l.array(l.string()).optional().describe("Tools allowed when command runs")}).refine((e)=>e.source&&!e.content||!e.source&&e.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),kNe=C(()=>l.object({commands:l.union([Gk().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded — list its files here if you want both."),l.array(Gk().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded — list its files here if you want both.")).describe("List of command file or skill directory paths. When set, the commands/ directory is not auto-loaded."),l.record(l.string(),ANe()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")')])})),ONe=C(()=>l.object({agents:l.union([qk().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded — list its files here if you want both."),l.array(qk().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded — list its files here if you want both.")).describe("List of agent file paths. When set, the agents/ directory is not auto-loaded.")])})),CNe=C(()=>l.object({skills:l.union([wn().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory (except: for a marketplace entry whose source resolves to the marketplace root, declaring a specific subdirectory replaces the skills/ scan)."),l.array(wn().describe("Path to a skill directory, relative to the plugin root.")).describe("List of skill directory paths, loaded in addition to the skills/ directory (except: for a marketplace entry whose source resolves to the marketplace root, declaring specific subdirectories replaces the skills/ scan).")])})),ZG=C(()=>l.object({outputStyles:l.union([wn().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded — list its files here if you want both."),l.array(wn().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded — list its files here if you want both.")).describe("List of output-style directory or file paths. When set, the output-styles/ directory is not auto-loaded.")])})),RNe=C(()=>l.string().max(64).regex(/^[a-z][a-z0-9_-]*$/,"must match ^[a-z][a-z0-9_-]*$")),INe=16,PNe=C(()=>l.object({id:RNe(),remote:l.string().max(256).regex(/^(npm:[@a-z0-9/._-]+(@[a-z0-9._+-]+)?|github:[\w.-]+\/[\w.-]+@[\w./-]+#.+\.js)$/,"must be npm:<pkg>[@ver] or github:<owner>/<repo>@<ref>#<path>.js").optional(),integrity:l.string().max(512).regex(/^sha(256|384|512)-[A-Za-z0-9+/=]+$/,"must be SRI form: sha256-, sha384-, or sha512-<base64>").optional()}).strict()),DNe=C(()=>l.object({syntaxHighlighting:l.object({hljsLanguages:l.array(PNe()).max(INe)}).strict()})),JG=C(()=>l.object({themes:l.union([wn().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded — list its files here if you want both."),l.array(wn().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded — list its files here if you want both.")).describe("List of theme directory or file paths. When set, the themes/ directory is not auto-loaded.")])})),LNe=C(()=>l.object({})),GG=C(()=>l.string().min(1)),NNe=C(()=>l.string().min(2).refine((e)=>e.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),MNe=C(()=>l.object({mcpServers:l.union([Ss().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),qG().describe("Path or URL to MCPB file containing MCP server configuration"),l.record(l.string(),Ty()).describe("MCP server configurations keyed by server name"),l.array(l.union([Ss().describe("Path to MCP servers configuration file"),qG().describe("Path or URL to MCPB file"),l.record(l.string(),Ty()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),YG=C(()=>l.object({type:l.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:l.string().describe("Human-readable label shown in the config dialog"),description:l.string().describe("Help text shown beneath the field in the config dialog"),required:l.boolean().optional().describe("If true, validation fails when this field is empty"),default:l.union([l.string(),l.number(),l.boolean(),l.array(l.string())]).optional().describe("Default value used when the user provides nothing"),multiple:l.boolean().optional().describe("For string type: allow an array of strings"),sensitive:l.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:l.number().optional().describe("Minimum value (number type only)"),max:l.number().optional().describe("Maximum value (number type only)")}).strict()),UNe=C(()=>l.object({userConfig:l.record(l.string().regex(/^[A-Za-z_]\w*$/,"Option keys must be valid identifiers (letters, digits, underscore; no leading digit) — they become CLAUDE_PLUGIN_OPTION_<KEY> env vars in hooks"),YG()).optional().describe("User-configurable values this plugin needs. Prompted at enable time. Non-sensitive values saved to settings.json; sensitive values to secure storage. Available as ${user_config.KEY} in MCP/LSP server config, hook commands, and (non-sensitive only) skill/agent content. Keep sensitive value counts small.")})),$Ne=C(()=>l.object({channels:l.array(l.object({server:l.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:l.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:l.record(l.string(),YG()).optional().describe("Fields to prompt the user for when enabling this plugin in assistant mode. Saved values are substituted into ${user_config.KEY} references in the mcpServers env.")}).strict()).describe("Channels this plugin provides. Each entry declares an MCP server as a message channel and optionally specifies user configuration to prompt for at enable time.")})),WG=C(()=>l.strictObject({command:l.string().min(1).refine((e)=>{if(e.includes(" ")&&!e.startsWith("/"))return!1;return!0},{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:l.array(GG()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:l.record(NNe(),GG()).refine((e)=>Object.keys(e).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:l.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:l.record(l.string(),l.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:l.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:l.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:l.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:l.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:l.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:l.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:l.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up"),diagnostics:l.boolean().optional().describe("Whether to push publishDiagnostics into the agent context after edits. Set to false to keep LSP navigation (goToDefinition, hover, etc.) but suppress automatic diagnostic injection. Defaults to true.")})),jNe=C(()=>l.strictObject({name:l.string().min(1).describe("Identifier for this monitor, unique within the plugin. Used to dedupe so re-arming (plugin reload, repeat skill invoke) does not spawn duplicates."),command:l.string().min(1).describe('Shell command to run as a persistent background monitor. Each stdout line is delivered to the model as a <task_notification> event; the process runs for the session lifetime. ${CLAUDE_PLUGIN_ROOT}, ${CLAUDE_PLUGIN_DATA}, ${CLAUDE_PROJECT_DIR}, ${user_config.*}, and ${ENV_VAR} are substituted. Runs in the session cwd — prefix with `cd "${CLAUDE_PLUGIN_ROOT}" && ` if the script needs its own directory.'),description:l.string().min(1).describe("Short human-readable description of what is being monitored (shown in task panel and notification summary)."),when:l.union([l.literal("always"),l.string().startsWith("on-skill-invoke:").refine((e)=>e.length>16,{message:"on-skill-invoke: must specify a skill name"})]).default("always").describe('Arm trigger. "always" arms at session start and on plugin reload. "on-skill-invoke:<skill>" arms the first time that skill is dispatched (via Skill tool or slash command).')})),FNe=C(()=>l.array(jNe()).refine((e)=>new Set(e.map((t)=>t.name)).size===e.length,{message:"Monitor names must be unique within a plugin"})),XG=C(()=>l.object({monitors:l.union([Ss().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),FNe()]).describe("Background watch scripts the host arms as persistent Monitor tasks (unsandboxed, same trust tier as hooks) so plugins need not instruct the model to arm them. When omitted, monitors/monitors.json at the plugin root is loaded if present.")})),zNe=C(()=>l.object({lspServers:l.union([Ss().describe("Path to .lsp.json configuration file relative to plugin root"),l.record(l.string(),WG()).describe("LSP server configurations keyed by server name"),l.array(l.union([Ss().describe("Path to LSP configuration file"),l.record(l.string(),WG()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),QG=C(()=>l.string().refine((e)=>!e.includes("..")&&!e.includes("//"),"Package name cannot contain path traversal patterns").refine((e)=>{let t=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,r=/^[a-z0-9][a-z0-9-._]*$/;return t.test(e)||r.test(e)},"Invalid npm package name format")),BNe=/^[a-z0-9](?:[a-z0-9._-]*[a-z0-9_-])?$/,HNe=/^[0-9a-f]{64}$/;var qNe=64;var GNe=C(()=>l.object({sha256:l.string().regex(HNe)}));function WNe(e){let t=l.record(l.string(),l.unknown()).safeParse(e);if(!t.success)return;let r=Object.create(null),n=0;for(let[o,i]of Object.entries(t.data)){if(n>=qNe)break;let s=GNe().safeParse(i);if(BNe.test(o)&&s.success)r[o]=s.data,n++}return n>0?r:void 0}var VNe=C(()=>l.object({binaries:l.unknown().transform(WNe).describe("sha256-pinned files to fetch into bin/ at install time, keyed by basename (target triple encoded in the name)")})),KNe=C(()=>l.object({settings:l.record(l.string(),l.unknown()).optional().describe("Settings to merge into the user settings while this plugin is enabled. Only the documented allowlisted keys are applied.")})),ZNe=C(()=>l.object({experimental:l.preprocess((e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)?e:void 0,l.object({...JG().partial().shape,...DNe().partial().shape,...XG().partial().shape,...ZG().partial().shape,evals:l.union([l.string(),l.array(l.string())]).optional().describe("Path(s) to evaluation query files for `claude plugin eval`. Defaults to `evals/`.")}).passthrough().optional().describe("Components whose manifest shape may change without a deprecation cycle. Move a key out of here once it is promoted to stable."))}));var JNe=C(()=>l.object({...wNe().shape,...TNe().partial().shape,...kNe().partial().shape,...ONe().partial().shape,...CNe().partial().shape,...ZG().partial().shape,...JG().partial().shape,...LNe().shape,...$Ne().partial().shape,...MNe().partial().shape,...zNe().partial().shape,...XG().partial().shape,...KNe().partial().shape,...UNe().partial().shape,...VNe().partial().shape,...ZNe().partial().shape})),Md=C(()=>l.discriminatedUnion("source",[l.object({source:l.literal("url"),url:l.string().url().describe("Direct URL to marketplace.json file"),headers:l.record(l.string(),l.string()).optional().describe("Custom HTTP headers (e.g., for authentication)")}),l.object({source:l.literal("github"),repo:l.string().describe("GitHub repository in owner/repo format"),ref:l.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:l.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:l.array(l.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:l.boolean().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),l.object({source:l.literal("git"),url:l.string().describe("Full git repository URL"),ref:l.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:l.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:l.array(l.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:l.boolean().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),l.object({source:l.literal("npm"),package:QG().describe("NPM package containing marketplace.json")}),l.object({source:l.literal("file"),path:l.string().describe("Local file path to marketplace.json")}),l.object({source:l.literal("directory"),path:l.string().describe("Local directory containing .claude-plugin/marketplace.json")}),l.object({source:l.literal("skills-dir")}).describe("Policy-list sentinel for the ~/.claude/skills/ auto-load (@skills-dir plugins). In strictKnownMarketplaces: opt the scan back IN (by default any allowlist blocks it). In blockedMarketplaces: turn the scan OFF without otherwise restricting marketplaces. Only meaningful in those two managed-settings lists (areLocalPluginDirsAllowedByPolicy); known_marketplaces.json / marketplace add etc. ignore it."),l.object({source:l.literal("hostPattern"),hostPattern:l.string().describe('Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against github.com. For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").')}),l.object({source:l.literal("pathPattern"),pathPattern:l.string().describe('Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.')}),l.object({source:l.literal("settings"),name:KG().refine((e)=>!VG.has(e.toLowerCase()),{message:"Reserved marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false."}).describe("Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation "+"as PluginMarketplaceSchema plus reserved-name rejection — "+"validateOfficialNameSource runs after the disk write, too late to clean up."),plugins:l.array(YNe()).describe("Plugin entries declared inline in settings.json"),owner:Wk().optional()}).describe("Inline marketplace manifest defined directly in settings.json. The reconciler writes a synthetic marketplace.json to the cache; diffMarketplaces detects edits via isEqual on the stored source (the plugins array is inside this object, so edits surface as sourceChanged).")])),Hk=C(()=>l.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),e6=C(()=>l.union([l.preprocess((e)=>e==="."?"./":e,wn()).describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),l.object({source:l.literal("npm"),package:QG().or(l.string().refine((e)=>/^(?:file|https?|git(?:\+https?|\+ssh)?|ssh|github|gitlab|bitbucket):/i.test(e)||!e.includes(".."),'Package reference cannot contain ".." path segments')).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:l.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:l.string().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),l.object({source:l.literal("url"),url:l.string().describe("Full git repository URL (https:// or git@)"),ref:l.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Hk().optional().describe("Specific commit SHA to use")}),l.object({source:l.literal("github"),repo:l.string().describe("GitHub repository in owner/repo format"),ref:l.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Hk().optional().describe("Specific commit SHA to use")}),l.object({source:l.literal("git-subdir"),url:l.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:l.string().min(1).describe('Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.'),ref:l.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Hk().optional().describe("Specific commit SHA to use")}).describe("Plugin located in a subdirectory of a larger repository (monorepo). Only the specified subdirectory is materialized; the rest of the repo is not downloaded."),l.object({source:l.literal("unsupported")}).describe("Placeholder for source types this Claude Code version does not "+"recognize. Never authored by hand — PluginMarketplaceSchema rewrites "+'unparseable sources to this so the entry remains in marketplace.plugins (detectDelistedPlugins must not see it as removed). Install attempts fail at cachePlugin with a clear "update Claude Code" message.')])),YNe=C(()=>l.object({name:l.string().min(1,"Plugin name cannot be empty").refine((e)=>!e.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Plugin name as it appears in the target repository"),source:e6().describe("Where to fetch the plugin from. Must be a remote source — relative "+"paths have no marketplace repository to resolve against."),description:l.string().optional(),version:l.string().optional(),strict:l.boolean().optional()}).refine((e)=>typeof e.source!=="string",{message:'Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url). Relative-path sources like "./foo" have no marketplace repository to resolve against.'}).refine((e)=>typeof e.source==="string"||e.source.source!=="unsupported",{message:"source.source: 'unsupported' is a parse-time placeholder and cannot be authored. Use a remote source (github, git-subdir, npm, url)."}));var XNe=C(()=>l.object({cli:l.array(l.string().max(64)).max(10).optional().describe('First command tokens (e.g. ["stripe"]) — exact match against commands run this session.'),hosts:l.array(l.string().max(128)).max(20).optional().describe('Hostnames (e.g. ["api.stripe.com"]) — exact, case-insensitive match against '+"hostnames seen in https?:// URLs in bash commands run this session. Bare hostname only: lowercase, no scheme, no port, no path."),filesRead:l.array(l.string().max(256)).max(10).optional().describe('Glob patterns (e.g. ["**/*.tf"]) — the plugin is relevant when a file Claude has read '+"this session matches any pattern. Matched against read-file paths, forward-slash normalized, case-insensitive."),manifestDeps:l.array(l.object({file:l.string().max(256),pattern:l.string().max(256)})).max(10).optional().describe("Dependency declared in a package manifest. Each {file, pattern} is a pair of RegExp sources: "+"`file` matches the manifest filename (package.json, go.mod, requirements.txt, …); "+"`pattern` matches the dependency declaration inside that file. Evaluated against files read this session."),cwd:l.array(l.string().max(256)).max(10).optional().describe('Glob patterns (e.g. ["Engine/Source/Runtime/Renderer/**"]) — the plugin is relevant when the '+`session's working directory is at or under a directory matching the pattern. Matched against the cwd both relative to the enclosing git repo root and as an absolute path, forward-slash normalized, case-insensitive. A bare directory (no glob characters) means "cwd is at or under this directory". Known at session start, so this signal can surface a suggestion before the first turn.`)})),QNe=C(()=>l.object({topic:l.string().max(64).optional().describe('What the user is working with when this plugin is relevant — fills "Working with {topic}?". '+'Often the product name (e.g. "Stripe"); use a domain (e.g. "design") when the plugin name does not read naturally as a topic. Defaults to the plugin name with each hyphen-segment capitalized.'),signals:XNe().optional().describe("Matchers that determine when the plugin is relevant.")})),eMe=C(()=>JNe().partial().extend({name:l.string().min(1,"Plugin name cannot be empty").refine((e)=>!e.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier matching the plugin name"),source:e6().describe("Where to fetch the plugin from"),category:l.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:l.array(l.string()).optional().describe("Tags for searchability and discovery"),strict:l.boolean().optional().default(!0).describe("Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest."),relevance:l.preprocess((e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)?e:void 0,QNe().optional()).describe(`Declares when this plugin is relevant to the user's work. Consumed by the spinner tip ("Working with {topic}?"), session-start auto-suggest, and marketplace browse ranking.`)})),tMe=C(()=>l.object({name:l.string().min(1).refine((e)=>!e.includes(" "))}));function rMe(e){let t=eMe();return e.flatMap((r,n)=>{let o=t.safeParse(r);if(o.success)return[o.data];let i=tMe().safeParse(r).data?.name,s=o.error.issues.map((a)=>`${a.path.join(".")}: ${a.message}`).join(", ");if(i)return ce(`Stubbing unparseable marketplace plugin entry (${i}): ${s}`,{level:"warn"}),[{name:i,source:{source:"unsupported"},strict:!0}];return ce(`Dropping unparseable marketplace plugin entry (index ${n}): ${s}`,{level:"warn"}),[]})}var Zwt=C(()=>l.object({$schema:l.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:KG(),version:l.string().optional().describe("Marketplace manifest version"),description:l.string().optional().describe("Human-readable description of this marketplace"),owner:Wk().describe("Marketplace maintainer or curator information"),plugins:l.array(l.unknown()).transform(rMe).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:l.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:l.object({pluginRoot:l.string().optional().describe("Base path for relative plugin sources"),version:l.string().optional().describe("Marketplace version"),description:l.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:l.array(l.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust."),renames:l.record(l.string(),l.string().nullable()).optional().catch(void 0).describe("Append-only map of old plugin name → current name (or null when removed). The loader follows this on plugin-not-found and migrates user settings to the new name.")})),t6=C(()=>l.string().regex(/^[A-Za-z0-9][-A-Za-z0-9._]*@[A-Za-z0-9][-A-Za-z0-9._]*$/,"Plugin ID must be in format: plugin@marketplace")),nMe=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,oMe=C(()=>l.union([l.string().regex(nMe,"Dependency must be a plugin name, optionally qualified with @marketplace").transform((e)=>e.replace(/@\^[^@]*$/,"")),l.object({name:l.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/),marketplace:l.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/).optional()}).loose().transform((e)=>e.marketplace?`${e.name}@${e.marketplace}`:e.name)])),iMe=C(()=>l.object({version:l.string().describe("Currently installed version"),installedAt:l.string().describe("ISO 8601 timestamp of installation"),lastUpdated:l.string().optional().describe("ISO 8601 timestamp of last update"),installPath:l.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:l.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)"),resolvedVersion:l.string().optional().describe("Tag-derived semver this install resolved to (when fetched via a version constraint). Used by verifyAndDemote in preference to manifest.version, since the upstream may have forgotten to bump plugin.json."),auto:l.boolean().optional().describe("True when this plugin was pulled in as a dependency rather than installed explicitly. Auto-installed plugins are eligible for removal by the orphan sweep when nothing depends on them. Absent = manual (preserves pre-flag installs).")})),Jwt=C(()=>l.object({version:l.literal(1).describe("Schema version 1"),plugins:l.record(t6(),iMe()).describe("Map of plugin IDs to their installation metadata")})),sMe=C(()=>l.enum(["managed","user","project","local"])),aMe=C(()=>l.object({scope:sMe().describe("Installation scope"),projectPath:l.string().optional().describe("Project path (required for project/local scopes)"),installPath:l.string().describe("Absolute path to the versioned plugin directory"),version:l.string().optional().describe("Currently installed version"),installedAt:l.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:l.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:l.string().optional().describe("Git commit SHA for git-based plugins"),resolvedVersion:l.string().optional().describe("Tag-derived semver this install resolved to"),auto:l.boolean().optional().describe("True when pulled in as a dependency. Eligible for orphan sweep.")})),Ywt=C(()=>l.object({version:l.literal(2).describe("Schema version 2"),plugins:l.record(t6(),l.array(aMe())).describe("Map of plugin IDs to arrays of installation entries")})),cMe=C(()=>l.object({source:Md().describe("Where to fetch the marketplace from"),installLocation:l.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:l.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:l.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),Xwt=C(()=>l.record(l.string(),cMe()));var lMe=["autoMode","deepLink","voice","briefView","screenReader"],Vk={},Ay={autoMode:{buildGate:()=>!1,shape:()=>Vk,permissionsShape:()=>Vk,permissionModes:()=>[]},deepLink:{buildGate:()=>!0,shape:()=>({disableDeepLinkRegistration:l.enum(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")})},voice:{buildGate:()=>!0,shape:()=>({voiceEnabled:l.boolean().optional().describe("Enable voice mode (hold-to-talk dictation)")})},briefView:{buildGate:()=>!0,shape:()=>({defaultView:l.enum(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")})},screenReader:{buildGate:()=>!1,shape:()=>Vk}};function Kk(){return lMe.filter((e)=>Ay[e].buildGate())}function r6(e){let t={};for(let r of e)t={...t,...Ay[r].shape()};return t}function n6(e){let t={};for(let r of e)t={...t,...Ay[r].permissionsShape?.()};return t}function o6(e){let t=[];for(let r of e)t.push(...Ay[r].permissionModes?.()??[]);return t}function Zk(e){let t=e.split("__"),[r,n,...o]=t;if(r!=="mcp"||!n)return null;let i=o.length>0?o.join("__"):void 0;return{serverName:n,toolName:i}}var i6={Task:"Agent",KillShell:"TaskStop",KillBash:"TaskStop",AgentOutputTool:"TaskOutput",BashOutputTool:"TaskOutput",AgentOutput:"TaskOutput",BashOutput:"TaskOutput",ListPeers:"ListAgents",Brief:"SendUserMessage",ListMcpResources:"ListMcpResourcesTool",ReadMcpResource:"ReadMcpResourceTool",ReadMcpResourceDir:"ReadMcpResourceDirTool"};function Hc(e){return Object.hasOwn(i6,e)?i6[e]:e}var s6="workspace",lTt=`mcp__${s6}__bash`,uTt=`mcp__${s6}__web_fetch`;function Jk(e){return e.includes("*")}function uMe(e){return e.replaceAll("\\","\\\\").replaceAll("(","\\(").replaceAll(")","\\)")}function pMe(e){return e.replaceAll("\\(","(").replaceAll("\\)",")").replaceAll("\\\\","\\")}function a6(e){let t=dMe(e,"(");if(t===-1)return{toolName:Hc(e)};let r=fMe(e,")");if(r===-1||r<=t)return{toolName:Hc(e)};if(r!==e.length-1)return{toolName:Hc(e)};let n=e.substring(0,t),o=e.substring(t+1,r);if(!n)return{toolName:Hc(e)};if(o===""||o==="*")return{toolName:Hc(n)};let i=pMe(o);return{toolName:Hc(n),ruleContent:i}}function Yk(e){if(!e.ruleContent)return e.toolName;let t=uMe(e.ruleContent);return`${e.toolName}(${t})`}function dMe(e,t){for(let r=0;r<e.length;r++)if(e[r]===t){let n=0,o=r-1;while(o>=0&&e[o]==="\\")n++,o--;if(n%2===0)return r}return-1}function fMe(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]===t){let n=0,o=r-1;while(o>=0&&e[o]==="\\")n++,o--;if(n%2===0)return r}return-1}var ky={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit","Cd"],bashPrefixTools:["Bash"],customValidation:{WebSearch:(e)=>{if(e.includes("*")||e.includes("?"))return{valid:!1,error:"WebSearch does not support wildcards",suggestion:"Use exact search terms without * or ?",examples:["WebSearch(claude ai)","WebSearch(typescript tutorial)"]};return{valid:!0}},WebFetch:(e)=>{if(e.includes("://")||e.startsWith("http"))return{valid:!1,error:"WebFetch permissions use domain format, not URLs",suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:github.com)"]};if(!e.startsWith("domain:"))return{valid:!1,error:'WebFetch permissions must use "domain:" prefix',suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:*.google.com)"]};return{valid:!0}}}};function c6(e){return ky.filePatternTools.includes(e)}function l6(e){return ky.bashPrefixTools.includes(e)}function u6(e){return Object.hasOwn(ky.customValidation,e)?ky.customValidation[e]:void 0}function d6(e,t){let r=0,n=t-1;while(n>=0&&e[n]==="\\")r++,n--;return r%2!==0}function Xk(e,t){let r=0;for(let n=0;n<e.length;n++)if(e[n]===t&&!d6(e,n))r++;return r}function mMe(e){for(let t=0;t<e.length-1;t++)if(e[t]==="("&&e[t+1]===")"){if(!d6(e,t))return!0}return!1}function p6(e){if(!Jk(e))return null;let t=Zk(e);if(t&&!Jk(t.serverName))return null;return{valid:!1,error:`Wildcard tool name "${e}" is not supported in allow rules`,suggestion:"An allow pattern must name the scope it widens — globs are permitted only in the tool position after a literal mcp__<server>__ prefix. Deny and ask rules accept wildcards anywhere",examples:["mcp__puppeteer__*","mcp__github__get_*"]}}function Qk(e,t){if(!e||e.trim()==="")return{valid:!1,error:"Permission rule cannot be empty"};let r=Xk(e,"("),n=Xk(e,")");if(r!==n)return{valid:!1,error:"Mismatched parentheses",suggestion:"Ensure all opening parentheses have matching closing parentheses"};if(mMe(e)){let a=e.substring(0,e.indexOf("("));if(!a)return{valid:!1,error:"Empty parentheses with no tool name",suggestion:"Specify a tool name before the parentheses"};return{valid:!1,error:"Empty parentheses",suggestion:`Either specify a pattern or use just "${a}" without parentheses`,examples:[`${a}`,`${a}(some-pattern)`]}}let o=a6(e),i=Zk(o.toolName);if(i){if(o.ruleContent!==void 0||Xk(e,"(")>0)return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:`Use "${o.toolName}" without parentheses, or use "mcp__${i.serverName}__*" for all tools`,examples:[`mcp__${i.serverName}`,`mcp__${i.serverName}__*`,i.toolName&&i.toolName!=="*"?`mcp__${i.serverName}__${i.toolName}`:void 0].filter(Boolean)};if(t==="allow"){let a=p6(o.toolName);if(a)return a}return{valid:!0}}if(!o.toolName||o.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(t==="allow"){let a=p6(o.toolName);if(a)return a}if(!o.toolName.includes("_")&&o.toolName[0]!==o.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${qy(String(o.toolName))}"`};let s=u6(o.toolName);if(s&&o.ruleContent!==void 0){let a=s(o.ruleContent);if(!a.valid)return a}if(l6(o.toolName)&&o.ruleContent!==void 0){let a=o.ruleContent;if(a.includes(":*")&&!a.endsWith(":*"))return{valid:!1,error:"The :* pattern must be at the end",suggestion:"Move :* to the end for prefix matching, or use * for wildcard matching",examples:["Bash(npm run:*) - prefix matching (legacy)","Bash(npm run *) - wildcard matching"]};if(a===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm *)","Bash(git *)"]}}if(c6(o.toolName)&&o.ruleContent!==void 0){if(o.ruleContent.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${o.toolName}(*.ts) - matches .ts files`,`${o.toolName}(src/**) - matches all files in src`,`${o.toolName}(**/*.test.ts) - matches test files`]}}if(o.ruleContent!==void 0){let a=o.toolName==="Write"||o.toolName==="NotebookEdit"||o.toolName==="MultiEdit"?"Edit":o.toolName==="Glob"?"Read":void 0;if(a!==void 0&&!o.ruleContent.includes(":*"))return{valid:!0,warning:`${Yk(o)} is not matched by file permission checks — only ${a}(path) rules are. Use ${Yk({toolName:a,ruleContent:o.ruleContent})} instead (${a} rules cover all file-${a==="Edit"?"editing":"reading"} tools).`}}return{valid:!0}}var eO=C(()=>m6()),f6=C(()=>m6("allow"));function m6(e){return l.string().superRefine((t,r)=>{let n=Qk(t,e);if(!n.valid){let o=n.error;if(n.suggestion)o+=`. ${n.suggestion}`;if(n.examples&&n.examples.length>0)o+=`. Examples: ${n.examples.join(", ")}`;r.addIssue({code:l.ZodIssueCode.custom,message:o,params:{received:t}})}})}var gMe=C(()=>l.record(l.string(),l.coerce.string()));function b6(e){return l.object({allow:l.array(f6()).optional().describe("List of permission rules for allowed operations"),deny:l.array(eO()).optional().describe("List of permission rules for denied operations"),ask:l.array(eO()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:l.preprocess(Ld,l.enum([...Dd,...o6(e)])).optional().describe("Default permission mode when Claude Code needs access ('manual' is accepted as an alias for 'default')"),disableBypassPermissionsMode:l.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),...n6(e),additionalDirectories:l.array(l.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}var PTt=C(()=>b6(Kk())),hMe=C(()=>l.object({source:Md().describe("Where to fetch the marketplace from"),installLocation:l.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:l.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),Oy=C(()=>l.object({serverName:l.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that users are allowed to configure"),serverCommand:l.array(l.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for allowed stdio servers"),serverUrl:l.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine((e)=>jS([e.serverName!==void 0,e.serverCommand!==void 0,e.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),Cy=C(()=>l.object({serverName:l.string().min(1,"Server name must be non-empty").refine((e)=>e.trim().length>0,{message:"Server name must not be whitespace-only"}).refine((e)=>e===e.trim(),{message:"Server name has leading or trailing whitespace and will never match (names are compared verbatim)"}).optional().describe("Name of the MCP server that is explicitly blocked"),serverCommand:l.array(l.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for blocked stdio servers"),serverUrl:l.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine((e)=>jS([e.serverName!==void 0,e.serverCommand!==void 0,e.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),_Me=C(()=>l.object({path:l.string().describe("Absolute path to the helper executable"),timeoutMs:l.number().int().min(1000).optional(),refreshIntervalMs:l.union([l.literal(0),l.number().int().min(60000)]).optional()})),g6=["skills","agents","hooks","mcp"],h6=Object.freeze({type:"invalid-entry-stripped"}),yMe=C(()=>l.union([l.object({type:l.literal("regex").describe('Config variant. This client understands "regex": matches turn output and builds a URL from named capture groups. Entries with other variants are preserved but skipped at runtime.'),pattern:l.string().describe("Regex matched against turn output (tool results and assistant text)"),url:l.string().describe("Link target. {name} placeholders are filled from named regex capture groups, e.g. (?<id>...) -> {id}. Values are URL-encoded; the origin must be literal in the template. The scheme must be https, http, or a recognized editor or workspace deep-link scheme: vscode, vscode-insiders, cursor, windsurf, zed, jetbrains, idea, slack, linear, notion, figma."),label:l.string().optional().describe("Badge text. {name} placeholders filled from named capture groups; defaults to the full match.")}).passthrough(),l.object({type:l.string().describe("Config variant discriminator for entries this client does not understand; the entry is preserved as-is and skipped at runtime.")}).passthrough()]));function x6(e){return l.object({$schema:l.string().optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:l.string().optional().describe("Path to a script that outputs authentication values"),proxyAuthHelper:l.string().optional().describe("Shell command that outputs a Proxy-Authorization header value (EAP)"),awsCredentialExport:l.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:l.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:l.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),processWrapper:l.string().optional().describe("Corporate launcher argv prefix for the background-agent supervisor, the sessions and workers it hosts, and the other covered background processes listed in the Claude Code corporate-launcher documentation. Equivalent to the CLAUDE_CODE_PROCESS_WRAPPER environment variable, which takes precedence when set. Honored from managed settings, a --settings/SDK-supplied settings file, and user settings, in that precedence order; project and local settings are ignored."),policyHelper:_Me().optional().describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),...Hr.CLAUDE_CODE_ENABLE_XAA&&{xaaIdp:l.object({issuer:l.string().url().describe("IdP issuer URL for OIDC discovery"),clientId:l.string().describe("Claude Code's client_id registered at the IdP"),callbackPort:l.number().int().positive().optional().describe("Fixed loopback callback port for the IdP OIDC login. Only needed if the IdP does not honor RFC 8252 port-any matching.")}).optional().describe("XAA (SEP-990) IdP connection. Configure once; all XAA-enabled MCP servers reuse this.")},fileSuggestion:l.object({type:l.literal("command"),command:l.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:l.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),breakReminder:l.object({enabled:l.boolean().optional().describe("Show a friendly nudge after sustained continuous use (default false). Must be true for the reminder to fire."),intervalMinutes:l.number().int().positive().optional().describe("Minutes of continuous use before the reminder fires (default 30). Re-fires every interval until you take a break."),breakThresholdMinutes:l.number().int().positive().optional().describe("Minutes of inactivity that count as a break and reset the timer (default 10)"),message:l.string().optional().describe("Custom reminder text. Leave unset for a rotating set of friendly nudges.")}).optional().describe("@internal Opt-in break reminder. When enabled, shows a dismissible nudge after sustained continuous use. Never blocks — just a friendly heads-up."),quietHours:l.object({enabled:l.boolean().optional().describe("Show a one-time nudge when you start or keep using the CLI inside your quiet-hours window (default false)."),start:l.string().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "22:00")').optional().describe('Start of the quiet-hours window, 24-hour local time "HH:MM".'),end:l.string().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "07:00")').optional().describe('End of the quiet-hours window, 24-hour local time "HH:MM". May be earlier than start for an overnight range.')}).optional().describe("@internal Opt-in quiet hours. When enabled, shows a single soft nudge per session while inside the configured local-time window. Never blocks."),cleanupPeriodDays:l.number().int().positive().optional().describe("Number of days to retain chat transcripts before automatic cleanup (default: 30). Minimum 1. Use a large value for long retention; use --no-session-persistence to disable transcript writes entirely."),skillListingMaxDescChars:l.number().int().positive().optional().describe("Per-skill description character cap in the skill listing sent to Claude (default: 1536). Descriptions longer than this are truncated. Raise to opt in to higher per-turn context cost."),skillListingBudgetFraction:l.number().gt(0).lte(1).optional().describe("Fraction of the context window (in characters) reserved for the skill listing sent to Claude (default: 0.01 = 1%). When the listing exceeds this, descriptions are shortened to fit. Raise to opt in to higher per-turn context cost."),wslInheritsWindowsSettings:l.boolean().optional().describe("When set to true in either admin-only Windows source — the HKLM SOFTWARE/Policies/ClaudeCode registry key or C:/Program Files/ClaudeCode/managed-settings.json — WSL reads managed settings from the full Windows policy chain (HKLM, C:/Program Files/ClaudeCode via DrvFs, HKCU) in addition to /etc/claude-code. Windows sources take priority. The flag is also required in HKCU itself for HKCU policy to apply on WSL (double opt-in: admin enables the chain, user confirms HKCU). On native Windows the flag has no effect."),env:gMe().optional().describe("Environment variables to set for Claude Code sessions"),attribution:l.object({commit:l.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:l.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution."),sessionUrl:l.boolean().optional().describe("Whether to append the claude.ai session link to commits and PRs created from web or Remote Control sessions (default: true). Set to false to omit the Claude-Session trailer and PR-body link.")}).optional().describe("Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set."),includeCoAuthoredBy:l.boolean().optional().describe("Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)"),...!1,includeGitInstructions:l.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:b6(e).optional().describe("Tool usage permissions configuration"),model:l.string().optional().describe("Override the default model used by Claude Code"),fallbackModel:l.array(l.string()).optional().describe('Fallback model(s) tried in order when the primary model is overloaded or unavailable. Each element accepts a model name or alias; "default" expands to the default model. CLI --fallback-model takes precedence.'),availableModels:l.array(l.string()).optional().describe('Allowlist of models that users can select. Accepts family aliases ("opus" allows any opus version), version prefixes ("opus-4-5" allows only that version), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.'),enforceAvailableModels:l.boolean().optional().describe("When true and availableModels is a non-empty array, the Default model selection is also constrained: if the default model for the user tier is not in availableModels, Default resolves to the first allowed availableModels entry instead. Has no effect when availableModels is unset or an empty array. Typically set in managed settings by enterprise administrators."),modelOverrides:l.record(l.string(),l.string()).optional().describe('Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.'),enableAllProjectMcpServers:l.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:l.array(l.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:l.array(l.string()).optional().describe("List of rejected MCP servers from .mcp.json"),disableClaudeAiConnectors:l.boolean().optional().describe("When true in any settings source, claude.ai MCP cloud connectors are not auto-fetched or connected. "+"Only gates auto-fetched connectors — a claudeai-proxy server passed explicitly "+"(e.g. via --mcp-config or the SDK mcpServers option) still follows the normal MCP config trust flow. Any-source-true wins: a project can opt out, but a project-level false cannot override a user-level true."),skillOverrides:l.record(l.string(),l.enum(["on","name-only","user-invocable-only","off"])).optional().describe('Per-skill listing overrides keyed by skill name. "name-only" lists the skill without its description; "user-invocable-only" hides it from the model but keeps /name; "off" hides it from both. Absent = on.'),disableBundledSkills:l.boolean().optional().describe("Disable the skills and workflows that ship with Claude Code: bundled skills and workflows are removed entirely; built-in slash commands stay typable but are hidden from the model. Plugins, .claude/skills/, and .claude/commands/ are unaffected. Equivalent to CLAUDE_CODE_DISABLE_BUNDLED_SKILLS=1."),allowedMcpServers:l.array(Oy()).optional().describe("Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied."),deniedMcpServers:l.array(Cy()).optional().describe("Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),hooks:vs().optional().describe("Custom commands to run before/after tool executions"),worktree:l.object({symlinkDirectories:l.array(l.string()).optional().describe('Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: "node_modules", ".cache", ".bin"'),sparsePaths:l.array(l.string()).optional().describe("Directories to include when creating worktrees, via git sparse-checkout (cone mode). "+"Dramatically faster in large monorepos — only the listed paths are written to disk."),baseRef:l.enum(["fresh","head"]).optional().describe("Which ref new worktrees branch from. 'fresh' (default) branches from origin/<default-branch> for a clean tree. 'head' branches from your current local HEAD so unpushed commits and feature-branch state are present. Applies to --worktree, EnterWorktree, and agent isolation."),bgIsolation:l.enum(["worktree","none"]).optional().catch(void 0).describe("Isolation mode for background sessions in this repo. 'worktree' (default) blocks Edit/Write in the main checkout until EnterWorktree is called. 'none' lets background jobs edit the working copy directly.")}).optional().describe("Git worktree configuration for --worktree flag."),disableAllHooks:l.boolean().optional().describe("Disable all hooks and statusLine execution"),disableAgentView:l.boolean().optional().describe("Disable agent view (`claude agents`, `--bg`, /background, the on-demand daemon). Typically set in managed settings. Equivalent to CLAUDE_CODE_DISABLE_AGENT_VIEW=1."),disableRemoteControl:l.boolean().optional().describe("Disable Remote Control (claude.ai/code, `claude remote-control`, `--remote-control`/`--rc`, auto-start, and the in-session toggle). Typically set in managed settings."),disableWorkflows:l.boolean().optional().describe("Disable the Workflows feature (also via CLAUDE_CODE_DISABLE_WORKFLOWS)."),disableArtifact:l.boolean().optional().describe("Disable the Artifact tool (also via CLAUDE_CODE_DISABLE_ARTIFACT)."),enableArtifact:l.boolean().optional().describe("Enable or disable the Artifact tool for this user. Unset defaults to enabled once the feature is available."),enableWorkflows:l.boolean().optional().describe("Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available."),workflowKeywordTriggerEnabled:l.boolean().optional().describe('Enable the "ultracode" keyword trigger: including the keyword in a prompt opts that turn into the Workflow tool. Set to false to disable the trigger. Default: true.'),disableSkillShellExecution:l.boolean().optional().describe("Disable inline shell execution in skills and custom slash commands from user, project, or plugin sources. Commands are replaced with a placeholder instead of being run."),defaultShell:l.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),respondToBashCommands:l.boolean().optional().describe("Whether Claude responds after an input-box ! bash command runs. Set to false to add the command output to context without a response. Default: true."),allowManagedHooksOnly:l.boolean().optional().describe("When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored."),allowedHttpHookUrls:l.array(l.string()).optional().describe('Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).'),httpHookAllowedEnvVars:l.array(l.string()).optional().describe("Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers)."),allowManagedPermissionRulesOnly:l.boolean().optional().describe("When true (and set in managed settings), only permission rules (allow/deny/ask) from managed settings are respected. User, project, local, and CLI argument permission rules are ignored."),allowManagedMcpServersOnly:l.boolean().optional().describe("When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies."),allowAllClaudeAiMcps:l.boolean().optional().describe("When true (and set in managed settings), claude.ai cloud MCP connectors load alongside managed-mcp.json instead of being suppressed by its exclusive-control lockdown. Default off preserves the lockdown. Read from managed settings only."),strictPluginOnlyCustomization:l.preprocess((t)=>Array.isArray(t)?t.filter((r)=>g6.includes(r)):t,l.union([l.boolean(),l.array(l.enum(g6))])).optional().catch(void 0).describe('When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.claude/{surface}/, .claude/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. '+"Composes with strictKnownMarketplaces for end-to-end admin control — plugins gated by "+"marketplace allowlist, everything else blocked here."),statusLine:l.object({type:l.literal("command"),command:l.string(),padding:l.number().optional(),refreshInterval:l.number().min(1).optional().catch(void 0).describe("Re-run the status line command every N seconds in addition to event-driven updates"),hideVimModeIndicator:l.boolean().optional().describe("Hide the built-in `-- INSERT --` / `-- VISUAL --` indicator below the prompt. Use this when your status line script renders `vim.mode` itself.")}).optional().describe("Custom status line display configuration"),prUrlTemplate:l.string().optional().describe('URL template for PR links in the footer link badges and inline messages. The detected git PR is rendered as the first footer-link badge. Placeholders: {host} {owner} {repo} {number} {url}. Example: "https://reviews.example.com/{owner}/{repo}/pull/{number}"'),footerLinksRegexes:l.array(yMe().catch(h6)).transform((t)=>t.filter((r)=>r!==h6)).optional().catch(void 0).describe("Extra clickable footer badges that appear when a regex matches turn output (tool results and assistant responses). Read from user, flag, and managed settings only; ignored in project .claude/settings.json and local .claude/settings.local.json. At most 5 badges render; the oldest is displaced by newer matches and /clear removes them. Use to surface IDs printed by project CLIs as session links."),subagentStatusLine:l.object({type:l.literal("command"),command:l.string()}).optional().describe("Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin"),enabledPlugins:l.record(l.string(),l.union([l.array(l.string()),l.boolean(),l.undefined()])).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints. Settings precedence is user < project < local < flag < policy, so to disable a plugin that project settings enable, set it to false in .claude/settings.local.json — setting false in ~/.claude/settings.json is overridden by the project.'),extraKnownMarketplaces:l.record(l.string(),hMe()).check((t)=>{for(let[r,n]of Object.entries(t.value))if(n.source.source==="settings"&&n.source.name!==r)t.issues.push({code:"custom",input:n.source.name,path:[r,"source","name"],message:`Settings-sourced marketplace name must match its extraKnownMarketplaces key (got key "${r}" but source.name "${n.source.name}")`})}).optional().describe("Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources."),strictKnownMarketplaces:l.array(Md()).optional().describe("Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these exact sources can be added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem. "+"Note: this is a policy gate only — it does NOT register marketplaces. "+"To pre-register allowed marketplaces for users, also set extraKnownMarketplaces."),blockedMarketplaces:l.array(Md()).optional().describe("Enterprise blocklist of marketplace sources. When set in managed settings, these exact sources are blocked from being added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem."),disableSideloadFlags:l.boolean().optional().describe("When true (and set in managed settings), rejects the --plugin-dir, --plugin-url, --agents, and non-sdk --mcp-config CLI flags at startup. Closes the CLI-flag bypass of strictKnownMarketplaces. Pair with allowedMcpServers for per-server MCP control; this setting does not gate other MCP entry points (SDK setMcpServers, claude mcp add, .mcp.json). Also blocks surfaces that spawn the CLI with these flags internally (see settings documentation). Only honored from managed settings; ignored in user/project/local settings."),pluginSuggestionMarketplaces:l.array(l.string()).optional().describe("Marketplace names whose plugins may surface as contextual install suggestions (relevance-based tips). No marketplace-declared suggestions surface without this allowlist; the built-in first-party frontend-design tip is unaffected. Only honored when set in managed settings (policy scope); the key is ignored in user, project, and local settings. A name only takes effect when the marketplace is registered on the machine AND its registered source is also declared in managed settings, either as the extraKnownMarketplaces entry for that name or as an entry of strictKnownMarketplaces. A marketplace registered from a different source under an allowlisted name is ignored. The official marketplace is exempt from the source requirement: allowlisting its name alone suffices, since that name can only register from the official Anthropic source."),forceLoginMethod:l.enum(["claudeai","console","gateway"]).optional().catch(void 0).describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing, "gateway" for the Cloud gateway OIDC device flow'),forceLoginGatewayUrl:l.string().url().optional().catch(void 0).describe('@internal Cloud gateway URL to pre-fill and auto-connect to during login. Typically set in local managed settings alongside forceLoginMethod: "gateway" so users never type the URL. Hidden from public SDK types until Cloud gateway is documented.'),parentSettingsBehavior:l.enum(["first-wins","merge"]).optional().describe('Controls whether the SDK parent tier (Options.managedSettings / --managed-settings) layers under this admin tier. "first-wins" '+"(default): parent is dropped — admin tiers are the only policy "+`source. "merge": parent's restrictive-only-filtered settings union under the admin winner. Has no effect when no admin tier exists (parent applies as the sole policy tier, still filtered restrictive-only).`),forceLoginOrgUUID:l.union([l.string(),l.array(l.string())]).optional().describe("Organization UUID to require for OAuth login. Accepts a single UUID string or an array of UUIDs (any one is permitted). When set in managed settings, login fails if the authenticated account does not belong to a listed organization."),forceRemoteSettingsRefresh:l.boolean().optional().describe("When set in managed settings, the CLI blocks startup until remote managed settings are freshly fetched, and exits if the fetch fails"),otelHeadersHelper:l.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:l.string().optional().describe("Controls the output style for assistant responses"),viewMode:l.enum(["default","verbose","focus"]).optional().catch(void 0).describe("Default transcript view mode on startup"),language:l.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:l.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:zk().optional(),feedbackSurveyRate:l.number().min(0).max(1).optional().describe("Probability (0–1) that the session quality survey appears when eligible. 0.05 is a reasonable starting point."),feedbackDrafts:l.enum(["notify","quiet","off"]).optional().describe('Model-drafted feedback (the SendFeedback tool). "notify" (default) shows a one-line notice when a draft is queued; "quiet" shows only the footer counter; "off" disables the tool entirely so drafts are never queued.'),spinnerTipsEnabled:l.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:l.object({mode:l.enum(["append","replace"]),verbs:l.array(l.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:l.object({excludeDefault:l.boolean().optional(),tips:l.array(l.string())}).optional().describe("Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false)."),syntaxHighlightingDisabled:l.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),terminalTitleFromRename:l.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),alwaysThinkingEnabled:l.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:l.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for supported models."),ultracode:l.boolean().optional().catch(void 0).describe("Enable ultracode for the session: xhigh effort plus standing dynamic-workflow orchestration. "+"Session-scoped — typically provided via --settings or the apply_flag_settings control request; "+"interactive toggles never persist it. Requires workflows to be enabled and an xhigh-capable model."),autoCompactWindow:l.number().int().min(1e5).max(1e6).optional().catch(void 0).describe("Auto-compact window size"),advisorModel:l.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:l.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:l.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:l.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),emojiCompletionEnabled:l.boolean().optional().describe("When false, the :emoji: shortcode typeahead (the suggestion popup and the :name: inline replacement) is disabled. When absent or true, it is enabled."),awaySummaryEnabled:l.boolean().optional().describe("@internal When false, the session recap (shown when you return after being away for 5+ minutes) is disabled. When absent or true, recap is enabled. Hidden from public SDK types until external launch."),showClearContextOnPlanAccept:l.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),askUserQuestionTimeout:l.enum(["60s","5m","10m","never"]).optional().catch(void 0).describe("Idle time before Claude's questions auto-continue with any answers "+"selected so far. Defaults to never — auto-continue only runs "+"when explicitly set to 60s/5m/10m."),agent:l.string().optional().describe("Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model."),companyAnnouncements:l.array(l.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:l.record(l.string(),l.object({mcpServers:l.record(l.string(),l.record(l.string(),l.union([l.string(),l.number(),l.boolean(),l.array(l.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:l.record(l.string(),l.union([l.string(),l.number(),l.boolean(),l.array(l.string())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")}).or(l.undefined())).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:l.object({defaultEnvironmentId:l.string().optional().describe("Default environment ID to use for cloud sessions")}).optional().describe("Cloud session configuration"),autoUpdatesChannel:l.enum(["latest","stable","rc"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:l.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),requiredMinimumVersion:l.string().optional().describe("Minimum Claude Code version required to start. If the running version is older, Claude Code exits at startup with instructions to update. Only enforced from managed (policy) settings."),requiredMaximumVersion:l.string().optional().describe("Maximum Claude Code version allowed to start. If the running version is newer, Claude Code exits at startup with instructions to install an approved version. Only enforced from managed (policy) settings."),plansDirectory:l.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),tui:l.enum(["default","fullscreen"]).optional().describe('Terminal UI renderer. "fullscreen" uses the flicker-free alt-screen renderer with virtualized scrollback (equivalent to CLAUDE_CODE_NO_FLICKER=1). "default" uses the classic main-screen renderer.'),...!1,voice:l.object({enabled:l.boolean().optional(),mode:l.enum(["hold","tap"]).optional().describe("'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit."),autoSubmit:l.boolean().optional().describe("Submit the prompt when hold-to-talk is released (hold mode only)")}).optional().describe("Voice mode settings (hold-to-talk / tap-to-toggle dictation)"),channelsEnabled:l.boolean().optional().describe("Managed-org opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). claude.ai Teams/Enterprise: default off. Console: default on unless managed settings exist. Set true to allow; users then select servers via --channels."),allowedChannelPlugins:l.array(l.object({marketplace:l.string(),plugin:l.string()})).optional().describe("Managed-org allowlist of channel plugins. When set, "+"replaces the default Anthropic allowlist — admins decide which "+"plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true."),prefersReducedMotion:l.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),doneMeansMerged:l.boolean().optional().describe("@internal When true, Claude keeps working until the PR is ready for you to merge, a cron/Monitor is armed to resume later, or it hands you a self-contained next step."),totalTokensReminder:l.enum(["off","infinite","fixed","countdown","padded-countdown"]).optional().describe("@internal Emit a <total_tokens>N tokens left</total_tokens> block in the system prompt, after each tool result, and (when totalTokensReminderAfterUserTurn is on) after each regular user prompt. 'infinite' uses the literal value Infinite, 'fixed' uses 5000000, 'countdown' uses the live remaining context-window tokens, 'padded-countdown' counts down from totalTokensReminderBudget (re-anchoring to the full budget on each regular user prompt when totalTokensReminderAfterUserTurn "+"is on — task-budget semantics). Defaults to off. Env var "+"CLAUDE_CODE_TOTAL_TOKENS_REMINDER overrides."),totalTokensReminderBudget:l.number().int().positive().optional().describe("@internal Starting budget (tokens) for totalTokensReminder 'padded-countdown' mode. Defaults to 15000000. Server-controlled via GrowthBook; env var CLAUDE_CODE_TOTAL_TOKENS_REMINDER_BUDGET overrides."),totalTokensReminderAfterUserTurn:l.boolean().optional().describe("@internal When true, emit the totalTokensReminder block after each regular user prompt and (for 'padded-countdown') re-anchor the task budget to the full configured value at the start of each user turn. When false, the reminder appears only in the system prompt and after each tool-result batch, and 'padded-countdown' counts down over the whole session. Defaults to off. Env var CLAUDE_CODE_TOTAL_TOKENS_REMINDER_AFTER_USER_TURN overrides; server-controlled via GrowthBook tengu_lapis_anchor_user_turn."),autoMemoryEnabled:l.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:l.string().optional().describe("Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .claude/settings.json) for security. When unset, defaults to ~/.claude/projects/<sanitized-cwd>/memory/."),autoDreamEnabled:l.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:l.boolean().optional().describe("Request API-side thinking summaries and show them in the conversation and in the transcript view (ctrl+o). Set explicitly to override the default for your install."),skipDangerousModePermissionPrompt:l.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),skipWorkflowUsageWarning:l.boolean().optional().describe("@internal Whether the user has accepted the multi-agent workflow usage warning. Until set, auto permission mode prompts before running a workflow."),disableAutoMode:l.enum(["disable"]).optional().describe("Disable auto mode"),sshConfigs:l.array(l.object({id:l.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:l.string().describe("Display name for the SSH connection"),sshHost:l.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:l.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:l.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:l.string().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh <config> [dir]`.")})).optional().describe("SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members."),claudeMd:l.string().optional().describe("CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings."),claudeMdExcludes:l.array(l.string()).optional().describe('Glob patterns or absolute paths of CLAUDE.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: "/home/user/monorepo/CLAUDE.md", "**/code/CLAUDE.md", "**/some-dir/.claude/rules/**"'),pluginTrustMessage:l.string().optional().describe('Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").'),theme:l.union([l.enum(MG),l.string().startsWith("custom:").transform((t)=>t)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:l.enum(LG).optional().catch(void 0).describe("Key binding mode for the prompt input"),vimInsertModeRemaps:l.record(l.string(),l.unknown()).optional().catch(void 0).describe('Vim INSERT-mode key-sequence remaps, e.g. {"jj": "<Esc>"}. Each key is exactly two printable characters typed in sequence; "<Esc>" (return to NORMAL mode) is the only supported target. Applies when editorMode is "vim".'),verbose:l.boolean().optional().describe("Show full tool output instead of truncated summaries"),preferredNotifChannel:l.enum(DG).optional().catch(void 0).describe("Preferred OS notification channel"),autoCompactEnabled:l.boolean().optional().describe("Automatically compact conversation when context fills"),precomputeCompactionEnabled:l.boolean().optional().describe("@internal Precompute the compaction summary in the background before it is needed. Only applies when auto-compact is on."),switchModelsOnFlag:l.boolean().optional().describe("When safety measures flag a message, automatically switch to a different model to keep chatting. When off, your session will pause instead."),autoScrollEnabled:l.boolean().optional().describe("Auto-scroll the conversation view to bottom (fullscreen mode only)"),wheelScrollAccelerationEnabled:l.boolean().optional().describe("Ramp mouse-wheel scroll speed during fast scrolls (fullscreen mode only)"),fileCheckpointingEnabled:l.boolean().optional().describe("Snapshot files before edits so /rewind can restore them"),showTurnDuration:l.boolean().optional().describe('Show "Cooked for Nm Ns" after each assistant turn'),showMessageTimestamps:l.boolean().optional().describe("Stamp each message with its arrival time"),terminalProgressBarEnabled:l.boolean().optional().describe("Emit OSC 9;4 progress sequences during long operations"),todoFeatureEnabled:l.boolean().optional().describe("Enable the todo / task tracking panel"),teammateMode:l.enum(NG).optional().catch(void 0).describe("How spawned teammates execute (tmux, iterm2, in-process, auto)"),remoteControlAtStartup:l.boolean().optional().describe("Start Remote Control bridge automatically each session"),isolatePeerMachines:l.boolean().optional().describe("Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control"),daemonColdStart:l.enum(["transient","ask"]).optional().describe("When no background service is running: 'transient' spawns one for this login session; 'ask' offers to install it persistently"),autoUploadSessions:l.boolean().optional().describe("Mirror local sessions to claude.ai as view-only (no remote control)"),inputNeededNotifEnabled:l.boolean().optional().describe("Push to mobile when a permission prompt or question is waiting"),agentPushNotifEnabled:l.boolean().optional().describe("Allow Claude to push proactive mobile notifications"),...r6(e)}).passthrough()}var Es=C(()=>x6(Kk())),_6=Object.freeze({serverName:"invalid-entry-stripped"});function y6(e,t,r){return l.array(t.catch((n)=>(r({path:`${e}[]`,message:`Invalid entry was ignored: ${n.issues[0]?.message??"failed validation"}`}),_6))).transform((n)=>n.filter((o)=>o!==_6)).optional()}function tO(e){let t=Es(),r={};for(let[s,a]of Object.entries(t.shape))r[s]=a.catch((c)=>{e({path:s,message:`${c.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return});r.allowedMcpServers=y6("allowedMcpServers",Oy(),e).catch(()=>(e({path:"allowedMcpServers",message:'"allowedMcpServers" was present but invalid; enforcing an empty allowlist (no MCP servers admitted) until it is fixed.'}),[])),r.deniedMcpServers=y6("deniedMcpServers",Cy(),e).catch(()=>{e({path:"deniedMcpServers",message:'"deniedMcpServers" was present but invalid and was dropped; its entries cannot be enforced until it is fixed.'});return}),r.allowManagedMcpServersOnly=t.shape.allowManagedMcpServersOnly.catch(()=>(e({path:"allowManagedMcpServersOnly",message:'"allowManagedMcpServersOnly" was present but invalid; treating it as true until it is fixed.'}),!0)),r.enforceAvailableModels=t.shape.enforceAvailableModels.catch(()=>(e({path:"enforceAvailableModels",message:'"enforceAvailableModels" was present but invalid; treating it as true until it is fixed.'}),!0)),r.availableModels=l.array(l.unknown()).transform((s,a)=>{let c=[];for(let u of s)if(typeof u==="string")c.push(u);else e({path:"availableModels",message:`"availableModels" contained a non-string entry (${JSON.stringify(u)}); the entry was ignored.`});return c}).optional().catch(()=>(e({path:"availableModels",message:'"availableModels" was present but invalid; enforcing an empty allowlist (only the default model is available) until it is fixed.'}),[])),r.forceLoginOrgUUID=t.shape.forceLoginOrgUUID.catch(()=>(e({path:"forceLoginOrgUUID",message:'"forceLoginOrgUUID" was present but invalid; no organization is permitted to log in until it is fixed.'}),[]));let n=Object.freeze({mode:"deny"}),o=(s,a)=>l.array(a.catch((c)=>(e({path:`sandbox.credentials.${s}[]`,message:`Invalid entry was ignored: ${c.issues[0]?.message??"failed validation"}. This credential is NOT protected until the entry is fixed.`}),n))).transform((c)=>c.filter((u)=>u!==n)).optional();return r.sandbox=zk().extend({credentials:l.object({files:o("files",jk()),envVars:o("envVars",Fk()),allowPlaintextInject:l.boolean().optional().catch((s)=>{e({path:"sandbox.credentials.allowPlaintextInject",message:`${s.issues[0]?.message??"Invalid value"}. "allowPlaintextInject" was ignored; plaintext credential injection stays disabled until it is fixed.`});return})}).optional().catch((s)=>{e({path:"sandbox.credentials",message:`${s.issues[0]?.message??"Failed schema validation"}. The credentials block was dropped; no credential protection is applied until it is fixed.`});return})}).optional().catch((s)=>{e({path:"sandbox",message:`${s.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return}),l.object(r).passthrough().transform((s)=>{for(let a of Object.keys(s))if(s[a]===void 0)delete s[a];return s})}var fo="https://code.claude.com/docs/en",bMe=[{matches:(e)=>e.path==="permissions.defaultMode"&&e.code==="invalid_value",tip:{suggestion:'Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)',docLink:`${fo}/iam#permission-modes`}},{matches:(e)=>e.path==="apiKeyHelper"&&e.code==="invalid_type",tip:{suggestion:'Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"'}},{matches:(e)=>e.path==="cleanupPeriodDays"&&e.code==="too_small",tip:{suggestion:'cleanupPeriodDays must be at least 1. To keep transcripts for a long time, set a large number (e.g. 3650 for ~10 years). To disable transcript writes entirely, remove this setting and use the --no-session-persistence CLI flag or the SDK persistSession:false option instead. (0 is rejected because it previously silently disabled all transcript writes, which users setting it to mean "never clean up" did not expect.)'}},{matches:(e)=>e.path.startsWith("env.")&&e.code==="invalid_type",tip:{suggestion:'Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"',docLink:`${fo}/settings#environment-variables`}},{matches:(e)=>(e.path==="permissions.allow"||e.path==="permissions.deny")&&e.code==="invalid_type"&&e.expected==="array",tip:{suggestion:'Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.'}},{matches:(e)=>e.path.startsWith("hooks.")&&e.code==="invalid_key",tip:{suggestion:"Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",docLink:`${fo}/hooks`}},{matches:(e)=>/\.hooks\.\d+\.command$/.test(e.path)&&e.code==="invalid_type"&&e.received==="undefined",tip:{suggestion:'Command hooks require `command`. For exec form (no shell), set `command` to the executable and `args` to its arguments: {"type": "command", "command": "echo", "args": ["hi"]}. For shell form, set `command` to the full shell string: {"type": "command", "command": "echo hi"}.',docLink:`${fo}/hooks#exec-form-and-shell-form`}},{matches:(e)=>e.path.includes("hooks")&&e.code==="invalid_type",tip:{suggestion:'Hooks use a matcher + hooks array. The matcher is a string: a tool name ("Bash"), pipe-separated list ("Edit|Write"), or empty to match all. Example: {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "echo Done"}]}]}'}},{matches:(e)=>e.code==="invalid_type"&&e.expected==="boolean",tip:{suggestion:'Use true or false without quotes. Example: "includeCoAuthoredBy": true'}},{matches:(e)=>e.code==="unrecognized_keys",tip:{suggestion:"Check for typos or refer to the documentation for valid fields",docLink:`${fo}/settings`}},{matches:(e)=>e.code==="invalid_value"&&e.enumValues!==void 0,tip:{suggestion:void 0}},{matches:(e)=>e.code==="invalid_type"&&e.expected==="object"&&e.received===null&&e.path==="",tip:{suggestion:"Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error."}},{matches:(e)=>e.path==="permissions.additionalDirectories"&&e.code==="invalid_type",tip:{suggestion:'Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command',docLink:`${fo}/iam#working-directories`}}],xMe={permissions:`${fo}/iam#configuring-permissions`,env:`${fo}/settings#environment-variables`,hooks:`${fo}/hooks`};function v6(e){let t=bMe.find((n)=>n.matches(e));if(!t)return null;let r={...t.tip};if(e.code==="invalid_value"&&e.enumValues&&!r.suggestion)r.suggestion=`Valid values: ${e.enumValues.map((n)=>`"${n}"`).join(", ")}`;if(!r.docLink&&e.path)r.docLink=xMe[Wy(e.path,".")];return r}var YTt=C(()=>Es().strict());function S6(e){return e.code==="invalid_type"}function E6(e){return e.code==="invalid_value"}function vMe(e){return e.code==="unrecognized_keys"}function w6(e){return e.code==="too_small"}function qc(e){if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";return typeof e}function T6(e){let t=e.match(/received (\w+)/);return t?t[1]:void 0}function $d(e,t){return e.issues.map((r)=>{let n=r.path.map(String).join("."),o=r.message,i,s,a,c,u;if(E6(r))s=r.values.map((f)=>String(f)),a=s.join(" | "),c=void 0,u=void 0;else if(S6(r)){a=r.expected;let f=T6(r.message);c=f??qc(r.input),u=f??qc(r.input)}else if(w6(r))a=String(r.minimum);else if(r.code==="custom"&&"params"in r)c=r.params.received,u=c;let d=v6({path:n,code:r.code,expected:a,received:c,enumValues:s,message:r.message,value:c});if(E6(r))i=s?.map((f)=>`"${f}"`).join(", "),o=`Invalid value. Expected one of: ${i}`;else if(S6(r)){let f=T6(r.message)??qc(r.input);if(r.expected==="object"&&f==="null"&&n==="")o="Invalid or malformed JSON";else o=`Expected ${r.expected}, but received ${f}`}else if(vMe(r)){let f=r.keys.join(", ");o=`Unrecognized ${jO(r.keys.length,"field")}: ${f}`}else if(w6(r))o=`Number must be greater than or equal to ${r.minimum}`,i=String(r.minimum);return{file:t,path:n,message:o,expected:i,invalidValue:u,suggestion:d?.suggestion,docLink:d?.docLink}})}function SMe(e,t){if(!e||typeof e!=="object")return[];let r=e;if(!r.permissions||typeof r.permissions!=="object")return[];let n=r.permissions,o=[];for(let i of["allow","deny","ask"]){let s=n[i];if(!Array.isArray(s))continue;n[i]=s.filter((a)=>{if(typeof a!=="string")return o.push({file:t,path:`permissions.${i}`,message:`Non-string value in ${i} array was removed`,severity:"warning",invalidValue:a}),!1;let c=Qk(a,i);if(!c.valid){let u=`Invalid permission rule "${a}" was skipped: ${c.error}`;if(c.suggestion)u+=`. ${c.suggestion}`;return o.push({file:t,path:`permissions.${i}`,message:u,severity:"warning",invalidValue:a}),!1}return!0})}return o}var EMe=new Set(Os);function wMe(e,t){if(!e||typeof e!=="object")return[];let r=e;if(!("hooks"in r))return[];if(r.hooks===null||typeof r.hooks!=="object"||Array.isArray(r.hooks)){let i=qc(r.hooks);return delete r.hooks,[{file:t,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${i}. This field was ignored.`,severity:"warning",invalidValue:i,docLink:"https://code.claude.com/docs/en/hooks"}]}let n=r.hooks,o=[];for(let i of Object.keys(n)){if(!EMe.has(i)){delete n[i],o.push({file:t,path:`hooks.${i}`,message:`Unknown hook event "${i}" was ignored. Valid events: ${Os.join(", ")}`,severity:"warning",invalidValue:i,docLink:"https://code.claude.com/docs/en/hooks"});continue}if(!Array.isArray(n[i])){let s=qc(n[i]);delete n[i],o.push({file:t,path:`hooks.${i}`,message:`Hook event "${i}" must be an array of matchers; received ${s}. This entry was ignored.`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"})}}if(o.length>0&&Object.keys(n).length===0)delete r.hooks;return o}var TMe=[{key:"allowedMcpServers",schema:Oy},{key:"deniedMcpServers",schema:Cy}];function AMe(e,t){if(!e||typeof e!=="object")return[];let r=e,n=[];for(let{key:o,schema:i}of TMe){if(!(o in r))continue;if(!Array.isArray(r[o])){let c=r[o];delete r[o],n.push({file:t,path:o,message:`"${o}" must be an array; received ${qc(c)}. This field was ignored.`,severity:"warning",invalidValue:c});continue}let s=r[o],a=[];for(let c=0;c<s.length;c++){let u=i().safeParse(s[c]);if(u.success)a.push(s[c]);else n.push({file:t,path:`${o}[${c}]`,message:`Invalid entry was ignored: ${u.error.issues[0]?.message??"failed validation"}`,severity:"warning",invalidValue:s[c]})}if(a.length<s.length)r[o]=a}return n}function ws(e,t,r){return[...SMe(e,t),...wMe(e,t),...r?.skipMcpServerEntryFilter?[]:AMe(e,t)]}function oO(e){let t=new Set(e.allowedSources);return t.add("flagSettings"),t.add("policySettings"),wG.filter((r)=>t.has(r))}function CMe(){return Tn(xs(),"managed-settings.json")}function k6(e){if(no()==="wsl"&&e.wslInherits?.()){let t=rO(zc);if(t.settings)return t;let r=rO(xs());return{settings:r.settings,errors:[...t.errors,...r.errors]}}return rO(xs())}function rO(e){let t=[],r={},n=!1,{settings:o,errors:i}=Gc(Tn(e,"managed-settings.json"),void 0,!0);if(t.push(...i),o&&Object.keys(o).length>0)r=En(r,o,Un),n=!0;let s=Tn(e,"managed-settings.d");try{let u=Fe().readdirSync(s).filter((d)=>(d.isFile()||d.isSymbolicLink())&&d.name.endsWith(".json")&&!d.name.startsWith(".")).map((d)=>d.name).sort();for(let d of u){let{settings:f,errors:m}=Gc(Tn(s,d),void 0,!0);if(t.push(...m),f&&Object.keys(f).length>0)r=En(r,f,Un),n=!0}}catch(u){let d=dt(u);if(d!=="ENOENT"&&d!=="ENOTDIR")ce(`managed-settings.d read failed: ${u}`,{level:"error"})}let{wslInheritsWindowsSettings:a,...c}=r;return{settings:n&&Object.keys(c).length>0?r:null,errors:t}}function RMe(e,t){if(On(e))ce(`Broken symlink or missing file encountered for settings.json at path: ${t}`);else ce(`settings file read failed at ${t}: ${e}`,{level:"error"})}function Gc(e,t,r){let n=xD(e);if(n)return{settings:n.settings?Ho(n.settings):null,errors:n.errors};let o=DMe(e,t,r);return vD(e,o),{settings:o.settings?Ho(o.settings):null,errors:o.errors}}function O6(e){if(!e.mdm)return{settings:null,errors:[]};let t=e.mdm();return{settings:Object.keys(t.settings).length>0?t.settings:null,errors:t.errors}}function Ry(e,t){let r=Ho(e),n=ws(r,t,{skipMcpServerEntryFilter:!0}),o=[],i=tO((s)=>o.push({file:t,path:s.path,message:s.message,severity:"warning"})).safeParse(r);if(!i.success)return{settings:null,errors:[...n,...$d(i.error,t)]};return{settings:Object.keys(i.data).length>0?i.data:null,errors:[...n,...o]}}function C6(e){let t=e?.remote?e.remote():EG();if(!t||Object.keys(t).length===0)return{settings:null,errors:[]};return Ry(t,"remote managed settings")}function IMe(e){let t=e.parentManaged;if(!t||Object.keys(t).length===0)return{settings:null,errors:[]};return Ry(t,"parent managed settings")}function R6(e){let t=e.flagInline;if(!t)return{settings:null,errors:[]};let r=Ho(t),n=ws(r,"SDK inline settings"),o=Es().safeParse(r);if(!o.success)return{settings:null,errors:[...n,...$d(o.error,"SDK inline settings")]};return{settings:o.data,errors:n}}var PMe=2097152;function DMe(e,t,r){try{let n;if(t!==void 0)n=t;else{let{resolvedPath:a}=ih(Fe(),e);n=bs(a,PMe)}if(n.trim()==="")return{settings:{},errors:[]};let o=Ho(Mc(n,!1));if(r){let a=ws(o,e,{skipMcpServerEntryFilter:!0}),c=[],u=tO((d)=>c.push({file:e,path:d.path,message:d.message,severity:"warning"})).safeParse(o);if(!u.success)return{settings:null,errors:[...a,...$d(u.error,e)]};return{settings:u.data,errors:[...a,...c]}}let i=ws(o,e),s=Es().safeParse(o);if(!s.success){let a=$d(s.error,e);return{settings:null,errors:[...i,...a]}}return{settings:s.data,errors:i}}catch(n){if(RMe(n,e),On(n))return{settings:null,errors:[]};return{settings:null,errors:[{file:e,path:"",message:`Settings file could not be read: ${n instanceof Error?n.message:String(n)}`,severity:"fatal"}]}}}function A6(e,t){switch(e){case"userSettings":return Zr(Yt());case"policySettings":case"projectSettings":return Zr(t.cwd);case"localSettings":return I6(t.cwd,t.canonicalGitRoot);case"flagSettings":return t.flagPath?OMe(Zr(t.flagPath)):Zr(t.cwd)}}function I6(e,t){let r=t?.(e);if(!r)return Zr(e);let n=Zr(r),o=Zr(e);if(n===o)return n;let i;try{i=MMe()}catch{return o}if(n===i)return o;if(!NMe(n))return o;return n}var LMe=re((e)=>{let t=Fe(),r=null;try{r=t.lstatSync(Tn(e,".claude")).uid}catch(n){if(!On(n))throw n}return{rootUid:t.statSync(e).uid,gitEntryUid:t.lstatSync(Tn(e,".git")).uid,claudeEntryUid:r}});function NMe(e){if(typeof process.getuid!=="function"&&typeof process.geteuid!=="function")return ce(`localSettings: not canonicalizing the consent store to ${e} — this platform has no uid semantics to verify directory ownership with, so the store stays at the session cwd (canonicalization is POSIX-only)`,{level:"warn"}),!1;let t=typeof process.geteuid==="function"?process.geteuid():process.getuid?.();try{let{rootUid:r,gitEntryUid:n,claudeEntryUid:o}=LMe(e);if(r===t&&n===t&&(o===null||o===t))return!0;return ce(`localSettings: not canonicalizing the consent store to ${e} — it (uid ${r}), its .git entry (uid ${n}), or its .claude entry (uid ${o??"absent"}) is not owned by the current user (uid ${t}); the store stays at the session cwd (the pre-canonicalization behavior). If you own this repo, chown it (including .git and .claude) or run from a directory you own.`,{level:"warn"}),!1}catch(r){return ce(`localSettings: not canonicalizing the consent store to ${e} — its ownership could not be verified (${r instanceof Error?r.message:String(r)}); the store stays at the session cwd`,{level:"warn"}),!1}}var MMe=re(()=>{let e=Hy(kMe());if(e===null)throw Error("home directory realpath unavailable");return xr(e)});function UMe(e){if(e.coworkPlugins||Hr.CLAUDE_CODE_USE_COWORK_PLUGINS)return"cowork_settings.json";return"settings.json"}function jd(e,t){switch(e){case"userSettings":return Tn(A6(e,t),UMe(t));case"projectSettings":case"localSettings":return Tn(A6(e,t),P6(e));case"policySettings":return CMe();case"flagSettings":return t.flagPath}}function P6(e){switch(e){case"projectSettings":return Tn(".claude","settings.json");case"localSettings":return Tn(".claude","settings.local.json")}}function D6(e){if(I6(e.cwd,e.canonicalGitRoot)===Zr(e.cwd))return;return Tn(Zr(e.cwd),P6("localSettings"))}function L6(e,t){let r=yD(e);if(r!==void 0)return r;let n=FMe(e,t);return bD(e,n),n}function $Me(e){return!e||e.parentSettingsBehavior==="merge"}function jMe(e,t){let r={};if(e.allowManagedHooksOnly===!0)r.allowManagedHooksOnly=!0;if(e.allowManagedMcpServersOnly===!0)r.allowManagedMcpServersOnly=!0;if(e.disableClaudeAiConnectors===!0)r.disableClaudeAiConnectors=!0;if(e.allowManagedPermissionRulesOnly===!0)r.allowManagedPermissionRulesOnly=!0;let n=e.strictPluginOnlyCustomization;if(n===!0||Array.isArray(n)&&n.length>0)r.strictPluginOnlyCustomization=n;if(e.deniedMcpServers)r.deniedMcpServers=e.deniedMcpServers;if(t.forceLoginOrgUUID===void 0&&e.forceLoginOrgUUID)r.forceLoginOrgUUID=e.forceLoginOrgUUID;if(t.allowedMcpServers===void 0&&e.allowedMcpServers)r.allowedMcpServers=e.allowedMcpServers;if(t.availableModels===void 0&&e.availableModels)r.availableModels=e.availableModels;if(e.enforceAvailableModels===!0)r.enforceAvailableModels=!0;if(e.permissions){let o=Ey(e.permissions,["deny","ask"]);if(e.permissions.disableBypassPermissionsMode==="disable")o.disableBypassPermissionsMode="disable";if(t.allowManagedPermissionRulesOnly!==!0){let{allow:i,additionalDirectories:s}=e.permissions;if(i&&t.sandbox?.network?.allowManagedDomainsOnly!==!0)o.allow=i;if(s)o.additionalDirectories=s}if(Object.keys(o).length>0)r.permissions=o}if(e.sandbox){let{network:o,filesystem:i,credentials:s}=e.sandbox,a={};if(e.sandbox.enabled===!0)a.enabled=!0;if(e.sandbox.failIfUnavailable===!0)a.failIfUnavailable=!0;if(e.sandbox.allowUnsandboxedCommands===!1)a.allowUnsandboxedCommands=!1;if(e.sandbox.autoAllowBashIfSandboxed===!1)a.autoAllowBashIfSandboxed=!1;if(o){let c=Ey(o,["deniedDomains"]);if(o.allowManagedDomainsOnly===!0)c.allowManagedDomainsOnly=!0;if(t.sandbox?.network?.allowManagedDomainsOnly!==!0&&o.allowedDomains)c.allowedDomains=o.allowedDomains;if(Object.keys(c).length>0)a.network=c}if(i){let c=Ey(i,["denyRead","denyWrite"]);if(i.allowManagedReadPathsOnly===!0)c.allowManagedReadPathsOnly=!0;if(i.disabled===!1)c.disabled=!1;if(t.sandbox?.filesystem?.allowManagedReadPathsOnly!==!0&&i.allowRead)c.allowRead=i.allowRead;if(Object.keys(c).length>0)a.filesystem=c}if(s){let c=(s.files??[]).filter((f)=>f.mode==="deny"),u=(s.envVars??[]).filter((f)=>f.mode==="deny"),d={...c.length>0&&{files:c},...u.length>0&&{envVars:u}};if(s.allowPlaintextInject===!1)d.allowPlaintextInject=!1;if(Object.keys(d).length>0)a.credentials=d}if(Object.keys(a).length>0)r.sandbox=a}return r}function N6(e){if(e.helper?.())return"helper";if(C6(e).settings)return"remote";if(O6(e).settings)return no()==="macos"?"plist":"hklm";if((e.file?.()??k6(e)).settings)return"file";if(M6(e).parentSlice)return"parent";let t=e.hkcu?.();return t&&Object.keys(t.settings).length>0?"hkcu":null}function M6(e){let t=[],{settings:r,errors:n}=C6(e);t.push(...n);let{settings:o,errors:i}=O6(e);t.push(...i);let{settings:s,errors:a}=e.file?.()??k6(e);t.push(...a);let{settings:c,errors:u}=IMe(e);t.push(...u);let d=[r,o,s].filter((_)=>_!==null),f=d[0]??null,m={allowManagedPermissionRulesOnly:d.some((_)=>_.allowManagedPermissionRulesOnly===!0)||void 0,forceLoginOrgUUID:d.find((_)=>_.forceLoginOrgUUID!==void 0)?.forceLoginOrgUUID,allowedMcpServers:d.find((_)=>_.allowedMcpServers!==void 0)?.allowedMcpServers,availableModels:d[0]?.availableModels,sandbox:{network:{allowManagedDomainsOnly:d.some((_)=>_.sandbox?.network?.allowManagedDomainsOnly===!0)||void 0},filesystem:{allowManagedReadPathsOnly:d.some((_)=>_.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)||void 0}}},g=c&&$Me(f)?jMe(c,m):null,h=g&&Object.keys(g).length>0?g:null;return{tiers:d,admin:f,parentSlice:h,errors:t}}function U6(e){let t=e.helper?.();if(t)return{settings:t,errors:e.helperWarnings?.()??[]};let{tiers:r,admin:n,parentSlice:o,errors:i}=M6(e);if(!n&&!o){let a=e.hkcu?.();if(a&&Object.keys(a.settings).length>0)return{settings:a.settings,errors:[...i,...a.errors]};return{settings:null,errors:[...i,...a?.errors??[]]}}let s=En({},o??{},n??{},Un);if(r.some((a)=>a.forceRemoteSettingsRefresh===!0))s.forceRemoteSettingsRefresh=!0;return{settings:s,errors:i}}function FMe(e,t,{includeLegacyLocalSettings:r=!0}={}){if(e==="policySettings")return U6(t).settings;let n=jd(e,t),{settings:o}=n?Gc(n,e==="flagSettings"?t.flagExpectedContent:void 0):{settings:null};if(e==="flagSettings"){let{settings:i}=R6(t);if(i)return En(o||{},i,Un)}if(e==="localSettings"&&r){let i=D6(t);if(i){let{settings:s}=Gc(i);if(s)return En(s,o||{},Un)}}return o}function Un(e,t,r){if(Array.isArray(e)&&Array.isArray(t)){if(r==="fallbackModel")return t;return Ra([...e,...t])}return}var nO=!1;function zMe(e){if(nO)return{settings:{},errors:[]};let t=Date.now();kd("info","settings_load_started"),nO=!0;try{let r=SD(),n={};if(r)n=En(n,r,Un);let o=[],i=new Set,s=new Set,a=(u)=>{for(let d of u){let f=`${d.file}:${d.path}:${d.message}`;if(!i.has(f))i.add(f),o.push(d)}},c=null;for(let u of oO(e)){if(u==="policySettings"){let{settings:f,errors:m}=U6(e);if(c=f,f)n=En(n,f,Un);a(m);continue}if(u==="localSettings"){let f=D6(e);if(f&&!s.has(Zr(f))){s.add(Zr(f));let{settings:m,errors:g}=Gc(f);if(a(g),m)n=En(n,m,Un)}}let d=jd(u,e);if(d){let f=Zr(d);if(!s.has(f)){s.add(f);let{settings:m,errors:g}=Gc(d,u==="flagSettings"?e.flagExpectedContent:void 0);if(a(g),m)n=En(n,m,Un)}}if(u==="flagSettings"){let{settings:f,errors:m}=R6(e);if(a(m),f)n=En(n,f,Un)}}if(c){if(c.availableModels!==void 0)n.availableModels=[...c.availableModels];if(c.enforceAvailableModels!==void 0)n.enforceAvailableModels=c.enforceAvailableModels}return kd("info","settings_load_completed",{duration_ms:Date.now()-t,source_count:s.size,error_count:o.length}),{settings:n,errors:o}}finally{nO=!1}}function BMe(e){let t=hD();if(t!==null)return t;let r=zMe(e);return _D(r),r}function HMe(e){let{settings:t}=BMe(e);return t||{}}function $6(e){qi();let t=[];for(let r of oO(e)){let n=L6(r,e);if(n&&Object.keys(n).length>0)t.push({source:r,settings:n})}return{effective:HMe(e),sources:t}}function j6(e,t){let r=oO(t);for(let n=r.length-1;n>=0;n--){let o=r[n];if(L6(o,t)?.[e]!==void 0)return o}return null}import{execFile as qMe}from"child_process";import{existsSync as GMe}from"fs";var WMe=null;function Fd(e,t){return new Promise((r)=>{try{qMe(e,t,{encoding:"utf-8",timeout:OG,windowsHide:!0},(n,o)=>{r({stdout:o??"",code:n?1:0})})}catch{r({stdout:"",code:1})}})}function F6(){return(async()=>{if(process.platform==="darwin"){let e=CG(),r=(await Promise.all(e.map(async({path:n,label:o})=>{if(!GMe(n))return{stdout:"",label:o,ok:!1};let{stdout:i,code:s}=await Fd(AG,[...kG,n]);return{stdout:i,label:o,ok:s===0&&!!i}}))).find((n)=>n.ok);return{plistStdouts:r?[{stdout:r.stdout,label:r.label}]:[],hklmStdout:null,hkcuStdout:null}}if(process.platform==="win32"){let t=`${process.env.SYSTEMROOT||"C:\\Windows"}\\System32\\reg.exe`,[r,n]=await Promise.all([Fd(t,["query",Id,"/v",pi]),Fd(t,["query",Pd,"/v",pi])]);return{plistStdouts:null,hklmStdout:r.code===0?r.stdout:null,hkcuStdout:n.code===0?n.stdout:null}}if(wy()){let[e,t]=await Promise.all([Fd($k,["query",Id,"/v",pi]),Fd($k,["query",Pd,"/v",pi])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:t.code===0?t.stdout:null}}return{plistStdouts:null,hklmStdout:null,hkcuStdout:null}})()}function z6(){return WMe}var fi=Object.freeze({settings:{},errors:[]}),G6=null,W6=null,V6=!1,Iy=null;function VMe(){if(Iy)return;Iy=(async()=>{let e=Date.now(),t=z6()??F6(),{mdm:r,hkcu:n,wslInherits:o}=KMe(await t);G6=r,W6=n,V6=o;let i=Date.now()-e;if(ce(`MDM settings load completed in ${i}ms`),Object.keys(r.settings).length>0){ce(`MDM settings found: ${Object.keys(r.settings).join(", ")}`);try{kd("info","mdm_settings_loaded",{duration_ms:i,key_count:Object.keys(r.settings).length,error_count:r.errors.length})}catch{}}})()}async function K6(){if(!Iy)VMe();await Iy}function Z6(){return G6??fi}function J6(){return W6??fi}function Y6(){return V6}function iO(e,t){let r=Mc(e,!1);if(!r||typeof r!=="object")return{settings:{},errors:[]};let{settings:n,errors:o}=Ry(r,t);return{settings:n??{},errors:o}}function B6(e,t="Settings"){let r=e.split(/\r?\n/),n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`^\\s+${n}\\s+REG_(?:EXPAND_)?SZ\\s+(.*)$`,"i");for(let i of r){let s=i.match(o);if(s&&s[1])return s[1].trimEnd()}return null}function KMe(e){let t=[];if(e.plistStdouts&&e.plistStdouts.length>0){let{stdout:s,label:a}=e.plistStdouts[0],c=iO(s,a),{wslInheritsWindowsSettings:u,...d}=c.settings;if(Object.keys(d).length>0)return{mdm:c,hkcu:fi,wslInherits:!1};t.push(...c.errors)}let r=null;if(e.hklmStdout){let s=B6(e.hklmStdout);if(s)r=iO(s,`Registry: ${Id}\\${pi}`)}if(r)t.push(...r.errors);let n=t.length>0?{settings:{},errors:t}:fi,o=wy(),i=!1;if(o){if(i=r?.settings.wslInheritsWindowsSettings===!0||JMe(),!i)return{mdm:n,hkcu:fi,wslInherits:!1}}if(r){let{wslInheritsWindowsSettings:s,...a}=r.settings;if(Object.keys(a).length>0)return{mdm:r,hkcu:fi,wslInherits:i}}if(ZMe(i))return{mdm:n,hkcu:fi,wslInherits:i};if(e.hkcuStdout){let s=B6(e.hkcuStdout);if(s){let a=iO(s,`Registry: ${Pd}\\${pi}`);if(!o||a.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:c,...u}=a.settings;return{mdm:n,hkcu:{settings:u,errors:a.errors},wslInherits:i}}if(a.errors.length>0)return{mdm:n,hkcu:{settings:{},errors:a.errors},wslInherits:i}}}return{mdm:n,hkcu:fi,wslInherits:i}}function ZMe(e){if(e&&q6(zc))return!0;return q6(xs())}function H6(e){let t=Ho(Mc(bs(e),!1));if(!t||typeof t!=="object")return!1;ws(t,e);let{wslInheritsWindowsSettings:r,...n}=t;return Object.keys(n).length>0}function JMe(){function e(t){try{let r=Mc(bs(t),!1);return!!r&&typeof r==="object"&&"wslInheritsWindowsSettings"in r&&r.wslInheritsWindowsSettings===!0}catch{return!1}}if(e(Wc(zc,"managed-settings.json")))return!0;try{let t=Wc(zc,"managed-settings.d");for(let r of Fe().readdirSync(t))if((r.isFile()||r.isSymbolicLink())&&r.name.endsWith(".json")&&!r.name.startsWith(".")&&e(Wc(t,r.name)))return!0}catch{}return!1}function q6(e){try{if(H6(Wc(e,"managed-settings.json")))return!0}catch{}try{let t=Wc(e,"managed-settings.d"),r=Fe().readdirSync(t);for(let n of r){if(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(".json")||n.name.startsWith("."))continue;try{if(H6(Wc(t,n.name)))return!0}catch{}}}catch{}return!1}var XMe={user:"userSettings",project:"projectSettings",local:"localSettings"},X6={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},QMe=["user","project","local"],eUe=new Set(["bypassPermissions","auto","acceptEdits"]),tUe=new Set(["project"]);function rUe(e){let t=e.effective.permissions?.defaultMode;if(!t||!eUe.has(t))return e.effective;for(let r=e.sources.length-1;r>=0;r--){let n=e.sources[r];if(n.settings.permissions?.defaultMode!==void 0){if(tUe.has(n.source)){let{defaultMode:o,...i}=e.effective.permissions??{};return{...e.effective,permissions:i}}return e.effective}}return e.effective}async function Q6(e={}){await K6();let t={cwd:YMe(e.cwd??Fe().cwd()),allowedSources:(e.settingSources??QMe).map((r)=>XMe[r]),parentManaged:e.managedSettings??null,flagInline:null,flagPath:void 0,mdm:Z6,hkcu:J6,wslInherits:Y6,...e.serverManagedSettings!==void 0&&{remote:()=>e.serverManagedSettings}};try{let{effective:r,sources:n}=$6(t),o=N6(t)??void 0,i=n.map(({source:a,settings:c})=>({source:X6[a],settings:c,path:a==="policySettings"?void 0:jd(a,t),...a==="policySettings"&&{policyOrigin:o}})),s={};for(let a of Object.keys(r)){let c=j6(a,t);if(c)s[a]={source:X6[c],path:c==="policySettings"?void 0:jd(c,t),...c==="policySettings"&&{policyOrigin:o}}}return{effective:r,provenance:s,sources:i}}finally{qi()}}process.env.NoDefaultCurrentDirectoryInExePath="1";async function kkt(e){return Q6(e)}async function fUe(e,t){try{await sUe(e,t)}catch(r){if(!On(r))throw r}}async function mUe(e,t){if(!e)return;let r=e;try{let n=yt(e);if(n?.claudeAiOauth?.refreshToken)delete n.claudeAiOauth.refreshToken,r=Re(n)}catch{}await oW(t,r,{mode:384})}function gUe(){if(process.platform!=="darwin")return Promise.resolve(void 0);let e=vF(xF);return new Promise((t)=>{nUe("security",["find-generic-password","-a",SF(),"-w","-s",e],{encoding:"utf-8",timeout:5000,windowsHide:!0},(r,n)=>t(r?void 0:n.trim()||void 0))})}async function aW(e,t,r,n,o=60000){if(!ze(t))return;let i=Jr(r),s=await Mr(e.load({projectKey:i,sessionId:t}),o,`SessionStore.load() timed out after ${o}ms for session ${t}`);if(!s||s.length===0)return;let a=Dr(uUe(),`claude-resume-${lO()}`);try{let c=Dr(a,"projects",i);await sO(c,{recursive:!0});let u=Dr(c,`${t}.jsonl`);await qp(u,s);let d=n?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR,f=d??Dr(aO(),".claude"),m;try{m=await nW(Dr(f,".credentials.json"),"utf-8")}catch(g){if(!On(g))throw g}if(!d&&!(n??process.env).ANTHROPIC_API_KEY&&!(n??process.env).CLAUDE_CODE_OAUTH_TOKEN)m=await gUe()??m;if(await mUe(m,Dr(a,".credentials.json")),await fUe(Dr(d??aO(),".claude.json"),Dr(a,".claude.json")),e.listSubkeys)await hUe(e,{projectKey:i,sessionId:t},Dr(c,t),o);return a}catch(c){throw await Py(a),c}}async function hUe(e,t,r,n){let o=await Mr(e.listSubkeys({projectKey:t.projectKey,sessionId:t.sessionId}),n,`SessionStore.listSubkeys() timed out after ${n}ms for session ${t.sessionId}`);for(let i of o){let s=zd(r,i+".jsonl");if(!i||iW(i)||i.split(/[\\/]/).includes("..")||!s.startsWith(r+uO)){ce(`[SessionStore] skipping unsafe subpath from listSubkeys: ${i}`,{level:"warn"});continue}let a=await Mr(e.load({projectKey:t.projectKey,sessionId:t.sessionId,subpath:i}),n,`SessionStore.load() timed out after ${n}ms for session ${t.sessionId} subpath ${i}`);if(!a||a.length===0)continue;let c=[],u=[];for(let d of a)if(cO(d))c.push(d);else u.push(d);if(u.length>0)await sO(eW(s),{recursive:!0}),await qp(s,u);if(c.length>0){let d=c.at(-1),f=zd(r,i+".meta.json");await sO(eW(f),{recursive:!0});let{type:m,...g}=d;await oW(f,Re(g),{mode:384})}}}function pO(e,t){let{isSingleUserTurn:r,resumeConfigDir:n,deferSpawn:o}=t,{systemPrompt:i,settings:s,managedSettings:a,settingSources:c,sandbox:u,...d}=e??{},f,m,g;if(i===void 0)f="";else if(typeof i==="string")f=i;else if(Array.isArray(i))f=i;else if(i.type==="preset")m=i.append,g=i.excludeDynamicSections;process.env.CLAUDE_AGENT_SDK_VERSION="0.3.218";let{abortController:h=Jc(),additionalDirectories:_=[],agent:y,agents:b,allowedTools:T=[],betas:w,canUseTool:k,continue:P,cwd:te,debug:oe,debugFile:Oe,disallowedTools:ke=[],tools:jt,env:xt,executable:Ft=Cs()?"bun":"node",executableArgs:vt=[],extraArgs:St={},fallbackModel:Lr,enableFileCheckpointing:H,toolConfig:Nr,forkSession:Vt,hooks:Ye,includeHookEvents:yr,includePartialMessages:nt,forwardSubagentText:W,onElicitation:q,onUserDialog:V,supportedDialogKinds:ve,persistSession:me,sessionStore:He,sessionStoreFlush:Yr,thinking:qe,effort:mo,maxThinkingTokens:$n,maxTurns:mt,maxBudgetUsd:Bd,taskBudget:mW,mcpServers:fO,model:gW,outputFormat:mO,permissionMode:gO="default",allowDangerouslySkipPermissions:hW=!1,permissionPromptToolName:_W,plugins:yW,getOAuthToken:hO,getHostAuthToken:_O,workload:yO,resume:bO,resumeSessionAt:bW,sessionId:xW,skills:xO,stderr:vW,strictMcpConfig:SW}=d;if(He&&me===!1)throw Error("sessionStore cannot be used with persistSession: false -- the storage adapter requires local writes to mirror from. Use CLAUDE_CONFIG_DIR=/tmp for ephemeral local writes with external mirroring.");if(ve!==void 0&&ve.length>0&&!V)throw Error("supportedDialogKinds requires an onUserDialog callback -- declaring dialog kinds without a handler would park dialogs nothing can answer. Provide onUserDialog, or omit supportedDialogKinds.");if(He&&P&&!bO&&!He.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");if(He&&H)throw Error("enableFileCheckpointing is not yet supported with sessionStore (backup blobs are not mirrored, so rewindFiles() fails after a store-backed resume).");if(He&&d.spawnClaudeCodeProcess)ce("sessionStore with custom spawnClaudeCodeProcess: ensure the subprocess CLAUDE_CONFIG_DIR matches the parent (same path, same separators) or transcript_mirror frames will be dropped.",{level:"warn"});EF(!!k,gO,T);let Ly=d.pathToClaudeCodeExecutable;if(!Ly){let br=dUe(import.meta.url),Xr=lUe(br),mi=FU((Ts)=>Xr.resolve(Ts));if(!mi)throw Error(`Native CLI binary for ${process.platform}-${process.arch} not found. Reinstall @anthropic-ai/claude-agent-sdk without --omit=optional, or set options.pathToClaudeCodeExecutable.`);Ly=mi}let vO=mO?.type==="json_schema"?mO.schema:void 0,Kt=xt?{...xt}:{...process.env};if(!Kt.CLAUDE_CODE_ENTRYPOINT)Kt.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(!Kt.CLAUDE_AGENT_SDK_VERSION)Kt.CLAUDE_AGENT_SDK_VERSION="0.3.218";if(H)Kt.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true";if(hO)Kt.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH="1";if(_O)Kt.CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH="1";if(Nr?.askUserQuestion?.previewFormat)Kt.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=Nr.askUserQuestion.previewFormat;let Ny={};if(Dy.propagation.inject(Dy.context.active(),Ny),"traceparent"in Ny){for(let br of["TRACEPARENT","TRACESTATE"])if(!(br in(xt??{})))delete Kt[br]}for(let[br,Xr]of Object.entries(Ny)){let mi=br.toUpperCase();if(!(mi in(xt??{})))Kt[mi]=Xr}let SO={},EO=new Map;if(fO)for(let[br,Xr]of Object.entries(fO))if(Xr.type==="sdk"&&Xr.instance)EO.set(br,Xr.instance);else SO[br]=Xr;let Vc;if(qe)switch(qe.type){case"adaptive":Vc={type:"adaptive",display:qe.display};break;case"enabled":Vc={type:"enabled",budgetTokens:qe.budgetTokens,display:qe.display};break;case"disabled":Vc={type:"disabled"};break}else if($n!==void 0)Vc=$n===0?{type:"disabled"}:{type:"enabled",budgetTokens:$n};if(n){if(Kt.CLAUDE_CONFIG_DIR=n,process.platform==="win32")Kt.CLAUDE_SECURESTORAGE_CONFIG_DIR=xt?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??xt?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??""}let wO=new Uw({abortController:h,additionalDirectories:_,agent:y,betas:w,cwd:te,debug:oe,debugFile:Oe,executable:Ft,executableArgs:vt,extraArgs:yO?{...St,workload:yO}:St,pathToClaudeCodeExecutable:Ly,env:Kt,forkSession:Vt,stderr:vW,thinkingConfig:Vc,effort:mo,maxTurns:mt,maxBudgetUsd:Bd,taskBudget:mW,model:gW,fallbackModel:Lr,jsonSchema:vO,permissionMode:gO,allowDangerouslySkipPermissions:hW,permissionPromptToolName:_W,continueConversation:He?void 0:P,resume:bO,resumeSessionAt:bW,sessionId:xW,settings:typeof s==="object"?Re(s):s,managedSettings:a?Re(a):void 0,settingSources:c,skills:xO,allowedTools:T,disallowedTools:ke,tools:jt,mcpServers:SO,strictMcpConfig:SW,canUseTool:!!k,hooks:!!Ye,includeHookEvents:yr,includePartialMessages:nt,persistSession:me,sessionMirror:!!He,plugins:yW,sandbox:u,spawnClaudeCodeProcess:d.spawnClaudeCodeProcess,deferSpawn:o}),EW={systemPrompt:f,appendSystemPrompt:m,planModeInstructions:d.planModeInstructions,appendSubagentSystemPrompt:d.appendSubagentSystemPrompt,toolAliases:d.toolAliases,excludeDynamicSections:g,agents:b,title:d.title,skills:xO,webSearchIsolationExemptMcpServers:d.webSearchIsolationExemptMcpServers,promptSuggestions:d.promptSuggestions,agentProgressSummaries:d.agentProgressSummaries,forwardSubagentText:W,supportedDialogKinds:ve},My=new Hh(wO,r,k,Ye,h,EO,vO,EW,q,hO,_O,V);if(He){let br=()=>Dr(Kt.CLAUDE_CONFIG_DIR??Dr(aO(),".claude"),"projects"),Xr=Yr==="eager",mi=new Bw(async(Ts,Uy)=>{let Kc=rW(Ts,br());if(Kc)await He.append(Kc,Uy);else ce(`[SessionStore] dropping mirror frame: filePath ${Ts} is not under ${br()} -- subprocess CLAUDE_CONFIG_DIR likely differs from parent (custom spawnClaudeCodeProcess / container?)`,{level:"warn"})},{onError:(Ts,Uy)=>{let Kc=rW(Ts,br());if(Kc)My.reportMirrorError(Kc,Uy.message)},maxPendingEntries:Xr?0:qh,maxPendingBytes:Xr?0:Gh});My.setTranscriptMirrorBatcher(mi)}return{queryInstance:My,transport:wO,abortController:h,processEnv:Kt}}function dO(e,t,r,n){if(typeof r==="string")t.write(Re({type:"user",session_id:"",message:{role:"user",content:[{type:"text",text:r}]},parent_tool_use_id:null})+`
|
|
136
|
+
`+"\t".repeat(t))}};var Eq;(function(e){e.DEFAULT={allowTrailingComma:!1}})(Eq||(Eq={}));var wq;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(wq||(wq={}));var Tq;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(Tq||(Tq={}));var Aq;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(Aq||(Aq={}));function my(e){return e.startsWith("\uFEFF")?e.slice(1):e}var Lc=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,Oq=new Set,Ik=typeof process==="object"&&!!process?process:{},Cq=(e,t,r,n)=>{typeof Ik.emitWarning==="function"?Ik.emitWarning(e,t,r,n):console.error(`[${r}] ${t}: ${e}`)},gy=globalThis.AbortController,kq=globalThis.AbortSignal;if(typeof gy>"u"){kq=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,o){this._onabort.push(o)}},gy=class{constructor(){t()}signal=new kq;abort(n){if(this.signal.aborted)return;this.signal.reason=n,this.signal.aborted=!0;for(let o of this.signal._onabort)o(n);this.signal.onabort?.(n)}};let e=Ik.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{if(!e)return;e=!1,Cq("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t)}}var N0e=(e)=>!Oq.has(e),Rxt=Symbol("type"),ui=(e)=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Rq=(e)=>!ui(e)?null:e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?Od:null;class Od extends Array{constructor(e){super(e);this.fill(0)}}class Nc{heap;length;static#n=!1;static create(e){let t=Rq(e);if(!t)return[];Nc.#n=!0;let r=new Nc(e,t);return Nc.#n=!1,r}constructor(e,t){if(!Nc.#n)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class hy{#n;#p;#g;#h;#R;#I;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#_;#o;#r;#e;#l;#d;#c;#s;#y;#a;#b;#x;#f;#v;#A;#u;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#f,sizes:e.#b,keyMap:e.#o,keyList:e.#r,valList:e.#e,next:e.#l,prev:e.#d,get head(){return e.#c},get tail(){return e.#s},free:e.#y,isBackgroundFetch:(t)=>e.#t(t),backgroundFetch:(t,r,n,o)=>e.#L(t,r,n,o),moveToTail:(t)=>e.#C(t),indexes:(t)=>e.#S(t),rindexes:(t)=>e.#E(t),isStale:(t)=>e.#m(t)}}get max(){return this.#n}get maxSize(){return this.#p}get calculatedSize(){return this.#_}get size(){return this.#i}get fetchMethod(){return this.#R}get memoMethod(){return this.#I}get dispose(){return this.#g}get disposeAfter(){return this.#h}constructor(e){let{max:t=0,ttl:r,ttlResolution:n=1,ttlAutopurge:o,updateAgeOnGet:i,updateAgeOnHas:s,allowStale:a,dispose:c,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:f,maxSize:m=0,maxEntrySize:g=0,sizeCalculation:h,fetchMethod:_,memoMethod:y,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:k,ignoreFetchAbort:P}=e;if(t!==0&&!ui(t))throw TypeError("max option must be a nonnegative integer");let te=t?Rq(t):Array;if(!te)throw Error("invalid max value: "+t);if(this.#n=t,this.#p=m,this.maxEntrySize=g||this.#p,this.sizeCalculation=h,this.sizeCalculation){if(!this.#p&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!=="function")throw TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!=="function")throw TypeError("memoMethod must be a function if defined");if(this.#I=y,_!==void 0&&typeof _!=="function")throw TypeError("fetchMethod must be a function if specified");if(this.#R=_,this.#A=!!_,this.#o=new Map,this.#r=Array(t).fill(void 0),this.#e=Array(t).fill(void 0),this.#l=new te(t),this.#d=new te(t),this.#c=0,this.#s=0,this.#y=Nc.create(t),this.#i=0,this.#_=0,typeof c==="function")this.#g=c;if(typeof u==="function")this.#h=u,this.#a=[];else this.#h=void 0,this.#a=void 0;if(this.#v=!!this.#g,this.#u=!!this.#h,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(this.#p!==0){if(!ui(this.#p))throw TypeError("maxSize must be a positive integer if specified")}if(!ui(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#z()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!i,this.updateAgeOnHas=!!s,this.ttlResolution=ui(n)||n===0?n:1,this.ttlAutopurge=!!o,this.ttl=r||0,this.ttl){if(!ui(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#N()}if(this.#n===0&&this.ttl===0&&this.#p===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#n&&!this.#p){if(N0e("LRU_CACHE_UNBOUNDED"))Oq.add("LRU_CACHE_UNBOUNDED"),Cq("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",hy)}}getRemainingTTL(e){return this.#o.has(e)?1/0:0}#N(){let e=new Od(this.#n),t=new Od(this.#n);this.#f=e,this.#x=t,this.#M=(o,i,s=Lc.now())=>{if(t[o]=i!==0?s:0,e[o]=i,i!==0&&this.ttlAutopurge){let a=setTimeout(()=>{if(this.#m(o))this.#w(this.#r[o],"expire")},i+1);if(a.unref)a.unref()}},this.#k=(o)=>{t[o]=e[o]!==0?Lc.now():0},this.#T=(o,i)=>{if(e[i]){let s=e[i],a=t[i];if(!s||!a)return;o.ttl=s,o.start=a,o.now=r||n();let c=o.now-a;o.remainingTTL=s-c}};let r=0,n=()=>{let o=Lc.now();if(this.ttlResolution>0){r=o;let i=setTimeout(()=>r=0,this.ttlResolution);if(i.unref)i.unref()}return o};this.getRemainingTTL=(o)=>{let i=this.#o.get(o);if(i===void 0)return 0;let s=e[i],a=t[i];if(!s||!a)return 1/0;let c=(r||n())-a;return s-c},this.#m=(o)=>{let i=t[o],s=e[o];return!!s&&!!i&&(r||n())-i>s}}#k=()=>{};#T=()=>{};#M=()=>{};#m=()=>!1;#z(){let e=new Od(this.#n);this.#_=0,this.#b=e,this.#O=(t)=>{this.#_-=e[t],e[t]=0},this.#U=(t,r,n,o)=>{if(this.#t(r))return 0;if(!ui(n))if(o){if(typeof o!=="function")throw TypeError("sizeCalculation must be a function");if(n=o(r,t),!ui(n))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return n},this.#P=(t,r,n)=>{if(e[t]=r,this.#p){let o=this.#p-e[t];while(this.#_>o)this.#D(!0)}if(this.#_+=e[t],n)n.entrySize=r,n.totalCalculatedSize=this.#_}}#O=(e)=>{};#P=(e,t,r)=>{};#U=(e,t,r,n)=>{if(r||n)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#S({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#s;;){if(!this.#$(t))break;if(e||!this.#m(t))yield t;if(t===this.#c)break;else t=this.#d[t]}}*#E({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#c;;){if(!this.#$(t))break;if(e||!this.#m(t))yield t;if(t===this.#s)break;else t=this.#l[t]}}#$(e){return e!==void 0&&this.#o.get(this.#r[e])===e}*entries(){for(let e of this.#S())if(this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e]))yield[this.#r[e],this.#e[e]]}*rentries(){for(let e of this.#E())if(this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e]))yield[this.#r[e],this.#e[e]]}*keys(){for(let e of this.#S()){let t=this.#r[e];if(t!==void 0&&!this.#t(this.#e[e]))yield t}}*rkeys(){for(let e of this.#E()){let t=this.#r[e];if(t!==void 0&&!this.#t(this.#e[e]))yield t}}*values(){for(let e of this.#S())if(this.#e[e]!==void 0&&!this.#t(this.#e[e]))yield this.#e[e]}*rvalues(){for(let e of this.#E())if(this.#e[e]!==void 0&&!this.#t(this.#e[e]))yield this.#e[e]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#S()){let n=this.#e[r],o=this.#t(n)?n.__staleWhileFetching:n;if(o===void 0)continue;if(e(o,this.#r[r],this))return this.get(this.#r[r],t)}}forEach(e,t=this){for(let r of this.#S()){let n=this.#e[r],o=this.#t(n)?n.__staleWhileFetching:n;if(o===void 0)continue;e.call(t,o,this.#r[r],this)}}rforEach(e,t=this){for(let r of this.#E()){let n=this.#e[r],o=this.#t(n)?n.__staleWhileFetching:n;if(o===void 0)continue;e.call(t,o,this.#r[r],this)}}purgeStale(){let e=!1;for(let t of this.#E({allowStale:!0}))if(this.#m(t))this.#w(this.#r[t],"expire"),e=!0;return e}info(e){let t=this.#o.get(e);if(t===void 0)return;let r=this.#e[t],n=this.#t(r)?r.__staleWhileFetching:r;if(n===void 0)return;let o={value:n};if(this.#f&&this.#x){let i=this.#f[t],s=this.#x[t];if(i&&s){let a=i-(Lc.now()-s);o.ttl=a,o.start=Date.now()}}if(this.#b)o.size=this.#b[t];return o}dump(){let e=[];for(let t of this.#S({allowStale:!0})){let r=this.#r[t],n=this.#e[t],o=this.#t(n)?n.__staleWhileFetching:n;if(o===void 0||r===void 0)continue;let i={value:o};if(this.#f&&this.#x){i.ttl=this.#f[t];let s=Lc.now()-this.#x[t];i.start=Math.floor(Date.now()-s)}if(this.#b)i.size=this.#b[t];e.unshift([r,i])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let n=Date.now()-r.start;r.start=Lc.now()-n}this.set(t,r.value,r)}}set(e,t,r={}){if(t===void 0)return this.delete(e),this;let{ttl:n=this.ttl,start:o,noDisposeOnSet:i=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r,{noUpdateTTL:c=this.noUpdateTTL}=r,u=this.#U(e,t,r.size||0,s);if(this.maxEntrySize&&u>this.maxEntrySize){if(a)a.set="miss",a.maxEntrySizeExceeded=!0;return this.#w(e,"set"),this}let d=this.#i===0?void 0:this.#o.get(e);if(d===void 0){if(d=this.#i===0?this.#s:this.#y.length!==0?this.#y.pop():this.#i===this.#n?this.#D(!1):this.#i,this.#r[d]=e,this.#e[d]=t,this.#o.set(e,d),this.#l[this.#s]=d,this.#d[d]=this.#s,this.#s=d,this.#i++,this.#P(d,u,a),a)a.set="add";c=!1}else{this.#C(d);let f=this.#e[d];if(t!==f){if(this.#A&&this.#t(f)){f.__abortController.abort(Error("replaced"));let{__staleWhileFetching:m}=f;if(m!==void 0&&!i){if(this.#v)this.#g?.(m,e,"set");if(this.#u)this.#a?.push([m,e,"set"])}}else if(!i){if(this.#v)this.#g?.(f,e,"set");if(this.#u)this.#a?.push([f,e,"set"])}if(this.#O(d),this.#P(d,u,a),this.#e[d]=t,a){a.set="replace";let m=f&&this.#t(f)?f.__staleWhileFetching:f;if(m!==void 0)a.oldValue=m}}else if(a)a.set="update"}if(n!==0&&!this.#f)this.#N();if(this.#f){if(!c)this.#M(d,n,o);if(a)this.#T(a,d)}if(!i&&this.#u&&this.#a){let f=this.#a,m;while(m=f?.shift())this.#h?.(...m)}return this}pop(){try{while(this.#i){let e=this.#e[this.#c];if(this.#D(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#u&&this.#a){let e=this.#a,t;while(t=e?.shift())this.#h?.(...t)}}}#D(e){let t=this.#c,r=this.#r[t],n=this.#e[t];if(this.#A&&this.#t(n))n.__abortController.abort(Error("evicted"));else if(this.#v||this.#u){if(this.#v)this.#g?.(n,r,"evict");if(this.#u)this.#a?.push([n,r,"evict"])}if(this.#O(t),e)this.#r[t]=void 0,this.#e[t]=void 0,this.#y.push(t);if(this.#i===1)this.#c=this.#s=0,this.#y.length=0;else this.#c=this.#l[t];return this.#o.delete(r),this.#i--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=t,o=this.#o.get(e);if(o!==void 0){let i=this.#e[o];if(this.#t(i)&&i.__staleWhileFetching===void 0)return!1;if(!this.#m(o)){if(r)this.#k(o);if(n)n.has="hit",this.#T(n,o);return!0}else if(n)n.has="stale",this.#T(n,o)}else if(n)n.has="miss";return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,n=this.#o.get(e);if(n===void 0||!r&&this.#m(n))return;let o=this.#e[n];return this.#t(o)?o.__staleWhileFetching:o}#L(e,t,r,n){let o=t===void 0?void 0:this.#e[t];if(this.#t(o))return o;let i=new gy,{signal:s}=r;s?.addEventListener("abort",()=>i.abort(s.reason),{signal:i.signal});let a={signal:i.signal,options:r,context:n},c=(h,_=!1)=>{let{aborted:y}=i.signal,b=r.ignoreFetchAbort&&h!==void 0;if(r.status)if(y&&!_){if(r.status.fetchAborted=!0,r.status.fetchError=i.signal.reason,b)r.status.fetchAbortIgnored=!0}else r.status.fetchResolved=!0;if(y&&!b&&!_)return d(i.signal.reason);let T=m;if(this.#e[t]===m)if(h===void 0)if(T.__staleWhileFetching)this.#e[t]=T.__staleWhileFetching;else this.#w(e,"fetch");else{if(r.status)r.status.fetchUpdated=!0;this.set(e,h,a.options)}return h},u=(h)=>{if(r.status)r.status.fetchRejected=!0,r.status.fetchError=h;return d(h)},d=(h)=>{let{aborted:_}=i.signal,y=_&&r.allowStaleOnFetchAbort,b=y||r.allowStaleOnFetchRejection,T=b||r.noDeleteOnFetchRejection,w=m;if(this.#e[t]===m){if(!T||w.__staleWhileFetching===void 0)this.#w(e,"fetch");else if(!y)this.#e[t]=w.__staleWhileFetching}if(b){if(r.status&&w.__staleWhileFetching!==void 0)r.status.returnedStale=!0;return w.__staleWhileFetching}else if(w.__returned===w)throw h},f=(h,_)=>{let y=this.#R?.(e,o,a);if(y&&y instanceof Promise)y.then((b)=>h(b===void 0?void 0:b),_);i.signal.addEventListener("abort",()=>{if(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort){if(h(void 0),r.allowStaleOnFetchAbort)h=(b)=>c(b,!0)}})};if(r.status)r.status.fetchDispatched=!0;let m=new Promise(f).then(c,u),g=Object.assign(m,{__abortController:i,__staleWhileFetching:o,__returned:void 0});if(t===void 0)this.set(e,g,{...a.options,status:void 0}),t=this.#o.get(e);else this.#e[t]=g;return g}#t(e){if(!this.#A)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof gy}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:h,forceRefresh:_=!1,status:y,signal:b}=t;if(!this.#A){if(y)y.fetch="get";return this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,status:y})}let T={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:i,noDisposeOnSet:s,size:a,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:g,ignoreFetchAbort:m,status:y,signal:b},w=this.#o.get(e);if(w===void 0){if(y)y.fetch="miss";let k=this.#L(e,w,T,h);return k.__returned=k}else{let k=this.#e[w];if(this.#t(k)){let ke=r&&k.__staleWhileFetching!==void 0;if(y){if(y.fetch="inflight",ke)y.returnedStale=!0}return ke?k.__staleWhileFetching:k.__returned=k}let P=this.#m(w);if(!_&&!P){if(y)y.fetch="hit";if(this.#C(w),n)this.#k(w);if(y)this.#T(y,w);return k}let te=this.#L(e,w,T,h),Oe=te.__staleWhileFetching!==void 0&&r;if(y){if(y.fetch=P?"stale":"refresh",Oe&&P)y.returnedStale=!0}return Oe?te.__staleWhileFetching:te.__returned=te}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#I;if(!r)throw Error("no memoMethod provided to constructor");let{context:n,forceRefresh:o,...i}=t,s=this.get(e,i);if(!o&&s!==void 0)return s;let a=r(e,s,{options:i,context:n});return this.set(e,a,i),a}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:i}=t,s=this.#o.get(e);if(s!==void 0){let a=this.#e[s],c=this.#t(a);if(i)this.#T(i,s);if(this.#m(s)){if(i)i.get="stale";if(!c){if(!o)this.#w(e,"expire");if(i&&r)i.returnedStale=!0;return r?a:void 0}else{if(i&&r&&a.__staleWhileFetching!==void 0)i.returnedStale=!0;return r?a.__staleWhileFetching:void 0}}else{if(i)i.get="hit";if(c)return a.__staleWhileFetching;if(this.#C(s),n)this.#k(s);return a}}else if(i)i.get="miss"}#j(e,t){this.#d[t]=e,this.#l[e]=t}#C(e){if(e!==this.#s){if(e===this.#c)this.#c=this.#l[e];else this.#j(this.#d[e],this.#l[e]);this.#j(this.#s,e),this.#s=e}}delete(e){return this.#w(e,"delete")}#w(e,t){let r=!1;if(this.#i!==0){let n=this.#o.get(e);if(n!==void 0)if(r=!0,this.#i===1)this.#F(t);else{this.#O(n);let o=this.#e[n];if(this.#t(o))o.__abortController.abort(Error("deleted"));else if(this.#v||this.#u){if(this.#v)this.#g?.(o,e,t);if(this.#u)this.#a?.push([o,e,t])}if(this.#o.delete(e),this.#r[n]=void 0,this.#e[n]=void 0,n===this.#s)this.#s=this.#d[n];else if(n===this.#c)this.#c=this.#l[n];else{let i=this.#d[n];this.#l[i]=this.#l[n];let s=this.#l[n];this.#d[s]=this.#d[n]}this.#i--,this.#y.push(n)}}if(this.#u&&this.#a?.length){let n=this.#a,o;while(o=n?.shift())this.#h?.(...o)}return r}clear(){return this.#F("delete")}#F(e){for(let t of this.#E({allowStale:!0})){let r=this.#e[t];if(this.#t(r))r.__abortController.abort(Error("deleted"));else{let n=this.#r[t];if(this.#v)this.#g?.(r,n,e);if(this.#u)this.#a?.push([r,n,e])}}if(this.#o.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#f&&this.#x)this.#f.fill(0),this.#x.fill(0);if(this.#b)this.#b.fill(0);if(this.#c=0,this.#s=0,this.#y.length=0,this.#_=0,this.#i=0,this.#u&&this.#a){let t=this.#a,r;while(r=t?.shift())this.#h?.(...r)}}}function Iq(e,t,r=100){let n=new hy({max:r}),o=(...i)=>{let s=t(...i),a=n.get(s);if(a!==void 0)return a;let c=e(...i);return n.set(s,c),c};return o.cache={clear:()=>n.clear(),size:()=>n.size,delete:(i)=>n.delete(i),get:(i)=>n.peek(i),has:(i)=>n.has(i)},o}var M0e=8192;function Dq(e,t){try{return{ok:!0,value:JSON.parse(my(e))}}catch(r){if(t)sh(FI(r,`safeParseJSON: invalid JSON (${r instanceof Error?r.constructor.name:typeof r}, ${e.length} bytes)`));return{ok:!1}}}var Pq=Iq(Dq,(e)=>e,50);var Mc=Object.assign(function(t,r=!0){if(!t)return null;let n=t.length>M0e?Dq(t,r):Pq(t,r);return n.ok?n.value:null},{cache:Pq.cache});import{join as U0e}from"path";var xs=re(function(){switch(no()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),Qxt=re(function(){return U0e(xs(),"managed-settings.d")});var $0e=function(){try{var e=or(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),Uc=$0e;function j0e(e,t,r){if(t=="__proto__"&&Uc)Uc(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0});else e[t]=r}var $c=j0e;function F0e(e,t,r){if(r!==void 0&&!An(e[t],r)||r===void 0&&!(t in e))$c(e,t,r)}var Cd=F0e;function z0e(e){return function(t,r,n){var o=-1,i=Object(t),s=n(t),a=s.length;while(a--){var c=s[e?a:++o];if(r(i[c],c,i)===!1)break}return t}}var Lq=z0e;var B0e=Lq(),Nq=B0e;var yy={};lt(yy,{default:()=>Pk});var jq=typeof yy=="object"&&yy&&!yy.nodeType&&yy,Mq=jq&&typeof _y=="object"&&_y&&!_y.nodeType&&_y,H0e=Mq&&Mq.exports===jq,Uq=H0e?gt.Buffer:void 0,$q=Uq?Uq.allocUnsafe:void 0;function q0e(e,t){if(t)return e.slice();var r=e.length,n=$q?$q(r):new e.constructor(r);return e.copy(n),n}var Pk=q0e;function G0e(e){var t=new e.constructor(e.byteLength);return new Pa(t).set(new Pa(e)),t}var Fq=G0e;function W0e(e,t){var r=t?Fq(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var zq=W0e;function V0e(e,t){var r=-1,n=e.length;t||(t=Array(n));while(++r<n)t[r]=e[r];return t}var Bq=V0e;var Hq=Object.create,K0e=function(){function e(){}return function(t){if(!Et(t))return{};if(Hq)return Hq(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),qq=K0e;var Z0e=Hg(Object.getPrototypeOf,Object),jc=Z0e;function J0e(e){return typeof e.constructor=="function"&&!Ma(e)?qq(jc(e)):{}}var Gq=J0e;function Y0e(e){return Qt(e)&&zo(e)}var Wq=Y0e;var X0e="[object Object]",Q0e=Function.prototype,eLe=Object.prototype,Vq=Q0e.toString,tLe=eLe.hasOwnProperty,rLe=Vq.call(Object);function nLe(e){if(!Qt(e)||vr(e)!=X0e)return!1;var t=jc(e);if(t===null)return!0;var r=tLe.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Vq.call(r)==rLe}var Kq=nLe;function oLe(e,t){if(t==="constructor"&&typeof e[t]==="function")return;if(t=="__proto__")return;return e[t]}var Rd=oLe;var iLe=Object.prototype,sLe=iLe.hasOwnProperty;function aLe(e,t,r){var n=e[t];if(!(sLe.call(e,t)&&An(n,r))||r===void 0&&!(t in e))$c(e,t,r)}var by=aLe;function cLe(e,t,r,n){var o=!r;r||(r={});var i=-1,s=t.length;while(++i<s){var a=t[i],c=n?n(r[a],e[a],a,r,e):void 0;if(c===void 0)c=e[a];if(o)$c(r,a,c);else by(r,a,c)}return r}var Zq=cLe;function lLe(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var Jq=lLe;var uLe=Object.prototype,pLe=uLe.hasOwnProperty;function dLe(e){if(!Et(e))return Jq(e);var t=Ma(e),r=[];for(var n in e)if(!(n=="constructor"&&(t||!pLe.call(e,n))))r.push(n);return r}var Yq=dLe;function fLe(e){return zo(e)?Bg(e,!0):Yq(e)}var Fc=fLe;function mLe(e){return Zq(e,Fc(e))}var Xq=mLe;function gLe(e,t,r,n,o,i,s){var a=Rd(e,r),c=Rd(t,r),u=s.get(c);if(u){Cd(e,r,u);return}var d=i?i(a,c,r+"",e,t,s):void 0,f=d===void 0;if(f){var m=at(c),g=!m&&jo(c),h=!m&&!g&&Na(c);if(d=c,m||g||h)if(at(a))d=a;else if(Wq(a))d=Bq(a);else if(g)f=!1,d=Pk(c,!0);else if(h)f=!1,d=zq(c,!0);else d=[];else if(Kq(c)||ro(c)){if(d=a,ro(a))d=Xq(a);else if(!Et(a)||Rs(a))d=Gq(c)}else f=!1}if(f)s.set(c,d),o(d,c,n,i,s),s.delete(c);Cd(e,r,d)}var Qq=gLe;function eG(e,t,r,n,o){if(e===t)return;Nq(t,function(i,s){if(o||(o=new $o),Et(i))Qq(e,t,s,r,eG,n,o);else{var a=n?n(Rd(e,s),i,s+"",e,t,o):void 0;if(a===void 0)a=i;Cd(e,s,a)}},Fc)}var tG=eG;function hLe(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var rG=hLe;var nG=Math.max;function _Le(e,t,r){return t=nG(t===void 0?e.length-1:t,0),function(){var n=arguments,o=-1,i=nG(n.length-t,0),s=Array(i);while(++o<i)s[o]=n[t+o];o=-1;var a=Array(t+1);while(++o<t)a[o]=n[o];return a[t]=r(s),rG(e,this,a)}}var xy=_Le;function yLe(e){return function(){return e}}var oG=yLe;var bLe=!Uc?Fa:function(e,t){return Uc(e,"toString",{configurable:!0,enumerable:!1,value:oG(t),writable:!0})},iG=bLe;var xLe=800,vLe=16,SLe=Date.now;function ELe(e){var t=0,r=0;return function(){var n=SLe(),o=vLe-(n-r);if(r=n,o>0){if(++t>=xLe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var sG=ELe;var wLe=sG(iG),vy=wLe;function TLe(e,t){return vy(xy(e,t,Fa),e+"")}var aG=TLe;function ALe(e,t,r){if(!Et(r))return!1;var n=typeof t;if(n=="number"?zo(r)&&Fo(t,r.length):n=="string"&&(t in r))return An(r[t],e);return!1}var cG=ALe;function kLe(e){return aG(function(t,r){var n=-1,o=r.length,i=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;if(i=e.length>3&&typeof i=="function"?(o--,i):void 0,s&&cG(r[0],r[1],s))i=o<3?void 0:i,o=1;t=Object(t);while(++n<o){var a=r[n];if(a)e(t,a,n,i)}return t})}var lG=kLe;var OLe=lG(function(e,t,r,n){tG(e,t,r,n)}),En=OLe;function CLe(e,t,r,n){if(!Et(e))return e;t=Bo(t,e);var o=-1,i=t.length,s=i-1,a=e;while(a!=null&&++o<i){var c=Pn(t[o]),u=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(o!=s){var d=a[c];if(u=n?n(d,c,a):void 0,u===void 0)u=Et(d)?d:Fo(t[o+1])?[]:{}}by(a,c,u),a=a[c]}return e}var uG=CLe;function RLe(e,t,r){var n=-1,o=t.length,i={};while(++n<o){var s=t[n],a=ja(e,s);if(r(a,s))uG(i,Bo(s,e),a)}return i}var Sy=RLe;function ILe(e,t){return Sy(e,t,function(r,n){return eh(e,n)})}var pG=ILe;var dG=Zt?Zt.isConcatSpreadable:void 0;function PLe(e){return at(e)||ro(e)||!!(dG&&e&&e[dG])}var fG=PLe;function mG(e,t,r,n,o){var i=-1,s=e.length;r||(r=fG),o||(o=[]);while(++i<s){var a=e[i];if(t>0&&r(a))if(t>1)mG(a,t-1,r,n,o);else Da(o,a);else if(!n)o[o.length]=a}return o}var gG=mG;function DLe(e){var t=e==null?0:e.length;return t?gG(e,1):[]}var hG=DLe;function LLe(e){return vy(xy(e,void 0,hG),e+"")}var _G=LLe;var NLe=_G(function(e,t){return e==null?{}:pG(e,t)}),Ey=NLe;import{homedir as kMe}from"os";import{dirname as OMe,join as Tn,resolve as Zr}from"path";var MLe="Expected a function";function ULe(e){if(typeof e!="function")throw TypeError(MLe);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}var yG=ULe;var $Le=Object.getOwnPropertySymbols,jLe=!$Le?Ng:function(e){var t=[];while(e)Da(t,Mg(e)),e=jc(e);return t},bG=jLe;function FLe(e){return Lg(e,Fc,bG)}var xG=FLe;function zLe(e,t){if(e==null)return{};var r=Qg(xG(e),function(n){return[n]});return t=th(t),Sy(e,r,function(n,o){return t(n,o[0])})}var vG=zLe;function BLe(e,t){return vG(e,yG(th(t)))}var SG=BLe;import{join as VLe}from"path";var Dk=["CLAUDE_CODE_USE_BEDROCK","CLAUDE_CODE_USE_VERTEX","CLAUDE_CODE_USE_FOUNDRY","CLAUDE_CODE_USE_ANTHROPIC_AWS","CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD","CLAUDE_CODE_USE_MANTLE","CLAUDE_CODE_USE_GATEWAY","ANTHROPIC_FOUNDRY_RESOURCE","ANTHROPIC_VERTEX_PROJECT_ID","ANTHROPIC_AWS_WORKSPACE_ID","ANTHROPIC_GOOGLE_CLOUD_PROJECT","ANTHROPIC_GOOGLE_CLOUD_LOCATION","ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID","CLOUD_ML_REGION"];var Lk=["ANTHROPIC_BASE_URL","_CLAUDE_CODE_ASSUME_FIRST_PARTY_BASE_URL","ANTHROPIC_BEDROCK_BASE_URL","ANTHROPIC_VERTEX_BASE_URL","ANTHROPIC_FOUNDRY_BASE_URL","ANTHROPIC_AWS_BASE_URL","ANTHROPIC_GOOGLE_CLOUD_BASE_URL","ANTHROPIC_BEDROCK_MANTLE_BASE_URL","CLAUDE_CODE_ARTIFACTS_API_BASE_URL"];var Nk=["ANTHROPIC_API_KEY","ANTHROPIC_AUTH_TOKEN","CLAUDE_CODE_OAUTH_TOKEN","AWS_BEARER_TOKEN_BEDROCK","ANTHROPIC_FOUNDRY_API_KEY","ANTHROPIC_FOUNDRY_AUTH_TOKEN","ANTHROPIC_AWS_API_KEY"],HLe=["CLAUDE_CODE_SKIP_BEDROCK_AUTH","CLAUDE_CODE_SKIP_VERTEX_AUTH","CLAUDE_CODE_SKIP_FOUNDRY_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH","CLAUDE_CODE_SKIP_ANTHROPIC_GOOGLE_CLOUD_AUTH","CLAUDE_CODE_SKIP_MANTLE_AUTH"],qLe=["ANTHROPIC_MODEL","ANTHROPIC_DEFAULT_FABLE_MODEL","ANTHROPIC_DEFAULT_FABLE_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_FABLE_MODEL_NAME","ANTHROPIC_DEFAULT_FABLE_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_HAIKU_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME","ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_OPUS_MODEL","ANTHROPIC_DEFAULT_OPUS_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_OPUS_MODEL_NAME","ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_DEFAULT_SONNET_MODEL","ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION","ANTHROPIC_DEFAULT_SONNET_MODEL_NAME","ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES","ANTHROPIC_SMALL_FAST_MODEL","ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION","CLAUDE_CODE_SUBAGENT_MODEL","CLAUDE_CODE_3P_PROBE_WROTE_SONNET_DEFAULT","CLAUDE_CODE_3P_PROBE_WROTE_OPUS_DEFAULT"];var GLe=["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_SESSION_TOKEN"],WLe=[...GLe,"AWS_PROFILE","AWS_CONFIG_FILE","AWS_SHARED_CREDENTIALS_FILE","GOOGLE_APPLICATION_CREDENTIALS","GOOGLE_CLOUD_PROJECT"];var qEt=new Set(["CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST",...Dk,...Lk,...Nk,...HLe,"CLAUDE_CODE_HOST_AUTH_ENV_VAR","CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH","CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS","CLAUDE_CODE_HOST_CREDS_FILE",...WLe,"GCLOUD_PROJECT","GOOGLE_CLOUD_QUOTA_PROJECT","GCE_METADATA_HOST","GCE_METADATA_IP","METADATA_SERVER_DETECTION","AWS_CONTAINER_CREDENTIALS_FULL_URI","AWS_CONTAINER_CREDENTIALS_RELATIVE_URI","AWS_CONTAINER_AUTHORIZATION_TOKEN","AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE","AWS_EC2_METADATA_SERVICE_ENDPOINT","AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE","AWS_REGION","AWS_DEFAULT_REGION",...qLe,"ANTHROPIC_BEDROCK_SERVICE_TIER","CLAUDE_CODE_CERT_STORE","DISABLE_GROWTHBOOK"]);var KLe="remote-settings.json",Mk=null,ZLe;var JLe=null,YLe=null;function Uk(){return}function XLe(){return Uk()??VLe(Yt(),KLe)}function QLe(){try{let e=bs(XLe()),t=yt(my(e));if(!t||typeof t!=="object"||Array.isArray(t))return null;return t}catch{return null}}var eNe=new Set(["HTTPS_PROXY","HTTP_PROXY","NO_PROXY","CLAUDE_CODE_PROXY_RESOLVES_HOSTS","CLAUDE_CODE_ENABLE_PROXY_AUTH_HELPER","CLAUDE_CODE_PROXY_AUTH_HELPER_TTL_MS","API_FORCE_IDLE_TIMEOUT","ANTHROPIC_UNIX_SOCKET","NODE_EXTRA_CA_CERTS","CLAUDE_CODE_CERT_STORE","CLAUDE_CODE_CLIENT_CERT","CLAUDE_CODE_CLIENT_KEY","CLAUDE_CODE_CLIENT_KEY_PASSPHRASE","ALL_PROXY","NODE_OPTIONS","NODE_TLS_REJECT_UNAUTHORIZED",...Dk,...Lk,"CLAUDE_CODE_CUSTOM_OAUTH_URL",...Nk,"ANTHROPIC_CUSTOM_HEADERS","CLAUDE_CODE_HOST_CREDS_FILE","CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST","CLAUDE_CODE_HOST_AUTH_ENV_VAR","CLAUDE_CONFIG_DIR","CLAUDE_SECURESTORAGE_CONFIG_DIR","CLAUDE_CODE_REMOTE_SETTINGS_PATH","CLAUDE_CODE_MOCK_REMOTE_SETTINGS","USE_LOCAL_OAUTH","USE_STAGING_OAUTH","CLAUDE_LOCAL_OAUTH_API_BASE"].map((e)=>e.toUpperCase()));function tNe(e){if(!e?.env)return e;let t=SG(e.env,(r,n)=>eNe.has(n.toUpperCase()));return{...e,env:t}}function rNe(){if(!Uk()&&ZLe!==!0)return null;if(Mk)return Mk;let e=QLe();if(e)return Mk=e,YLe??=e,qi(),e;return null}function EG(){let e=rNe();if(e===JLe||Uk())return e;return tNe(e)}var wG=["userSettings","projectSettings","localSettings","flagSettings","policySettings"];import{userInfo as nNe}from"os";var TG="com.anthropic.claudecode",Id="HKLM\\SOFTWARE\\Policies\\ClaudeCode",Pd="HKCU\\SOFTWARE\\Policies\\ClaudeCode",pi="Settings",AG="/usr/bin/plutil",kG=["-convert","json","-o","-","--"],OG=5000,$k="/mnt/c/Windows/System32/reg.exe",zc="/mnt/c/Program Files/ClaudeCode";function wy(){if(process.platform!=="linux")return!1;if(process.env.WSL_DISTRO_NAME)return!0;try{let e=be("fs").readFileSync("/proc/version","utf8").toLowerCase();return e.includes("microsoft")||e.includes("wsl")}catch{return!1}}function CG(){let e="";try{e=nNe().username}catch{}let t=[];if(e)t.push({path:`/Library/Managed Preferences/${e}/${TG}.plist`,label:"per-user managed preferences"});return t.push({path:`/Library/Managed Preferences/${TG}.plist`,label:"device-level managed preferences"}),t}import{isAbsolute as RG}from"path";var oNe=C(()=>l.object({allowedDomains:l.array(l.string()).optional(),deniedDomains:l.array(l.string()).optional().describe("Domains that are always blocked, even if matched by allowedDomains. Supports the same wildcard syntax as allowedDomains. Merged from all settings sources regardless of allowManagedDomainsOnly."),strictAllowlist:l.boolean().optional().describe("When true, the sandbox runtime deterministically denies hosts not in allowedDomains instead of prompting. "+"Enforced for sandboxed commands only — in-process tools such as WebFetch are not gated by this setting. "+"Only honored from user, managed/policy, or CLI (--settings) settings — "+"project settings (.claude/settings.json and .claude/settings.local.json) are ignored."),allowManagedDomainsOnly:l.boolean().optional().describe("When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources."),allowUnixSockets:l.array(l.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:l.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:l.boolean().optional(),allowMachLookup:l.array(l.string().refine((e)=>!(e.endsWith("*")?e.slice(0,-1):e).includes("*"),{message:'Wildcards are only allowed as a single trailing "*" (e.g., "com.example.*" or "*" for all services).'})).optional().describe('macOS only: Additional XPC/Mach service names to allow looking up. Supports trailing-wildcard prefix matching (e.g., "com.apple.coresimulator.*"). Needed for tools that communicate via XPC such as the iOS Simulator or Playwright.'),httpProxyPort:l.number().optional(),socksProxyPort:l.number().optional(),tlsTerminate:l.object({caCertPath:l.string().min(1).optional(),caKeyPath:l.string().min(1).optional()}).optional().describe("[EXPERIMENTAL] Enable in-process TLS termination so the per-request filter can see HTTPS request bodies. Provide a CA cert+key, or omit both to have sandbox-runtime generate an ephemeral one for the session. "+"Only honored from user, managed/policy, or CLI (`--settings`) settings — project settings "+"(.claude/settings.json and .claude/settings.local.json) are ignored.")}).optional()),iNe=C(()=>l.object({allowWrite:l.array(l.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules."),denyWrite:l.array(l.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:l.array(l.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:l.array(l.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths."),allowManagedReadPathsOnly:l.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used."),disabled:l.boolean().optional().describe("macOS and Linux/WSL only: skip filesystem isolation entirely while keeping network and seccomp isolation. Ignored on native Windows, where the sandboxed process runs as a separate user with no inherent rights, so skipping the filesystem rules would "+"withhold every access grant rather than loosen them — filesystem isolation stays on there. "+"Sandboxed commands get unrestricted read/write access to the host filesystem; network egress is still confined to network.allowedDomains. Intended for deployments whose goal is egress control rather than filesystem containment. Does not change Bash prompting: sandbox.autoAllowBashIfSandboxed is independent and still defaults to true, so set it to false to keep prompting for sandboxed commands. Drops the read protection from filesystem.denyRead and credentials.files for sandboxed commands, since both are enforced by the filesystem layer this turns off; credentials.envVars deny/mask is unaffected. "+"Only honored from user, managed/policy, or CLI (`--settings`) settings — "+"project settings (.claude/settings.json and .claude/settings.local.json) are ignored. If managed settings configure sandbox.filesystem at all, or list any sandbox.credentials.files entry, only managed settings can set this: an admin who deployed filesystem restrictions must not have them switched off by a user-writable "+"file. (sandbox.credentials.envVars does not pin it — env scrubbing is independent of "+"the filesystem layer and survives this setting.) When unset, filesystem isolation stays on.")}).optional()),jk=C(()=>l.object({path:l.string().min(1).describe("Path to a credential file or directory. Same resolution as sandbox.filesystem.* paths: absolute, ~ expanded, or relative to the settings file root (project root for project settings, ~/.claude for user settings)."),mode:l.literal("deny").describe("Access mode for this path. Only `deny` is supported.")})),Fk=C(()=>l.object({name:l.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/,"Environment variable name must start with a letter or underscore and contain only letters, digits, and underscores").describe("Environment variable name."),mode:l.enum(["deny","mask"]).describe("Access mode for this environment variable. `deny` unsets the variable for sandboxed commands; `mask` shows sandboxed commands a sentinel value and the "+"host proxy swaps sentinel→real on egress to `injectHosts`."),injectHosts:l.array(l.string()).optional().describe("Optional narrowing of where the proxy substitutes this credential. Only meaningful when mode is `mask`; accepted but ignored for `deny`. If unset, defaults to "+"`network.allowedDomains` — the credential is injected at "+"every reachable host. Each entry must be reachable via `network.allowedDomains` (sandbox-runtime validates this).")})),sNe=C(()=>l.object({files:l.array(jk()).optional().describe("Credential files or directories to protect. `deny` blocks reads inside the sandbox."),envVars:l.array(Fk()).optional().describe("Environment variables to protect. `deny` unsets the variable for sandboxed commands; `mask` substitutes a sentinel inside the sandbox and injects the real value at the proxy."),allowPlaintextInject:l.boolean().optional().describe("Allow sentinel→real substitution on the plain-HTTP proxy path. "+"Defaults to false: without TLS termination the upstream identity is unverified and the credential travels in cleartext. Set only for trusted-network test fixtures. Only honored from user, managed/policy, or CLI (`--settings`) "+"settings — project settings (.claude/settings.json and "+".claude/settings.local.json) are ignored.")}).optional()),zk=C(()=>l.object({enabled:l.boolean().optional(),failIfUnavailable:l.boolean().optional().describe("Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies or unsupported platform). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate."),autoAllowBashIfSandboxed:l.boolean().optional(),allowUnsandboxedCommands:l.boolean().optional().describe("Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."),network:oNe(),filesystem:iNe(),credentials:sNe(),ignoreViolations:l.record(l.string(),l.array(l.string())).optional(),enableWeakerNestedSandbox:l.boolean().optional(),enableWeakerNetworkIsolation:l.boolean().optional().describe("macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. "+"**Reduces security** — opens a potential data exfiltration vector through the trustd service. Default: false"),allowAppleEvents:l.boolean().optional().describe("macOS only: Allow sandboxed commands to send Apple Events (and look up the appleeventsd Mach service). Needed for `open`, `osascript`, and browser-based auth flows that open URLs. "+"**Removes code-execution isolation** — sandboxed commands can launch other applications "+"unsandboxed with no user prompt, and can script running apps (e.g. Terminal) subject to the user's per-app TCC automation consent. "+"Only honored from user, managed/policy, or CLI (--settings) settings — "+"project settings (.claude/settings.json and .claude/settings.local.json) are ignored. Default: false"),excludedCommands:l.array(l.string()).optional(),ripgrep:l.object({command:l.string(),args:l.array(l.string()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support"),bwrapPath:l.preprocess((e)=>typeof e==="string"&&RG(e)?e:void 0,l.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the bwrap (bubblewrap) binary. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings."),socatPath:l.preprocess((e)=>typeof e==="string"&&RG(e)?e:void 0,l.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the socat binary used for the sandbox network proxy. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings.")}).passthrough());var Dd=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],IG=[...Dd],PG=IG;function Ld(e){return e==="manual"?"default":e}var pwt=`Cannot set permission mode: must be one of ${IG.join(", ")}`;var DG=["auto","iterm2","terminal_bell","iterm2_with_bell","kitty","ghostty","notifications_disabled"],LG=["normal","vim"],NG=["auto","tmux","iterm2","in-process"],aNe=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],MG=["auto",...aNe];var gwt=no()==="macos"?"⏺":"●";var Ewt=C(()=>ru.preprocess(Ld,ru.enum(PG))),wwt=C(()=>ru.preprocess(Ld,ru.enum(Dd)));var UG=["bash","powershell"];var Nd=C(()=>l.string().optional().describe('Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.'));function cNe(){let e=l.object({type:l.literal("command").describe("Shell command hook type"),command:l.string().describe("Shell command to execute"),args:l.array(l.string()).optional().describe("Argument list for exec form. When present, `command` is resolved as "+"an executable and spawned directly with these arguments — no shell. "+"Path placeholders like ${CLAUDE_PLUGIN_ROOT} are substituted per-element as plain strings, so paths with quotes, $, or backticks never reach a shell parser. When absent, `command` runs through a shell (bash on POSIX, PowerShell on Windows without Git Bash)."),if:Nd(),shell:l.enum(UG).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."),timeout:l.number().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:l.string().optional().describe("Custom status message to display in spinner while hook runs"),once:l.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:l.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:l.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),rewakeMessage:l.string().min(1).optional().describe("@internal Custom prefix for the system-reminder shown to the model when an asyncRewake hook exits with code 2. The hook output is appended after this prefix."),rewakeSummary:l.string().min(1).optional().describe('@internal One-line summary shown to the user in the terminal when an asyncRewake hook exits with code 2. Defaults to "Stop hook feedback".')}),t=l.object({type:l.literal("prompt").describe("LLM prompt hook type"),prompt:l.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:Nd(),timeout:l.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:l.string().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-5"). If not specified, uses the default small fast model.'),continueOnBlock:l.boolean().optional().describe(`Sets the continue value for the decision:"block" produced when ok is false. Default false (turn ends). Whether continue:true lets the turn proceed depends on the event's decision:"block" semantics. On PostToolUse, the reason is fed back to Claude and the turn continues.`),statusMessage:l.string().optional().describe("Custom status message to display in spinner while hook runs"),once:l.boolean().optional().describe("If true, hook runs once and is removed after execution")}),r=l.object({type:l.literal("mcp_tool").describe("MCP tool hook type"),server:l.string().describe("Name of an already-configured MCP server to invoke"),tool:l.string().describe("Name of the tool on that server to call"),input:l.record(l.string(),l.unknown()).optional().describe('Arguments passed to the MCP tool. String values support ${path} interpolation from the hook input JSON (e.g. "${tool_input.file_path}").'),if:Nd(),timeout:l.number().positive().optional().describe("Timeout in seconds for this specific tool call"),statusMessage:l.string().optional().describe("Custom status message to display in spinner while hook runs"),once:l.boolean().optional().describe("If true, hook runs once and is removed after execution")}),n=l.object({type:l.literal("http").describe("HTTP hook type"),url:l.string().url().describe("URL to POST the hook input JSON to"),if:Nd(),timeout:l.number().positive().optional().describe("Timeout in seconds for this specific request"),headers:l.record(l.string(),l.string()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:l.array(l.string()).optional().describe("Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work."),statusMessage:l.string().optional().describe("Custom status message to display in spinner while hook runs"),once:l.boolean().optional().describe("If true, hook runs once and is removed after execution")}),o=l.object({type:l.literal("agent").describe("Agentic verifier hook type"),prompt:l.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:Nd(),timeout:l.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:l.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-5"). If not specified, uses Haiku.'),statusMessage:l.string().optional().describe("Custom status message to display in spinner while hook runs"),once:l.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:e,PromptHookSchema:t,HttpHookSchema:n,AgentHookSchema:o,McpToolHookSchema:r}}var $G=C(()=>{let{BashCommandHookSchema:e,PromptHookSchema:t,AgentHookSchema:r,HttpHookSchema:n,McpToolHookSchema:o}=cNe();return l.discriminatedUnion("type",[e,t,r,n,o])}),jG=C(()=>l.object({matcher:l.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:l.array($G()).describe("List of hooks to execute when the matcher matches")})),vs=C(()=>l.partialRecord(l.enum(Os),l.array(jG())));var Lwt=C(()=>l.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),Nwt=C(()=>l.enum(["stdio","sse","sse-ide","http","ws","sdk"])),Bc=C(()=>l.literal("comms").optional().catch(void 0)),di=C(()=>l.number().int().positive()),lNe=300000,FG=C(()=>l.number().int().positive().optional().catch(void 0).describe("@internal CCR backend wire hint; folded into timeout at parse."));function zG({request_timeout_ms:e,...t}){return{...t,...t.timeout===void 0&&e!==void 0&&{timeout:Math.min(e,lNe)}}}var uNe=C(()=>l.object({type:l.literal("stdio").optional(),command:l.string().min(1,"Command cannot be empty"),args:l.array(l.string()).default([]),env:l.record(l.string(),l.string()).optional(),timeout:di().optional(),alwaysLoad:l.boolean().optional(),role:Bc()})),pNe=C(()=>l.boolean()),BG=C(()=>l.object({clientId:l.string().optional(),callbackPort:l.number().int().positive().optional(),authServerMetadataUrl:l.string().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:l.string().min(1).optional(),xaa:pNe().optional()})),HG=C(()=>l.object({name:l.string(),permission_policy:l.enum(["always_allow","always_ask","always_deny"]).optional()})),dNe=C(()=>l.object({type:l.literal("sse"),url:l.string(),headers:l.record(l.string(),l.string()).optional(),headersHelper:l.string().optional(),oauth:BG().optional(),timeout:di().optional(),request_timeout_ms:FG(),tools:l.array(HG()).optional(),alwaysLoad:l.boolean().optional(),role:Bc(),toolPermissions:l.record(l.string(),Bk()).optional(),discoveryCache:l.boolean().optional()}).transform(zG)),fNe=C(()=>l.object({type:l.literal("sse-ide"),url:l.string(),ideName:l.string(),ideRunningInWindows:l.boolean().optional(),timeout:di().optional(),alwaysLoad:l.boolean().optional(),role:Bc()})),mNe=C(()=>l.object({type:l.literal("ws-ide"),url:l.string(),ideName:l.string(),authToken:l.string().optional(),ideRunningInWindows:l.boolean().optional(),timeout:di().optional(),alwaysLoad:l.boolean().optional(),role:Bc()})),gNe=C(()=>l.object({type:l.enum(["http","streamable-http"]).transform(()=>"http"),url:l.string(),headers:l.record(l.string(),l.string()).optional(),headersHelper:l.string().optional(),oauth:BG().optional(),timeout:di().optional(),request_timeout_ms:FG(),tools:l.array(HG()).optional(),alwaysLoad:l.boolean().optional(),role:Bc(),toolPermissions:l.record(l.string(),Bk()).optional(),discoveryCache:l.boolean().optional()}).transform(zG)),hNe=C(()=>l.object({type:l.literal("ws"),url:l.string(),headers:l.record(l.string(),l.string()).optional(),headersHelper:l.string().optional(),timeout:di().optional(),alwaysLoad:l.boolean().optional(),role:Bc()})),_Ne=C(()=>l.object({type:l.literal("sdk"),name:l.string(),timeout:di().optional(),alwaysLoad:l.boolean().optional()})),Bk=C(()=>l.enum(["allow","ask","blocked"])),yNe=C(()=>l.object({type:l.literal("claudeai-proxy"),url:l.string(),id:l.string(),displayName:l.string().optional(),iconUrl:l.string().optional(),timeout:di().optional(),alwaysLoad:l.boolean().optional(),toolPermissions:l.record(l.string(),Bk()).optional(),stateless:l.boolean().optional(),cachedInitResponse:l.record(l.string(),l.unknown()).nullish(),eligible:l.boolean().nullish(),ineligibleReason:l.string().nullish()})),Ty=C(()=>l.union([uNe(),dNe(),fNe(),mNe(),gNe(),hNe(),_Ne(),yNe()]));var Mwt=C(()=>l.object({mcpServers:l.record(l.string(),Ty())}));var bNe=new Set(["claude-community","claude-plugins-community","healthcare"]),xNe=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","anthropic-agent-skills","life-sciences","knowledge-work-plugins","claude-for-legal","claude-for-financial-services","financial-services-plugins","first-party-plugins"]),VG=new Set([...xNe,...bNe]);var vNe=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,SNe=/[^\u0020-\u007E]/;function ENe(e){if(VG.has(e.toLowerCase()))return!1;if(SNe.test(e))return!0;return vNe.test(e)}var wn=C(()=>l.string().startsWith("./")),Ss=C(()=>wn().endsWith(".json")),qG=C(()=>l.union([wn().refine((e)=>e.endsWith(".mcpb")||e.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),l.string().url().refine((e)=>e.endsWith(".mcpb")||e.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),qk=C(()=>wn().endsWith(".md")),Gk=C(()=>l.union([qk(),wn()])),KG=C(()=>l.string().min(1,"Marketplace must have a name").refine((e)=>!e.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine((e)=>!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&e!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine((e)=>!ENe(e),{message:"Marketplace name impersonates an official Anthropic/Claude marketplace"}).refine((e)=>e.toLowerCase()!=="inline",{message:'Marketplace name "inline" is reserved for --plugin-dir session plugins'}).refine((e)=>e.toLowerCase()!=="builtin",{message:'Marketplace name "builtin" is reserved for built-in plugins'}).refine((e)=>e.toLowerCase()!=="skills-dir",{message:'Marketplace name "skills-dir" is reserved for plugins auto-loaded from .claude/skills/'})),Wk=C(()=>l.object({name:l.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:l.string().optional().describe("Contact email for support or feedback"),url:l.string().optional().describe("Website, GitHub profile, or organization URL")})),wNe=C(()=>l.object({$schema:l.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:l.string().min(1,"Plugin name cannot be empty").refine((e)=>!e.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),displayName:l.string().optional().describe('Human-readable name shown in UI (e.g., "GitHub Utils"). Falls back to `name` when omitted. Unlike `name`, may contain spaces and any casing; not used for namespacing or lookup.'),version:l.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:l.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:Wk().optional().describe("Information about the plugin creator or maintainer"),homepage:l.string().url().optional().describe("Plugin homepage or documentation URL"),repository:l.string().optional().describe("Source code repository URL"),license:l.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:l.array(l.string()).optional().describe("Tags for plugin discovery and categorization"),defaultEnabled:l.boolean().optional().describe("Whether the plugin starts enabled when the user has no explicit enabled/disabled setting for it (default: true). Explicit enabledPlugins values always win, and a plugin required by an enabled dependent is enabled regardless of this value."),dependencies:l.array(oMe()).optional().describe(`Plugins that must be enabled for this plugin to function. Bare names (no "@marketplace") are resolved against the declaring plugin's own marketplace.`)})),Kwt=C(()=>l.object({description:l.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:l.lazy(()=>vs()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),TNe=C(()=>l.object({hooks:l.union([Ss().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),l.lazy(()=>vs()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),l.array(l.union([Ss().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),l.lazy(()=>vs()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),ANe=C(()=>l.object({source:Gk().optional().describe("Path to command markdown file, relative to plugin root"),content:l.string().optional().describe("Inline markdown content for the command"),description:l.string().optional().describe("Command description override"),argumentHint:l.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:l.string().optional().describe("Default model for this command"),allowedTools:l.array(l.string()).optional().describe("Tools allowed when command runs")}).refine((e)=>e.source&&!e.content||!e.source&&e.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),kNe=C(()=>l.object({commands:l.union([Gk().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded — list its files here if you want both."),l.array(Gk().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded — list its files here if you want both.")).describe("List of command file or skill directory paths. When set, the commands/ directory is not auto-loaded."),l.record(l.string(),ANe()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")')])})),ONe=C(()=>l.object({agents:l.union([qk().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded — list its files here if you want both."),l.array(qk().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded — list its files here if you want both.")).describe("List of agent file paths. When set, the agents/ directory is not auto-loaded.")])})),CNe=C(()=>l.object({skills:l.union([wn().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory (except: for a marketplace entry whose source resolves to the marketplace root, declaring a specific subdirectory replaces the skills/ scan)."),l.array(wn().describe("Path to a skill directory, relative to the plugin root.")).describe("List of skill directory paths, loaded in addition to the skills/ directory (except: for a marketplace entry whose source resolves to the marketplace root, declaring specific subdirectories replaces the skills/ scan).")])})),ZG=C(()=>l.object({outputStyles:l.union([wn().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded — list its files here if you want both."),l.array(wn().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded — list its files here if you want both.")).describe("List of output-style directory or file paths. When set, the output-styles/ directory is not auto-loaded.")])})),RNe=C(()=>l.string().max(64).regex(/^[a-z][a-z0-9_-]*$/,"must match ^[a-z][a-z0-9_-]*$")),INe=16,PNe=C(()=>l.object({id:RNe(),remote:l.string().max(256).regex(/^(npm:[@a-z0-9/._-]+(@[a-z0-9._+-]+)?|github:[\w.-]+\/[\w.-]+@[\w./-]+#.+\.js)$/,"must be npm:<pkg>[@ver] or github:<owner>/<repo>@<ref>#<path>.js").optional(),integrity:l.string().max(512).regex(/^sha(256|384|512)-[A-Za-z0-9+/=]+$/,"must be SRI form: sha256-, sha384-, or sha512-<base64>").optional()}).strict()),DNe=C(()=>l.object({syntaxHighlighting:l.object({hljsLanguages:l.array(PNe()).max(INe)}).strict()})),JG=C(()=>l.object({themes:l.union([wn().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded — list its files here if you want both."),l.array(wn().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded — list its files here if you want both.")).describe("List of theme directory or file paths. When set, the themes/ directory is not auto-loaded.")])})),LNe=C(()=>l.object({})),GG=C(()=>l.string().min(1)),NNe=C(()=>l.string().min(2).refine((e)=>e.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),MNe=C(()=>l.object({mcpServers:l.union([Ss().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),qG().describe("Path or URL to MCPB file containing MCP server configuration"),l.record(l.string(),Ty()).describe("MCP server configurations keyed by server name"),l.array(l.union([Ss().describe("Path to MCP servers configuration file"),qG().describe("Path or URL to MCPB file"),l.record(l.string(),Ty()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),YG=C(()=>l.object({type:l.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:l.string().describe("Human-readable label shown in the config dialog"),description:l.string().describe("Help text shown beneath the field in the config dialog"),required:l.boolean().optional().describe("If true, validation fails when this field is empty"),default:l.union([l.string(),l.number(),l.boolean(),l.array(l.string())]).optional().describe("Default value used when the user provides nothing"),multiple:l.boolean().optional().describe("For string type: allow an array of strings"),sensitive:l.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:l.number().optional().describe("Minimum value (number type only)"),max:l.number().optional().describe("Maximum value (number type only)")}).strict()),UNe=C(()=>l.object({userConfig:l.record(l.string().regex(/^[A-Za-z_]\w*$/,"Option keys must be valid identifiers (letters, digits, underscore; no leading digit) — they become CLAUDE_PLUGIN_OPTION_<KEY> env vars in hooks"),YG()).optional().describe("User-configurable values this plugin needs. Prompted at enable time. Non-sensitive values saved to settings.json; sensitive values to secure storage. Available as ${user_config.KEY} in MCP/LSP server config, hook commands, and (non-sensitive only) skill/agent content. Keep sensitive value counts small.")})),$Ne=C(()=>l.object({channels:l.array(l.object({server:l.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:l.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:l.record(l.string(),YG()).optional().describe("Fields to prompt the user for when enabling this plugin in assistant mode. Saved values are substituted into ${user_config.KEY} references in the mcpServers env.")}).strict()).describe("Channels this plugin provides. Each entry declares an MCP server as a message channel and optionally specifies user configuration to prompt for at enable time.")})),WG=C(()=>l.strictObject({command:l.string().min(1).refine((e)=>{if(e.includes(" ")&&!e.startsWith("/"))return!1;return!0},{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:l.array(GG()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:l.record(NNe(),GG()).refine((e)=>Object.keys(e).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:l.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:l.record(l.string(),l.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:l.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:l.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:l.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:l.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:l.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:l.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:l.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up"),diagnostics:l.boolean().optional().describe("Whether to push publishDiagnostics into the agent context after edits. Set to false to keep LSP navigation (goToDefinition, hover, etc.) but suppress automatic diagnostic injection. Defaults to true.")})),jNe=C(()=>l.strictObject({name:l.string().min(1).describe("Identifier for this monitor, unique within the plugin. Used to dedupe so re-arming (plugin reload, repeat skill invoke) does not spawn duplicates."),command:l.string().min(1).describe('Shell command to run as a persistent background monitor. Each stdout line is delivered to the model as a <task_notification> event; the process runs for the session lifetime. ${CLAUDE_PLUGIN_ROOT}, ${CLAUDE_PLUGIN_DATA}, ${CLAUDE_PROJECT_DIR}, ${user_config.*}, and ${ENV_VAR} are substituted. Runs in the session cwd — prefix with `cd "${CLAUDE_PLUGIN_ROOT}" && ` if the script needs its own directory.'),description:l.string().min(1).describe("Short human-readable description of what is being monitored (shown in task panel and notification summary)."),when:l.union([l.literal("always"),l.string().startsWith("on-skill-invoke:").refine((e)=>e.length>16,{message:"on-skill-invoke: must specify a skill name"})]).default("always").describe('Arm trigger. "always" arms at session start and on plugin reload. "on-skill-invoke:<skill>" arms the first time that skill is dispatched (via Skill tool or slash command).')})),FNe=C(()=>l.array(jNe()).refine((e)=>new Set(e.map((t)=>t.name)).size===e.length,{message:"Monitor names must be unique within a plugin"})),XG=C(()=>l.object({monitors:l.union([Ss().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),FNe()]).describe("Background watch scripts the host arms as persistent Monitor tasks (unsandboxed, same trust tier as hooks) so plugins need not instruct the model to arm them. When omitted, monitors/monitors.json at the plugin root is loaded if present.")})),zNe=C(()=>l.object({lspServers:l.union([Ss().describe("Path to .lsp.json configuration file relative to plugin root"),l.record(l.string(),WG()).describe("LSP server configurations keyed by server name"),l.array(l.union([Ss().describe("Path to LSP configuration file"),l.record(l.string(),WG()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),QG=C(()=>l.string().refine((e)=>!e.includes("..")&&!e.includes("//"),"Package name cannot contain path traversal patterns").refine((e)=>{let t=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,r=/^[a-z0-9][a-z0-9-._]*$/;return t.test(e)||r.test(e)},"Invalid npm package name format")),BNe=/^[a-z0-9](?:[a-z0-9._-]*[a-z0-9_-])?$/,HNe=/^[0-9a-f]{64}$/;var qNe=64;var GNe=C(()=>l.object({sha256:l.string().regex(HNe)}));function WNe(e){let t=l.record(l.string(),l.unknown()).safeParse(e);if(!t.success)return;let r=Object.create(null),n=0;for(let[o,i]of Object.entries(t.data)){if(n>=qNe)break;let s=GNe().safeParse(i);if(BNe.test(o)&&s.success)r[o]=s.data,n++}return n>0?r:void 0}var VNe=C(()=>l.object({binaries:l.unknown().transform(WNe).describe("sha256-pinned files to fetch into bin/ at install time, keyed by basename (target triple encoded in the name)")})),KNe=C(()=>l.object({settings:l.record(l.string(),l.unknown()).optional().describe("Settings to merge into the user settings while this plugin is enabled. Only the documented allowlisted keys are applied.")})),ZNe=C(()=>l.object({experimental:l.preprocess((e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)?e:void 0,l.object({...JG().partial().shape,...DNe().partial().shape,...XG().partial().shape,...ZG().partial().shape,evals:l.union([l.string(),l.array(l.string())]).optional().describe("Path(s) to evaluation query files for `claude plugin eval`. Defaults to `evals/`.")}).passthrough().optional().describe("Components whose manifest shape may change without a deprecation cycle. Move a key out of here once it is promoted to stable."))}));var JNe=C(()=>l.object({...wNe().shape,...TNe().partial().shape,...kNe().partial().shape,...ONe().partial().shape,...CNe().partial().shape,...ZG().partial().shape,...JG().partial().shape,...LNe().shape,...$Ne().partial().shape,...MNe().partial().shape,...zNe().partial().shape,...XG().partial().shape,...KNe().partial().shape,...UNe().partial().shape,...VNe().partial().shape,...ZNe().partial().shape})),Md=C(()=>l.discriminatedUnion("source",[l.object({source:l.literal("url"),url:l.string().url().describe("Direct URL to marketplace.json file"),headers:l.record(l.string(),l.string()).optional().describe("Custom HTTP headers (e.g., for authentication)")}),l.object({source:l.literal("github"),repo:l.string().describe("GitHub repository in owner/repo format"),ref:l.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:l.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:l.array(l.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:l.boolean().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),l.object({source:l.literal("git"),url:l.string().describe("Full git repository URL"),ref:l.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:l.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:l.array(l.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:l.boolean().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),l.object({source:l.literal("npm"),package:QG().describe("NPM package containing marketplace.json")}),l.object({source:l.literal("file"),path:l.string().describe("Local file path to marketplace.json")}),l.object({source:l.literal("directory"),path:l.string().describe("Local directory containing .claude-plugin/marketplace.json")}),l.object({source:l.literal("skills-dir")}).describe("Policy-list sentinel for the ~/.claude/skills/ auto-load (@skills-dir plugins). In strictKnownMarketplaces: opt the scan back IN (by default any allowlist blocks it). In blockedMarketplaces: turn the scan OFF without otherwise restricting marketplaces. Only meaningful in those two managed-settings lists (areLocalPluginDirsAllowedByPolicy); known_marketplaces.json / marketplace add etc. ignore it."),l.object({source:l.literal("hostPattern"),hostPattern:l.string().describe('Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against github.com. For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").')}),l.object({source:l.literal("pathPattern"),pathPattern:l.string().describe('Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.')}),l.object({source:l.literal("settings"),name:KG().refine((e)=>!VG.has(e.toLowerCase()),{message:"Reserved marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false."}).describe("Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation "+"as PluginMarketplaceSchema plus reserved-name rejection — "+"validateOfficialNameSource runs after the disk write, too late to clean up."),plugins:l.array(YNe()).describe("Plugin entries declared inline in settings.json"),owner:Wk().optional()}).describe("Inline marketplace manifest defined directly in settings.json. The reconciler writes a synthetic marketplace.json to the cache; diffMarketplaces detects edits via isEqual on the stored source (the plugins array is inside this object, so edits surface as sourceChanged).")])),Hk=C(()=>l.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),e6=C(()=>l.union([l.preprocess((e)=>e==="."?"./":e,wn()).describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),l.object({source:l.literal("npm"),package:QG().or(l.string().refine((e)=>/^(?:file|https?|git(?:\+https?|\+ssh)?|ssh|github|gitlab|bitbucket):/i.test(e)||!e.includes(".."),'Package reference cannot contain ".." path segments')).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:l.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:l.string().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),l.object({source:l.literal("url"),url:l.string().describe("Full git repository URL (https:// or git@)"),ref:l.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Hk().optional().describe("Specific commit SHA to use")}),l.object({source:l.literal("github"),repo:l.string().describe("GitHub repository in owner/repo format"),ref:l.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Hk().optional().describe("Specific commit SHA to use")}),l.object({source:l.literal("git-subdir"),url:l.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:l.string().min(1).describe('Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.'),ref:l.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:Hk().optional().describe("Specific commit SHA to use")}).describe("Plugin located in a subdirectory of a larger repository (monorepo). Only the specified subdirectory is materialized; the rest of the repo is not downloaded."),l.object({source:l.literal("unsupported")}).describe("Placeholder for source types this Claude Code version does not "+"recognize. Never authored by hand — PluginMarketplaceSchema rewrites "+'unparseable sources to this so the entry remains in marketplace.plugins (detectDelistedPlugins must not see it as removed). Install attempts fail at cachePlugin with a clear "update Claude Code" message.')])),YNe=C(()=>l.object({name:l.string().min(1,"Plugin name cannot be empty").refine((e)=>!e.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Plugin name as it appears in the target repository"),source:e6().describe("Where to fetch the plugin from. Must be a remote source — relative "+"paths have no marketplace repository to resolve against."),description:l.string().optional(),version:l.string().optional(),strict:l.boolean().optional()}).refine((e)=>typeof e.source!=="string",{message:'Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url). Relative-path sources like "./foo" have no marketplace repository to resolve against.'}).refine((e)=>typeof e.source==="string"||e.source.source!=="unsupported",{message:"source.source: 'unsupported' is a parse-time placeholder and cannot be authored. Use a remote source (github, git-subdir, npm, url)."}));var XNe=C(()=>l.object({cli:l.array(l.string().max(64)).max(10).optional().describe('First command tokens (e.g. ["stripe"]) — exact match against commands run this session.'),hosts:l.array(l.string().max(128)).max(20).optional().describe('Hostnames (e.g. ["api.stripe.com"]) — exact, case-insensitive match against '+"hostnames seen in https?:// URLs in bash commands run this session. Bare hostname only: lowercase, no scheme, no port, no path."),filesRead:l.array(l.string().max(256)).max(10).optional().describe('Glob patterns (e.g. ["**/*.tf"]) — the plugin is relevant when a file Claude has read '+"this session matches any pattern. Matched against read-file paths, forward-slash normalized, case-insensitive."),manifestDeps:l.array(l.object({file:l.string().max(256),pattern:l.string().max(256)})).max(10).optional().describe("Dependency declared in a package manifest. Each {file, pattern} is a pair of RegExp sources: "+"`file` matches the manifest filename (package.json, go.mod, requirements.txt, …); "+"`pattern` matches the dependency declaration inside that file. Evaluated against files read this session."),cwd:l.array(l.string().max(256)).max(10).optional().describe('Glob patterns (e.g. ["Engine/Source/Runtime/Renderer/**"]) — the plugin is relevant when the '+`session's working directory is at or under a directory matching the pattern. Matched against the cwd both relative to the enclosing git repo root and as an absolute path, forward-slash normalized, case-insensitive. A bare directory (no glob characters) means "cwd is at or under this directory". Known at session start, so this signal can surface a suggestion before the first turn.`)})),QNe=C(()=>l.object({topic:l.string().max(64).optional().describe('What the user is working with when this plugin is relevant — fills "Working with {topic}?". '+'Often the product name (e.g. "Stripe"); use a domain (e.g. "design") when the plugin name does not read naturally as a topic. Defaults to the plugin name with each hyphen-segment capitalized.'),signals:XNe().optional().describe("Matchers that determine when the plugin is relevant.")})),eMe=C(()=>JNe().partial().extend({name:l.string().min(1,"Plugin name cannot be empty").refine((e)=>!e.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier matching the plugin name"),source:e6().describe("Where to fetch the plugin from"),category:l.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:l.array(l.string()).optional().describe("Tags for searchability and discovery"),strict:l.boolean().optional().default(!0).describe("Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest."),relevance:l.preprocess((e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)?e:void 0,QNe().optional()).describe(`Declares when this plugin is relevant to the user's work. Consumed by the spinner tip ("Working with {topic}?"), session-start auto-suggest, and marketplace browse ranking.`)})),tMe=C(()=>l.object({name:l.string().min(1).refine((e)=>!e.includes(" "))}));function rMe(e){let t=eMe();return e.flatMap((r,n)=>{let o=t.safeParse(r);if(o.success)return[o.data];let i=tMe().safeParse(r).data?.name,s=o.error.issues.map((a)=>`${a.path.join(".")}: ${a.message}`).join(", ");if(i)return ce(`Stubbing unparseable marketplace plugin entry (${i}): ${s}`,{level:"warn"}),[{name:i,source:{source:"unsupported"},strict:!0}];return ce(`Dropping unparseable marketplace plugin entry (index ${n}): ${s}`,{level:"warn"}),[]})}var Zwt=C(()=>l.object({$schema:l.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:KG(),version:l.string().optional().describe("Marketplace manifest version"),description:l.string().optional().describe("Human-readable description of this marketplace"),owner:Wk().describe("Marketplace maintainer or curator information"),plugins:l.array(l.unknown()).transform(rMe).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:l.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:l.object({pluginRoot:l.string().optional().describe("Base path for relative plugin sources"),version:l.string().optional().describe("Marketplace version"),description:l.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:l.array(l.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust."),renames:l.record(l.string(),l.string().nullable()).optional().catch(void 0).describe("Append-only map of old plugin name → current name (or null when removed). The loader follows this on plugin-not-found and migrates user settings to the new name.")})),t6=C(()=>l.string().regex(/^[A-Za-z0-9][-A-Za-z0-9._]*@[A-Za-z0-9][-A-Za-z0-9._]*$/,"Plugin ID must be in format: plugin@marketplace")),nMe=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,oMe=C(()=>l.union([l.string().regex(nMe,"Dependency must be a plugin name, optionally qualified with @marketplace").transform((e)=>e.replace(/@\^[^@]*$/,"")),l.object({name:l.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/),marketplace:l.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/).optional()}).loose().transform((e)=>e.marketplace?`${e.name}@${e.marketplace}`:e.name)])),iMe=C(()=>l.object({version:l.string().describe("Currently installed version"),installedAt:l.string().describe("ISO 8601 timestamp of installation"),lastUpdated:l.string().optional().describe("ISO 8601 timestamp of last update"),installPath:l.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:l.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)"),resolvedVersion:l.string().optional().describe("Tag-derived semver this install resolved to (when fetched via a version constraint). Used by verifyAndDemote in preference to manifest.version, since the upstream may have forgotten to bump plugin.json."),auto:l.boolean().optional().describe("True when this plugin was pulled in as a dependency rather than installed explicitly. Auto-installed plugins are eligible for removal by the orphan sweep when nothing depends on them. Absent = manual (preserves pre-flag installs).")})),Jwt=C(()=>l.object({version:l.literal(1).describe("Schema version 1"),plugins:l.record(t6(),iMe()).describe("Map of plugin IDs to their installation metadata")})),sMe=C(()=>l.enum(["managed","user","project","local"])),aMe=C(()=>l.object({scope:sMe().describe("Installation scope"),projectPath:l.string().optional().describe("Project path (required for project/local scopes)"),installPath:l.string().describe("Absolute path to the versioned plugin directory"),version:l.string().optional().describe("Currently installed version"),installedAt:l.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:l.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:l.string().optional().describe("Git commit SHA for git-based plugins"),resolvedVersion:l.string().optional().describe("Tag-derived semver this install resolved to"),auto:l.boolean().optional().describe("True when pulled in as a dependency. Eligible for orphan sweep.")})),Ywt=C(()=>l.object({version:l.literal(2).describe("Schema version 2"),plugins:l.record(t6(),l.array(aMe())).describe("Map of plugin IDs to arrays of installation entries")})),cMe=C(()=>l.object({source:Md().describe("Where to fetch the marketplace from"),installLocation:l.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:l.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:l.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),Xwt=C(()=>l.record(l.string(),cMe()));var lMe=["autoMode","deepLink","voice","briefView","screenReader"],Vk={},Ay={autoMode:{buildGate:()=>!1,shape:()=>Vk,permissionsShape:()=>Vk,permissionModes:()=>[]},deepLink:{buildGate:()=>!0,shape:()=>({disableDeepLinkRegistration:l.enum(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")})},voice:{buildGate:()=>!0,shape:()=>({voiceEnabled:l.boolean().optional().describe("Enable voice mode (hold-to-talk dictation)")})},briefView:{buildGate:()=>!0,shape:()=>({defaultView:l.enum(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")})},screenReader:{buildGate:()=>!1,shape:()=>Vk}};function Kk(){return lMe.filter((e)=>Ay[e].buildGate())}function r6(e){let t={};for(let r of e)t={...t,...Ay[r].shape()};return t}function n6(e){let t={};for(let r of e)t={...t,...Ay[r].permissionsShape?.()};return t}function o6(e){let t=[];for(let r of e)t.push(...Ay[r].permissionModes?.()??[]);return t}function Zk(e){let t=e.split("__"),[r,n,...o]=t;if(r!=="mcp"||!n)return null;let i=o.length>0?o.join("__"):void 0;return{serverName:n,toolName:i}}var i6={Task:"Agent",KillShell:"TaskStop",KillBash:"TaskStop",AgentOutputTool:"TaskOutput",BashOutputTool:"TaskOutput",AgentOutput:"TaskOutput",BashOutput:"TaskOutput",ListPeers:"ListAgents",Brief:"SendUserMessage",ListMcpResources:"ListMcpResourcesTool",ReadMcpResource:"ReadMcpResourceTool",ReadMcpResourceDir:"ReadMcpResourceDirTool"};function Hc(e){return Object.hasOwn(i6,e)?i6[e]:e}var s6="workspace",lTt=`mcp__${s6}__bash`,uTt=`mcp__${s6}__web_fetch`;function Jk(e){return e.includes("*")}function uMe(e){return e.replaceAll("\\","\\\\").replaceAll("(","\\(").replaceAll(")","\\)")}function pMe(e){return e.replaceAll("\\(","(").replaceAll("\\)",")").replaceAll("\\\\","\\")}function a6(e){let t=dMe(e,"(");if(t===-1)return{toolName:Hc(e)};let r=fMe(e,")");if(r===-1||r<=t)return{toolName:Hc(e)};if(r!==e.length-1)return{toolName:Hc(e)};let n=e.substring(0,t),o=e.substring(t+1,r);if(!n)return{toolName:Hc(e)};if(o===""||o==="*")return{toolName:Hc(n)};let i=pMe(o);return{toolName:Hc(n),ruleContent:i}}function Yk(e){if(!e.ruleContent)return e.toolName;let t=uMe(e.ruleContent);return`${e.toolName}(${t})`}function dMe(e,t){for(let r=0;r<e.length;r++)if(e[r]===t){let n=0,o=r-1;while(o>=0&&e[o]==="\\")n++,o--;if(n%2===0)return r}return-1}function fMe(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]===t){let n=0,o=r-1;while(o>=0&&e[o]==="\\")n++,o--;if(n%2===0)return r}return-1}var ky={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit","Cd"],bashPrefixTools:["Bash"],customValidation:{WebSearch:(e)=>{if(e.includes("*")||e.includes("?"))return{valid:!1,error:"WebSearch does not support wildcards",suggestion:"Use exact search terms without * or ?",examples:["WebSearch(claude ai)","WebSearch(typescript tutorial)"]};return{valid:!0}},WebFetch:(e)=>{if(e.includes("://")||e.startsWith("http"))return{valid:!1,error:"WebFetch permissions use domain format, not URLs",suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:github.com)"]};if(!e.startsWith("domain:"))return{valid:!1,error:'WebFetch permissions must use "domain:" prefix',suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:*.google.com)"]};return{valid:!0}}}};function c6(e){return ky.filePatternTools.includes(e)}function l6(e){return ky.bashPrefixTools.includes(e)}function u6(e){return Object.hasOwn(ky.customValidation,e)?ky.customValidation[e]:void 0}function d6(e,t){let r=0,n=t-1;while(n>=0&&e[n]==="\\")r++,n--;return r%2!==0}function Xk(e,t){let r=0;for(let n=0;n<e.length;n++)if(e[n]===t&&!d6(e,n))r++;return r}function mMe(e){for(let t=0;t<e.length-1;t++)if(e[t]==="("&&e[t+1]===")"){if(!d6(e,t))return!0}return!1}function p6(e){if(!Jk(e))return null;let t=Zk(e);if(t&&!Jk(t.serverName))return null;return{valid:!1,error:`Wildcard tool name "${e}" is not supported in allow rules`,suggestion:"An allow pattern must name the scope it widens — globs are permitted only in the tool position after a literal mcp__<server>__ prefix. Deny and ask rules accept wildcards anywhere",examples:["mcp__puppeteer__*","mcp__github__get_*"]}}function Qk(e,t){if(!e||e.trim()==="")return{valid:!1,error:"Permission rule cannot be empty"};let r=Xk(e,"("),n=Xk(e,")");if(r!==n)return{valid:!1,error:"Mismatched parentheses",suggestion:"Ensure all opening parentheses have matching closing parentheses"};if(mMe(e)){let a=e.substring(0,e.indexOf("("));if(!a)return{valid:!1,error:"Empty parentheses with no tool name",suggestion:"Specify a tool name before the parentheses"};return{valid:!1,error:"Empty parentheses",suggestion:`Either specify a pattern or use just "${a}" without parentheses`,examples:[`${a}`,`${a}(some-pattern)`]}}let o=a6(e),i=Zk(o.toolName);if(i){if(o.ruleContent!==void 0||Xk(e,"(")>0)return{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:`Use "${o.toolName}" without parentheses, or use "mcp__${i.serverName}__*" for all tools`,examples:[`mcp__${i.serverName}`,`mcp__${i.serverName}__*`,i.toolName&&i.toolName!=="*"?`mcp__${i.serverName}__${i.toolName}`:void 0].filter(Boolean)};if(t==="allow"){let a=p6(o.toolName);if(a)return a}return{valid:!0}}if(!o.toolName||o.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(t==="allow"){let a=p6(o.toolName);if(a)return a}if(!o.toolName.includes("_")&&o.toolName[0]!==o.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${qy(String(o.toolName))}"`};let s=u6(o.toolName);if(s&&o.ruleContent!==void 0){let a=s(o.ruleContent);if(!a.valid)return a}if(l6(o.toolName)&&o.ruleContent!==void 0){let a=o.ruleContent;if(a.includes(":*")&&!a.endsWith(":*"))return{valid:!1,error:"The :* pattern must be at the end",suggestion:"Move :* to the end for prefix matching, or use * for wildcard matching",examples:["Bash(npm run:*) - prefix matching (legacy)","Bash(npm run *) - wildcard matching"]};if(a===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm *)","Bash(git *)"]}}if(c6(o.toolName)&&o.ruleContent!==void 0){if(o.ruleContent.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${o.toolName}(*.ts) - matches .ts files`,`${o.toolName}(src/**) - matches all files in src`,`${o.toolName}(**/*.test.ts) - matches test files`]}}if(o.ruleContent!==void 0){let a=o.toolName==="Write"||o.toolName==="NotebookEdit"||o.toolName==="MultiEdit"?"Edit":o.toolName==="Glob"?"Read":void 0;if(a!==void 0&&!o.ruleContent.includes(":*"))return{valid:!0,warning:`${Yk(o)} is not matched by file permission checks — only ${a}(path) rules are. Use ${Yk({toolName:a,ruleContent:o.ruleContent})} instead (${a} rules cover all file-${a==="Edit"?"editing":"reading"} tools).`}}return{valid:!0}}var eO=C(()=>m6()),f6=C(()=>m6("allow"));function m6(e){return l.string().superRefine((t,r)=>{let n=Qk(t,e);if(!n.valid){let o=n.error;if(n.suggestion)o+=`. ${n.suggestion}`;if(n.examples&&n.examples.length>0)o+=`. Examples: ${n.examples.join(", ")}`;r.addIssue({code:l.ZodIssueCode.custom,message:o,params:{received:t}})}})}var gMe=C(()=>l.record(l.string(),l.coerce.string()));function b6(e){return l.object({allow:l.array(f6()).optional().describe("List of permission rules for allowed operations"),deny:l.array(eO()).optional().describe("List of permission rules for denied operations"),ask:l.array(eO()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:l.preprocess(Ld,l.enum([...Dd,...o6(e)])).optional().describe("Default permission mode when Claude Code needs access ('manual' is accepted as an alias for 'default')"),disableBypassPermissionsMode:l.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),...n6(e),additionalDirectories:l.array(l.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}var PTt=C(()=>b6(Kk())),hMe=C(()=>l.object({source:Md().describe("Where to fetch the marketplace from"),installLocation:l.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:l.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),Oy=C(()=>l.object({serverName:l.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that users are allowed to configure"),serverCommand:l.array(l.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for allowed stdio servers"),serverUrl:l.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine((e)=>jS([e.serverName!==void 0,e.serverCommand!==void 0,e.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),Cy=C(()=>l.object({serverName:l.string().min(1,"Server name must be non-empty").refine((e)=>e.trim().length>0,{message:"Server name must not be whitespace-only"}).refine((e)=>e===e.trim(),{message:"Server name has leading or trailing whitespace and will never match (names are compared verbatim)"}).optional().describe("Name of the MCP server that is explicitly blocked"),serverCommand:l.array(l.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for blocked stdio servers"),serverUrl:l.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine((e)=>jS([e.serverName!==void 0,e.serverCommand!==void 0,e.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),_Me=C(()=>l.object({path:l.string().describe("Absolute path to the helper executable"),timeoutMs:l.number().int().min(1000).optional(),refreshIntervalMs:l.union([l.literal(0),l.number().int().min(60000)]).optional()})),g6=["skills","agents","hooks","mcp"],h6=Object.freeze({type:"invalid-entry-stripped"}),yMe=C(()=>l.union([l.object({type:l.literal("regex").describe('Config variant. This client understands "regex": matches turn output and builds a URL from named capture groups. Entries with other variants are preserved but skipped at runtime.'),pattern:l.string().describe("Regex matched against turn output (tool results and assistant text)"),url:l.string().describe("Link target. {name} placeholders are filled from named regex capture groups, e.g. (?<id>...) -> {id}. Values are URL-encoded; the origin must be literal in the template. The scheme must be https, http, or a recognized editor or workspace deep-link scheme: vscode, vscode-insiders, cursor, windsurf, zed, jetbrains, idea, slack, linear, notion, figma."),label:l.string().optional().describe("Badge text. {name} placeholders filled from named capture groups; defaults to the full match.")}).passthrough(),l.object({type:l.string().describe("Config variant discriminator for entries this client does not understand; the entry is preserved as-is and skipped at runtime.")}).passthrough()]));function x6(e){return l.object({$schema:l.string().optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:l.string().optional().describe("Path to a script that outputs authentication values"),proxyAuthHelper:l.string().optional().describe("Shell command that outputs a Proxy-Authorization header value (EAP)"),awsCredentialExport:l.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:l.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:l.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),processWrapper:l.string().optional().describe("Corporate launcher argv prefix for the background-agent supervisor, the sessions and workers it hosts, and the other covered background processes listed in the Claude Code corporate-launcher documentation. Equivalent to the CLAUDE_CODE_PROCESS_WRAPPER environment variable, which takes precedence when set. Honored from managed settings, a --settings/SDK-supplied settings file, and user settings, in that precedence order; project and local settings are ignored."),policyHelper:_Me().optional().describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),...Hr.CLAUDE_CODE_ENABLE_XAA&&{xaaIdp:l.object({issuer:l.string().url().describe("IdP issuer URL for OIDC discovery"),clientId:l.string().describe("Claude Code's client_id registered at the IdP"),callbackPort:l.number().int().positive().optional().describe("Fixed loopback callback port for the IdP OIDC login. Only needed if the IdP does not honor RFC 8252 port-any matching.")}).optional().describe("XAA (SEP-990) IdP connection. Configure once; all XAA-enabled MCP servers reuse this.")},fileSuggestion:l.object({type:l.literal("command"),command:l.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:l.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),breakReminder:l.object({enabled:l.boolean().optional().describe("Show a friendly nudge after sustained continuous use (default false). Must be true for the reminder to fire."),intervalMinutes:l.number().int().positive().optional().describe("Minutes of continuous use before the reminder fires (default 30). Re-fires every interval until you take a break."),breakThresholdMinutes:l.number().int().positive().optional().describe("Minutes of inactivity that count as a break and reset the timer (default 10)"),message:l.string().optional().describe("Custom reminder text. Leave unset for a rotating set of friendly nudges.")}).optional().describe("@internal Opt-in break reminder. When enabled, shows a dismissible nudge after sustained continuous use. Never blocks — just a friendly heads-up."),quietHours:l.object({enabled:l.boolean().optional().describe("Show a one-time nudge when you start or keep using the CLI inside your quiet-hours window (default false)."),start:l.string().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "22:00")').optional().describe('Start of the quiet-hours window, 24-hour local time "HH:MM".'),end:l.string().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "07:00")').optional().describe('End of the quiet-hours window, 24-hour local time "HH:MM". May be earlier than start for an overnight range.')}).optional().describe("@internal Opt-in quiet hours. When enabled, shows a single soft nudge per session while inside the configured local-time window. Never blocks."),cleanupPeriodDays:l.number().int().positive().optional().describe("Number of days to retain chat transcripts before automatic cleanup (default: 30). Minimum 1. Use a large value for long retention; use --no-session-persistence to disable transcript writes entirely."),skillListingMaxDescChars:l.number().int().positive().optional().describe("Per-skill description character cap in the skill listing sent to Claude (default: 1536). Descriptions longer than this are truncated. Raise to opt in to higher per-turn context cost."),skillListingBudgetFraction:l.number().gt(0).lte(1).optional().describe("Fraction of the context window (in characters) reserved for the skill listing sent to Claude (default: 0.01 = 1%). When the listing exceeds this, descriptions are shortened to fit. Raise to opt in to higher per-turn context cost."),wslInheritsWindowsSettings:l.boolean().optional().describe("When set to true in either admin-only Windows source — the HKLM SOFTWARE/Policies/ClaudeCode registry key or C:/Program Files/ClaudeCode/managed-settings.json — WSL reads managed settings from the full Windows policy chain (HKLM, C:/Program Files/ClaudeCode via DrvFs, HKCU) in addition to /etc/claude-code. Windows sources take priority. The flag is also required in HKCU itself for HKCU policy to apply on WSL (double opt-in: admin enables the chain, user confirms HKCU). On native Windows the flag has no effect."),env:gMe().optional().describe("Environment variables to set for Claude Code sessions"),attribution:l.object({commit:l.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:l.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution."),sessionUrl:l.boolean().optional().describe("Whether to append the claude.ai session link to commits and PRs created from web or Remote Control sessions (default: true). Set to false to omit the Claude-Session trailer and PR-body link.")}).optional().describe("Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set."),includeCoAuthoredBy:l.boolean().optional().describe("Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)"),...!1,includeGitInstructions:l.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:b6(e).optional().describe("Tool usage permissions configuration"),model:l.string().optional().describe("Override the default model used by Claude Code"),fallbackModel:l.array(l.string()).optional().describe('Fallback model(s) tried in order when the primary model is overloaded or unavailable. Each element accepts a model name or alias; "default" expands to the default model. CLI --fallback-model takes precedence.'),availableModels:l.array(l.string()).optional().describe('Allowlist of models that users can select. Accepts family aliases ("opus" allows any opus version), version prefixes ("opus-4-5" allows only that version), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.'),enforceAvailableModels:l.boolean().optional().describe("When true and availableModels is a non-empty array, the Default model selection is also constrained: if the default model for the user tier is not in availableModels, Default resolves to the first allowed availableModels entry instead. Has no effect when availableModels is unset or an empty array. Typically set in managed settings by enterprise administrators."),modelOverrides:l.record(l.string(),l.string()).optional().describe('Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.'),enableAllProjectMcpServers:l.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:l.array(l.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:l.array(l.string()).optional().describe("List of rejected MCP servers from .mcp.json"),disableClaudeAiConnectors:l.boolean().optional().describe("When true in any settings source, claude.ai MCP cloud connectors are not auto-fetched or connected. "+"Only gates auto-fetched connectors — a claudeai-proxy server passed explicitly "+"(e.g. via --mcp-config or the SDK mcpServers option) still follows the normal MCP config trust flow. Any-source-true wins: a project can opt out, but a project-level false cannot override a user-level true."),skillOverrides:l.record(l.string(),l.enum(["on","name-only","user-invocable-only","off"])).optional().describe('Per-skill listing overrides keyed by skill name. "name-only" lists the skill without its description; "user-invocable-only" hides it from the model but keeps /name; "off" hides it from both. Absent = on.'),disableBundledSkills:l.boolean().optional().describe("Disable the skills and workflows that ship with Claude Code: bundled skills and workflows are removed entirely; built-in slash commands stay typable but are hidden from the model. Plugins, .claude/skills/, and .claude/commands/ are unaffected. Equivalent to CLAUDE_CODE_DISABLE_BUNDLED_SKILLS=1."),allowedMcpServers:l.array(Oy()).optional().describe("Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied."),deniedMcpServers:l.array(Cy()).optional().describe("Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),hooks:vs().optional().describe("Custom commands to run before/after tool executions"),worktree:l.object({symlinkDirectories:l.array(l.string()).optional().describe('Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: "node_modules", ".cache", ".bin"'),sparsePaths:l.array(l.string()).optional().describe("Directories to include when creating worktrees, via git sparse-checkout (cone mode). "+"Dramatically faster in large monorepos — only the listed paths are written to disk."),baseRef:l.enum(["fresh","head"]).optional().describe("Which ref new worktrees branch from. 'fresh' (default) branches from origin/<default-branch> for a clean tree. 'head' branches from your current local HEAD so unpushed commits and feature-branch state are present. Applies to --worktree, EnterWorktree, and agent isolation."),bgIsolation:l.enum(["worktree","none"]).optional().catch(void 0).describe("Isolation mode for background sessions in this repo. 'worktree' (default) blocks Edit/Write in the main checkout until EnterWorktree is called. 'none' lets background jobs edit the working copy directly.")}).optional().describe("Git worktree configuration for --worktree flag."),disableAllHooks:l.boolean().optional().describe("Disable all hooks and statusLine execution"),disableAgentView:l.boolean().optional().describe("Disable agent view (`claude agents`, `--bg`, /background, the on-demand daemon). Typically set in managed settings. Equivalent to CLAUDE_CODE_DISABLE_AGENT_VIEW=1."),disableRemoteControl:l.boolean().optional().describe("Disable Remote Control (claude.ai/code, `claude remote-control`, `--remote-control`/`--rc`, auto-start, and the in-session toggle). Typically set in managed settings."),disableWorkflows:l.boolean().optional().describe("Disable the Workflows feature (also via CLAUDE_CODE_DISABLE_WORKFLOWS)."),disableArtifact:l.boolean().optional().describe("Disable the Artifact tool (also via CLAUDE_CODE_DISABLE_ARTIFACT)."),enableArtifact:l.boolean().optional().describe("Enable or disable the Artifact tool for this user. Unset defaults to enabled once the feature is available."),enableWorkflows:l.boolean().optional().describe("Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available."),workflowSizeGuideline:l.enum(["unrestricted","small","medium","large"]).optional().describe('Advisory size guideline for the dynamic workflows Claude writes: "small" aims for fewer than 5 agents, "medium" (the default) fewer than 15, "large" fewer than 50, and "unrestricted" sends no guideline. A value here — including from managed settings — takes precedence over the "Dynamic workflow size" choice in /config, and that /config row is hidden while a settings file provides the key. This is a guideline, not an enforced limit.'),workflowKeywordTriggerEnabled:l.boolean().optional().describe('Enable the "ultracode" keyword trigger: including the keyword in a prompt opts that turn into the Workflow tool. Set to false to disable the trigger. Default: true.'),disableSkillShellExecution:l.boolean().optional().describe("Disable inline shell execution in skills and custom slash commands from user, project, or plugin sources. Commands are replaced with a placeholder instead of being run."),defaultShell:l.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),respondToBashCommands:l.boolean().optional().describe("Whether Claude responds after an input-box ! bash command runs. Set to false to add the command output to context without a response. Default: true."),allowManagedHooksOnly:l.boolean().optional().describe("When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored."),allowedHttpHookUrls:l.array(l.string()).optional().describe('Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).'),httpHookAllowedEnvVars:l.array(l.string()).optional().describe("Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers)."),allowManagedPermissionRulesOnly:l.boolean().optional().describe("When true (and set in managed settings), only permission rules (allow/deny/ask) from managed settings are respected. User, project, local, and CLI argument permission rules are ignored."),allowManagedMcpServersOnly:l.boolean().optional().describe("When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies."),allowAllClaudeAiMcps:l.boolean().optional().describe("When true (and set in managed settings), claude.ai cloud MCP connectors load alongside managed-mcp.json instead of being suppressed by its exclusive-control lockdown. Default off preserves the lockdown. Read from managed settings only."),strictPluginOnlyCustomization:l.preprocess((t)=>Array.isArray(t)?t.filter((r)=>g6.includes(r)):t,l.union([l.boolean(),l.array(l.enum(g6))])).optional().catch(void 0).describe('When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.claude/{surface}/, .claude/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. '+"Composes with strictKnownMarketplaces for end-to-end admin control — plugins gated by "+"marketplace allowlist, everything else blocked here."),statusLine:l.object({type:l.literal("command"),command:l.string(),padding:l.number().optional(),refreshInterval:l.number().min(1).optional().catch(void 0).describe("Re-run the status line command every N seconds in addition to event-driven updates"),hideVimModeIndicator:l.boolean().optional().describe("Hide the built-in `-- INSERT --` / `-- VISUAL --` indicator below the prompt. Use this when your status line script renders `vim.mode` itself.")}).optional().describe("Custom status line display configuration"),prUrlTemplate:l.string().optional().describe('URL template for PR links in the footer link badges and inline messages. The detected git PR is rendered as the first footer-link badge. Placeholders: {host} {owner} {repo} {number} {url}. Example: "https://reviews.example.com/{owner}/{repo}/pull/{number}"'),footerLinksRegexes:l.array(yMe().catch(h6)).transform((t)=>t.filter((r)=>r!==h6)).optional().catch(void 0).describe("Extra clickable footer badges that appear when a regex matches turn output (tool results and assistant responses). Read from user, flag, and managed settings only; ignored in project .claude/settings.json and local .claude/settings.local.json. At most 5 badges render; the oldest is displaced by newer matches and /clear removes them. Use to surface IDs printed by project CLIs as session links."),subagentStatusLine:l.object({type:l.literal("command"),command:l.string()}).optional().describe("Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin"),enabledPlugins:l.record(l.string(),l.union([l.array(l.string()),l.boolean(),l.undefined()])).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints. Settings precedence is user < project < local < flag < policy, so to disable a plugin that project settings enable, set it to false in .claude/settings.local.json — setting false in ~/.claude/settings.json is overridden by the project.'),extraKnownMarketplaces:l.record(l.string(),hMe()).check((t)=>{for(let[r,n]of Object.entries(t.value))if(n.source.source==="settings"&&n.source.name!==r)t.issues.push({code:"custom",input:n.source.name,path:[r,"source","name"],message:`Settings-sourced marketplace name must match its extraKnownMarketplaces key (got key "${r}" but source.name "${n.source.name}")`})}).optional().describe("Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources."),strictKnownMarketplaces:l.array(Md()).optional().describe("Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these exact sources can be added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem. "+"Note: this is a policy gate only — it does NOT register marketplaces. "+"To pre-register allowed marketplaces for users, also set extraKnownMarketplaces."),blockedMarketplaces:l.array(Md()).optional().describe("Enterprise blocklist of marketplace sources. When set in managed settings, these exact sources are blocked from being added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem."),disableSideloadFlags:l.boolean().optional().describe("When true (and set in managed settings), rejects the --plugin-dir, --plugin-url, --agents, and non-sdk --mcp-config CLI flags at startup. Closes the CLI-flag bypass of strictKnownMarketplaces. Pair with allowedMcpServers for per-server MCP control; this setting does not gate other MCP entry points (SDK setMcpServers, claude mcp add, .mcp.json). Also blocks surfaces that spawn the CLI with these flags internally (see settings documentation). Only honored from managed settings; ignored in user/project/local settings."),pluginSuggestionMarketplaces:l.array(l.string()).optional().describe("Marketplace names whose plugins may surface as contextual install suggestions (relevance-based tips). No marketplace-declared suggestions surface without this allowlist; the built-in first-party frontend-design tip is unaffected. Only honored when set in managed settings (policy scope); the key is ignored in user, project, and local settings. A name only takes effect when the marketplace is registered on the machine AND its registered source is also declared in managed settings, either as the extraKnownMarketplaces entry for that name or as an entry of strictKnownMarketplaces. A marketplace registered from a different source under an allowlisted name is ignored. The official marketplace is exempt from the source requirement: allowlisting its name alone suffices, since that name can only register from the official Anthropic source."),forceLoginMethod:l.enum(["claudeai","console","gateway"]).optional().catch(void 0).describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing, "gateway" for the Cloud gateway OIDC device flow'),forceLoginGatewayUrl:l.string().url().optional().catch(void 0).describe('@internal Cloud gateway URL to pre-fill and auto-connect to during login. Typically set in local managed settings alongside forceLoginMethod: "gateway" so users never type the URL. Hidden from public SDK types until Cloud gateway is documented.'),parentSettingsBehavior:l.enum(["first-wins","merge"]).optional().describe('Controls whether the SDK parent tier (Options.managedSettings / --managed-settings) layers under this admin tier. "first-wins" '+"(default): parent is dropped — admin tiers are the only policy "+`source. "merge": parent's restrictive-only-filtered settings union under the admin winner. Has no effect when no admin tier exists (parent applies as the sole policy tier, still filtered restrictive-only).`),forceLoginOrgUUID:l.union([l.string(),l.array(l.string())]).optional().describe("Organization UUID to require for OAuth login. Accepts a single UUID string or an array of UUIDs (any one is permitted). When set in managed settings, login fails if the authenticated account does not belong to a listed organization."),forceRemoteSettingsRefresh:l.boolean().optional().describe("When set in managed settings, the CLI blocks startup until remote managed settings are freshly fetched, and exits if the fetch fails"),otelHeadersHelper:l.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:l.string().optional().describe("Controls the output style for assistant responses"),viewMode:l.enum(["default","verbose","focus"]).optional().catch(void 0).describe("Default transcript view mode on startup"),language:l.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:l.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:zk().optional(),feedbackSurveyRate:l.number().min(0).max(1).optional().describe("Probability (0–1) that the session quality survey appears when eligible. 0.05 is a reasonable starting point."),feedbackDrafts:l.enum(["notify","quiet","off"]).optional().describe('Model-drafted feedback (the SendFeedback tool). "notify" (default) shows a one-line notice when a draft is queued; "quiet" shows only the footer counter; "off" disables the tool entirely so drafts are never queued.'),spinnerTipsEnabled:l.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:l.object({mode:l.enum(["append","replace"]),verbs:l.array(l.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:l.object({excludeDefault:l.boolean().optional(),tips:l.array(l.string())}).optional().describe("Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false)."),syntaxHighlightingDisabled:l.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),terminalTitleFromRename:l.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),alwaysThinkingEnabled:l.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:l.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for supported models."),ultracode:l.boolean().optional().catch(void 0).describe("Enable ultracode for the session: xhigh effort plus standing dynamic-workflow orchestration. "+"Session-scoped — typically provided via --settings or the apply_flag_settings control request; "+"interactive toggles never persist it. Requires workflows to be enabled and an xhigh-capable model."),autoCompactWindow:l.number().int().min(1e5).max(1e6).optional().catch(void 0).describe("Auto-compact window size"),advisorModel:l.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:l.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:l.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:l.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),emojiCompletionEnabled:l.boolean().optional().describe("When false, the :emoji: shortcode typeahead (the suggestion popup and the :name: inline replacement) is disabled. When absent or true, it is enabled."),awaySummaryEnabled:l.boolean().optional().describe("@internal When false, the session recap (shown when you return after being away for 5+ minutes) is disabled. When absent or true, recap is enabled. Hidden from public SDK types until external launch."),showClearContextOnPlanAccept:l.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),askUserQuestionTimeout:l.enum(["60s","5m","10m","never"]).optional().catch(void 0).describe("Idle time before Claude's questions auto-continue with any answers "+"selected so far. Defaults to never — auto-continue only runs "+"when explicitly set to 60s/5m/10m."),agent:l.string().optional().describe("Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model."),companyAnnouncements:l.array(l.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:l.record(l.string(),l.object({mcpServers:l.record(l.string(),l.record(l.string(),l.union([l.string(),l.number(),l.boolean(),l.array(l.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:l.record(l.string(),l.union([l.string(),l.number(),l.boolean(),l.array(l.string())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")}).or(l.undefined())).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:l.object({defaultEnvironmentId:l.string().optional().describe("Default environment ID to use for cloud sessions")}).optional().describe("Cloud session configuration"),autoUpdatesChannel:l.enum(["latest","stable","rc"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:l.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),requiredMinimumVersion:l.string().optional().describe("Minimum Claude Code version required to start. If the running version is older, Claude Code exits at startup with instructions to update. Only enforced from managed (policy) settings."),requiredMaximumVersion:l.string().optional().describe("Maximum Claude Code version allowed to start. If the running version is newer, Claude Code exits at startup with instructions to install an approved version. Only enforced from managed (policy) settings."),plansDirectory:l.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),tui:l.enum(["default","fullscreen"]).optional().describe('Terminal UI renderer. "fullscreen" uses the flicker-free alt-screen renderer with virtualized scrollback (equivalent to CLAUDE_CODE_NO_FLICKER=1). "default" uses the classic main-screen renderer.'),...!1,voice:l.object({enabled:l.boolean().optional(),mode:l.enum(["hold","tap"]).optional().describe("'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit."),autoSubmit:l.boolean().optional().describe("Submit the prompt when hold-to-talk is released (hold mode only)")}).optional().describe("Voice mode settings (hold-to-talk / tap-to-toggle dictation)"),channelsEnabled:l.boolean().optional().describe("Managed-org opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). claude.ai Teams/Enterprise: default off. Console: default on unless managed settings exist. Set true to allow; users then select servers via --channels."),allowedChannelPlugins:l.array(l.object({marketplace:l.string(),plugin:l.string()})).optional().describe("Managed-org allowlist of channel plugins. When set, "+"replaces the default Anthropic allowlist — admins decide which "+"plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true."),prefersReducedMotion:l.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),doneMeansMerged:l.boolean().optional().describe("@internal When true, Claude keeps working until the PR is ready for you to merge, a cron/Monitor is armed to resume later, or it hands you a self-contained next step."),totalTokensReminder:l.enum(["off","infinite","fixed","countdown","padded-countdown"]).optional().describe("@internal Emit a <total_tokens>N tokens left</total_tokens> block in the system prompt, after each tool result, and (when totalTokensReminderAfterUserTurn is on) after each regular user prompt. 'infinite' uses the literal value Infinite, 'fixed' uses 5000000, 'countdown' uses the live remaining context-window tokens, 'padded-countdown' counts down from totalTokensReminderBudget (re-anchoring to the full budget on each regular user prompt when totalTokensReminderAfterUserTurn "+"is on — task-budget semantics). Defaults to off. Env var "+"CLAUDE_CODE_TOTAL_TOKENS_REMINDER overrides."),totalTokensReminderBudget:l.number().int().positive().optional().describe("@internal Starting budget (tokens) for totalTokensReminder 'padded-countdown' mode. Defaults to 15000000. Server-controlled via GrowthBook; env var CLAUDE_CODE_TOTAL_TOKENS_REMINDER_BUDGET overrides."),totalTokensReminderAfterUserTurn:l.boolean().optional().describe("@internal When true, emit the totalTokensReminder block after each regular user prompt and (for 'padded-countdown') re-anchor the task budget to the full configured value at the start of each user turn. When false, the reminder appears only in the system prompt and after each tool-result batch, and 'padded-countdown' counts down over the whole session. Defaults to off. Env var CLAUDE_CODE_TOTAL_TOKENS_REMINDER_AFTER_USER_TURN overrides; server-controlled via GrowthBook tengu_lapis_anchor_user_turn."),autoMemoryEnabled:l.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:l.string().optional().describe("Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .claude/settings.json) for security. When unset, defaults to ~/.claude/projects/<sanitized-cwd>/memory/."),autoDreamEnabled:l.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:l.boolean().optional().describe("Request API-side thinking summaries and show them in the conversation and in the transcript view (ctrl+o). Set explicitly to override the default for your install."),skipDangerousModePermissionPrompt:l.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),skipWorkflowUsageWarning:l.boolean().optional().describe("@internal Whether the user has accepted the multi-agent workflow usage warning. Until set, auto permission mode prompts before running a workflow."),disableAutoMode:l.enum(["disable"]).optional().describe("Disable auto mode"),sshConfigs:l.array(l.object({id:l.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:l.string().describe("Display name for the SSH connection"),sshHost:l.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:l.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:l.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:l.string().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh <config> [dir]`.")})).optional().describe("SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members."),claudeMd:l.string().optional().describe("CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings."),claudeMdExcludes:l.array(l.string()).optional().describe('Glob patterns or absolute paths of CLAUDE.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: "/home/user/monorepo/CLAUDE.md", "**/code/CLAUDE.md", "**/some-dir/.claude/rules/**"'),pluginTrustMessage:l.string().optional().describe('Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").'),theme:l.union([l.enum(MG),l.string().startsWith("custom:").transform((t)=>t)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:l.enum(LG).optional().catch(void 0).describe("Key binding mode for the prompt input"),vimInsertModeRemaps:l.record(l.string(),l.unknown()).optional().catch(void 0).describe('Vim INSERT-mode key-sequence remaps, e.g. {"jj": "<Esc>"}. Each key is exactly two printable characters typed in sequence; "<Esc>" (return to NORMAL mode) is the only supported target. Applies when editorMode is "vim".'),verbose:l.boolean().optional().describe("Show full tool output instead of truncated summaries"),preferredNotifChannel:l.enum(DG).optional().catch(void 0).describe("Preferred OS notification channel"),autoCompactEnabled:l.boolean().optional().describe("Automatically compact conversation when context fills"),precomputeCompactionEnabled:l.boolean().optional().describe("Precompute the compaction summary in the background before it is needed. Only applies when auto-compact is on."),switchModelsOnFlag:l.boolean().optional().describe("When safeguards flag a message, automatically switch to a different model to keep chatting. When off, your session will pause instead."),autoScrollEnabled:l.boolean().optional().describe("Auto-scroll the conversation view to bottom (fullscreen mode only)"),wheelScrollAccelerationEnabled:l.boolean().optional().describe("Ramp mouse-wheel scroll speed during fast scrolls (fullscreen mode only)"),fileCheckpointingEnabled:l.boolean().optional().describe("Snapshot files before edits so /rewind can restore them"),showTurnDuration:l.boolean().optional().describe('Show "Cooked for Nm Ns" after each assistant turn'),showMessageTimestamps:l.boolean().optional().describe("Stamp each message with its arrival time"),terminalProgressBarEnabled:l.boolean().optional().describe("Emit OSC 9;4 progress sequences during long operations"),todoFeatureEnabled:l.boolean().optional().describe("Enable the todo / task tracking panel"),teammateMode:l.enum(NG).optional().catch(void 0).describe("How spawned teammates execute (tmux, iterm2, in-process, auto)"),remoteControlAtStartup:l.boolean().optional().describe("Start Remote Control bridge automatically each session"),isolatePeerMachines:l.boolean().optional().describe("Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control"),daemonColdStart:l.enum(["transient","ask"]).optional().describe("When no background service is running: 'transient' spawns one for this login session; 'ask' offers to install it persistently"),autoUploadSessions:l.boolean().optional().describe("Mirror local sessions to claude.ai as view-only (no remote control)"),inputNeededNotifEnabled:l.boolean().optional().describe("Push to mobile when a permission prompt or question is waiting"),agentPushNotifEnabled:l.boolean().optional().describe("Allow Claude to push proactive mobile notifications"),...r6(e)}).passthrough()}var Es=C(()=>x6(Kk())),_6=Object.freeze({serverName:"invalid-entry-stripped"});function y6(e,t,r){return l.array(t.catch((n)=>(r({path:`${e}[]`,message:`Invalid entry was ignored: ${n.issues[0]?.message??"failed validation"}`}),_6))).transform((n)=>n.filter((o)=>o!==_6)).optional()}function tO(e){let t=Es(),r={};for(let[s,a]of Object.entries(t.shape))r[s]=a.catch((c)=>{e({path:s,message:`${c.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return});r.allowedMcpServers=y6("allowedMcpServers",Oy(),e).catch(()=>(e({path:"allowedMcpServers",message:'"allowedMcpServers" was present but invalid; enforcing an empty allowlist (no MCP servers admitted) until it is fixed.'}),[])),r.deniedMcpServers=y6("deniedMcpServers",Cy(),e).catch(()=>{e({path:"deniedMcpServers",message:'"deniedMcpServers" was present but invalid and was dropped; its entries cannot be enforced until it is fixed.'});return}),r.allowManagedMcpServersOnly=t.shape.allowManagedMcpServersOnly.catch(()=>(e({path:"allowManagedMcpServersOnly",message:'"allowManagedMcpServersOnly" was present but invalid; treating it as true until it is fixed.'}),!0)),r.enforceAvailableModels=t.shape.enforceAvailableModels.catch(()=>(e({path:"enforceAvailableModels",message:'"enforceAvailableModels" was present but invalid; treating it as true until it is fixed.'}),!0)),r.availableModels=l.array(l.unknown()).transform((s,a)=>{let c=[];for(let u of s)if(typeof u==="string")c.push(u);else e({path:"availableModels",message:`"availableModels" contained a non-string entry (${JSON.stringify(u)}); the entry was ignored.`});return c}).optional().catch(()=>(e({path:"availableModels",message:'"availableModels" was present but invalid; enforcing an empty allowlist (only the default model is available) until it is fixed.'}),[])),r.forceLoginOrgUUID=t.shape.forceLoginOrgUUID.catch(()=>(e({path:"forceLoginOrgUUID",message:'"forceLoginOrgUUID" was present but invalid; no organization is permitted to log in until it is fixed.'}),[]));let n=Object.freeze({mode:"deny"}),o=(s,a)=>l.array(a.catch((c)=>(e({path:`sandbox.credentials.${s}[]`,message:`Invalid entry was ignored: ${c.issues[0]?.message??"failed validation"}. This credential is NOT protected until the entry is fixed.`}),n))).transform((c)=>c.filter((u)=>u!==n)).optional();return r.sandbox=zk().extend({credentials:l.object({files:o("files",jk()),envVars:o("envVars",Fk()),allowPlaintextInject:l.boolean().optional().catch((s)=>{e({path:"sandbox.credentials.allowPlaintextInject",message:`${s.issues[0]?.message??"Invalid value"}. "allowPlaintextInject" was ignored; plaintext credential injection stays disabled until it is fixed.`});return})}).optional().catch((s)=>{e({path:"sandbox.credentials",message:`${s.issues[0]?.message??"Failed schema validation"}. The credentials block was dropped; no credential protection is applied until it is fixed.`});return})}).optional().catch((s)=>{e({path:"sandbox",message:`${s.issues[0]?.message??"Failed schema validation"}. This field was ignored.`});return}),l.object(r).passthrough().transform((s)=>{for(let a of Object.keys(s))if(s[a]===void 0)delete s[a];return s})}var fo="https://code.claude.com/docs/en",bMe=[{matches:(e)=>e.path==="permissions.defaultMode"&&e.code==="invalid_value",tip:{suggestion:'Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)',docLink:`${fo}/iam#permission-modes`}},{matches:(e)=>e.path==="apiKeyHelper"&&e.code==="invalid_type",tip:{suggestion:'Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"'}},{matches:(e)=>e.path==="cleanupPeriodDays"&&e.code==="too_small",tip:{suggestion:'cleanupPeriodDays must be at least 1. To keep transcripts for a long time, set a large number (e.g. 3650 for ~10 years). To disable transcript writes entirely, remove this setting and use the --no-session-persistence CLI flag or the SDK persistSession:false option instead. (0 is rejected because it previously silently disabled all transcript writes, which users setting it to mean "never clean up" did not expect.)'}},{matches:(e)=>e.path.startsWith("env.")&&e.code==="invalid_type",tip:{suggestion:'Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"',docLink:`${fo}/settings#environment-variables`}},{matches:(e)=>(e.path==="permissions.allow"||e.path==="permissions.deny")&&e.code==="invalid_type"&&e.expected==="array",tip:{suggestion:'Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.'}},{matches:(e)=>e.path.startsWith("hooks.")&&e.code==="invalid_key",tip:{suggestion:"Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",docLink:`${fo}/hooks`}},{matches:(e)=>/\.hooks\.\d+\.command$/.test(e.path)&&e.code==="invalid_type"&&e.received==="undefined",tip:{suggestion:'Command hooks require `command`. For exec form (no shell), set `command` to the executable and `args` to its arguments: {"type": "command", "command": "echo", "args": ["hi"]}. For shell form, set `command` to the full shell string: {"type": "command", "command": "echo hi"}.',docLink:`${fo}/hooks#exec-form-and-shell-form`}},{matches:(e)=>e.path.includes("hooks")&&e.code==="invalid_type",tip:{suggestion:'Hooks use a matcher + hooks array. The matcher is a string: a tool name ("Bash"), pipe-separated list ("Edit|Write"), or empty to match all. Example: {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "echo Done"}]}]}'}},{matches:(e)=>e.code==="invalid_type"&&e.expected==="boolean",tip:{suggestion:'Use true or false without quotes. Example: "includeCoAuthoredBy": true'}},{matches:(e)=>e.code==="unrecognized_keys",tip:{suggestion:"Check for typos or refer to the documentation for valid fields",docLink:`${fo}/settings`}},{matches:(e)=>e.code==="invalid_value"&&e.enumValues!==void 0,tip:{suggestion:void 0}},{matches:(e)=>e.code==="invalid_type"&&e.expected==="object"&&e.received===null&&e.path==="",tip:{suggestion:"Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error."}},{matches:(e)=>e.path==="permissions.additionalDirectories"&&e.code==="invalid_type",tip:{suggestion:'Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command',docLink:`${fo}/iam#working-directories`}}],xMe={permissions:`${fo}/iam#configuring-permissions`,env:`${fo}/settings#environment-variables`,hooks:`${fo}/hooks`};function v6(e){let t=bMe.find((n)=>n.matches(e));if(!t)return null;let r={...t.tip};if(e.code==="invalid_value"&&e.enumValues&&!r.suggestion)r.suggestion=`Valid values: ${e.enumValues.map((n)=>`"${n}"`).join(", ")}`;if(!r.docLink&&e.path)r.docLink=xMe[Wy(e.path,".")];return r}var YTt=C(()=>Es().strict());function S6(e){return e.code==="invalid_type"}function E6(e){return e.code==="invalid_value"}function vMe(e){return e.code==="unrecognized_keys"}function w6(e){return e.code==="too_small"}function qc(e){if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";return typeof e}function T6(e){let t=e.match(/received (\w+)/);return t?t[1]:void 0}function $d(e,t){return e.issues.map((r)=>{let n=r.path.map(String).join("."),o=r.message,i,s,a,c,u;if(E6(r))s=r.values.map((f)=>String(f)),a=s.join(" | "),c=void 0,u=void 0;else if(S6(r)){a=r.expected;let f=T6(r.message);c=f??qc(r.input),u=f??qc(r.input)}else if(w6(r))a=String(r.minimum);else if(r.code==="custom"&&"params"in r)c=r.params.received,u=c;let d=v6({path:n,code:r.code,expected:a,received:c,enumValues:s,message:r.message,value:c});if(E6(r))i=s?.map((f)=>`"${f}"`).join(", "),o=`Invalid value. Expected one of: ${i}`;else if(S6(r)){let f=T6(r.message)??qc(r.input);if(r.expected==="object"&&f==="null"&&n==="")o="Invalid or malformed JSON";else o=`Expected ${r.expected}, but received ${f}`}else if(vMe(r)){let f=r.keys.join(", ");o=`Unrecognized ${jO(r.keys.length,"field")}: ${f}`}else if(w6(r))o=`Number must be greater than or equal to ${r.minimum}`,i=String(r.minimum);return{file:t,path:n,message:o,expected:i,invalidValue:u,suggestion:d?.suggestion,docLink:d?.docLink}})}function SMe(e,t){if(!e||typeof e!=="object")return[];let r=e;if(!r.permissions||typeof r.permissions!=="object")return[];let n=r.permissions,o=[];for(let i of["allow","deny","ask"]){let s=n[i];if(!Array.isArray(s))continue;n[i]=s.filter((a)=>{if(typeof a!=="string")return o.push({file:t,path:`permissions.${i}`,message:`Non-string value in ${i} array was removed`,severity:"warning",invalidValue:a}),!1;let c=Qk(a,i);if(!c.valid){let u=`Invalid permission rule "${a}" was skipped: ${c.error}`;if(c.suggestion)u+=`. ${c.suggestion}`;return o.push({file:t,path:`permissions.${i}`,message:u,severity:"warning",invalidValue:a}),!1}return!0})}return o}var EMe=new Set(Os);function wMe(e,t){if(!e||typeof e!=="object")return[];let r=e;if(!("hooks"in r))return[];if(r.hooks===null||typeof r.hooks!=="object"||Array.isArray(r.hooks)){let i=qc(r.hooks);return delete r.hooks,[{file:t,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${i}. This field was ignored.`,severity:"warning",invalidValue:i,docLink:"https://code.claude.com/docs/en/hooks"}]}let n=r.hooks,o=[];for(let i of Object.keys(n)){if(!EMe.has(i)){delete n[i],o.push({file:t,path:`hooks.${i}`,message:`Unknown hook event "${i}" was ignored. Valid events: ${Os.join(", ")}`,severity:"warning",invalidValue:i,docLink:"https://code.claude.com/docs/en/hooks"});continue}if(!Array.isArray(n[i])){let s=qc(n[i]);delete n[i],o.push({file:t,path:`hooks.${i}`,message:`Hook event "${i}" must be an array of matchers; received ${s}. This entry was ignored.`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"})}}if(o.length>0&&Object.keys(n).length===0)delete r.hooks;return o}var TMe=[{key:"allowedMcpServers",schema:Oy},{key:"deniedMcpServers",schema:Cy}];function AMe(e,t){if(!e||typeof e!=="object")return[];let r=e,n=[];for(let{key:o,schema:i}of TMe){if(!(o in r))continue;if(!Array.isArray(r[o])){let c=r[o];delete r[o],n.push({file:t,path:o,message:`"${o}" must be an array; received ${qc(c)}. This field was ignored.`,severity:"warning",invalidValue:c});continue}let s=r[o],a=[];for(let c=0;c<s.length;c++){let u=i().safeParse(s[c]);if(u.success)a.push(s[c]);else n.push({file:t,path:`${o}[${c}]`,message:`Invalid entry was ignored: ${u.error.issues[0]?.message??"failed validation"}`,severity:"warning",invalidValue:s[c]})}if(a.length<s.length)r[o]=a}return n}function ws(e,t,r){return[...SMe(e,t),...wMe(e,t),...r?.skipMcpServerEntryFilter?[]:AMe(e,t)]}function oO(e){let t=new Set(e.allowedSources);return t.add("flagSettings"),t.add("policySettings"),wG.filter((r)=>t.has(r))}function CMe(){return Tn(xs(),"managed-settings.json")}function k6(e){if(no()==="wsl"&&e.wslInherits?.()){let t=rO(zc);if(t.settings)return t;let r=rO(xs());return{settings:r.settings,errors:[...t.errors,...r.errors]}}return rO(xs())}function rO(e){let t=[],r={},n=!1,{settings:o,errors:i}=Gc(Tn(e,"managed-settings.json"),void 0,!0);if(t.push(...i),o&&Object.keys(o).length>0)r=En(r,o,Un),n=!0;let s=Tn(e,"managed-settings.d");try{let u=Fe().readdirSync(s).filter((d)=>(d.isFile()||d.isSymbolicLink())&&d.name.endsWith(".json")&&!d.name.startsWith(".")).map((d)=>d.name).sort();for(let d of u){let{settings:f,errors:m}=Gc(Tn(s,d),void 0,!0);if(t.push(...m),f&&Object.keys(f).length>0)r=En(r,f,Un),n=!0}}catch(u){let d=dt(u);if(d!=="ENOENT"&&d!=="ENOTDIR")ce(`managed-settings.d read failed: ${u}`,{level:"error"})}let{wslInheritsWindowsSettings:a,...c}=r;return{settings:n&&Object.keys(c).length>0?r:null,errors:t}}function RMe(e,t){if(On(e))ce(`Broken symlink or missing file encountered for settings.json at path: ${t}`);else ce(`settings file read failed at ${t}: ${e}`,{level:"error"})}function Gc(e,t,r){let n=xD(e);if(n)return{settings:n.settings?Ho(n.settings):null,errors:n.errors};let o=DMe(e,t,r);return vD(e,o),{settings:o.settings?Ho(o.settings):null,errors:o.errors}}function O6(e){if(!e.mdm)return{settings:null,errors:[]};let t=e.mdm();return{settings:Object.keys(t.settings).length>0?t.settings:null,errors:t.errors}}function Ry(e,t){let r=Ho(e),n=ws(r,t,{skipMcpServerEntryFilter:!0}),o=[],i=tO((s)=>o.push({file:t,path:s.path,message:s.message,severity:"warning"})).safeParse(r);if(!i.success)return{settings:null,errors:[...n,...$d(i.error,t)]};return{settings:Object.keys(i.data).length>0?i.data:null,errors:[...n,...o]}}function C6(e){let t=e?.remote?e.remote():EG();if(!t||Object.keys(t).length===0)return{settings:null,errors:[]};return Ry(t,"remote managed settings")}function IMe(e){let t=e.parentManaged;if(!t||Object.keys(t).length===0)return{settings:null,errors:[]};return Ry(t,"parent managed settings")}function R6(e){let t=e.flagInline;if(!t)return{settings:null,errors:[]};let r=Ho(t),n=ws(r,"SDK inline settings"),o=Es().safeParse(r);if(!o.success)return{settings:null,errors:[...n,...$d(o.error,"SDK inline settings")]};return{settings:o.data,errors:n}}var PMe=2097152;function DMe(e,t,r){try{let n;if(t!==void 0)n=t;else{let{resolvedPath:a}=ih(Fe(),e);n=bs(a,PMe)}if(n.trim()==="")return{settings:{},errors:[]};let o=Ho(Mc(n,!1));if(r){let a=ws(o,e,{skipMcpServerEntryFilter:!0}),c=[],u=tO((d)=>c.push({file:e,path:d.path,message:d.message,severity:"warning"})).safeParse(o);if(!u.success)return{settings:null,errors:[...a,...$d(u.error,e)]};return{settings:u.data,errors:[...a,...c]}}let i=ws(o,e),s=Es().safeParse(o);if(!s.success){let a=$d(s.error,e);return{settings:null,errors:[...i,...a]}}return{settings:s.data,errors:i}}catch(n){if(RMe(n,e),On(n))return{settings:null,errors:[]};return{settings:null,errors:[{file:e,path:"",message:`Settings file could not be read: ${n instanceof Error?n.message:String(n)}`,severity:"fatal"}]}}}function A6(e,t){switch(e){case"userSettings":return Zr(Yt());case"policySettings":case"projectSettings":return Zr(t.cwd);case"localSettings":return I6(t.cwd,t.canonicalGitRoot);case"flagSettings":return t.flagPath?OMe(Zr(t.flagPath)):Zr(t.cwd)}}function I6(e,t){let r=t?.(e);if(!r)return Zr(e);let n=Zr(r),o=Zr(e);if(n===o)return n;let i;try{i=MMe()}catch{return o}if(n===i)return o;if(!NMe(n))return o;return n}var LMe=re((e)=>{let t=Fe(),r=null;try{r=t.lstatSync(Tn(e,".claude")).uid}catch(n){if(!On(n))throw n}return{rootUid:t.statSync(e).uid,gitEntryUid:t.lstatSync(Tn(e,".git")).uid,claudeEntryUid:r}});function NMe(e){if(typeof process.getuid!=="function"&&typeof process.geteuid!=="function")return ce(`localSettings: not canonicalizing the consent store to ${e} — this platform has no uid semantics to verify directory ownership with, so the store stays at the session cwd (canonicalization is POSIX-only)`,{level:"warn"}),!1;let t=typeof process.geteuid==="function"?process.geteuid():process.getuid?.();try{let{rootUid:r,gitEntryUid:n,claudeEntryUid:o}=LMe(e);if(r===t&&n===t&&(o===null||o===t))return!0;return ce(`localSettings: not canonicalizing the consent store to ${e} — it (uid ${r}), its .git entry (uid ${n}), or its .claude entry (uid ${o??"absent"}) is not owned by the current user (uid ${t}); the store stays at the session cwd (the pre-canonicalization behavior). If you own this repo, chown it (including .git and .claude) or run from a directory you own.`,{level:"warn"}),!1}catch(r){return ce(`localSettings: not canonicalizing the consent store to ${e} — its ownership could not be verified (${r instanceof Error?r.message:String(r)}); the store stays at the session cwd`,{level:"warn"}),!1}}var MMe=re(()=>{let e=Hy(kMe());if(e===null)throw Error("home directory realpath unavailable");return xr(e)});function UMe(e){if(e.coworkPlugins||Hr.CLAUDE_CODE_USE_COWORK_PLUGINS)return"cowork_settings.json";return"settings.json"}function jd(e,t){switch(e){case"userSettings":return Tn(A6(e,t),UMe(t));case"projectSettings":case"localSettings":return Tn(A6(e,t),P6(e));case"policySettings":return CMe();case"flagSettings":return t.flagPath}}function P6(e){switch(e){case"projectSettings":return Tn(".claude","settings.json");case"localSettings":return Tn(".claude","settings.local.json")}}function D6(e){if(I6(e.cwd,e.canonicalGitRoot)===Zr(e.cwd))return;return Tn(Zr(e.cwd),P6("localSettings"))}function L6(e,t){let r=yD(e);if(r!==void 0)return r;let n=FMe(e,t);return bD(e,n),n}function $Me(e){return!e||e.parentSettingsBehavior==="merge"}function jMe(e,t){let r={};if(e.allowManagedHooksOnly===!0)r.allowManagedHooksOnly=!0;if(e.allowManagedMcpServersOnly===!0)r.allowManagedMcpServersOnly=!0;if(e.disableClaudeAiConnectors===!0)r.disableClaudeAiConnectors=!0;if(e.allowManagedPermissionRulesOnly===!0)r.allowManagedPermissionRulesOnly=!0;let n=e.strictPluginOnlyCustomization;if(n===!0||Array.isArray(n)&&n.length>0)r.strictPluginOnlyCustomization=n;if(e.deniedMcpServers)r.deniedMcpServers=e.deniedMcpServers;if(t.forceLoginOrgUUID===void 0&&e.forceLoginOrgUUID)r.forceLoginOrgUUID=e.forceLoginOrgUUID;if(t.allowedMcpServers===void 0&&e.allowedMcpServers)r.allowedMcpServers=e.allowedMcpServers;if(t.availableModels===void 0&&e.availableModels)r.availableModels=e.availableModels;if(e.enforceAvailableModels===!0)r.enforceAvailableModels=!0;if(e.permissions){let o=Ey(e.permissions,["deny","ask"]);if(e.permissions.disableBypassPermissionsMode==="disable")o.disableBypassPermissionsMode="disable";if(t.allowManagedPermissionRulesOnly!==!0){let{allow:i,additionalDirectories:s}=e.permissions;if(i&&t.sandbox?.network?.allowManagedDomainsOnly!==!0)o.allow=i;if(s)o.additionalDirectories=s}if(Object.keys(o).length>0)r.permissions=o}if(e.sandbox){let{network:o,filesystem:i,credentials:s}=e.sandbox,a={};if(e.sandbox.enabled===!0)a.enabled=!0;if(e.sandbox.failIfUnavailable===!0)a.failIfUnavailable=!0;if(e.sandbox.allowUnsandboxedCommands===!1)a.allowUnsandboxedCommands=!1;if(e.sandbox.autoAllowBashIfSandboxed===!1)a.autoAllowBashIfSandboxed=!1;if(o){let c=Ey(o,["deniedDomains"]);if(o.allowManagedDomainsOnly===!0)c.allowManagedDomainsOnly=!0;if(o.strictAllowlist===!0)c.strictAllowlist=!0;if(t.sandbox?.network?.allowManagedDomainsOnly!==!0&&o.allowedDomains)c.allowedDomains=o.allowedDomains;if(Object.keys(c).length>0)a.network=c}if(i){let c=Ey(i,["denyRead","denyWrite"]);if(i.allowManagedReadPathsOnly===!0)c.allowManagedReadPathsOnly=!0;if(i.disabled===!1)c.disabled=!1;if(t.sandbox?.filesystem?.allowManagedReadPathsOnly!==!0&&i.allowRead)c.allowRead=i.allowRead;if(Object.keys(c).length>0)a.filesystem=c}if(s){let c=(s.files??[]).filter((f)=>f.mode==="deny"),u=(s.envVars??[]).filter((f)=>f.mode==="deny"),d={...c.length>0&&{files:c},...u.length>0&&{envVars:u}};if(s.allowPlaintextInject===!1)d.allowPlaintextInject=!1;if(Object.keys(d).length>0)a.credentials=d}if(Object.keys(a).length>0)r.sandbox=a}return r}function N6(e){if(e.helper?.())return"helper";if(C6(e).settings)return"remote";if(O6(e).settings)return no()==="macos"?"plist":"hklm";if((e.file?.()??k6(e)).settings)return"file";if(M6(e).parentSlice)return"parent";let t=e.hkcu?.();return t&&Object.keys(t.settings).length>0?"hkcu":null}function M6(e){let t=[],{settings:r,errors:n}=C6(e);t.push(...n);let{settings:o,errors:i}=O6(e);t.push(...i);let{settings:s,errors:a}=e.file?.()??k6(e);t.push(...a);let{settings:c,errors:u}=IMe(e);t.push(...u);let d=[r,o,s].filter((_)=>_!==null),f=d[0]??null,m={allowManagedPermissionRulesOnly:d.some((_)=>_.allowManagedPermissionRulesOnly===!0)||void 0,forceLoginOrgUUID:d.find((_)=>_.forceLoginOrgUUID!==void 0)?.forceLoginOrgUUID,allowedMcpServers:d.find((_)=>_.allowedMcpServers!==void 0)?.allowedMcpServers,availableModels:d[0]?.availableModels,sandbox:{network:{allowManagedDomainsOnly:d.some((_)=>_.sandbox?.network?.allowManagedDomainsOnly===!0)||void 0},filesystem:{allowManagedReadPathsOnly:d.some((_)=>_.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)||void 0}}},g=c&&$Me(f)?jMe(c,m):null,h=g&&Object.keys(g).length>0?g:null;return{tiers:d,admin:f,parentSlice:h,errors:t}}function U6(e){let t=e.helper?.();if(t)return{settings:t,errors:e.helperWarnings?.()??[]};let{tiers:r,admin:n,parentSlice:o,errors:i}=M6(e);if(!n&&!o){let a=e.hkcu?.();if(a&&Object.keys(a.settings).length>0)return{settings:a.settings,errors:[...i,...a.errors]};return{settings:null,errors:[...i,...a?.errors??[]]}}let s=En({},o??{},n??{},Un);if(r.some((a)=>a.forceRemoteSettingsRefresh===!0))s.forceRemoteSettingsRefresh=!0;return{settings:s,errors:i}}function FMe(e,t,{includeLegacyLocalSettings:r=!0}={}){if(e==="policySettings")return U6(t).settings;let n=jd(e,t),{settings:o}=n?Gc(n,e==="flagSettings"?t.flagExpectedContent:void 0):{settings:null};if(e==="flagSettings"){let{settings:i}=R6(t);if(i)return En(o||{},i,Un)}if(e==="localSettings"&&r){let i=D6(t);if(i){let{settings:s}=Gc(i);if(s)return En(s,o||{},Un)}}return o}function Un(e,t,r){if(Array.isArray(e)&&Array.isArray(t)){if(r==="fallbackModel")return t;return Ra([...e,...t])}return}var nO=!1;function zMe(e){if(nO)return{settings:{},errors:[]};let t=Date.now();kd("info","settings_load_started"),nO=!0;try{let r=SD(),n={};if(r)n=En(n,r,Un);let o=[],i=new Set,s=new Set,a=(u)=>{for(let d of u){let f=`${d.file}:${d.path}:${d.message}`;if(!i.has(f))i.add(f),o.push(d)}},c=null;for(let u of oO(e)){if(u==="policySettings"){let{settings:f,errors:m}=U6(e);if(c=f,f)n=En(n,f,Un);a(m);continue}if(u==="localSettings"){let f=D6(e);if(f&&!s.has(Zr(f))){s.add(Zr(f));let{settings:m,errors:g}=Gc(f);if(a(g),m)n=En(n,m,Un)}}let d=jd(u,e);if(d){let f=Zr(d);if(!s.has(f)){s.add(f);let{settings:m,errors:g}=Gc(d,u==="flagSettings"?e.flagExpectedContent:void 0);if(a(g),m)n=En(n,m,Un)}}if(u==="flagSettings"){let{settings:f,errors:m}=R6(e);if(a(m),f)n=En(n,f,Un)}}if(c){if(c.availableModels!==void 0)n.availableModels=[...c.availableModels];if(c.enforceAvailableModels!==void 0)n.enforceAvailableModels=c.enforceAvailableModels}return kd("info","settings_load_completed",{duration_ms:Date.now()-t,source_count:s.size,error_count:o.length}),{settings:n,errors:o}}finally{nO=!1}}function BMe(e){let t=hD();if(t!==null)return t;let r=zMe(e);return _D(r),r}function HMe(e){let{settings:t}=BMe(e);return t||{}}function $6(e){qi();let t=[];for(let r of oO(e)){let n=L6(r,e);if(n&&Object.keys(n).length>0)t.push({source:r,settings:n})}return{effective:HMe(e),sources:t}}function j6(e,t){let r=oO(t);for(let n=r.length-1;n>=0;n--){let o=r[n];if(L6(o,t)?.[e]!==void 0)return o}return null}import{execFile as qMe}from"child_process";import{existsSync as GMe}from"fs";var WMe=null;function Fd(e,t){return new Promise((r)=>{try{qMe(e,t,{encoding:"utf-8",timeout:OG,windowsHide:!0},(n,o)=>{r({stdout:o??"",code:n?1:0})})}catch{r({stdout:"",code:1})}})}function F6(){return(async()=>{if(process.platform==="darwin"){let e=CG(),r=(await Promise.all(e.map(async({path:n,label:o})=>{if(!GMe(n))return{stdout:"",label:o,ok:!1};let{stdout:i,code:s}=await Fd(AG,[...kG,n]);return{stdout:i,label:o,ok:s===0&&!!i}}))).find((n)=>n.ok);return{plistStdouts:r?[{stdout:r.stdout,label:r.label}]:[],hklmStdout:null,hkcuStdout:null}}if(process.platform==="win32"){let t=`${process.env.SYSTEMROOT||"C:\\Windows"}\\System32\\reg.exe`,[r,n]=await Promise.all([Fd(t,["query",Id,"/v",pi]),Fd(t,["query",Pd,"/v",pi])]);return{plistStdouts:null,hklmStdout:r.code===0?r.stdout:null,hkcuStdout:n.code===0?n.stdout:null}}if(wy()){let[e,t]=await Promise.all([Fd($k,["query",Id,"/v",pi]),Fd($k,["query",Pd,"/v",pi])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:t.code===0?t.stdout:null}}return{plistStdouts:null,hklmStdout:null,hkcuStdout:null}})()}function z6(){return WMe}var fi=Object.freeze({settings:{},errors:[]}),G6=null,W6=null,V6=!1,Iy=null;function VMe(){if(Iy)return;Iy=(async()=>{let e=Date.now(),t=z6()??F6(),{mdm:r,hkcu:n,wslInherits:o}=KMe(await t);G6=r,W6=n,V6=o;let i=Date.now()-e;if(ce(`MDM settings load completed in ${i}ms`),Object.keys(r.settings).length>0){ce(`MDM settings found: ${Object.keys(r.settings).join(", ")}`);try{kd("info","mdm_settings_loaded",{duration_ms:i,key_count:Object.keys(r.settings).length,error_count:r.errors.length})}catch{}}})()}async function K6(){if(!Iy)VMe();await Iy}function Z6(){return G6??fi}function J6(){return W6??fi}function Y6(){return V6}function iO(e,t){let r=Mc(e,!1);if(!r||typeof r!=="object")return{settings:{},errors:[]};let{settings:n,errors:o}=Ry(r,t);return{settings:n??{},errors:o}}function B6(e,t="Settings"){let r=e.split(/\r?\n/),n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`^\\s+${n}\\s+REG_(?:EXPAND_)?SZ\\s+(.*)$`,"i");for(let i of r){let s=i.match(o);if(s&&s[1])return s[1].trimEnd()}return null}function KMe(e){let t=[];if(e.plistStdouts&&e.plistStdouts.length>0){let{stdout:s,label:a}=e.plistStdouts[0],c=iO(s,a),{wslInheritsWindowsSettings:u,...d}=c.settings;if(Object.keys(d).length>0)return{mdm:c,hkcu:fi,wslInherits:!1};t.push(...c.errors)}let r=null;if(e.hklmStdout){let s=B6(e.hklmStdout);if(s)r=iO(s,`Registry: ${Id}\\${pi}`)}if(r)t.push(...r.errors);let n=t.length>0?{settings:{},errors:t}:fi,o=wy(),i=!1;if(o){if(i=r?.settings.wslInheritsWindowsSettings===!0||JMe(),!i)return{mdm:n,hkcu:fi,wslInherits:!1}}if(r){let{wslInheritsWindowsSettings:s,...a}=r.settings;if(Object.keys(a).length>0)return{mdm:r,hkcu:fi,wslInherits:i}}if(ZMe(i))return{mdm:n,hkcu:fi,wslInherits:i};if(e.hkcuStdout){let s=B6(e.hkcuStdout);if(s){let a=iO(s,`Registry: ${Pd}\\${pi}`);if(!o||a.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:c,...u}=a.settings;return{mdm:n,hkcu:{settings:u,errors:a.errors},wslInherits:i}}if(a.errors.length>0)return{mdm:n,hkcu:{settings:{},errors:a.errors},wslInherits:i}}}return{mdm:n,hkcu:fi,wslInherits:i}}function ZMe(e){if(e&&q6(zc))return!0;return q6(xs())}function H6(e){let t=Ho(Mc(bs(e),!1));if(!t||typeof t!=="object")return!1;ws(t,e);let{wslInheritsWindowsSettings:r,...n}=t;return Object.keys(n).length>0}function JMe(){function e(t){try{let r=Mc(bs(t),!1);return!!r&&typeof r==="object"&&"wslInheritsWindowsSettings"in r&&r.wslInheritsWindowsSettings===!0}catch{return!1}}if(e(Wc(zc,"managed-settings.json")))return!0;try{let t=Wc(zc,"managed-settings.d");for(let r of Fe().readdirSync(t))if((r.isFile()||r.isSymbolicLink())&&r.name.endsWith(".json")&&!r.name.startsWith(".")&&e(Wc(t,r.name)))return!0}catch{}return!1}function q6(e){try{if(H6(Wc(e,"managed-settings.json")))return!0}catch{}try{let t=Wc(e,"managed-settings.d"),r=Fe().readdirSync(t);for(let n of r){if(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(".json")||n.name.startsWith("."))continue;try{if(H6(Wc(t,n.name)))return!0}catch{}}}catch{}return!1}var XMe={user:"userSettings",project:"projectSettings",local:"localSettings"},X6={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},QMe=["user","project","local"],eUe=new Set(["bypassPermissions","auto","acceptEdits"]),tUe=new Set(["project"]);function rUe(e){let t=e.effective.permissions?.defaultMode;if(!t||!eUe.has(t))return e.effective;for(let r=e.sources.length-1;r>=0;r--){let n=e.sources[r];if(n.settings.permissions?.defaultMode!==void 0){if(tUe.has(n.source)){let{defaultMode:o,...i}=e.effective.permissions??{};return{...e.effective,permissions:i}}return e.effective}}return e.effective}async function Q6(e={}){await K6();let t={cwd:YMe(e.cwd??Fe().cwd()),allowedSources:(e.settingSources??QMe).map((r)=>XMe[r]),parentManaged:e.managedSettings??null,flagInline:null,flagPath:void 0,mdm:Z6,hkcu:J6,wslInherits:Y6,...e.serverManagedSettings!==void 0&&{remote:()=>e.serverManagedSettings}};try{let{effective:r,sources:n}=$6(t),o=N6(t)??void 0,i=n.map(({source:a,settings:c})=>({source:X6[a],settings:c,path:a==="policySettings"?void 0:jd(a,t),...a==="policySettings"&&{policyOrigin:o}})),s={};for(let a of Object.keys(r)){let c=j6(a,t);if(c)s[a]={source:X6[c],path:c==="policySettings"?void 0:jd(c,t),...c==="policySettings"&&{policyOrigin:o}}}return{effective:r,provenance:s,sources:i}}finally{qi()}}process.env.NoDefaultCurrentDirectoryInExePath="1";async function kkt(e){return Q6(e)}async function fUe(e,t){try{await sUe(e,t)}catch(r){if(!On(r))throw r}}async function mUe(e,t){if(!e)return;let r=e;try{let n=yt(e);if(n?.claudeAiOauth?.refreshToken)delete n.claudeAiOauth.refreshToken,r=Re(n)}catch{}await oW(t,r,{mode:384})}function gUe(){if(process.platform!=="darwin")return Promise.resolve(void 0);let e=vF(xF);return new Promise((t)=>{nUe("security",["find-generic-password","-a",SF(),"-w","-s",e],{encoding:"utf-8",timeout:5000,windowsHide:!0},(r,n)=>t(r?void 0:n.trim()||void 0))})}async function aW(e,t,r,n,o=60000){if(!ze(t))return;let i=Jr(r),s=await Mr(e.load({projectKey:i,sessionId:t}),o,`SessionStore.load() timed out after ${o}ms for session ${t}`);if(!s||s.length===0)return;let a=Dr(uUe(),`claude-resume-${lO()}`);try{let c=Dr(a,"projects",i);await sO(c,{recursive:!0});let u=Dr(c,`${t}.jsonl`);await qp(u,s);let d=n?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR,f=d??Dr(aO(),".claude"),m;try{m=await nW(Dr(f,".credentials.json"),"utf-8")}catch(g){if(!On(g))throw g}if(!d&&!(n??process.env).ANTHROPIC_API_KEY&&!(n??process.env).CLAUDE_CODE_OAUTH_TOKEN)m=await gUe()??m;if(await mUe(m,Dr(a,".credentials.json")),await fUe(Dr(d??aO(),".claude.json"),Dr(a,".claude.json")),e.listSubkeys)await hUe(e,{projectKey:i,sessionId:t},Dr(c,t),o);return a}catch(c){throw await Py(a),c}}async function hUe(e,t,r,n){let o=await Mr(e.listSubkeys({projectKey:t.projectKey,sessionId:t.sessionId}),n,`SessionStore.listSubkeys() timed out after ${n}ms for session ${t.sessionId}`);for(let i of o){let s=zd(r,i+".jsonl");if(!i||iW(i)||i.split(/[\\/]/).includes("..")||!s.startsWith(r+uO)){ce(`[SessionStore] skipping unsafe subpath from listSubkeys: ${i}`,{level:"warn"});continue}let a=await Mr(e.load({projectKey:t.projectKey,sessionId:t.sessionId,subpath:i}),n,`SessionStore.load() timed out after ${n}ms for session ${t.sessionId} subpath ${i}`);if(!a||a.length===0)continue;let c=[],u=[];for(let d of a)if(cO(d))c.push(d);else u.push(d);if(u.length>0)await sO(eW(s),{recursive:!0}),await qp(s,u);if(c.length>0){let d=c.at(-1),f=zd(r,i+".meta.json");await sO(eW(f),{recursive:!0});let{type:m,...g}=d;await oW(f,Re(g),{mode:384})}}}function pO(e,t){let{isSingleUserTurn:r,resumeConfigDir:n,deferSpawn:o}=t,{systemPrompt:i,settings:s,managedSettings:a,settingSources:c,sandbox:u,...d}=e??{},f,m,g;if(i===void 0)f="";else if(typeof i==="string")f=i;else if(Array.isArray(i))f=i;else if(i.type==="preset")m=i.append,g=i.excludeDynamicSections;process.env.CLAUDE_AGENT_SDK_VERSION="0.3.220";let{abortController:h=Jc(),additionalDirectories:_=[],agent:y,agents:b,allowedTools:T=[],betas:w,canUseTool:k,continue:P,cwd:te,debug:oe,debugFile:Oe,disallowedTools:ke=[],tools:jt,env:xt,executable:Ft=Cs()?"bun":"node",executableArgs:vt=[],extraArgs:St={},fallbackModel:Lr,enableFileCheckpointing:H,toolConfig:Nr,forkSession:Vt,hooks:Ye,includeHookEvents:yr,includePartialMessages:nt,forwardSubagentText:W,onElicitation:q,onUserDialog:V,supportedDialogKinds:ve,persistSession:me,sessionStore:He,sessionStoreFlush:Yr,thinking:qe,effort:mo,maxThinkingTokens:$n,maxTurns:mt,maxBudgetUsd:Bd,taskBudget:mW,mcpServers:fO,model:gW,outputFormat:mO,permissionMode:gO="default",allowDangerouslySkipPermissions:hW=!1,permissionPromptToolName:_W,plugins:yW,getOAuthToken:hO,getHostAuthToken:_O,workload:yO,resume:bO,resumeSessionAt:bW,sessionId:xW,skills:xO,stderr:vW,strictMcpConfig:SW}=d;if(He&&me===!1)throw Error("sessionStore cannot be used with persistSession: false -- the storage adapter requires local writes to mirror from. Use CLAUDE_CONFIG_DIR=/tmp for ephemeral local writes with external mirroring.");if(ve!==void 0&&ve.length>0&&!V)throw Error("supportedDialogKinds requires an onUserDialog callback -- declaring dialog kinds without a handler would park dialogs nothing can answer. Provide onUserDialog, or omit supportedDialogKinds.");if(He&&P&&!bO&&!He.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");if(He&&H)throw Error("enableFileCheckpointing is not yet supported with sessionStore (backup blobs are not mirrored, so rewindFiles() fails after a store-backed resume).");if(He&&d.spawnClaudeCodeProcess)ce("sessionStore with custom spawnClaudeCodeProcess: ensure the subprocess CLAUDE_CONFIG_DIR matches the parent (same path, same separators) or transcript_mirror frames will be dropped.",{level:"warn"});EF(!!k,gO,T);let Ly=d.pathToClaudeCodeExecutable;if(!Ly){let br=dUe(import.meta.url),Xr=lUe(br),mi=FU((Ts)=>Xr.resolve(Ts));if(!mi)throw Error(`Native CLI binary for ${process.platform}-${process.arch} not found. Reinstall @anthropic-ai/claude-agent-sdk without --omit=optional, or set options.pathToClaudeCodeExecutable.`);Ly=mi}let vO=mO?.type==="json_schema"?mO.schema:void 0,Kt=xt?{...xt}:{...process.env};if(!Kt.CLAUDE_CODE_ENTRYPOINT)Kt.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(!Kt.CLAUDE_AGENT_SDK_VERSION)Kt.CLAUDE_AGENT_SDK_VERSION="0.3.220";if(H)Kt.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true";if(hO)Kt.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH="1";if(_O)Kt.CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH="1";if(Nr?.askUserQuestion?.previewFormat)Kt.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=Nr.askUserQuestion.previewFormat;let Ny={};if(Dy.propagation.inject(Dy.context.active(),Ny),"traceparent"in Ny){for(let br of["TRACEPARENT","TRACESTATE"])if(!(br in(xt??{})))delete Kt[br]}for(let[br,Xr]of Object.entries(Ny)){let mi=br.toUpperCase();if(!(mi in(xt??{})))Kt[mi]=Xr}let SO={},EO=new Map;if(fO)for(let[br,Xr]of Object.entries(fO))if(Xr.type==="sdk"&&Xr.instance)EO.set(br,Xr.instance);else SO[br]=Xr;let Vc;if(qe)switch(qe.type){case"adaptive":Vc={type:"adaptive",display:qe.display};break;case"enabled":Vc={type:"enabled",budgetTokens:qe.budgetTokens,display:qe.display};break;case"disabled":Vc={type:"disabled"};break}else if($n!==void 0)Vc=$n===0?{type:"disabled"}:{type:"enabled",budgetTokens:$n};if(n){if(Kt.CLAUDE_CONFIG_DIR=n,process.platform==="win32")Kt.CLAUDE_SECURESTORAGE_CONFIG_DIR=xt?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??xt?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??""}let wO=new Uw({abortController:h,additionalDirectories:_,agent:y,betas:w,cwd:te,debug:oe,debugFile:Oe,executable:Ft,executableArgs:vt,extraArgs:yO?{...St,workload:yO}:St,pathToClaudeCodeExecutable:Ly,env:Kt,forkSession:Vt,stderr:vW,thinkingConfig:Vc,effort:mo,maxTurns:mt,maxBudgetUsd:Bd,taskBudget:mW,model:gW,fallbackModel:Lr,jsonSchema:vO,permissionMode:gO,allowDangerouslySkipPermissions:hW,permissionPromptToolName:_W,continueConversation:He?void 0:P,resume:bO,resumeSessionAt:bW,sessionId:xW,settings:typeof s==="object"?Re(s):s,managedSettings:a?Re(a):void 0,settingSources:c,skills:xO,allowedTools:T,disallowedTools:ke,tools:jt,mcpServers:SO,strictMcpConfig:SW,canUseTool:!!k,hooks:!!Ye,includeHookEvents:yr,includePartialMessages:nt,persistSession:me,sessionMirror:!!He,plugins:yW,sandbox:u,spawnClaudeCodeProcess:d.spawnClaudeCodeProcess,deferSpawn:o}),EW={systemPrompt:f,appendSystemPrompt:m,planModeInstructions:d.planModeInstructions,appendSubagentSystemPrompt:d.appendSubagentSystemPrompt,toolAliases:d.toolAliases,excludeDynamicSections:g,agents:b,title:d.title,skills:xO,webSearchIsolationExemptMcpServers:d.webSearchIsolationExemptMcpServers,promptSuggestions:d.promptSuggestions,agentProgressSummaries:d.agentProgressSummaries,forwardSubagentText:W,supportedDialogKinds:ve},My=new Hh(wO,r,k,Ye,h,EO,vO,EW,q,hO,_O,V);if(He){let br=()=>Dr(Kt.CLAUDE_CONFIG_DIR??Dr(aO(),".claude"),"projects"),Xr=Yr==="eager",mi=new Bw(async(Ts,Uy)=>{let Kc=rW(Ts,br());if(Kc)await He.append(Kc,Uy);else ce(`[SessionStore] dropping mirror frame: filePath ${Ts} is not under ${br()} -- subprocess CLAUDE_CONFIG_DIR likely differs from parent (custom spawnClaudeCodeProcess / container?)`,{level:"warn"})},{onError:(Ts,Uy)=>{let Kc=rW(Ts,br());if(Kc)My.reportMirrorError(Kc,Uy.message)},maxPendingEntries:Xr?0:qh,maxPendingBytes:Xr?0:Gh});My.setTranscriptMirrorBatcher(mi)}return{queryInstance:My,transport:wO,abortController:h,processEnv:Kt}}function dO(e,t,r,n){if(typeof r==="string")t.write(Re({type:"user",session_id:"",message:{role:"user",content:[{type:"text",text:r}]},parent_tool_use_id:null})+`
|
|
137
137
|
`);else e.streamInput(r).catch((o)=>n.abort(o))}var _Ue=new Set(["EBUSY","EMFILE","ENFILE","ENOTEMPTY","EPERM"]);async function Py(e){for(let t=0;;t++)try{return await cUe(e,{recursive:!0,force:!0})}catch(r){if(t>=4||!_Ue.has(dt(r)??""))return;await jn((t+1)*100)}}function yUe(e,t){e.waitForExit().catch(()=>{}).finally(()=>Py(t))}function Okt({prompt:e,options:t}){if((t?.resume||t?.continue)&&t?.sessionStore)return bUe(e,t);let{queryInstance:r,transport:n,abortController:o}=pO(t,{isSingleUserTurn:typeof e==="string"});return dO(r,n,e,o),r}function bUe(e,t){let{queryInstance:r,transport:n,abortController:o,processEnv:i}=pO({...t},{isSingleUserTurn:typeof e==="string",deferSpawn:!0}),s=zd(t.cwd??"."),a=t.sessionStore,c=t.loadTimeoutMs??60000,u=t.resume;return(async()=>{if(!u)u=(await Mr(a.listSessions(Jr(s)),c,`SessionStore.listSessions() timed out after ${c}ms`)).slice().sort((m,g)=>g.mtime-m.mtime)[0]?.sessionId;if(!u)return;return aW(a,u,s,t.env,t.loadTimeoutMs)})().then((f)=>{if(f){n.updateResume(u);let m={CLAUDE_CONFIG_DIR:f};if(process.platform==="win32"){let g=t.env?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??t.env?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??"";m.CLAUDE_SECURESTORAGE_CONFIG_DIR=g,i.CLAUDE_SECURESTORAGE_CONFIG_DIR=g}n.updateEnv(m),i.CLAUDE_CONFIG_DIR=f,r.addCleanupCallback(()=>yUe(n,f))}if(!r.isClosed())n.spawn()}).catch((f)=>{let m=kn(f);n.spawnAbort(m),r.setError(m)}),dO(r,n,e,o),r}async function Ckt({options:e,initializeTimeoutMs:t=60000}={}){let r,n=e?.resume;if((n||e?.continue)&&e?.sessionStore){let a=zd(e.cwd??".");if(!n){if(!e.sessionStore.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");let c=e.loadTimeoutMs??60000;n=(await Mr(e.sessionStore.listSessions(Jr(a)),c,`SessionStore.listSessions() timed out after ${c}ms`)).slice().sort((d,f)=>f.mtime-d.mtime)[0]?.sessionId}if(n)r=await aW(e.sessionStore,n,a,e.env,e.loadTimeoutMs)}let o,i,s;try{let m=function(){if(f)return;f=!0,d.close()},a=pO(r&&n&&n!==e?.resume?{...e,resume:n}:e,{isSingleUserTurn:!1,resumeConfigDir:r});o=a.queryInstance;let{transport:c,abortController:u}=a;i=c;let d=a.queryInstance;if(r){let g=r;d.addCleanupCallback(()=>{s=c.waitForExit().catch(()=>{}).then(()=>Py(g))})}await Mr(d.initializationResult(),t,`Subprocess initialization did not complete within ${t}ms — check authentication and network connectivity`);let f=!1;return{query(g){if(f)throw Error("WarmQuery.query() can only be called once");f=!0;try{dO(d,c,g,u)}catch(h){throw d.close(),h}if(typeof g==="string")d.setIsSingleUserTurn(!0);return d},close:m,async[Symbol.asyncDispose](){f=!0,d.close(),await s}}}catch(a){if(o?.close(),r&&!s){let c=i;s=(c?c.waitForExit().catch(()=>{}):Promise.resolve()).then(()=>Py(r))}throw await s,a}}async function Rkt(e,t){if(t?.sessionStore)return wUe(t.sessionStore,e,t);return eF(e,t)}async function Ikt(e){if(e?.sessionStore)return vUe(e.sessionStore,e);return rF(e)}async function Pkt(e,t){if(t?.sessionStore)return TUe(t.sessionStore,e,t);return nF(e,t)}async function Dkt(e,t,r){if(r?.sessionStore)return AUe(r.sessionStore,e,t,r.dir);return aF(e,t,r)}async function Lkt(e,t,r){if(r?.sessionStore)return kUe(r.sessionStore,e,t,r.dir);return cF(e,t,r)}async function Nkt(e,t){if(!ze(e))throw new Xt(`Invalid sessionId: ${e}`,"deleteSession: invalid sessionId (must be a UUID)");if(t?.sessionStore){if(!t.sessionStore.delete)return;let r=Jr(t.dir);await t.sessionStore.delete({projectKey:r,sessionId:e});return}return lF(e,t)}async function Mkt(e,t){if(t?.sessionStore)return OUe(t.sessionStore,e,t);return dF(e,t)}async function Ukt(e,t,r){if(!ze(e))throw new Xt(`Invalid sessionId: ${e}`,"importSessionToStore: invalid sessionId (must be a UUID)");let n=await Yo(e,r?.dir);if(!n)throw Error(`Session ${e} not found`);let o=Jr(r?.dir),i=r?.batchSize&&r.batchSize>0?r.batchSize:qh;if(await tW(n.filePath,{projectKey:o,sessionId:e},t,i),r?.includeSubagents===!1)return;let s=n.filePath.replace(/\.jsonl$/,""),a=Dr(s,"subagents");for(let c of await xUe(a)){let u=sW(s,c).split(uO);u[u.length-1]=u.at(-1).replace(/\.jsonl$/,"");let d={projectKey:o,sessionId:e,subpath:u.join("/")};await tW(c,d,t,i);let f=c.replace(/\.jsonl$/,".meta.json"),m;try{m=yt(await nW(f,"utf8"))}catch(g){if(!On(g))ce(`importSessionToStore: skipping unreadable sidecar ${f}: ${g}`)}if(m!==void 0)await t.append(d,[{type:"agent_metadata",...m}])}}async function tW(e,t,r,n){let o=pUe({input:oUe(e,{encoding:"utf8"}),crlfDelay:1/0}),i=[],s=0;for await(let a of o){if(!a)continue;try{i.push(yt(a))}catch(c){ce(`importSessionToStore: skipping unparseable line in ${e}: ${c}`);continue}if(s+=a.length,i.length>=n||s>=Gh)await r.append(t,i),i=[],s=0}if(i.length>0)await r.append(t,i)}async function xUe(e){let t=[];async function r(n){let o;try{o=await aUe(n,{withFileTypes:!0})}catch{return}for(let i of o){let s=Dr(n,i.name);if(i.isDirectory())await r(s);else if(i.isFile()&&i.name.endsWith(".jsonl"))t.push(s)}}return await r(e),t}async function $kt(e,t){if(t?.sessionStore)return CUe(t.sessionStore,e,t.dir);return yF(e,t)}async function jkt(e,t,r){if(r?.sessionStore)return RUe(r.sessionStore,e,t,r);return bF(e,t,r)}function cW(e){let t=zd(e??"."),r;try{r=iUe(t)}catch{r=t}return xr(r)}function Jr(e){return us(cW(e))}function lW(e){return e.map((t)=>Re(t)).join(`
|
|
138
138
|
`)+`
|
|
139
139
|
`}function uW(e,t,r){if(t!==void 0&&t>0)return e.slice(r,r+t);if(r>0)return e.slice(r);return e}function cO(e){return typeof e==="object"&&e!==null&&"type"in e&&e.type==="agent_metadata"}async function vUe(e,t){let r=cW(t.dir),n=us(r),o=t.offset??0,i=t.limit;if(e.listSessionSummaries)return SUe(e,n,r,t.dir,i,o);if(!e.listSessions)throw Error("sessionStore.listSessions is not implemented -- cannot list sessions. Provide a store with a listSessions() method.");let a=(await e.listSessions(n)).slice().sort((u,d)=>d.mtime-u.mtime),c=uW(a,i,o);return pW(e,c,t.dir,r)}async function SUe(e,t,r,n,o,i){let s=await e.listSessionSummaries(t),a=e.listSessions?new Map((await e.listSessions(t)).map((f)=>[f.sessionId,f])):void 0,c=[];for(let f of s){let m=a?.get(f.sessionId);if(a&&!m)continue;let g=m!==void 0&&f.mtime<m.mtime;c.push({sessionId:f.sessionId,mtime:g?m.mtime:f.mtime,info:g?void 0:HO(f,r)})}if(a){let f=new Set(s.map((m)=>m.sessionId));for(let[m,g]of a)if(!f.has(m))c.push({sessionId:m,mtime:g.mtime})}else ce("listSessionSummaries without listSessions: gap-fill skipped; sessions lacking a sidecar will be omitted");c.sort((f,m)=>m.mtime-f.mtime);let u=uW(c,o,i),d=u.filter((f)=>f.info===void 0);if(d.length>0){let f=await pW(e,d,n,r),m=new Map(f.map((g)=>[g.sessionId,g]));for(let g of u)if(g.info===void 0)g.info=m.get(g.sessionId)??null}return u.flatMap((f)=>f.info?[f.info]:[])}async function pW(e,t,r,n){return(await Promise.allSettled(t.map(async(i)=>{let s=await fW(e,i.sessionId,r);if(!s)return null;let a=fc(i.sessionId,dW(s,i.mtime),n);return a?{...a,lastModified:i.mtime}:null}))).flatMap((i,s)=>{let a=t[s];if(i.status==="fulfilled")return i.value?[i.value]:[];return[{sessionId:a.sessionId,summary:"",lastModified:a.mtime}]})}function dW(e,t){let r=Buffer.from(e,"utf-8"),n=r.length,o=r.subarray(0,dn).toString("utf-8"),i=n>dn?r.subarray(n-dn).toString("utf-8"):o;return{mtime:t,size:n,head:o,tail:i}}function EUe(e){let t=e.trimEnd(),r=t.slice(t.lastIndexOf(`
|