agentlogs 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +117 -117
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,184 +1,184 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as Uv}from"node:module";var eK=Object.create;var{getPrototypeOf:tK,defineProperty:_z,getOwnPropertyNames:sK}=Object;var _v=Object.prototype.hasOwnProperty;function $v(_){return this[_]}var zv,bv,Zv=(_,$,b)=>{var Z=_!=null&&typeof _==="object";if(Z){var z=$?zv??=new WeakMap:bv??=new WeakMap,A=z.get(_);if(A)return A}b=_!=null?eK(tK(_)):{};let J=$||!_||!_.__esModule?_z(b,"default",{value:_,enumerable:!0}):b;for(let U of sK(_))if(!_v.call(J,U))_z(J,U,{get:$v.bind(_,U),enumerable:!0});if(Z)z.set(_,J);return J};var O4=(_,$)=>()=>($||_(($={exports:{}}).exports,$),$.exports);var Av=(_)=>_;function Jv(_,$){this[_]=Av.bind(null,$)}var r_=(_,$)=>{for(var b in $)_z(_,b,{get:$[b],enumerable:!0,configurable:!0,set:Jv.bind($,b)})};var P4=Uv(import.meta.url);var t9=O4((Gv)=>{class $z extends Error{constructor(_,$,b){super(b);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=$,this.exitCode=_,this.nestedError=void 0}}class G7 extends $z{constructor(_){super(1,"commander.invalidArgument",_);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}Gv.CommanderError=$z;Gv.InvalidArgumentError=G7});var Q2=O4((vv)=>{var{InvalidArgumentError:Qv}=t9();class Y7{constructor(_,$){switch(this.description=$||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,_[0]){case"<":this.required=!0,this._name=_.slice(1,-1);break;case"[":this.required=!1,this._name=_.slice(1,-1);break;default:this.required=!0,this._name=_;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(_,$){if($===this.defaultValue||!Array.isArray($))return[_];return $.push(_),$}default(_,$){return this.defaultValue=_,this.defaultValueDescription=$,this}argParser(_){return this.parseArg=_,this}choices(_){return this.argChoices=_.slice(),this.parseArg=($,b)=>{if(!this.argChoices.includes($))throw new Qv(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue($,b);return $},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function Kv(_){let $=_.name()+(_.variadic===!0?"...":"");return _.required?"<"+$+">":"["+$+"]"}vv.Argument=Y7;vv.humanReadableArgName=Kv});var zz=O4((Vv)=>{var{humanReadableArgName:qv}=Q2();class X7{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(_){this.helpWidth=this.helpWidth??_.helpWidth??80}visibleCommands(_){let $=_.commands.filter((Z)=>!Z._hidden),b=_._getHelpCommand();if(b&&!b._hidden)$.push(b);if(this.sortSubcommands)$.sort((Z,z)=>{return Z.name().localeCompare(z.name())});return $}compareOptions(_,$){let b=(Z)=>{return Z.short?Z.short.replace(/^-/,""):Z.long.replace(/^--/,"")};return b(_).localeCompare(b($))}visibleOptions(_){let $=_.options.filter((Z)=>!Z.hidden),b=_._getHelpOption();if(b&&!b.hidden){let Z=b.short&&_._findOption(b.short),z=b.long&&_._findOption(b.long);if(!Z&&!z)$.push(b);else if(b.long&&!z)$.push(_.createOption(b.long,b.description));else if(b.short&&!Z)$.push(_.createOption(b.short,b.description))}if(this.sortOptions)$.sort(this.compareOptions);return $}visibleGlobalOptions(_){if(!this.showGlobalOptions)return[];let $=[];for(let b=_.parent;b;b=b.parent){let Z=b.options.filter((z)=>!z.hidden);$.push(...Z)}if(this.sortOptions)$.sort(this.compareOptions);return $}visibleArguments(_){if(_._argsDescription)_.registeredArguments.forEach(($)=>{$.description=$.description||_._argsDescription[$.name()]||""});if(_.registeredArguments.find(($)=>$.description))return _.registeredArguments;return[]}subcommandTerm(_){let $=_.registeredArguments.map((b)=>qv(b)).join(" ");return _._name+(_._aliases[0]?"|"+_._aliases[0]:"")+(_.options.length?" [options]":"")+($?" "+$:"")}optionTerm(_){return _.flags}argumentTerm(_){return _.name()}longestSubcommandTermLength(_,$){return $.visibleCommands(_).reduce((b,Z)=>{return Math.max(b,this.displayWidth($.styleSubcommandTerm($.subcommandTerm(Z))))},0)}longestOptionTermLength(_,$){return $.visibleOptions(_).reduce((b,Z)=>{return Math.max(b,this.displayWidth($.styleOptionTerm($.optionTerm(Z))))},0)}longestGlobalOptionTermLength(_,$){return $.visibleGlobalOptions(_).reduce((b,Z)=>{return Math.max(b,this.displayWidth($.styleOptionTerm($.optionTerm(Z))))},0)}longestArgumentTermLength(_,$){return $.visibleArguments(_).reduce((b,Z)=>{return Math.max(b,this.displayWidth($.styleArgumentTerm($.argumentTerm(Z))))},0)}commandUsage(_){let $=_._name;if(_._aliases[0])$=$+"|"+_._aliases[0];let b="";for(let Z=_.parent;Z;Z=Z.parent)b=Z.name()+" "+b;return b+$+" "+_.usage()}commandDescription(_){return _.description()}subcommandDescription(_){return _.summary()||_.description()}optionDescription(_){let $=[];if(_.argChoices)$.push(`choices: ${_.argChoices.map((b)=>JSON.stringify(b)).join(", ")}`);if(_.defaultValue!==void 0){if(_.required||_.optional||_.isBoolean()&&typeof _.defaultValue==="boolean")$.push(`default: ${_.defaultValueDescription||JSON.stringify(_.defaultValue)}`)}if(_.presetArg!==void 0&&_.optional)$.push(`preset: ${JSON.stringify(_.presetArg)}`);if(_.envVar!==void 0)$.push(`env: ${_.envVar}`);if($.length>0){let b=`(${$.join(", ")})`;if(_.description)return`${_.description} ${b}`;return b}return _.description}argumentDescription(_){let $=[];if(_.argChoices)$.push(`choices: ${_.argChoices.map((b)=>JSON.stringify(b)).join(", ")}`);if(_.defaultValue!==void 0)$.push(`default: ${_.defaultValueDescription||JSON.stringify(_.defaultValue)}`);if($.length>0){let b=`(${$.join(", ")})`;if(_.description)return`${_.description} ${b}`;return b}return _.description}formatItemList(_,$,b){if($.length===0)return[];return[b.styleTitle(_),...$,""]}groupItems(_,$,b){let Z=new Map;return _.forEach((z)=>{let A=b(z);if(!Z.has(A))Z.set(A,[])}),$.forEach((z)=>{let A=b(z);if(!Z.has(A))Z.set(A,[]);Z.get(A).push(z)}),Z}formatHelp(_,$){let b=$.padWidth(_,$),Z=$.helpWidth??80;function z(X,Q){return $.formatItem(X,b,Q,$)}let A=[`${$.styleTitle("Usage:")} ${$.styleUsage($.commandUsage(_))}`,""],J=$.commandDescription(_);if(J.length>0)A=A.concat([$.boxWrap($.styleCommandDescription(J),Z),""]);let U=$.visibleArguments(_).map((X)=>{return z($.styleArgumentTerm($.argumentTerm(X)),$.styleArgumentDescription($.argumentDescription(X)))});if(A=A.concat(this.formatItemList("Arguments:",U,$)),this.groupItems(_.options,$.visibleOptions(_),(X)=>X.helpGroupHeading??"Options:").forEach((X,Q)=>{let K=X.map((v)=>{return z($.styleOptionTerm($.optionTerm(v)),$.styleOptionDescription($.optionDescription(v)))});A=A.concat(this.formatItemList(Q,K,$))}),$.showGlobalOptions){let X=$.visibleGlobalOptions(_).map((Q)=>{return z($.styleOptionTerm($.optionTerm(Q)),$.styleOptionDescription($.optionDescription(Q)))});A=A.concat(this.formatItemList("Global Options:",X,$))}return this.groupItems(_.commands,$.visibleCommands(_),(X)=>X.helpGroup()||"Commands:").forEach((X,Q)=>{let K=X.map((v)=>{return z($.styleSubcommandTerm($.subcommandTerm(v)),$.styleSubcommandDescription($.subcommandDescription(v)))});A=A.concat(this.formatItemList(Q,K,$))}),A.join(`
3
- `)}displayWidth(_){return Q7(_).length}styleTitle(_){return _}styleUsage(_){return _.split(" ").map(($)=>{if($==="[options]")return this.styleOptionText($);if($==="[command]")return this.styleSubcommandText($);if($[0]==="["||$[0]==="<")return this.styleArgumentText($);return this.styleCommandText($)}).join(" ")}styleCommandDescription(_){return this.styleDescriptionText(_)}styleOptionDescription(_){return this.styleDescriptionText(_)}styleSubcommandDescription(_){return this.styleDescriptionText(_)}styleArgumentDescription(_){return this.styleDescriptionText(_)}styleDescriptionText(_){return _}styleOptionTerm(_){return this.styleOptionText(_)}styleSubcommandTerm(_){return _.split(" ").map(($)=>{if($==="[options]")return this.styleOptionText($);if($[0]==="["||$[0]==="<")return this.styleArgumentText($);return this.styleSubcommandText($)}).join(" ")}styleArgumentTerm(_){return this.styleArgumentText(_)}styleOptionText(_){return _}styleArgumentText(_){return _}styleSubcommandText(_){return _}styleCommandText(_){return _}padWidth(_,$){return Math.max($.longestOptionTermLength(_,$),$.longestGlobalOptionTermLength(_,$),$.longestSubcommandTermLength(_,$),$.longestArgumentTermLength(_,$))}preformatted(_){return/\n[^\S\r\n]/.test(_)}formatItem(_,$,b,Z){let A=" ".repeat(2);if(!b)return A+_;let J=_.padEnd($+_.length-Z.displayWidth(_)),U=2,Y=(this.helpWidth??80)-$-U-2,X;if(Y<this.minWidthToWrap||Z.preformatted(b))X=b;else X=Z.boxWrap(b,Y).replace(/\n/g,`
2
+ import{createRequire as FF}from"node:module";var bF=Object.create;var{getPrototypeOf:ZF,defineProperty:Zz,getOwnPropertyNames:AF}=Object;var JF=Object.prototype.hasOwnProperty;function UF(_){return this[_]}var GF,YF,XF=(_,$,b)=>{var Z=_!=null&&typeof _==="object";if(Z){var z=$?GF??=new WeakMap:YF??=new WeakMap,A=z.get(_);if(A)return A}b=_!=null?bF(ZF(_)):{};let J=$||!_||!_.__esModule?Zz(b,"default",{value:_,enumerable:!0}):b;for(let U of AF(_))if(!JF.call(J,U))Zz(J,U,{get:UF.bind(_,U),enumerable:!0});if(Z)z.set(_,J);return J};var P4=(_,$)=>()=>($||_(($={exports:{}}).exports,$),$.exports);var QF=(_)=>_;function KF(_,$){this[_]=QF.bind(null,$)}var i_=(_,$)=>{for(var b in $)Zz(_,b,{get:$[b],enumerable:!0,configurable:!0,set:KF.bind($,b)})};var j4=FF(import.meta.url);var e9=P4((vF)=>{class Az extends Error{constructor(_,$,b){super(b);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=$,this.exitCode=_,this.nestedError=void 0}}class KU extends Az{constructor(_){super(1,"commander.invalidArgument",_);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}vF.CommanderError=Az;vF.InvalidArgumentError=KU});var X2=P4((gF)=>{var{InvalidArgumentError:DF}=e9();class FU{constructor(_,$){switch(this.description=$||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,_[0]){case"<":this.required=!0,this._name=_.slice(1,-1);break;case"[":this.required=!1,this._name=_.slice(1,-1);break;default:this.required=!0,this._name=_;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(_,$){if($===this.defaultValue||!Array.isArray($))return[_];return $.push(_),$}default(_,$){return this.defaultValue=_,this.defaultValueDescription=$,this}argParser(_){return this.parseArg=_,this}choices(_){return this.argChoices=_.slice(),this.parseArg=($,b)=>{if(!this.argChoices.includes($))throw new DF(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue($,b);return $},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function VF(_){let $=_.name()+(_.variadic===!0?"...":"");return _.required?"<"+$+">":"["+$+"]"}gF.Argument=FU;gF.humanReadableArgName=VF});var Jz=P4((BF)=>{var{humanReadableArgName:wF}=X2();class vU{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(_){this.helpWidth=this.helpWidth??_.helpWidth??80}visibleCommands(_){let $=_.commands.filter((Z)=>!Z._hidden),b=_._getHelpCommand();if(b&&!b._hidden)$.push(b);if(this.sortSubcommands)$.sort((Z,z)=>{return Z.name().localeCompare(z.name())});return $}compareOptions(_,$){let b=(Z)=>{return Z.short?Z.short.replace(/^-/,""):Z.long.replace(/^--/,"")};return b(_).localeCompare(b($))}visibleOptions(_){let $=_.options.filter((Z)=>!Z.hidden),b=_._getHelpOption();if(b&&!b.hidden){let Z=b.short&&_._findOption(b.short),z=b.long&&_._findOption(b.long);if(!Z&&!z)$.push(b);else if(b.long&&!z)$.push(_.createOption(b.long,b.description));else if(b.short&&!Z)$.push(_.createOption(b.short,b.description))}if(this.sortOptions)$.sort(this.compareOptions);return $}visibleGlobalOptions(_){if(!this.showGlobalOptions)return[];let $=[];for(let b=_.parent;b;b=b.parent){let Z=b.options.filter((z)=>!z.hidden);$.push(...Z)}if(this.sortOptions)$.sort(this.compareOptions);return $}visibleArguments(_){if(_._argsDescription)_.registeredArguments.forEach(($)=>{$.description=$.description||_._argsDescription[$.name()]||""});if(_.registeredArguments.find(($)=>$.description))return _.registeredArguments;return[]}subcommandTerm(_){let $=_.registeredArguments.map((b)=>wF(b)).join(" ");return _._name+(_._aliases[0]?"|"+_._aliases[0]:"")+(_.options.length?" [options]":"")+($?" "+$:"")}optionTerm(_){return _.flags}argumentTerm(_){return _.name()}longestSubcommandTermLength(_,$){return $.visibleCommands(_).reduce((b,Z)=>{return Math.max(b,this.displayWidth($.styleSubcommandTerm($.subcommandTerm(Z))))},0)}longestOptionTermLength(_,$){return $.visibleOptions(_).reduce((b,Z)=>{return Math.max(b,this.displayWidth($.styleOptionTerm($.optionTerm(Z))))},0)}longestGlobalOptionTermLength(_,$){return $.visibleGlobalOptions(_).reduce((b,Z)=>{return Math.max(b,this.displayWidth($.styleOptionTerm($.optionTerm(Z))))},0)}longestArgumentTermLength(_,$){return $.visibleArguments(_).reduce((b,Z)=>{return Math.max(b,this.displayWidth($.styleArgumentTerm($.argumentTerm(Z))))},0)}commandUsage(_){let $=_._name;if(_._aliases[0])$=$+"|"+_._aliases[0];let b="";for(let Z=_.parent;Z;Z=Z.parent)b=Z.name()+" "+b;return b+$+" "+_.usage()}commandDescription(_){return _.description()}subcommandDescription(_){return _.summary()||_.description()}optionDescription(_){let $=[];if(_.argChoices)$.push(`choices: ${_.argChoices.map((b)=>JSON.stringify(b)).join(", ")}`);if(_.defaultValue!==void 0){if(_.required||_.optional||_.isBoolean()&&typeof _.defaultValue==="boolean")$.push(`default: ${_.defaultValueDescription||JSON.stringify(_.defaultValue)}`)}if(_.presetArg!==void 0&&_.optional)$.push(`preset: ${JSON.stringify(_.presetArg)}`);if(_.envVar!==void 0)$.push(`env: ${_.envVar}`);if($.length>0){let b=`(${$.join(", ")})`;if(_.description)return`${_.description} ${b}`;return b}return _.description}argumentDescription(_){let $=[];if(_.argChoices)$.push(`choices: ${_.argChoices.map((b)=>JSON.stringify(b)).join(", ")}`);if(_.defaultValue!==void 0)$.push(`default: ${_.defaultValueDescription||JSON.stringify(_.defaultValue)}`);if($.length>0){let b=`(${$.join(", ")})`;if(_.description)return`${_.description} ${b}`;return b}return _.description}formatItemList(_,$,b){if($.length===0)return[];return[b.styleTitle(_),...$,""]}groupItems(_,$,b){let Z=new Map;return _.forEach((z)=>{let A=b(z);if(!Z.has(A))Z.set(A,[])}),$.forEach((z)=>{let A=b(z);if(!Z.has(A))Z.set(A,[]);Z.get(A).push(z)}),Z}formatHelp(_,$){let b=$.padWidth(_,$),Z=$.helpWidth??80;function z(X,Q){return $.formatItem(X,b,Q,$)}let A=[`${$.styleTitle("Usage:")} ${$.styleUsage($.commandUsage(_))}`,""],J=$.commandDescription(_);if(J.length>0)A=A.concat([$.boxWrap($.styleCommandDescription(J),Z),""]);let U=$.visibleArguments(_).map((X)=>{return z($.styleArgumentTerm($.argumentTerm(X)),$.styleArgumentDescription($.argumentDescription(X)))});if(A=A.concat(this.formatItemList("Arguments:",U,$)),this.groupItems(_.options,$.visibleOptions(_),(X)=>X.helpGroupHeading??"Options:").forEach((X,Q)=>{let K=X.map((v)=>{return z($.styleOptionTerm($.optionTerm(v)),$.styleOptionDescription($.optionDescription(v)))});A=A.concat(this.formatItemList(Q,K,$))}),$.showGlobalOptions){let X=$.visibleGlobalOptions(_).map((Q)=>{return z($.styleOptionTerm($.optionTerm(Q)),$.styleOptionDescription($.optionDescription(Q)))});A=A.concat(this.formatItemList("Global Options:",X,$))}return this.groupItems(_.commands,$.visibleCommands(_),(X)=>X.helpGroup()||"Commands:").forEach((X,Q)=>{let K=X.map((v)=>{return z($.styleSubcommandTerm($.subcommandTerm(v)),$.styleSubcommandDescription($.subcommandDescription(v)))});A=A.concat(this.formatItemList(Q,K,$))}),A.join(`
3
+ `)}displayWidth(_){return HU(_).length}styleTitle(_){return _}styleUsage(_){return _.split(" ").map(($)=>{if($==="[options]")return this.styleOptionText($);if($==="[command]")return this.styleSubcommandText($);if($[0]==="["||$[0]==="<")return this.styleArgumentText($);return this.styleCommandText($)}).join(" ")}styleCommandDescription(_){return this.styleDescriptionText(_)}styleOptionDescription(_){return this.styleDescriptionText(_)}styleSubcommandDescription(_){return this.styleDescriptionText(_)}styleArgumentDescription(_){return this.styleDescriptionText(_)}styleDescriptionText(_){return _}styleOptionTerm(_){return this.styleOptionText(_)}styleSubcommandTerm(_){return _.split(" ").map(($)=>{if($==="[options]")return this.styleOptionText($);if($[0]==="["||$[0]==="<")return this.styleArgumentText($);return this.styleSubcommandText($)}).join(" ")}styleArgumentTerm(_){return this.styleArgumentText(_)}styleOptionText(_){return _}styleArgumentText(_){return _}styleSubcommandText(_){return _}styleCommandText(_){return _}padWidth(_,$){return Math.max($.longestOptionTermLength(_,$),$.longestGlobalOptionTermLength(_,$),$.longestSubcommandTermLength(_,$),$.longestArgumentTermLength(_,$))}preformatted(_){return/\n[^\S\r\n]/.test(_)}formatItem(_,$,b,Z){let A=" ".repeat(2);if(!b)return A+_;let J=_.padEnd($+_.length-Z.displayWidth(_)),U=2,Y=(this.helpWidth??80)-$-U-2,X;if(Y<this.minWidthToWrap||Z.preformatted(b))X=b;else X=Z.boxWrap(b,Y).replace(/\n/g,`
4
4
  `+" ".repeat($+U));return A+J+" ".repeat(U)+X.replace(/\n/g,`
5
5
  ${A}`)}boxWrap(_,$){if($<this.minWidthToWrap)return _;let b=_.split(/\r\n|\n/),Z=/[\s]*[^\s]+/g,z=[];return b.forEach((A)=>{let J=A.match(Z);if(J===null){z.push("");return}let U=[J.shift()],G=this.displayWidth(U[0]);J.forEach((Y)=>{let X=this.displayWidth(Y);if(G+X<=$){U.push(Y),G+=X;return}z.push(U.join(""));let Q=Y.trimStart();U=[Q],G=this.displayWidth(Q)}),z.push(U.join(""))}),z.join(`
6
- `)}}function Q7(_){let $=/\x1b\[\d*(;\d*)*m/g;return _.replace($,"")}Vv.Help=X7;Vv.stripColor=Q7});var bz=O4((Bv)=>{var{InvalidArgumentError:Wv}=t9();class v7{constructor(_,$){this.flags=_,this.description=$||"",this.required=_.includes("<"),this.optional=_.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(_),this.mandatory=!1;let b=gv(_);if(this.short=b.shortFlag,this.long=b.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(_,$){return this.defaultValue=_,this.defaultValueDescription=$,this}preset(_){return this.presetArg=_,this}conflicts(_){return this.conflictsWith=this.conflictsWith.concat(_),this}implies(_){let $=_;if(typeof _==="string")$={[_]:!0};return this.implied=Object.assign(this.implied||{},$),this}env(_){return this.envVar=_,this}argParser(_){return this.parseArg=_,this}makeOptionMandatory(_=!0){return this.mandatory=!!_,this}hideHelp(_=!0){return this.hidden=!!_,this}_collectValue(_,$){if($===this.defaultValue||!Array.isArray($))return[_];return $.push(_),$}choices(_){return this.argChoices=_.slice(),this.parseArg=($,b)=>{if(!this.argChoices.includes($))throw new Wv(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue($,b);return $},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return K7(this.name().replace(/^no-/,""));return K7(this.name())}helpGroup(_){return this.helpGroupHeading=_,this}is(_){return this.short===_||this.long===_}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class F7{constructor(_){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,_.forEach(($)=>{if($.negate)this.negativeOptions.set($.attributeName(),$);else this.positiveOptions.set($.attributeName(),$)}),this.negativeOptions.forEach(($,b)=>{if(this.positiveOptions.has(b))this.dualOptions.add(b)})}valueFromOption(_,$){let b=$.attributeName();if(!this.dualOptions.has(b))return!0;let Z=this.negativeOptions.get(b).presetArg,z=Z!==void 0?Z:!1;return $.negate===(z===_)}}function K7(_){return _.split("-").reduce(($,b)=>{return $+b[0].toUpperCase()+b.slice(1)})}function gv(_){let $,b,Z=/^-[^-]$/,z=/^--[^-]/,A=_.split(/[ |,]+/).concat("guard");if(Z.test(A[0]))$=A.shift();if(z.test(A[0]))b=A.shift();if(!$&&Z.test(A[0]))$=A.shift();if(!$&&z.test(A[0]))$=b,b=A.shift();if(A[0].startsWith("-")){let J=A[0],U=`option creation failed due to '${J}' in option flags '${_}'`;if(/^-[^-][^-]/.test(J))throw Error(`${U}
6
+ `)}}function HU(_){let $=/\x1b\[\d*(;\d*)*m/g;return _.replace($,"")}BF.Help=vU;BF.stripColor=HU});var Uz=P4((EF)=>{var{InvalidArgumentError:IF}=e9();class DU{constructor(_,$){this.flags=_,this.description=$||"",this.required=_.includes("<"),this.optional=_.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(_),this.mandatory=!1;let b=MF(_);if(this.short=b.shortFlag,this.long=b.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(_,$){return this.defaultValue=_,this.defaultValueDescription=$,this}preset(_){return this.presetArg=_,this}conflicts(_){return this.conflictsWith=this.conflictsWith.concat(_),this}implies(_){let $=_;if(typeof _==="string")$={[_]:!0};return this.implied=Object.assign(this.implied||{},$),this}env(_){return this.envVar=_,this}argParser(_){return this.parseArg=_,this}makeOptionMandatory(_=!0){return this.mandatory=!!_,this}hideHelp(_=!0){return this.hidden=!!_,this}_collectValue(_,$){if($===this.defaultValue||!Array.isArray($))return[_];return $.push(_),$}choices(_){return this.argChoices=_.slice(),this.parseArg=($,b)=>{if(!this.argChoices.includes($))throw new IF(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue($,b);return $},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return qU(this.name().replace(/^no-/,""));return qU(this.name())}helpGroup(_){return this.helpGroupHeading=_,this}is(_){return this.short===_||this.long===_}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class VU{constructor(_){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,_.forEach(($)=>{if($.negate)this.negativeOptions.set($.attributeName(),$);else this.positiveOptions.set($.attributeName(),$)}),this.negativeOptions.forEach(($,b)=>{if(this.positiveOptions.has(b))this.dualOptions.add(b)})}valueFromOption(_,$){let b=$.attributeName();if(!this.dualOptions.has(b))return!0;let Z=this.negativeOptions.get(b).presetArg,z=Z!==void 0?Z:!1;return $.negate===(z===_)}}function qU(_){return _.split("-").reduce(($,b)=>{return $+b[0].toUpperCase()+b.slice(1)})}function MF(_){let $,b,Z=/^-[^-]$/,z=/^--[^-]/,A=_.split(/[ |,]+/).concat("guard");if(Z.test(A[0]))$=A.shift();if(z.test(A[0]))b=A.shift();if(!$&&Z.test(A[0]))$=A.shift();if(!$&&z.test(A[0]))$=b,b=A.shift();if(A[0].startsWith("-")){let J=A[0],U=`option creation failed due to '${J}' in option flags '${_}'`;if(/^-[^-][^-]/.test(J))throw Error(`${U}
7
7
  - a short flag is a single dash and a single character
8
8
  - either use a single dash and a single character (for a short flag)
9
9
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(Z.test(J))throw Error(`${U}
10
10
  - too many short flags`);if(z.test(J))throw Error(`${U}
11
11
  - too many long flags`);throw Error(`${U}
12
- - unrecognised flag format`)}if($===void 0&&b===void 0)throw Error(`option creation failed due to no flags found in '${_}'.`);return{shortFlag:$,longFlag:b}}Bv.Option=v7;Bv.DualOptions=F7});var H7=O4((Mv)=>{function Nv(_,$){if(Math.abs(_.length-$.length)>3)return Math.max(_.length,$.length);let b=[];for(let Z=0;Z<=_.length;Z++)b[Z]=[Z];for(let Z=0;Z<=$.length;Z++)b[0][Z]=Z;for(let Z=1;Z<=$.length;Z++)for(let z=1;z<=_.length;z++){let A=1;if(_[z-1]===$[Z-1])A=0;else A=1;if(b[z][Z]=Math.min(b[z-1][Z]+1,b[z][Z-1]+1,b[z-1][Z-1]+A),z>1&&Z>1&&_[z-1]===$[Z-2]&&_[z-2]===$[Z-1])b[z][Z]=Math.min(b[z][Z],b[z-2][Z-2]+1)}return b[_.length][$.length]}function Iv(_,$){if(!$||$.length===0)return"";$=Array.from(new Set($));let b=_.startsWith("--");if(b)_=_.slice(2),$=$.map((J)=>J.slice(2));let Z=[],z=3,A=0.4;if($.forEach((J)=>{if(J.length<=1)return;let U=Nv(_,J),G=Math.max(_.length,J.length);if((G-U)/G>A){if(U<z)z=U,Z=[J];else if(U===z)Z.push(J)}}),Z.sort((J,U)=>J.localeCompare(U)),b)Z=Z.map((J)=>`--${J}`);if(Z.length>1)return`
12
+ - unrecognised flag format`)}if($===void 0&&b===void 0)throw Error(`option creation failed due to no flags found in '${_}'.`);return{shortFlag:$,longFlag:b}}EF.Option=DU;EF.DualOptions=VU});var gU=P4((RF)=>{function jF(_,$){if(Math.abs(_.length-$.length)>3)return Math.max(_.length,$.length);let b=[];for(let Z=0;Z<=_.length;Z++)b[Z]=[Z];for(let Z=0;Z<=$.length;Z++)b[0][Z]=Z;for(let Z=1;Z<=$.length;Z++)for(let z=1;z<=_.length;z++){let A=1;if(_[z-1]===$[Z-1])A=0;else A=1;if(b[z][Z]=Math.min(b[z-1][Z]+1,b[z][Z-1]+1,b[z-1][Z-1]+A),z>1&&Z>1&&_[z-1]===$[Z-2]&&_[z-2]===$[Z-1])b[z][Z]=Math.min(b[z][Z],b[z-2][Z-2]+1)}return b[_.length][$.length]}function SF(_,$){if(!$||$.length===0)return"";$=Array.from(new Set($));let b=_.startsWith("--");if(b)_=_.slice(2),$=$.map((J)=>J.slice(2));let Z=[],z=3,A=0.4;if($.forEach((J)=>{if(J.length<=1)return;let U=jF(_,J),G=Math.max(_.length,J.length);if((G-U)/G>A){if(U<z)z=U,Z=[J];else if(U===z)Z.push(J)}}),Z.sort((J,U)=>J.localeCompare(U)),b)Z=Z.map((J)=>`--${J}`);if(Z.length>1)return`
13
13
  (Did you mean one of ${Z.join(", ")}?)`;if(Z.length===1)return`
14
- (Did you mean ${Z[0]}?)`;return""}Mv.suggestSimilar=Iv});var k7=O4((Tv)=>{var Ov=P4("node:events").EventEmitter,Zz=P4("node:child_process"),n_=P4("node:path"),K2=P4("node:fs"),Z0=P4("node:process"),{Argument:Pv,humanReadableArgName:jv}=Q2(),{CommanderError:Az}=t9(),{Help:Sv,stripColor:Rv}=zz(),{Option:q7,DualOptions:Lv}=bz(),{suggestSimilar:V7}=H7();class Uz extends Ov{constructor(_){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=_||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:($)=>Z0.stdout.write($),writeErr:($)=>Z0.stderr.write($),outputError:($,b)=>b($),getOutHelpWidth:()=>Z0.stdout.isTTY?Z0.stdout.columns:void 0,getErrHelpWidth:()=>Z0.stderr.isTTY?Z0.stderr.columns:void 0,getOutHasColors:()=>Jz()??(Z0.stdout.isTTY&&Z0.stdout.hasColors?.()),getErrHasColors:()=>Jz()??(Z0.stderr.isTTY&&Z0.stderr.hasColors?.()),stripColor:($)=>Rv($)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(_){return this._outputConfiguration=_._outputConfiguration,this._helpOption=_._helpOption,this._helpCommand=_._helpCommand,this._helpConfiguration=_._helpConfiguration,this._exitCallback=_._exitCallback,this._storeOptionsAsProperties=_._storeOptionsAsProperties,this._combineFlagAndOptionalValue=_._combineFlagAndOptionalValue,this._allowExcessArguments=_._allowExcessArguments,this._enablePositionalOptions=_._enablePositionalOptions,this._showHelpAfterError=_._showHelpAfterError,this._showSuggestionAfterError=_._showSuggestionAfterError,this}_getCommandAndAncestors(){let _=[];for(let $=this;$;$=$.parent)_.push($);return _}command(_,$,b){let Z=$,z=b;if(typeof Z==="object"&&Z!==null)z=Z,Z=null;z=z||{};let[,A,J]=_.match(/([^ ]+) *(.*)/),U=this.createCommand(A);if(Z)U.description(Z),U._executableHandler=!0;if(z.isDefault)this._defaultCommandName=U._name;if(U._hidden=!!(z.noHelp||z.hidden),U._executableFile=z.executableFile||null,J)U.arguments(J);if(this._registerCommand(U),U.parent=this,U.copyInheritedSettings(this),Z)return this;return U}createCommand(_){return new Uz(_)}createHelp(){return Object.assign(new Sv,this.configureHelp())}configureHelp(_){if(_===void 0)return this._helpConfiguration;return this._helpConfiguration=_,this}configureOutput(_){if(_===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,..._},this}showHelpAfterError(_=!0){if(typeof _!=="string")_=!!_;return this._showHelpAfterError=_,this}showSuggestionAfterError(_=!0){return this._showSuggestionAfterError=!!_,this}addCommand(_,$){if(!_._name)throw Error(`Command passed to .addCommand() must have a name
15
- - specify the name in Command constructor or using .name()`);if($=$||{},$.isDefault)this._defaultCommandName=_._name;if($.noHelp||$.hidden)_._hidden=!0;return this._registerCommand(_),_.parent=this,_._checkForBrokenPassThrough(),this}createArgument(_,$){return new Pv(_,$)}argument(_,$,b,Z){let z=this.createArgument(_,$);if(typeof b==="function")z.default(Z).argParser(b);else z.default(b);return this.addArgument(z),this}arguments(_){return _.trim().split(/ +/).forEach(($)=>{this.argument($)}),this}addArgument(_){let $=this.registeredArguments.slice(-1)[0];if($?.variadic)throw Error(`only the last argument can be variadic '${$.name()}'`);if(_.required&&_.defaultValue!==void 0&&_.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${_.name()}'`);return this.registeredArguments.push(_),this}helpCommand(_,$){if(typeof _==="boolean"){if(this._addImplicitHelpCommand=_,_&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let b=_??"help [command]",[,Z,z]=b.match(/([^ ]+) *(.*)/),A=$??"display help for command",J=this.createCommand(Z);if(J.helpOption(!1),z)J.arguments(z);if(A)J.description(A);if(this._addImplicitHelpCommand=!0,this._helpCommand=J,_||$)this._initCommandGroup(J);return this}addHelpCommand(_,$){if(typeof _!=="object")return this.helpCommand(_,$),this;return this._addImplicitHelpCommand=!0,this._helpCommand=_,this._initCommandGroup(_),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(_,$){let b=["preSubcommand","preAction","postAction"];if(!b.includes(_))throw Error(`Unexpected value for event passed to hook : '${_}'.
16
- Expecting one of '${b.join("', '")}'`);if(this._lifeCycleHooks[_])this._lifeCycleHooks[_].push($);else this._lifeCycleHooks[_]=[$];return this}exitOverride(_){if(_)this._exitCallback=_;else this._exitCallback=($)=>{if($.code!=="commander.executeSubCommandAsync")throw $};return this}_exit(_,$,b){if(this._exitCallback)this._exitCallback(new Az(_,$,b));Z0.exit(_)}action(_){let $=(b)=>{let Z=this.registeredArguments.length,z=b.slice(0,Z);if(this._storeOptionsAsProperties)z[Z]=this;else z[Z]=this.opts();return z.push(this),_.apply(this,z)};return this._actionHandler=$,this}createOption(_,$){return new q7(_,$)}_callParseArg(_,$,b,Z){try{return _.parseArg($,b)}catch(z){if(z.code==="commander.invalidArgument"){let A=`${Z} ${z.message}`;this.error(A,{exitCode:z.exitCode,code:z.code})}throw z}}_registerOption(_){let $=_.short&&this._findOption(_.short)||_.long&&this._findOption(_.long);if($){let b=_.long&&this._findOption(_.long)?_.long:_.short;throw Error(`Cannot add option '${_.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${b}'
17
- - already used by option '${$.flags}'`)}this._initOptionGroup(_),this.options.push(_)}_registerCommand(_){let $=(Z)=>{return[Z.name()].concat(Z.aliases())},b=$(_).find((Z)=>this._findCommand(Z));if(b){let Z=$(this._findCommand(b)).join("|"),z=$(_).join("|");throw Error(`cannot add command '${z}' as already have command '${Z}'`)}this._initCommandGroup(_),this.commands.push(_)}addOption(_){this._registerOption(_);let $=_.name(),b=_.attributeName();if(_.negate){let z=_.long.replace(/^--no-/,"--");if(!this._findOption(z))this.setOptionValueWithSource(b,_.defaultValue===void 0?!0:_.defaultValue,"default")}else if(_.defaultValue!==void 0)this.setOptionValueWithSource(b,_.defaultValue,"default");let Z=(z,A,J)=>{if(z==null&&_.presetArg!==void 0)z=_.presetArg;let U=this.getOptionValue(b);if(z!==null&&_.parseArg)z=this._callParseArg(_,z,U,A);else if(z!==null&&_.variadic)z=_._collectValue(z,U);if(z==null)if(_.negate)z=!1;else if(_.isBoolean()||_.optional)z=!0;else z="";this.setOptionValueWithSource(b,z,J)};if(this.on("option:"+$,(z)=>{let A=`error: option '${_.flags}' argument '${z}' is invalid.`;Z(z,A,"cli")}),_.envVar)this.on("optionEnv:"+$,(z)=>{let A=`error: option '${_.flags}' value '${z}' from env '${_.envVar}' is invalid.`;Z(z,A,"env")});return this}_optionEx(_,$,b,Z,z){if(typeof $==="object"&&$ instanceof q7)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let A=this.createOption($,b);if(A.makeOptionMandatory(!!_.mandatory),typeof Z==="function")A.default(z).argParser(Z);else if(Z instanceof RegExp){let J=Z;Z=(U,G)=>{let Y=J.exec(U);return Y?Y[0]:G},A.default(z).argParser(Z)}else A.default(Z);return this.addOption(A)}option(_,$,b,Z){return this._optionEx({},_,$,b,Z)}requiredOption(_,$,b,Z){return this._optionEx({mandatory:!0},_,$,b,Z)}combineFlagAndOptionalValue(_=!0){return this._combineFlagAndOptionalValue=!!_,this}allowUnknownOption(_=!0){return this._allowUnknownOption=!!_,this}allowExcessArguments(_=!0){return this._allowExcessArguments=!!_,this}enablePositionalOptions(_=!0){return this._enablePositionalOptions=!!_,this}passThroughOptions(_=!0){return this._passThroughOptions=!!_,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(_=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!_,this}getOptionValue(_){if(this._storeOptionsAsProperties)return this[_];return this._optionValues[_]}setOptionValue(_,$){return this.setOptionValueWithSource(_,$,void 0)}setOptionValueWithSource(_,$,b){if(this._storeOptionsAsProperties)this[_]=$;else this._optionValues[_]=$;return this._optionValueSources[_]=b,this}getOptionValueSource(_){return this._optionValueSources[_]}getOptionValueSourceWithGlobals(_){let $;return this._getCommandAndAncestors().forEach((b)=>{if(b.getOptionValueSource(_)!==void 0)$=b.getOptionValueSource(_)}),$}_prepareUserArgs(_,$){if(_!==void 0&&!Array.isArray(_))throw Error("first parameter to parse must be array or undefined");if($=$||{},_===void 0&&$.from===void 0){if(Z0.versions?.electron)$.from="electron";let Z=Z0.execArgv??[];if(Z.includes("-e")||Z.includes("--eval")||Z.includes("-p")||Z.includes("--print"))$.from="eval"}if(_===void 0)_=Z0.argv;this.rawArgs=_.slice();let b;switch($.from){case void 0:case"node":this._scriptPath=_[1],b=_.slice(2);break;case"electron":if(Z0.defaultApp)this._scriptPath=_[1],b=_.slice(2);else b=_.slice(1);break;case"user":b=_.slice(0);break;case"eval":b=_.slice(1);break;default:throw Error(`unexpected parse option { from: '${$.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",b}parse(_,$){this._prepareForParse();let b=this._prepareUserArgs(_,$);return this._parseCommand([],b),this}async parseAsync(_,$){this._prepareForParse();let b=this._prepareUserArgs(_,$);return await this._parseCommand([],b),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
18
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(_,$,b){if(K2.existsSync(_))return;let Z=$?`searched for local subcommand relative to directory '${$}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",z=`'${_}' does not exist
14
+ (Did you mean ${Z[0]}?)`;return""}RF.suggestSimilar=SF});var BU=P4((cF)=>{var TF=j4("node:events").EventEmitter,Gz=j4("node:child_process"),o_=j4("node:path"),Q2=j4("node:fs"),Z0=j4("node:process"),{Argument:yF,humanReadableArgName:CF}=X2(),{CommanderError:Yz}=e9(),{Help:fF,stripColor:mF}=Jz(),{Option:kU,DualOptions:uF}=Uz(),{suggestSimilar:WU}=gU();class Qz extends TF{constructor(_){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=_||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:($)=>Z0.stdout.write($),writeErr:($)=>Z0.stderr.write($),outputError:($,b)=>b($),getOutHelpWidth:()=>Z0.stdout.isTTY?Z0.stdout.columns:void 0,getErrHelpWidth:()=>Z0.stderr.isTTY?Z0.stderr.columns:void 0,getOutHasColors:()=>Xz()??(Z0.stdout.isTTY&&Z0.stdout.hasColors?.()),getErrHasColors:()=>Xz()??(Z0.stderr.isTTY&&Z0.stderr.hasColors?.()),stripColor:($)=>mF($)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(_){return this._outputConfiguration=_._outputConfiguration,this._helpOption=_._helpOption,this._helpCommand=_._helpCommand,this._helpConfiguration=_._helpConfiguration,this._exitCallback=_._exitCallback,this._storeOptionsAsProperties=_._storeOptionsAsProperties,this._combineFlagAndOptionalValue=_._combineFlagAndOptionalValue,this._allowExcessArguments=_._allowExcessArguments,this._enablePositionalOptions=_._enablePositionalOptions,this._showHelpAfterError=_._showHelpAfterError,this._showSuggestionAfterError=_._showSuggestionAfterError,this}_getCommandAndAncestors(){let _=[];for(let $=this;$;$=$.parent)_.push($);return _}command(_,$,b){let Z=$,z=b;if(typeof Z==="object"&&Z!==null)z=Z,Z=null;z=z||{};let[,A,J]=_.match(/([^ ]+) *(.*)/),U=this.createCommand(A);if(Z)U.description(Z),U._executableHandler=!0;if(z.isDefault)this._defaultCommandName=U._name;if(U._hidden=!!(z.noHelp||z.hidden),U._executableFile=z.executableFile||null,J)U.arguments(J);if(this._registerCommand(U),U.parent=this,U.copyInheritedSettings(this),Z)return this;return U}createCommand(_){return new Qz(_)}createHelp(){return Object.assign(new fF,this.configureHelp())}configureHelp(_){if(_===void 0)return this._helpConfiguration;return this._helpConfiguration=_,this}configureOutput(_){if(_===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,..._},this}showHelpAfterError(_=!0){if(typeof _!=="string")_=!!_;return this._showHelpAfterError=_,this}showSuggestionAfterError(_=!0){return this._showSuggestionAfterError=!!_,this}addCommand(_,$){if(!_._name)throw Error(`Command passed to .addCommand() must have a name
15
+ - specify the name in Command constructor or using .name()`);if($=$||{},$.isDefault)this._defaultCommandName=_._name;if($.noHelp||$.hidden)_._hidden=!0;return this._registerCommand(_),_.parent=this,_._checkForBrokenPassThrough(),this}createArgument(_,$){return new yF(_,$)}argument(_,$,b,Z){let z=this.createArgument(_,$);if(typeof b==="function")z.default(Z).argParser(b);else z.default(b);return this.addArgument(z),this}arguments(_){return _.trim().split(/ +/).forEach(($)=>{this.argument($)}),this}addArgument(_){let $=this.registeredArguments.slice(-1)[0];if($?.variadic)throw Error(`only the last argument can be variadic '${$.name()}'`);if(_.required&&_.defaultValue!==void 0&&_.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${_.name()}'`);return this.registeredArguments.push(_),this}helpCommand(_,$){if(typeof _==="boolean"){if(this._addImplicitHelpCommand=_,_&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let b=_??"help [command]",[,Z,z]=b.match(/([^ ]+) *(.*)/),A=$??"display help for command",J=this.createCommand(Z);if(J.helpOption(!1),z)J.arguments(z);if(A)J.description(A);if(this._addImplicitHelpCommand=!0,this._helpCommand=J,_||$)this._initCommandGroup(J);return this}addHelpCommand(_,$){if(typeof _!=="object")return this.helpCommand(_,$),this;return this._addImplicitHelpCommand=!0,this._helpCommand=_,this._initCommandGroup(_),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(_,$){let b=["preSubcommand","preAction","postAction"];if(!b.includes(_))throw Error(`Unexpected value for event passed to hook : '${_}'.
16
+ Expecting one of '${b.join("', '")}'`);if(this._lifeCycleHooks[_])this._lifeCycleHooks[_].push($);else this._lifeCycleHooks[_]=[$];return this}exitOverride(_){if(_)this._exitCallback=_;else this._exitCallback=($)=>{if($.code!=="commander.executeSubCommandAsync")throw $};return this}_exit(_,$,b){if(this._exitCallback)this._exitCallback(new Yz(_,$,b));Z0.exit(_)}action(_){let $=(b)=>{let Z=this.registeredArguments.length,z=b.slice(0,Z);if(this._storeOptionsAsProperties)z[Z]=this;else z[Z]=this.opts();return z.push(this),_.apply(this,z)};return this._actionHandler=$,this}createOption(_,$){return new kU(_,$)}_callParseArg(_,$,b,Z){try{return _.parseArg($,b)}catch(z){if(z.code==="commander.invalidArgument"){let A=`${Z} ${z.message}`;this.error(A,{exitCode:z.exitCode,code:z.code})}throw z}}_registerOption(_){let $=_.short&&this._findOption(_.short)||_.long&&this._findOption(_.long);if($){let b=_.long&&this._findOption(_.long)?_.long:_.short;throw Error(`Cannot add option '${_.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${b}'
17
+ - already used by option '${$.flags}'`)}this._initOptionGroup(_),this.options.push(_)}_registerCommand(_){let $=(Z)=>{return[Z.name()].concat(Z.aliases())},b=$(_).find((Z)=>this._findCommand(Z));if(b){let Z=$(this._findCommand(b)).join("|"),z=$(_).join("|");throw Error(`cannot add command '${z}' as already have command '${Z}'`)}this._initCommandGroup(_),this.commands.push(_)}addOption(_){this._registerOption(_);let $=_.name(),b=_.attributeName();if(_.negate){let z=_.long.replace(/^--no-/,"--");if(!this._findOption(z))this.setOptionValueWithSource(b,_.defaultValue===void 0?!0:_.defaultValue,"default")}else if(_.defaultValue!==void 0)this.setOptionValueWithSource(b,_.defaultValue,"default");let Z=(z,A,J)=>{if(z==null&&_.presetArg!==void 0)z=_.presetArg;let U=this.getOptionValue(b);if(z!==null&&_.parseArg)z=this._callParseArg(_,z,U,A);else if(z!==null&&_.variadic)z=_._collectValue(z,U);if(z==null)if(_.negate)z=!1;else if(_.isBoolean()||_.optional)z=!0;else z="";this.setOptionValueWithSource(b,z,J)};if(this.on("option:"+$,(z)=>{let A=`error: option '${_.flags}' argument '${z}' is invalid.`;Z(z,A,"cli")}),_.envVar)this.on("optionEnv:"+$,(z)=>{let A=`error: option '${_.flags}' value '${z}' from env '${_.envVar}' is invalid.`;Z(z,A,"env")});return this}_optionEx(_,$,b,Z,z){if(typeof $==="object"&&$ instanceof kU)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let A=this.createOption($,b);if(A.makeOptionMandatory(!!_.mandatory),typeof Z==="function")A.default(z).argParser(Z);else if(Z instanceof RegExp){let J=Z;Z=(U,G)=>{let Y=J.exec(U);return Y?Y[0]:G},A.default(z).argParser(Z)}else A.default(Z);return this.addOption(A)}option(_,$,b,Z){return this._optionEx({},_,$,b,Z)}requiredOption(_,$,b,Z){return this._optionEx({mandatory:!0},_,$,b,Z)}combineFlagAndOptionalValue(_=!0){return this._combineFlagAndOptionalValue=!!_,this}allowUnknownOption(_=!0){return this._allowUnknownOption=!!_,this}allowExcessArguments(_=!0){return this._allowExcessArguments=!!_,this}enablePositionalOptions(_=!0){return this._enablePositionalOptions=!!_,this}passThroughOptions(_=!0){return this._passThroughOptions=!!_,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(_=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!_,this}getOptionValue(_){if(this._storeOptionsAsProperties)return this[_];return this._optionValues[_]}setOptionValue(_,$){return this.setOptionValueWithSource(_,$,void 0)}setOptionValueWithSource(_,$,b){if(this._storeOptionsAsProperties)this[_]=$;else this._optionValues[_]=$;return this._optionValueSources[_]=b,this}getOptionValueSource(_){return this._optionValueSources[_]}getOptionValueSourceWithGlobals(_){let $;return this._getCommandAndAncestors().forEach((b)=>{if(b.getOptionValueSource(_)!==void 0)$=b.getOptionValueSource(_)}),$}_prepareUserArgs(_,$){if(_!==void 0&&!Array.isArray(_))throw Error("first parameter to parse must be array or undefined");if($=$||{},_===void 0&&$.from===void 0){if(Z0.versions?.electron)$.from="electron";let Z=Z0.execArgv??[];if(Z.includes("-e")||Z.includes("--eval")||Z.includes("-p")||Z.includes("--print"))$.from="eval"}if(_===void 0)_=Z0.argv;this.rawArgs=_.slice();let b;switch($.from){case void 0:case"node":this._scriptPath=_[1],b=_.slice(2);break;case"electron":if(Z0.defaultApp)this._scriptPath=_[1],b=_.slice(2);else b=_.slice(1);break;case"user":b=_.slice(0);break;case"eval":b=_.slice(1);break;default:throw Error(`unexpected parse option { from: '${$.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",b}parse(_,$){this._prepareForParse();let b=this._prepareUserArgs(_,$);return this._parseCommand([],b),this}async parseAsync(_,$){this._prepareForParse();let b=this._prepareUserArgs(_,$);return await this._parseCommand([],b),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
18
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(_,$,b){if(Q2.existsSync(_))return;let Z=$?`searched for local subcommand relative to directory '${$}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",z=`'${_}' does not exist
19
19
  - if '${b}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20
20
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21
- - ${Z}`;throw Error(z)}_executeSubCommand(_,$){$=$.slice();let b=!1,Z=[".js",".ts",".tsx",".mjs",".cjs"];function z(Y,X){let Q=n_.resolve(Y,X);if(K2.existsSync(Q))return Q;if(Z.includes(n_.extname(X)))return;let K=Z.find((v)=>K2.existsSync(`${Q}${v}`));if(K)return`${Q}${K}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let A=_._executableFile||`${this._name}-${_._name}`,J=this._executableDir||"";if(this._scriptPath){let Y;try{Y=K2.realpathSync(this._scriptPath)}catch{Y=this._scriptPath}J=n_.resolve(n_.dirname(Y),J)}if(J){let Y=z(J,A);if(!Y&&!_._executableFile&&this._scriptPath){let X=n_.basename(this._scriptPath,n_.extname(this._scriptPath));if(X!==this._name)Y=z(J,`${X}-${_._name}`)}A=Y||A}b=Z.includes(n_.extname(A));let U;if(Z0.platform!=="win32")if(b)$.unshift(A),$=D7(Z0.execArgv).concat($),U=Zz.spawn(Z0.argv[0],$,{stdio:"inherit"});else U=Zz.spawn(A,$,{stdio:"inherit"});else this._checkForMissingExecutable(A,J,_._name),$.unshift(A),$=D7(Z0.execArgv).concat($),U=Zz.spawn(Z0.execPath,$,{stdio:"inherit"});if(!U.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((X)=>{Z0.on(X,()=>{if(U.killed===!1&&U.exitCode===null)U.kill(X)})});let G=this._exitCallback;U.on("close",(Y)=>{if(Y=Y??1,!G)Z0.exit(Y);else G(new Az(Y,"commander.executeSubCommandAsync","(close)"))}),U.on("error",(Y)=>{if(Y.code==="ENOENT")this._checkForMissingExecutable(A,J,_._name);else if(Y.code==="EACCES")throw Error(`'${A}' not executable`);if(!G)Z0.exit(1);else{let X=new Az(1,"commander.executeSubCommandAsync","(error)");X.nestedError=Y,G(X)}}),this.runningCommand=U}_dispatchSubcommand(_,$,b){let Z=this._findCommand(_);if(!Z)this.help({error:!0});Z._prepareForParse();let z;return z=this._chainOrCallSubCommandHook(z,Z,"preSubcommand"),z=this._chainOrCall(z,()=>{if(Z._executableHandler)this._executeSubCommand(Z,$.concat(b));else return Z._parseCommand($,b)}),z}_dispatchHelpCommand(_){if(!_)this.help();let $=this._findCommand(_);if($&&!$._executableHandler)$.help();return this._dispatchSubcommand(_,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((_,$)=>{if(_.required&&this.args[$]==null)this.missingArgument(_.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let _=(b,Z,z)=>{let A=Z;if(Z!==null&&b.parseArg){let J=`error: command-argument value '${Z}' is invalid for argument '${b.name()}'.`;A=this._callParseArg(b,Z,z,J)}return A};this._checkNumberOfArguments();let $=[];this.registeredArguments.forEach((b,Z)=>{let z=b.defaultValue;if(b.variadic){if(Z<this.args.length){if(z=this.args.slice(Z),b.parseArg)z=z.reduce((A,J)=>{return _(b,J,A)},b.defaultValue)}else if(z===void 0)z=[]}else if(Z<this.args.length){if(z=this.args[Z],b.parseArg)z=_(b,z,b.defaultValue)}$[Z]=z}),this.processedArgs=$}_chainOrCall(_,$){if(_?.then&&typeof _.then==="function")return _.then(()=>$());return $()}_chainOrCallHooks(_,$){let b=_,Z=[];if(this._getCommandAndAncestors().reverse().filter((z)=>z._lifeCycleHooks[$]!==void 0).forEach((z)=>{z._lifeCycleHooks[$].forEach((A)=>{Z.push({hookedCommand:z,callback:A})})}),$==="postAction")Z.reverse();return Z.forEach((z)=>{b=this._chainOrCall(b,()=>{return z.callback(z.hookedCommand,this)})}),b}_chainOrCallSubCommandHook(_,$,b){let Z=_;if(this._lifeCycleHooks[b]!==void 0)this._lifeCycleHooks[b].forEach((z)=>{Z=this._chainOrCall(Z,()=>{return z(this,$)})});return Z}_parseCommand(_,$){let b=this.parseOptions($);if(this._parseOptionsEnv(),this._parseOptionsImplied(),_=_.concat(b.operands),$=b.unknown,this.args=_.concat($),_&&this._findCommand(_[0]))return this._dispatchSubcommand(_[0],_.slice(1),$);if(this._getHelpCommand()&&_[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(_[1]);if(this._defaultCommandName)return this._outputHelpIfRequested($),this._dispatchSubcommand(this._defaultCommandName,_,$);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(b.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Z=()=>{if(b.unknown.length>0)this.unknownOption(b.unknown[0])},z=`command:${this.name()}`;if(this._actionHandler){Z(),this._processArguments();let A;if(A=this._chainOrCallHooks(A,"preAction"),A=this._chainOrCall(A,()=>this._actionHandler(this.processedArgs)),this.parent)A=this._chainOrCall(A,()=>{this.parent.emit(z,_,$)});return A=this._chainOrCallHooks(A,"postAction"),A}if(this.parent?.listenerCount(z))Z(),this._processArguments(),this.parent.emit(z,_,$);else if(_.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",_,$);if(this.listenerCount("command:*"))this.emit("command:*",_,$);else if(this.commands.length)this.unknownCommand();else Z(),this._processArguments()}else if(this.commands.length)Z(),this.help({error:!0});else Z(),this._processArguments()}_findCommand(_){if(!_)return;return this.commands.find(($)=>$._name===_||$._aliases.includes(_))}_findOption(_){return this.options.find(($)=>$.is(_))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((_)=>{_.options.forEach(($)=>{if($.mandatory&&_.getOptionValue($.attributeName())===void 0)_.missingMandatoryOptionValue($)})})}_checkForConflictingLocalOptions(){let _=this.options.filter((b)=>{let Z=b.attributeName();if(this.getOptionValue(Z)===void 0)return!1;return this.getOptionValueSource(Z)!=="default"});_.filter((b)=>b.conflictsWith.length>0).forEach((b)=>{let Z=_.find((z)=>b.conflictsWith.includes(z.attributeName()));if(Z)this._conflictingOption(b,Z)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((_)=>{_._checkForConflictingLocalOptions()})}parseOptions(_){let $=[],b=[],Z=$;function z(Y){return Y.length>1&&Y[0]==="-"}let A=(Y)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(Y))return!1;return!this._getCommandAndAncestors().some((X)=>X.options.map((Q)=>Q.short).some((Q)=>/^-\d$/.test(Q)))},J=null,U=null,G=0;while(G<_.length||U){let Y=U??_[G++];if(U=null,Y==="--"){if(Z===b)Z.push(Y);Z.push(..._.slice(G));break}if(J&&(!z(Y)||A(Y))){this.emit(`option:${J.name()}`,Y);continue}if(J=null,z(Y)){let X=this._findOption(Y);if(X){if(X.required){let Q=_[G++];if(Q===void 0)this.optionMissingArgument(X);this.emit(`option:${X.name()}`,Q)}else if(X.optional){let Q=null;if(G<_.length&&(!z(_[G])||A(_[G])))Q=_[G++];this.emit(`option:${X.name()}`,Q)}else this.emit(`option:${X.name()}`);J=X.variadic?X:null;continue}}if(Y.length>2&&Y[0]==="-"&&Y[1]!=="-"){let X=this._findOption(`-${Y[1]}`);if(X){if(X.required||X.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${X.name()}`,Y.slice(2));else this.emit(`option:${X.name()}`),U=`-${Y.slice(2)}`;continue}}if(/^--[^=]+=/.test(Y)){let X=Y.indexOf("="),Q=this._findOption(Y.slice(0,X));if(Q&&(Q.required||Q.optional)){this.emit(`option:${Q.name()}`,Y.slice(X+1));continue}}if(Z===$&&z(Y)&&!(this.commands.length===0&&A(Y)))Z=b;if((this._enablePositionalOptions||this._passThroughOptions)&&$.length===0&&b.length===0){if(this._findCommand(Y)){$.push(Y),b.push(..._.slice(G));break}else if(this._getHelpCommand()&&Y===this._getHelpCommand().name()){$.push(Y,..._.slice(G));break}else if(this._defaultCommandName){b.push(Y,..._.slice(G));break}}if(this._passThroughOptions){Z.push(Y,..._.slice(G));break}Z.push(Y)}return{operands:$,unknown:b}}opts(){if(this._storeOptionsAsProperties){let _={},$=this.options.length;for(let b=0;b<$;b++){let Z=this.options[b].attributeName();_[Z]=Z===this._versionOptionName?this._version:this[Z]}return _}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((_,$)=>Object.assign(_,$.opts()),{})}error(_,$){if(this._outputConfiguration.outputError(`${_}
21
+ - ${Z}`;throw Error(z)}_executeSubCommand(_,$){$=$.slice();let b=!1,Z=[".js",".ts",".tsx",".mjs",".cjs"];function z(Y,X){let Q=o_.resolve(Y,X);if(Q2.existsSync(Q))return Q;if(Z.includes(o_.extname(X)))return;let K=Z.find((v)=>Q2.existsSync(`${Q}${v}`));if(K)return`${Q}${K}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let A=_._executableFile||`${this._name}-${_._name}`,J=this._executableDir||"";if(this._scriptPath){let Y;try{Y=Q2.realpathSync(this._scriptPath)}catch{Y=this._scriptPath}J=o_.resolve(o_.dirname(Y),J)}if(J){let Y=z(J,A);if(!Y&&!_._executableFile&&this._scriptPath){let X=o_.basename(this._scriptPath,o_.extname(this._scriptPath));if(X!==this._name)Y=z(J,`${X}-${_._name}`)}A=Y||A}b=Z.includes(o_.extname(A));let U;if(Z0.platform!=="win32")if(b)$.unshift(A),$=wU(Z0.execArgv).concat($),U=Gz.spawn(Z0.argv[0],$,{stdio:"inherit"});else U=Gz.spawn(A,$,{stdio:"inherit"});else this._checkForMissingExecutable(A,J,_._name),$.unshift(A),$=wU(Z0.execArgv).concat($),U=Gz.spawn(Z0.execPath,$,{stdio:"inherit"});if(!U.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((X)=>{Z0.on(X,()=>{if(U.killed===!1&&U.exitCode===null)U.kill(X)})});let G=this._exitCallback;U.on("close",(Y)=>{if(Y=Y??1,!G)Z0.exit(Y);else G(new Yz(Y,"commander.executeSubCommandAsync","(close)"))}),U.on("error",(Y)=>{if(Y.code==="ENOENT")this._checkForMissingExecutable(A,J,_._name);else if(Y.code==="EACCES")throw Error(`'${A}' not executable`);if(!G)Z0.exit(1);else{let X=new Yz(1,"commander.executeSubCommandAsync","(error)");X.nestedError=Y,G(X)}}),this.runningCommand=U}_dispatchSubcommand(_,$,b){let Z=this._findCommand(_);if(!Z)this.help({error:!0});Z._prepareForParse();let z;return z=this._chainOrCallSubCommandHook(z,Z,"preSubcommand"),z=this._chainOrCall(z,()=>{if(Z._executableHandler)this._executeSubCommand(Z,$.concat(b));else return Z._parseCommand($,b)}),z}_dispatchHelpCommand(_){if(!_)this.help();let $=this._findCommand(_);if($&&!$._executableHandler)$.help();return this._dispatchSubcommand(_,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((_,$)=>{if(_.required&&this.args[$]==null)this.missingArgument(_.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let _=(b,Z,z)=>{let A=Z;if(Z!==null&&b.parseArg){let J=`error: command-argument value '${Z}' is invalid for argument '${b.name()}'.`;A=this._callParseArg(b,Z,z,J)}return A};this._checkNumberOfArguments();let $=[];this.registeredArguments.forEach((b,Z)=>{let z=b.defaultValue;if(b.variadic){if(Z<this.args.length){if(z=this.args.slice(Z),b.parseArg)z=z.reduce((A,J)=>{return _(b,J,A)},b.defaultValue)}else if(z===void 0)z=[]}else if(Z<this.args.length){if(z=this.args[Z],b.parseArg)z=_(b,z,b.defaultValue)}$[Z]=z}),this.processedArgs=$}_chainOrCall(_,$){if(_?.then&&typeof _.then==="function")return _.then(()=>$());return $()}_chainOrCallHooks(_,$){let b=_,Z=[];if(this._getCommandAndAncestors().reverse().filter((z)=>z._lifeCycleHooks[$]!==void 0).forEach((z)=>{z._lifeCycleHooks[$].forEach((A)=>{Z.push({hookedCommand:z,callback:A})})}),$==="postAction")Z.reverse();return Z.forEach((z)=>{b=this._chainOrCall(b,()=>{return z.callback(z.hookedCommand,this)})}),b}_chainOrCallSubCommandHook(_,$,b){let Z=_;if(this._lifeCycleHooks[b]!==void 0)this._lifeCycleHooks[b].forEach((z)=>{Z=this._chainOrCall(Z,()=>{return z(this,$)})});return Z}_parseCommand(_,$){let b=this.parseOptions($);if(this._parseOptionsEnv(),this._parseOptionsImplied(),_=_.concat(b.operands),$=b.unknown,this.args=_.concat($),_&&this._findCommand(_[0]))return this._dispatchSubcommand(_[0],_.slice(1),$);if(this._getHelpCommand()&&_[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(_[1]);if(this._defaultCommandName)return this._outputHelpIfRequested($),this._dispatchSubcommand(this._defaultCommandName,_,$);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(b.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Z=()=>{if(b.unknown.length>0)this.unknownOption(b.unknown[0])},z=`command:${this.name()}`;if(this._actionHandler){Z(),this._processArguments();let A;if(A=this._chainOrCallHooks(A,"preAction"),A=this._chainOrCall(A,()=>this._actionHandler(this.processedArgs)),this.parent)A=this._chainOrCall(A,()=>{this.parent.emit(z,_,$)});return A=this._chainOrCallHooks(A,"postAction"),A}if(this.parent?.listenerCount(z))Z(),this._processArguments(),this.parent.emit(z,_,$);else if(_.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",_,$);if(this.listenerCount("command:*"))this.emit("command:*",_,$);else if(this.commands.length)this.unknownCommand();else Z(),this._processArguments()}else if(this.commands.length)Z(),this.help({error:!0});else Z(),this._processArguments()}_findCommand(_){if(!_)return;return this.commands.find(($)=>$._name===_||$._aliases.includes(_))}_findOption(_){return this.options.find(($)=>$.is(_))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((_)=>{_.options.forEach(($)=>{if($.mandatory&&_.getOptionValue($.attributeName())===void 0)_.missingMandatoryOptionValue($)})})}_checkForConflictingLocalOptions(){let _=this.options.filter((b)=>{let Z=b.attributeName();if(this.getOptionValue(Z)===void 0)return!1;return this.getOptionValueSource(Z)!=="default"});_.filter((b)=>b.conflictsWith.length>0).forEach((b)=>{let Z=_.find((z)=>b.conflictsWith.includes(z.attributeName()));if(Z)this._conflictingOption(b,Z)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((_)=>{_._checkForConflictingLocalOptions()})}parseOptions(_){let $=[],b=[],Z=$;function z(Y){return Y.length>1&&Y[0]==="-"}let A=(Y)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(Y))return!1;return!this._getCommandAndAncestors().some((X)=>X.options.map((Q)=>Q.short).some((Q)=>/^-\d$/.test(Q)))},J=null,U=null,G=0;while(G<_.length||U){let Y=U??_[G++];if(U=null,Y==="--"){if(Z===b)Z.push(Y);Z.push(..._.slice(G));break}if(J&&(!z(Y)||A(Y))){this.emit(`option:${J.name()}`,Y);continue}if(J=null,z(Y)){let X=this._findOption(Y);if(X){if(X.required){let Q=_[G++];if(Q===void 0)this.optionMissingArgument(X);this.emit(`option:${X.name()}`,Q)}else if(X.optional){let Q=null;if(G<_.length&&(!z(_[G])||A(_[G])))Q=_[G++];this.emit(`option:${X.name()}`,Q)}else this.emit(`option:${X.name()}`);J=X.variadic?X:null;continue}}if(Y.length>2&&Y[0]==="-"&&Y[1]!=="-"){let X=this._findOption(`-${Y[1]}`);if(X){if(X.required||X.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${X.name()}`,Y.slice(2));else this.emit(`option:${X.name()}`),U=`-${Y.slice(2)}`;continue}}if(/^--[^=]+=/.test(Y)){let X=Y.indexOf("="),Q=this._findOption(Y.slice(0,X));if(Q&&(Q.required||Q.optional)){this.emit(`option:${Q.name()}`,Y.slice(X+1));continue}}if(Z===$&&z(Y)&&!(this.commands.length===0&&A(Y)))Z=b;if((this._enablePositionalOptions||this._passThroughOptions)&&$.length===0&&b.length===0){if(this._findCommand(Y)){$.push(Y),b.push(..._.slice(G));break}else if(this._getHelpCommand()&&Y===this._getHelpCommand().name()){$.push(Y,..._.slice(G));break}else if(this._defaultCommandName){b.push(Y,..._.slice(G));break}}if(this._passThroughOptions){Z.push(Y,..._.slice(G));break}Z.push(Y)}return{operands:$,unknown:b}}opts(){if(this._storeOptionsAsProperties){let _={},$=this.options.length;for(let b=0;b<$;b++){let Z=this.options[b].attributeName();_[Z]=Z===this._versionOptionName?this._version:this[Z]}return _}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((_,$)=>Object.assign(_,$.opts()),{})}error(_,$){if(this._outputConfiguration.outputError(`${_}
22
22
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
23
  `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
24
- `),this.outputHelp({error:!0});let b=$||{},Z=b.exitCode||1,z=b.code||"commander.error";this._exit(Z,z,_)}_parseOptionsEnv(){this.options.forEach((_)=>{if(_.envVar&&_.envVar in Z0.env){let $=_.attributeName();if(this.getOptionValue($)===void 0||["default","config","env"].includes(this.getOptionValueSource($)))if(_.required||_.optional)this.emit(`optionEnv:${_.name()}`,Z0.env[_.envVar]);else this.emit(`optionEnv:${_.name()}`)}})}_parseOptionsImplied(){let _=new Lv(this.options),$=(b)=>{return this.getOptionValue(b)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(b))};this.options.filter((b)=>b.implied!==void 0&&$(b.attributeName())&&_.valueFromOption(this.getOptionValue(b.attributeName()),b)).forEach((b)=>{Object.keys(b.implied).filter((Z)=>!$(Z)).forEach((Z)=>{this.setOptionValueWithSource(Z,b.implied[Z],"implied")})})}missingArgument(_){let $=`error: missing required argument '${_}'`;this.error($,{code:"commander.missingArgument"})}optionMissingArgument(_){let $=`error: option '${_.flags}' argument missing`;this.error($,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(_){let $=`error: required option '${_.flags}' not specified`;this.error($,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(_,$){let b=(A)=>{let J=A.attributeName(),U=this.getOptionValue(J),G=this.options.find((X)=>X.negate&&J===X.attributeName()),Y=this.options.find((X)=>!X.negate&&J===X.attributeName());if(G&&(G.presetArg===void 0&&U===!1||G.presetArg!==void 0&&U===G.presetArg))return G;return Y||A},Z=(A)=>{let J=b(A),U=J.attributeName();if(this.getOptionValueSource(U)==="env")return`environment variable '${J.envVar}'`;return`option '${J.flags}'`},z=`error: ${Z(_)} cannot be used with ${Z($)}`;this.error(z,{code:"commander.conflictingOption"})}unknownOption(_){if(this._allowUnknownOption)return;let $="";if(_.startsWith("--")&&this._showSuggestionAfterError){let Z=[],z=this;do{let A=z.createHelp().visibleOptions(z).filter((J)=>J.long).map((J)=>J.long);Z=Z.concat(A),z=z.parent}while(z&&!z._enablePositionalOptions);$=V7(_,Z)}let b=`error: unknown option '${_}'${$}`;this.error(b,{code:"commander.unknownOption"})}_excessArguments(_){if(this._allowExcessArguments)return;let $=this.registeredArguments.length,b=$===1?"":"s",z=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${$} argument${b} but got ${_.length}.`;this.error(z,{code:"commander.excessArguments"})}unknownCommand(){let _=this.args[0],$="";if(this._showSuggestionAfterError){let Z=[];this.createHelp().visibleCommands(this).forEach((z)=>{if(Z.push(z.name()),z.alias())Z.push(z.alias())}),$=V7(_,Z)}let b=`error: unknown command '${_}'${$}`;this.error(b,{code:"commander.unknownCommand"})}version(_,$,b){if(_===void 0)return this._version;this._version=_,$=$||"-V, --version",b=b||"output the version number";let Z=this.createOption($,b);return this._versionOptionName=Z.attributeName(),this._registerOption(Z),this.on("option:"+Z.name(),()=>{this._outputConfiguration.writeOut(`${_}
25
- `),this._exit(0,"commander.version",_)}),this}description(_,$){if(_===void 0&&$===void 0)return this._description;if(this._description=_,$)this._argsDescription=$;return this}summary(_){if(_===void 0)return this._summary;return this._summary=_,this}alias(_){if(_===void 0)return this._aliases[0];let $=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)$=this.commands[this.commands.length-1];if(_===$._name)throw Error("Command alias can't be the same as its name");let b=this.parent?._findCommand(_);if(b){let Z=[b.name()].concat(b.aliases()).join("|");throw Error(`cannot add alias '${_}' to command '${this.name()}' as already have command '${Z}'`)}return $._aliases.push(_),this}aliases(_){if(_===void 0)return this._aliases;return _.forEach(($)=>this.alias($)),this}usage(_){if(_===void 0){if(this._usage)return this._usage;let $=this.registeredArguments.map((b)=>{return jv(b)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?$:[]).join(" ")}return this._usage=_,this}name(_){if(_===void 0)return this._name;return this._name=_,this}helpGroup(_){if(_===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=_,this}commandsGroup(_){if(_===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=_,this}optionsGroup(_){if(_===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=_,this}_initOptionGroup(_){if(this._defaultOptionGroup&&!_.helpGroupHeading)_.helpGroup(this._defaultOptionGroup)}_initCommandGroup(_){if(this._defaultCommandGroup&&!_.helpGroup())_.helpGroup(this._defaultCommandGroup)}nameFromFilename(_){return this._name=n_.basename(_,n_.extname(_)),this}executableDir(_){if(_===void 0)return this._executableDir;return this._executableDir=_,this}helpInformation(_){let $=this.createHelp(),b=this._getOutputContext(_);$.prepareContext({error:b.error,helpWidth:b.helpWidth,outputHasColors:b.hasColors});let Z=$.formatHelp(this,$);if(b.hasColors)return Z;return this._outputConfiguration.stripColor(Z)}_getOutputContext(_){_=_||{};let $=!!_.error,b,Z,z;if($)b=(J)=>this._outputConfiguration.writeErr(J),Z=this._outputConfiguration.getErrHasColors(),z=this._outputConfiguration.getErrHelpWidth();else b=(J)=>this._outputConfiguration.writeOut(J),Z=this._outputConfiguration.getOutHasColors(),z=this._outputConfiguration.getOutHelpWidth();return{error:$,write:(J)=>{if(!Z)J=this._outputConfiguration.stripColor(J);return b(J)},hasColors:Z,helpWidth:z}}outputHelp(_){let $;if(typeof _==="function")$=_,_=void 0;let b=this._getOutputContext(_),Z={error:b.error,write:b.write,command:this};this._getCommandAndAncestors().reverse().forEach((A)=>A.emit("beforeAllHelp",Z)),this.emit("beforeHelp",Z);let z=this.helpInformation({error:b.error});if($){if(z=$(z),typeof z!=="string"&&!Buffer.isBuffer(z))throw Error("outputHelp callback must return a string or a Buffer")}if(b.write(z),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",Z),this._getCommandAndAncestors().forEach((A)=>A.emit("afterAllHelp",Z))}helpOption(_,$){if(typeof _==="boolean"){if(_){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(_??"-h, --help",$??"display help for command"),_||$)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(_){return this._helpOption=_,this._initOptionGroup(_),this}help(_){this.outputHelp(_);let $=Number(Z0.exitCode??0);if($===0&&_&&typeof _!=="function"&&_.error)$=1;this._exit($,"commander.help","(outputHelp)")}addHelpText(_,$){let b=["beforeAll","before","after","afterAll"];if(!b.includes(_))throw Error(`Unexpected value for position to addHelpText.
24
+ `),this.outputHelp({error:!0});let b=$||{},Z=b.exitCode||1,z=b.code||"commander.error";this._exit(Z,z,_)}_parseOptionsEnv(){this.options.forEach((_)=>{if(_.envVar&&_.envVar in Z0.env){let $=_.attributeName();if(this.getOptionValue($)===void 0||["default","config","env"].includes(this.getOptionValueSource($)))if(_.required||_.optional)this.emit(`optionEnv:${_.name()}`,Z0.env[_.envVar]);else this.emit(`optionEnv:${_.name()}`)}})}_parseOptionsImplied(){let _=new uF(this.options),$=(b)=>{return this.getOptionValue(b)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(b))};this.options.filter((b)=>b.implied!==void 0&&$(b.attributeName())&&_.valueFromOption(this.getOptionValue(b.attributeName()),b)).forEach((b)=>{Object.keys(b.implied).filter((Z)=>!$(Z)).forEach((Z)=>{this.setOptionValueWithSource(Z,b.implied[Z],"implied")})})}missingArgument(_){let $=`error: missing required argument '${_}'`;this.error($,{code:"commander.missingArgument"})}optionMissingArgument(_){let $=`error: option '${_.flags}' argument missing`;this.error($,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(_){let $=`error: required option '${_.flags}' not specified`;this.error($,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(_,$){let b=(A)=>{let J=A.attributeName(),U=this.getOptionValue(J),G=this.options.find((X)=>X.negate&&J===X.attributeName()),Y=this.options.find((X)=>!X.negate&&J===X.attributeName());if(G&&(G.presetArg===void 0&&U===!1||G.presetArg!==void 0&&U===G.presetArg))return G;return Y||A},Z=(A)=>{let J=b(A),U=J.attributeName();if(this.getOptionValueSource(U)==="env")return`environment variable '${J.envVar}'`;return`option '${J.flags}'`},z=`error: ${Z(_)} cannot be used with ${Z($)}`;this.error(z,{code:"commander.conflictingOption"})}unknownOption(_){if(this._allowUnknownOption)return;let $="";if(_.startsWith("--")&&this._showSuggestionAfterError){let Z=[],z=this;do{let A=z.createHelp().visibleOptions(z).filter((J)=>J.long).map((J)=>J.long);Z=Z.concat(A),z=z.parent}while(z&&!z._enablePositionalOptions);$=WU(_,Z)}let b=`error: unknown option '${_}'${$}`;this.error(b,{code:"commander.unknownOption"})}_excessArguments(_){if(this._allowExcessArguments)return;let $=this.registeredArguments.length,b=$===1?"":"s",z=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${$} argument${b} but got ${_.length}.`;this.error(z,{code:"commander.excessArguments"})}unknownCommand(){let _=this.args[0],$="";if(this._showSuggestionAfterError){let Z=[];this.createHelp().visibleCommands(this).forEach((z)=>{if(Z.push(z.name()),z.alias())Z.push(z.alias())}),$=WU(_,Z)}let b=`error: unknown command '${_}'${$}`;this.error(b,{code:"commander.unknownCommand"})}version(_,$,b){if(_===void 0)return this._version;this._version=_,$=$||"-V, --version",b=b||"output the version number";let Z=this.createOption($,b);return this._versionOptionName=Z.attributeName(),this._registerOption(Z),this.on("option:"+Z.name(),()=>{this._outputConfiguration.writeOut(`${_}
25
+ `),this._exit(0,"commander.version",_)}),this}description(_,$){if(_===void 0&&$===void 0)return this._description;if(this._description=_,$)this._argsDescription=$;return this}summary(_){if(_===void 0)return this._summary;return this._summary=_,this}alias(_){if(_===void 0)return this._aliases[0];let $=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)$=this.commands[this.commands.length-1];if(_===$._name)throw Error("Command alias can't be the same as its name");let b=this.parent?._findCommand(_);if(b){let Z=[b.name()].concat(b.aliases()).join("|");throw Error(`cannot add alias '${_}' to command '${this.name()}' as already have command '${Z}'`)}return $._aliases.push(_),this}aliases(_){if(_===void 0)return this._aliases;return _.forEach(($)=>this.alias($)),this}usage(_){if(_===void 0){if(this._usage)return this._usage;let $=this.registeredArguments.map((b)=>{return CF(b)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?$:[]).join(" ")}return this._usage=_,this}name(_){if(_===void 0)return this._name;return this._name=_,this}helpGroup(_){if(_===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=_,this}commandsGroup(_){if(_===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=_,this}optionsGroup(_){if(_===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=_,this}_initOptionGroup(_){if(this._defaultOptionGroup&&!_.helpGroupHeading)_.helpGroup(this._defaultOptionGroup)}_initCommandGroup(_){if(this._defaultCommandGroup&&!_.helpGroup())_.helpGroup(this._defaultCommandGroup)}nameFromFilename(_){return this._name=o_.basename(_,o_.extname(_)),this}executableDir(_){if(_===void 0)return this._executableDir;return this._executableDir=_,this}helpInformation(_){let $=this.createHelp(),b=this._getOutputContext(_);$.prepareContext({error:b.error,helpWidth:b.helpWidth,outputHasColors:b.hasColors});let Z=$.formatHelp(this,$);if(b.hasColors)return Z;return this._outputConfiguration.stripColor(Z)}_getOutputContext(_){_=_||{};let $=!!_.error,b,Z,z;if($)b=(J)=>this._outputConfiguration.writeErr(J),Z=this._outputConfiguration.getErrHasColors(),z=this._outputConfiguration.getErrHelpWidth();else b=(J)=>this._outputConfiguration.writeOut(J),Z=this._outputConfiguration.getOutHasColors(),z=this._outputConfiguration.getOutHelpWidth();return{error:$,write:(J)=>{if(!Z)J=this._outputConfiguration.stripColor(J);return b(J)},hasColors:Z,helpWidth:z}}outputHelp(_){let $;if(typeof _==="function")$=_,_=void 0;let b=this._getOutputContext(_),Z={error:b.error,write:b.write,command:this};this._getCommandAndAncestors().reverse().forEach((A)=>A.emit("beforeAllHelp",Z)),this.emit("beforeHelp",Z);let z=this.helpInformation({error:b.error});if($){if(z=$(z),typeof z!=="string"&&!Buffer.isBuffer(z))throw Error("outputHelp callback must return a string or a Buffer")}if(b.write(z),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",Z),this._getCommandAndAncestors().forEach((A)=>A.emit("afterAllHelp",Z))}helpOption(_,$){if(typeof _==="boolean"){if(_){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(_??"-h, --help",$??"display help for command"),_||$)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(_){return this._helpOption=_,this._initOptionGroup(_),this}help(_){this.outputHelp(_);let $=Number(Z0.exitCode??0);if($===0&&_&&typeof _!=="function"&&_.error)$=1;this._exit($,"commander.help","(outputHelp)")}addHelpText(_,$){let b=["beforeAll","before","after","afterAll"];if(!b.includes(_))throw Error(`Unexpected value for position to addHelpText.
26
26
  Expecting one of '${b.join("', '")}'`);let Z=`${_}Help`;return this.on(Z,(z)=>{let A;if(typeof $==="function")A=$({error:z.error,command:z.command});else A=$;if(A)z.write(`${A}
27
- `)}),this}_outputHelpIfRequested(_){let $=this._getHelpOption();if($&&_.find((Z)=>$.is(Z)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function D7(_){return _.map(($)=>{if(!$.startsWith("--inspect"))return $;let b,Z="127.0.0.1",z="9229",A;if((A=$.match(/^(--inspect(-brk)?)$/))!==null)b=A[1];else if((A=$.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(b=A[1],/^\d+$/.test(A[3]))z=A[3];else Z=A[3];else if((A=$.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)b=A[1],Z=A[3],z=A[4];if(b&&z!=="0")return`${b}=${Z}:${parseInt(z)+1}`;return $})}function Jz(){if(Z0.env.NO_COLOR||Z0.env.FORCE_COLOR==="0"||Z0.env.FORCE_COLOR==="false")return!1;if(Z0.env.FORCE_COLOR||Z0.env.CLICOLOR_FORCE!==void 0)return!0;return}Tv.Command=Uz;Tv.useColor=Jz});var w7=O4((uv)=>{var{Argument:W7}=Q2(),{Command:Gz}=k7(),{CommanderError:fv,InvalidArgumentError:g7}=t9(),{Help:mv}=zz(),{Option:B7}=bz();uv.program=new Gz;uv.createCommand=(_)=>new Gz(_);uv.createOption=(_,$)=>new B7(_,$);uv.createArgument=(_,$)=>new W7(_,$);uv.Command=Gz;uv.Option=B7;uv.Argument=W7;uv.Help=mv;uv.CommanderError=fv;uv.InvalidArgumentError=g7;uv.InvalidOptionArgumentError=g7});var x7=Zv(w7(),1),{program:yI,createCommand:CI,createArgument:fI,createOption:mI,CommanderError:uI,InvalidArgumentError:hI,InvalidOptionArgumentError:cI,Command:N7,Argument:rI,Option:nI,Help:lI}=x7.default;import{existsSync as qz,mkdirSync as JF,readFileSync as L7,writeFileSync as S7}from"fs";import{homedir as UF}from"os";import{join as T7}from"path";import{applyEdits as tv,findNodeAtLocation as I7,format as iI,getNodeValue as sv,modify as _F,parseTree as M7}from"jsonc-parser";function E7(_){if(!_)return[];let $=[],b="",Z=0;while(Z<_.length){let z=_[Z];if(z==="."){if(b)$.push(v2(b)),b="";Z++}else if(z==="["){if(b)$.push(v2(b)),b="";let A=_.indexOf("]",Z);if(A===-1)throw Error(`Unclosed bracket in path: ${_}`);let J=_.slice(Z+1,A);$.push(v2(J)),Z=A+1}else b+=z,Z++}if(b)$.push(v2(b));return $}function v2(_){let $=Number(_);if(!Number.isNaN($)&&Number.isInteger($)&&$>=0)return $;return _}function Yz(_){return typeof _==="string"?E7(_):_}function $F(_,$){let b=Yz($),Z=M7(_);if(!Z)return null;let z=I7(Z,b);if(!z||!z.parent)return null;return{node:z,propertyNode:z.parent,tree:Z}}function zF(_,$){let b=$.offset;while(b>0&&_[b-1]!==`
28
- `)b--;let Z=_.slice(b,$.offset).includes("{");return{lineStart:b,isSingleLine:Z}}function bF(_,$){let b=$-1;while(b>=0&&(_[b]===" "||_[b]==="\t"))b--;if(b>=0&&_[b]===`
27
+ `)}),this}_outputHelpIfRequested(_){let $=this._getHelpOption();if($&&_.find((Z)=>$.is(Z)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function wU(_){return _.map(($)=>{if(!$.startsWith("--inspect"))return $;let b,Z="127.0.0.1",z="9229",A;if((A=$.match(/^(--inspect(-brk)?)$/))!==null)b=A[1];else if((A=$.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(b=A[1],/^\d+$/.test(A[3]))z=A[3];else Z=A[3];else if((A=$.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)b=A[1],Z=A[3],z=A[4];if(b&&z!=="0")return`${b}=${Z}:${parseInt(z)+1}`;return $})}function Xz(){if(Z0.env.NO_COLOR||Z0.env.FORCE_COLOR==="0"||Z0.env.FORCE_COLOR==="false")return!1;if(Z0.env.FORCE_COLOR||Z0.env.CLICOLOR_FORCE!==void 0)return!0;return}cF.Command=Qz;cF.useColor=Xz});var MU=P4((pF)=>{var{Argument:xU}=X2(),{Command:Kz}=BU(),{CommanderError:nF,InvalidArgumentError:NU}=e9(),{Help:lF}=Jz(),{Option:IU}=Uz();pF.program=new Kz;pF.createCommand=(_)=>new Kz(_);pF.createOption=(_,$)=>new IU(_,$);pF.createArgument=(_,$)=>new xU(_,$);pF.Command=Kz;pF.Option=IU;pF.Argument=xU;pF.Help=lF;pF.CommanderError=nF;pF.InvalidArgumentError=NU;pF.InvalidOptionArgumentError=NU});var EU=XF(MU(),1),{program:_M,createCommand:$M,createArgument:zM,createOption:bM,CommanderError:ZM,InvalidArgumentError:AM,InvalidOptionArgumentError:JM,Command:OU,Argument:UM,Option:GM,Help:YM}=EU.default;import{existsSync as kz,mkdirSync as Kv,readFileSync as fU,writeFileSync as yU}from"fs";import{homedir as Fv}from"os";import{join as mU}from"path";import{applyEdits as Zv,findNodeAtLocation as PU,format as KM,getNodeValue as Av,modify as Jv,parseTree as jU}from"jsonc-parser";function SU(_){if(!_)return[];let $=[],b="",Z=0;while(Z<_.length){let z=_[Z];if(z==="."){if(b)$.push(K2(b)),b="";Z++}else if(z==="["){if(b)$.push(K2(b)),b="";let A=_.indexOf("]",Z);if(A===-1)throw Error(`Unclosed bracket in path: ${_}`);let J=_.slice(Z+1,A);$.push(K2(J)),Z=A+1}else b+=z,Z++}if(b)$.push(K2(b));return $}function K2(_){let $=Number(_);if(!Number.isNaN($)&&Number.isInteger($)&&$>=0)return $;return _}function Fz(_){return typeof _==="string"?SU(_):_}function Uv(_,$){let b=Fz($),Z=jU(_);if(!Z)return null;let z=PU(Z,b);if(!z||!z.parent)return null;return{node:z,propertyNode:z.parent,tree:Z}}function Gv(_,$){let b=$.offset;while(b>0&&_[b-1]!==`
28
+ `)b--;let Z=_.slice(b,$.offset).includes("{");return{lineStart:b,isSingleLine:Z}}function Yv(_,$){let b=$-1;while(b>=0&&(_[b]===" "||_[b]==="\t"))b--;if(b>=0&&_[b]===`
29
29
  `){if(b--,b>=0&&_[b]==="\r")b--}else return null;while(b>=0&&(_[b]===" "||_[b]==="\t"))b--;if(b<0)return null;if(b>=1&&_[b]==="/"&&_[b-1]==="*"){let J=b-2;while(J>=1){if(_[J-1]==="/"&&_[J]==="*"){if(_.slice(J+1,b-1).trim().startsWith("**"))return null;let U=J-1;while(U>0&&_[U-1]!==`
30
30
  `)U--;return U}J--}return null}let Z=b;while(b>=0&&_[b]!==`
31
- `)b--;let z=b+1,A=_.slice(z,Z+1).trim();if(A.startsWith("//")){if(A.slice(2).trim().startsWith("**"))return null;return z}return null}function ZF(_,$){let b=$;if(b<_.length&&_[b]===",")b++;while(b<_.length&&(_[b]===" "||_[b]==="\t"))b++;if(b>=_.length||_[b]===`
31
+ `)b--;let z=b+1,A=_.slice(z,Z+1).trim();if(A.startsWith("//")){if(A.slice(2).trim().startsWith("**"))return null;return z}return null}function Xv(_,$){let b=$;if(b<_.length&&_[b]===",")b++;while(b<_.length&&(_[b]===" "||_[b]==="\t"))b++;if(b>=_.length||_[b]===`
32
32
  `||_[b]==="\r")return null;if(b<_.length-1&&_[b]==="/"&&_[b+1]==="/"){let Z=b;b+=2;while(b<_.length&&_[b]!==`
33
- `&&_[b]!=="\r")b++;let z=_.slice(Z+2,b).trim();return{start:Z,end:b,content:z}}if(b<_.length-1&&_[b]==="/"&&_[b+1]==="*"){let Z=b;b+=2;while(b<_.length-1){if(_[b]==="*"&&_[b+1]==="/"){b+=2;let z=_.slice(Z+2,b-2).trim();return{start:Z,end:b,content:z}}b++}return null}return null}function O7(_,$=[]){let b=[];for(let[Z,z]of Object.entries(_)){let A=[...$,Z];if(z===void 0)b.push({path:A,value:void 0});else if(z!==null&&typeof z==="object"&&!Array.isArray(z))b.push(...O7(z,A));else b.push({path:A,value:z})}return b}function Xz(_,$){let b=Yz($),Z=M7(_);if(!Z)return;let z=I7(Z,b);if(!z)return;return sv(z)}function P7(_,$){let b=$F(_,Yz($));if(!b)return _;let{propertyNode:Z}=b,{lineStart:z,isSingleLine:A}=zF(_,Z),J=!A?bF(_,Z.offset):null,U;if(J!==null)U=J;else if(A)U=Z.offset;else U=z;let G=Z.offset+Z.length,Y=ZF(_,Z.offset+Z.length),X=Y?.content.startsWith("**");if(Y&&!X)G=Y.end;if(G<_.length&&_[G]===",")G++;while(G<_.length&&(_[G]===" "||_[G]==="\t"))G++;if(!A){if(G<_.length&&_[G]===`
33
+ `&&_[b]!=="\r")b++;let z=_.slice(Z+2,b).trim();return{start:Z,end:b,content:z}}if(b<_.length-1&&_[b]==="/"&&_[b+1]==="*"){let Z=b;b+=2;while(b<_.length-1){if(_[b]==="*"&&_[b+1]==="/"){b+=2;let z=_.slice(Z+2,b-2).trim();return{start:Z,end:b,content:z}}b++}return null}return null}function RU(_,$=[]){let b=[];for(let[Z,z]of Object.entries(_)){let A=[...$,Z];if(z===void 0)b.push({path:A,value:void 0});else if(z!==null&&typeof z==="object"&&!Array.isArray(z))b.push(...RU(z,A));else b.push({path:A,value:z})}return b}function vz(_,$){let b=Fz($),Z=jU(_);if(!Z)return;let z=PU(Z,b);if(!z)return;return Av(z)}function LU(_,$){let b=Uv(_,Fz($));if(!b)return _;let{propertyNode:Z}=b,{lineStart:z,isSingleLine:A}=Gv(_,Z),J=!A?Yv(_,Z.offset):null,U;if(J!==null)U=J;else if(A)U=Z.offset;else U=z;let G=Z.offset+Z.length,Y=Xv(_,Z.offset+Z.length),X=Y?.content.startsWith("**");if(Y&&!X)G=Y.end;if(G<_.length&&_[G]===",")G++;while(G<_.length&&(_[G]===" "||_[G]==="\t"))G++;if(!A){if(G<_.length&&_[G]===`
34
34
  `)G++;else if(G<_.length&&_[G]==="\r"){if(G++,G<_.length&&_[G]===`
35
- `)G++}}let Q=_.slice(0,U),K=_.slice(G),v=Q+K,V=Q.trimEnd(),w=K.trimStart();if(V.endsWith(",")&&w.startsWith("}")){let P=Q.lastIndexOf(",");v=Q.slice(0,P)+Q.slice(P+1)+K}return v}function Qz(_,$){let b=_,Z=O7($);for(let{path:z,value:A}of Z)if(A===void 0)b=P7(b,z);else{let J=_F(b,z,A,{});b=tv(b,J)}return b}import*as s9 from"fs/promises";import*as I_ from"path";function Kz(_){let $=_.match(/git@([^:]+):(.+?)(?:\.git)?$/);if($)return`${$[1]}/${$[2]}`;let b=_.match(/https?:\/\/([^/]+)\/(.+?)(?:\.git)?$/);if(b)return`${b[1]}/${b[2]}`;return null}async function vz(_){let $=I_.resolve(_),{root:b}=I_.parse($);while(!0){let Z=I_.join($,".git");try{let A=await s9.stat(Z);if(A.isDirectory()||A.isFile())return $}catch{}if($===b)return null;let z=I_.dirname($);if(z===$)return null;$=z}}async function AF(_){try{let $=I_.join(_,".git","config"),Z=(await s9.readFile($,"utf8")).match(/\[remote "origin"\]\s+url\s*=\s*(.+)/i);if(!Z||!Z[1])return null;return Z[1].trim()}catch{return null}}async function Fz(_){let $=await AF(_);if(!$)return null;return Kz($)}async function M0(_){let $=_??process.cwd(),b=await vz($);if(!b)return null;return Fz(b)}async function j7(_,$){try{let b=I_.join(_,".git","HEAD"),z=(await s9.readFile(b,"utf8")).trim();if(z.startsWith("ref:")){let J=z.slice(4).trim().split("/");return J[J.length-1]??$??null}return z||$||null}catch{return $??null}}var Hz=T7(UF(),".config","agentlogs"),j4=T7(Hz,"settings.json"),R7={allowMode:"denylist",repos:{}};function y7(){if(!qz(Hz))JF(Hz,{recursive:!0})}function M_(){if(y7(),!qz(j4))return{...R7};try{let _=L7(j4,"utf-8"),$=Xz(_,[]);return{allowMode:$.allowMode==="allowlist"?"allowlist":"denylist",repos:typeof $.repos==="object"&&$.repos!==null?$.repos:{}}}catch{return{...R7}}}function Vz(_){y7();try{if(qz(j4)){let $=L7(j4,"utf-8"),b=Qz($,_);S7(j4,b,"utf-8")}else S7(j4,JSON.stringify(_,null,2),"utf-8")}catch($){throw console.error("Failed to write settings file:",$),$}}function J_(_){if(!_)return M_().allowMode==="denylist";let $=M_(),b=$.repos[_];if($.allowMode==="denylist"){if(!b)return!0;return b.allow}else{if(!b)return!1;return b.allow}}function Dz(_){if(!_)return;return M_().repos[_]?.visibility}function C7(_,$){let b=M_();b.repos[_]={allow:!0,...$&&{visibility:$}},Vz(b)}function f7(_){let $=M_();$.repos[_]={allow:!1},Vz($)}function m7(_){let $=M_();$.allowMode=_,Vz($)}function u7(){return j4}async function h7(_={}){let $=await M0();if(!$)console.error("Could not detect repository."),console.error("Make sure you are in a git repository with a remote origin configured."),process.exit(1);let b;if(_.public)b="public";else if(_.team)b="team";else if(_.private)b="private";else if(_.visibility){let A=_.visibility.toLowerCase();if(A!=="public"&&A!=="team"&&A!=="private")console.error("Invalid visibility. Use 'public', 'team', or 'private'."),process.exit(1);b=A}C7($,b);let z=M_().repos[$];if(console.log(`✓ Capture enabled for: ${$}`),z?.visibility)console.log(` Visibility: ${z.visibility}`);else console.log(" Visibility: (server default)");process.exit(0)}async function c7(){let _=await M0();if(!_)console.error("Could not detect repository."),console.error("Make sure you are in a git repository with a remote origin configured."),process.exit(1);f7(_),console.log(`✗ Capture disabled for: ${_}`),process.exit(0)}import jz from"node:process";import JU from"node:path";import{fileURLToPath as mF}from"node:url";import uF from"node:child_process";import hF,{constants as cF}from"node:fs/promises";import{promisify as DF}from"node:util";import kF from"node:child_process";import wz,{constants as o7}from"node:fs/promises";import l7 from"node:process";import KF from"node:os";import vF from"node:fs";import XF from"node:fs";import r7 from"node:fs";var kz;function GF(){try{return r7.statSync("/.dockerenv"),!0}catch{return!1}}function YF(){try{return r7.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Wz(){if(kz===void 0)kz=GF()||YF();return kz}var gz,QF=()=>{try{return XF.statSync("/run/.containerenv"),!0}catch{return!1}};function $9(){if(gz===void 0)gz=QF()||Wz();return gz}var n7=()=>{if(l7.platform!=="linux")return!1;if(KF.release().toLowerCase().includes("microsoft")){if($9())return!1;return!0}try{return vF.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!$9():!1}catch{return!1}},l_=l7.env.__IS_WSL_TEST__?n7:n7();import p7 from"node:process";import{Buffer as FF}from"node:buffer";import{promisify as HF}from"node:util";import qF from"node:child_process";var VF=HF(qF.execFile),Bz=()=>`${p7.env.SYSTEMROOT||p7.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;var t0=async(_,$={})=>{let{powerShellPath:b,...Z}=$,z=t0.encodeCommand(_);return VF(b??Bz(),[...t0.argumentsPrefix,z],{encoding:"utf8",...Z})};t0.argumentsPrefix=["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"];t0.encodeCommand=(_)=>FF.from(_,"utf16le").toString("base64");t0.escapeArgument=(_)=>`'${String(_).replaceAll("'","''")}'`;function d7(_){for(let $ of _.split(`
36
- `)){if(/^\s*#/.test($))continue;let b=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec($);if(!b)continue;return b.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,"")}}var WF=DF(kF.execFile),gF=(()=>{let $;return async function(){if($)return $;let b="/etc/wsl.conf",Z=!1;try{await wz.access(b,o7.F_OK),Z=!0}catch{}if(!Z)return"/mnt/";let z=await wz.readFile(b,{encoding:"utf8"}),A=d7(z);if(A===void 0)return"/mnt/";return $=A,$=$.endsWith("/")?$:`${$}/`,$}})(),BF=async()=>{return`${await gF()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`},F2=l_?BF:Bz,i7,a7=async()=>{return i7??=(async()=>{try{let _=await F2();return await wz.access(_,o7.X_OK),!0}catch{return!1}})(),i7},e7=async()=>{let _=await F2(),$=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{stdout:b}=await t0($,{powerShellPath:_});return b.trim()},t7=async(_)=>{if(/^[a-z]+:\/\//i.test(_))return _;try{let{stdout:$}=await WF("wslpath",["-aw",_],{encoding:"utf8"});return $.trim()}catch{return _}};function S4(_,$,b){let Z=(z)=>Object.defineProperty(_,$,{value:z,enumerable:!0,writable:!0});return Object.defineProperty(_,$,{configurable:!0,enumerable:!0,get(){let z=b();return Z(z),z},set(z){Z(z)}}),_}import{promisify as LF}from"node:util";import Ez from"node:process";import{execFile as TF}from"node:child_process";import{promisify as wF}from"node:util";import xF from"node:process";import{execFile as NF}from"node:child_process";var IF=wF(NF);async function xz(){if(xF.platform!=="darwin")throw Error("macOS only");let{stdout:_}=await IF("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),b=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(_)?.groups.id??"com.apple.Safari";if(b==="com.apple.safari")return"com.apple.Safari";return b}import MF from"node:process";import{promisify as EF}from"node:util";import{execFile as OF,execFileSync as bE}from"node:child_process";var PF=EF(OF);async function s7(_,{humanReadableOutput:$=!0,signal:b}={}){if(MF.platform!=="darwin")throw Error("macOS only");let Z=$?[]:["-ss"],z={};if(b)z.signal=b;let{stdout:A}=await PF("osascript",["-e",_,Z],z);return A.trim()}async function Nz(_){return s7(`tell application "Finder" to set app_path to application file id "${_}" as string
37
- tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}import{promisify as jF}from"node:util";import{execFile as SF}from"node:child_process";var RF=jF(SF),_U={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},H2=new Map(Object.entries(_U));class Iz extends Error{}async function Mz(_=RF){let{stdout:$}=await _("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),b=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec($);if(!b)throw new Iz(`Cannot find Windows browser in stdout: ${JSON.stringify($)}`);let{id:Z}=b.groups,z=_U[Z];if(!z)throw new Iz(`Unknown browser ID: ${Z}`);return z}var yF=LF(TF),CF=(_)=>_.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,($)=>$.toUpperCase());async function Oz(){if(Ez.platform==="darwin"){let _=await xz();return{name:await Nz(_),id:_}}if(Ez.platform==="linux"){let{stdout:_}=await yF("xdg-mime",["query","default","x-scheme-handler/http"]),$=_.trim();return{name:CF($.replace(/.desktop$/,"").replace("-"," ")),id:$}}if(Ez.platform==="win32")return Mz();throw Error("Only macOS, Linux, and Windows are supported")}import Pz from"node:process";var fF=Boolean(Pz.env.SSH_CONNECTION||Pz.env.SSH_CLIENT||Pz.env.SSH_TTY),$U=fF;var q2=Symbol("fallbackAttempt"),Sz=import.meta.url?JU.dirname(mF(import.meta.url)):"",zU=JU.join(Sz,"xdg-open"),{platform:z9,arch:bU}=jz,ZU=async(_,$)=>{if(_.length===0)return;let b=[];for(let Z of _)try{return await $(Z)}catch(z){b.push(z)}throw AggregateError(b,"Failed to open in all supported apps")},V2=async(_)=>{_={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,..._};let $=_[q2]===!0;if(delete _[q2],Array.isArray(_.app))return ZU(_.app,(Y)=>V2({..._,app:Y,[q2]:!0}));let{name:b,arguments:Z=[]}=_.app??{};if(Z=[...Z],Array.isArray(b))return ZU(b,(Y)=>V2({..._,app:{name:Y,arguments:Z},[q2]:!0}));if(b==="browser"||b==="browserPrivate"){let Y={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge","com.apple.safari":"safari"},X={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},Q;if(l_){let K=await e7();Q=H2.get(K)??{}}else Q=await Oz();if(Q.id in Y){let K=Y[Q.id.toLowerCase()];if(b==="browserPrivate"){if(K==="safari")throw Error("Safari doesn't support opening in private mode via command line");Z.push(X[K])}return V2({..._,app:{name:b9[K],arguments:Z}})}throw Error(`${Q.name} is not supported as a default browser`)}let z,A=[],J={},U=!1;if(l_&&!$9()&&!$U&&!b)U=await a7();if(z9==="darwin"){if(z="open",_.wait)A.push("--wait-apps");if(_.background)A.push("--background");if(_.newInstance)A.push("--new");if(b)A.push("-a",b)}else if(z9==="win32"||U){if(z=await F2(),A.push(...t0.argumentsPrefix),!l_)J.windowsVerbatimArguments=!0;if(l_&&_.target)_.target=await t7(_.target);let Y=["$ProgressPreference = 'SilentlyContinue';","Start"];if(_.wait)Y.push("-Wait");if(b){if(Y.push(t0.escapeArgument(b)),_.target)Z.push(_.target)}else if(_.target)Y.push(t0.escapeArgument(_.target));if(Z.length>0)Z=Z.map((X)=>t0.escapeArgument(X)),Y.push("-ArgumentList",Z.join(","));if(_.target=t0.encodeCommand(Y.join(" ")),!_.wait)J.stdio="ignore"}else{if(b)z=b;else{let Y=!Sz||Sz==="/",X=!1;try{await hF.access(zU,cF.X_OK),X=!0}catch{}z=jz.versions.electron??(z9==="android"||Y||!X)?"xdg-open":zU}if(Z.length>0)A.push(...Z);if(!_.wait)J.stdio="ignore",J.detached=!0}if(z9==="darwin"&&Z.length>0)A.push("--args",...Z);if(_.target)A.push(_.target);let G=uF.spawn(z,A,J);if(_.wait)return new Promise((Y,X)=>{G.once("error",X),G.once("close",(Q)=>{if(!_.allowNonzeroExitCode&&Q!==0){X(Error(`Exited with code ${Q}`));return}Y(G)})});if($)return new Promise((Y,X)=>{G.once("error",X),G.once("spawn",()=>{G.once("close",(Q)=>{if(G.off("error",X),Q!==0){X(Error(`Exited with code ${Q}`));return}G.unref(),Y(G)})})});return G.unref(),new Promise((Y,X)=>{G.once("error",X),G.once("spawn",()=>{G.off("error",X),Y(G)})})},rF=(_,$)=>{if(typeof _!=="string")throw TypeError("Expected a `target`");return V2({...$,target:_})};function AU(_){if(typeof _==="string"||Array.isArray(_))return _;let{[bU]:$}=_;if(!$)throw Error(`${bU} is not supported`);return $}function _$({[z9]:_},{wsl:$}={}){if($&&l_)return AU($);if(!_)throw Error(`${z9} is not supported`);return AU(_)}var b9={browser:"browser",browserPrivate:"browserPrivate"};S4(b9,"chrome",()=>_$({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium","chromium-browser"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));S4(b9,"brave",()=>_$({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));S4(b9,"firefox",()=>_$({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));S4(b9,"edge",()=>_$({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));S4(b9,"safari",()=>_$({darwin:"Safari"}));var UU=rF;var D2=Symbol.for("better-auth:broadcast-channel"),nF=()=>Math.floor(Date.now()/1000),lF=class{listeners=new Set;name;constructor(_="better-auth.message"){this.name=_}subscribe(_){return this.listeners.add(_),()=>{this.listeners.delete(_)}}post(_){if(typeof window>"u")return;try{localStorage.setItem(this.name,JSON.stringify({..._,timestamp:nF()}))}catch{}}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};let _=($)=>{if($.key!==this.name)return;let b=JSON.parse($.newValue??"{}");if(b?.event!=="session"||!b?.data)return;this.listeners.forEach((Z)=>Z(b))};return window.addEventListener("storage",_),()=>{window.removeEventListener("storage",_)}}};function $$(_="better-auth.message"){if(!globalThis[D2])globalThis[D2]=new lF(_);return globalThis[D2]}var k2=Symbol.for("better-auth:focus-manager"),pF=class{listeners=new Set;subscribe(_){return this.listeners.add(_),()=>{this.listeners.delete(_)}}setFocused(_){this.listeners.forEach(($)=>$(_))}setup(){if(typeof window>"u"||typeof document>"u"||typeof window.addEventListener>"u")return()=>{};let _=()=>{if(document.visibilityState==="visible")this.setFocused(!0)};return document.addEventListener("visibilitychange",_,!1),()=>{document.removeEventListener("visibilitychange",_,!1)}}};function Rz(){if(!globalThis[k2])globalThis[k2]=new pF;return globalThis[k2]}var W2=Symbol.for("better-auth:online-manager"),dF=class{listeners=new Set;isOnline=typeof navigator<"u"?navigator.onLine:!0;subscribe(_){return this.listeners.add(_),()=>{this.listeners.delete(_)}}setOnline(_){this.isOnline=_,this.listeners.forEach(($)=>$(_))}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};let _=()=>this.setOnline(!0),$=()=>this.setOnline(!1);return window.addEventListener("online",_,!1),window.addEventListener("offline",$,!1),()=>{window.removeEventListener("online",_,!1),window.removeEventListener("offline",$,!1)}}};function g2(){if(!globalThis[W2])globalThis[W2]=new dF;return globalThis[W2]}var iF={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},oF=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,GU={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},aF=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function eF(_){return _ instanceof Date&&!isNaN(_.getTime())}function tF(_){let $=aF.exec(_);if(!$)return null;let[,b,Z,z,A,J,U,G,Y,X,Q]=$,K=new Date(Date.UTC(parseInt(b,10),parseInt(Z,10)-1,parseInt(z,10),parseInt(A,10),parseInt(J,10),parseInt(U,10),G?parseInt(G.padEnd(3,"0"),10):0));if(Y){let v=(parseInt(X,10)*60+parseInt(Q,10))*(Y==="+"?-1:1);K.setUTCMinutes(K.getUTCMinutes()+v)}return eF(K)?K:null}function sF(_,$={}){let{strict:b=!1,warnings:Z=!1,reviver:z,parseDates:A=!0}=$;if(typeof _!=="string")return _;let J=_.trim();if(J.length>0&&J[0]==='"'&&J.endsWith('"')&&!J.slice(1,-1).includes('"'))return J.slice(1,-1);let U=J.toLowerCase();if(U.length<=9&&U in GU)return GU[U];if(!oF.test(J)){if(b)throw SyntaxError("[better-json] Invalid JSON");return _}if(Object.entries(iF).some(([G,Y])=>{let X=Y.test(J);if(X&&Z)console.warn(`[better-json] Detected potential prototype pollution attempt using ${G} pattern`);return X})&&b)throw Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(J,(Y,X)=>{if(Y==="__proto__"||Y==="constructor"&&X&&typeof X==="object"&&"prototype"in X){if(Z)console.warn(`[better-json] Dropping "${Y}" key to prevent prototype pollution`);return}if(A&&typeof X==="string"){let Q=tF(X);if(Q)return Q}return z?z(Y,X):X})}catch(G){if(b)throw G;return _}}function Lz(_,$={strict:!0}){return sF(_,$)}var H_=[],U4=0,B2=4,_H=0,z$=(_)=>{let $=[],b={get(){if(!b.lc)b.listen(()=>{})();return b.value},lc:0,listen(Z){return b.lc=$.push(Z),()=>{for(let A=U4+B2;A<H_.length;)if(H_[A]===Z)H_.splice(A,B2);else A+=B2;let z=$.indexOf(Z);if(~z){if($.splice(z,1),!--b.lc)b.off()}}},notify(Z,z){_H++;let A=!H_.length;for(let J of $)H_.push(J,b.value,Z,z);if(A){for(U4=0;U4<H_.length;U4+=B2)H_[U4](H_[U4+1],H_[U4+2],H_[U4+3]);H_.length=0}},off(){},set(Z){let z=b.value;if(z!==Z)b.value=Z,b.notify(z)},subscribe(Z){let z=b.listen(Z);return Z(b.value),z},value:_};return b};var $H=5,w2=6,x2=10,zH=(_,$,b,Z)=>{if(_.events=_.events||{},!_.events[b+x2])_.events[b+x2]=Z((z)=>{_.events[b].reduceRight((A,J)=>(J(A),A),{shared:{},...z})});return _.events[b]=_.events[b]||[],_.events[b].push($),()=>{let z=_.events[b],A=z.indexOf($);if(z.splice(A,1),!z.length)delete _.events[b],_.events[b+x2](),delete _.events[b+x2]}};var YU=1000,b$=(_,$)=>{return zH(_,(Z)=>{let z=$(Z);if(z)_.events[w2].push(z)},$H,(Z)=>{let z=_.listen;_.listen=(...J)=>{if(!_.lc&&!_.active)_.active=!0,Z();return z(...J)};let A=_.off;return _.events[w2]=[],_.off=()=>{A(),setTimeout(()=>{if(_.active&&!_.lc){_.active=!1;for(let J of _.events[w2])J();_.events[w2]=[]}},YU)},()=>{_.listen=z,_.off=A}})};var bH=()=>typeof window>"u",N2=(_,$,b,Z)=>{let z=z$({data:null,error:null,isPending:!0,isRefetching:!1,refetch:(U)=>A(U)}),A=async(U)=>{return new Promise((G)=>{let Y=typeof Z==="function"?Z({data:z.get().data,error:z.get().error,isPending:z.get().isPending}):Z;b($,{...Y,query:{...Y?.query,...U?.query},async onSuccess(X){z.set({data:X.data,error:null,isPending:!1,isRefetching:!1,refetch:z.value.refetch}),await Y?.onSuccess?.(X)},async onError(X){let{request:Q}=X,K=typeof Q.retry==="number"?Q.retry:Q.retry?.attempts,v=Q.retryAttempt||0;if(K&&v<K)return;z.set({error:X.error,data:null,isPending:!1,isRefetching:!1,refetch:z.value.refetch}),await Y?.onError?.(X)},async onRequest(X){let Q=z.get();z.set({isPending:Q.data===null,data:Q.data,error:null,isRefetching:!0,refetch:z.value.refetch}),await Y?.onRequest?.(X)}}).catch((X)=>{z.set({error:X,data:null,isPending:!1,isRefetching:!1,refetch:z.value.refetch})}).finally(()=>{G(void 0)})})};_=Array.isArray(_)?_:[_];let J=!1;for(let U of _)U.subscribe(async()=>{if(bH())return;if(J)await A();else b$(z,()=>{let G=setTimeout(async()=>{if(!J)await A(),J=!0},0);return()=>{z.off(),U.off(),clearTimeout(G)}})});return z};var Z9=()=>Math.floor(Date.now()/1000),ZH=5;function Tz(_){let{sessionAtom:$,sessionSignal:b,$fetch:Z,options:z={}}=_,A=z.sessionOptions?.refetchInterval??0,J=z.sessionOptions?.refetchOnWindowFocus??!0,U=z.sessionOptions?.refetchWhenOffline??!1,G={lastSync:0,lastSessionRequest:0,cachedSession:void 0},Y=()=>{return U||g2().isOnline},X=(B)=>{if(!Y())return;if(B?.event==="storage"){G.lastSync=Z9(),b.set(!b.get());return}let T=$.get(),y=()=>{G.lastSessionRequest=Z9(),Z("/get-session").then(async(u)=>{let E=u.data,C=u.error||null;if(E?.needsRefresh)try{let H=await Z("/get-session",{method:"POST"});E=H.data,C=H.error||null}catch{}let F=E?.session&&E?.user?{session:E.session,user:E.user}:null;$.set({...T,data:F,error:C}),G.lastSync=Z9(),b.set(!b.get())}).catch(()=>{})};if(B?.event==="poll"){y();return}if(B?.event==="visibilitychange"){if(Z9()-G.lastSessionRequest<ZH)return;G.lastSessionRequest=Z9()}if(B?.event==="visibilitychange"){y();return}if(T?.data===null||T?.data===void 0)G.lastSync=Z9(),b.set(!b.get())},Q=(B)=>{$$().post({event:"session",data:{trigger:B},clientId:Math.random().toString(36).substring(7)})},K=()=>{if(A&&A>0)G.pollInterval=setInterval(()=>{if($.get()?.data)X({event:"poll"})},A*1000)},v=()=>{G.unsubscribeBroadcast=$$().subscribe(()=>{X({event:"storage"})})},V=()=>{if(!J)return;G.unsubscribeFocus=Rz().subscribe(()=>{X({event:"visibilitychange"})})},w=()=>{G.unsubscribeOnline=g2().subscribe((B)=>{if(B)X({event:"visibilitychange"})})};return{init:()=>{K(),v(),V(),w(),$$().setup(),Rz().setup(),g2().setup()},cleanup:()=>{if(G.pollInterval)clearInterval(G.pollInterval),G.pollInterval=void 0;if(G.unsubscribeBroadcast)G.unsubscribeBroadcast(),G.unsubscribeBroadcast=void 0;if(G.unsubscribeFocus)G.unsubscribeFocus(),G.unsubscribeFocus=void 0;if(G.unsubscribeOnline)G.unsubscribeOnline(),G.unsubscribeOnline=void 0;G.lastSync=0,G.lastSessionRequest=0,G.cachedSession=void 0},triggerRefetch:X,broadcastSessionUpdate:Q}}var I2=Object.create(null),Z$=(_)=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(_?I2:globalThis),T0=new Proxy(I2,{get(_,$){return Z$()[$]??I2[$]},has(_,$){return $ in Z$()||$ in I2},set(_,$,b){let Z=Z$(!0);return Z[$]=b,!0},deleteProperty(_,$){if(!$)return!1;let b=Z$(!0);return delete b[$],!0},ownKeys(){let _=Z$(!0);return Object.keys(_)}});var AH=typeof process<"u"&&process.env&&"production"||"";function U0(_,$){if(typeof process<"u"&&process.env)return process.env[_]??$;if(typeof Deno<"u")return Deno.env.get(_)??$;if(typeof Bun<"u")return Bun.env[_]??$;return $}var JH=Object.freeze({get BETTER_AUTH_SECRET(){return U0("BETTER_AUTH_SECRET")},get AUTH_SECRET(){return U0("AUTH_SECRET")},get BETTER_AUTH_TELEMETRY(){return U0("BETTER_AUTH_TELEMETRY")},get BETTER_AUTH_TELEMETRY_ID(){return U0("BETTER_AUTH_TELEMETRY_ID")},get NODE_ENV(){return U0("NODE_ENV","development")},get PACKAGE_VERSION(){return U0("PACKAGE_VERSION","0.0.0")},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return U0("BETTER_AUTH_TELEMETRY_ENDPOINT","")}});var A$=1,N0=4,E_=8,s0=24,XU={eterm:N0,cons25:N0,console:N0,cygwin:N0,dtterm:N0,gnome:N0,hurd:N0,jfbterm:N0,konsole:N0,kterm:N0,mlterm:N0,mosh:s0,putty:N0,st:N0,"rxvt-unicode-24bit":s0,terminator:s0,"xterm-kitty":s0},UH=new Map(Object.entries({APPVEYOR:E_,BUILDKITE:E_,CIRCLECI:s0,DRONE:E_,GITEA_ACTIONS:s0,GITHUB_ACTIONS:s0,GITLAB_CI:E_,TRAVIS:E_})),GH=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function yz(){if(U0("FORCE_COLOR")!==void 0)switch(U0("FORCE_COLOR")){case"":case"1":case"true":return N0;case"2":return E_;case"3":return s0;default:return A$}if(U0("NODE_DISABLE_COLORS")!==void 0&&U0("NODE_DISABLE_COLORS")!==""||U0("NO_COLOR")!==void 0&&U0("NO_COLOR")!==""||U0("TERM")==="dumb")return A$;if(U0("TMUX"))return s0;if("TF_BUILD"in T0&&"AGENT_NAME"in T0)return N0;if("CI"in T0){for(let{0:_,1:$}of UH)if(_ in T0)return $;if(U0("CI_NAME")==="codeship")return E_;return A$}if("TEAMCITY_VERSION"in T0)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(U0("TEAMCITY_VERSION"))!==null?N0:A$;switch(U0("TERM_PROGRAM")){case"iTerm.app":if(!U0("TERM_PROGRAM_VERSION")||/^[0-2]\./.exec(U0("TERM_PROGRAM_VERSION"))!==null)return E_;return s0;case"HyperTerm":case"MacTerm":return s0;case"Apple_Terminal":return E_}if(U0("COLORTERM")==="truecolor"||U0("COLORTERM")==="24bit")return s0;if(U0("TERM")){if(/truecolor/.exec(U0("TERM"))!==null)return s0;if(/^xterm-256/.exec(U0("TERM"))!==null)return E_;let _=U0("TERM").toLowerCase();if(XU[_])return XU[_];if(GH.some(($)=>$.exec(_)!==null))return N0}if(U0("COLORTERM"))return N0;return A$}var q_={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",undim:"\x1B[22m",underscore:"\x1B[4m",blink:"\x1B[5m",reverse:"\x1B[7m",hidden:"\x1B[8m",fg:{black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"},bg:{black:"\x1B[40m",red:"\x1B[41m",green:"\x1B[42m",yellow:"\x1B[43m",blue:"\x1B[44m",magenta:"\x1B[45m",cyan:"\x1B[46m",white:"\x1B[47m"}},M2=["debug","info","success","warn","error"];function QU(_,$){return M2.indexOf($)>=M2.indexOf(_)}var YH={info:q_.fg.blue,success:q_.fg.green,warn:q_.fg.yellow,error:q_.fg.red,debug:q_.fg.magenta},XH=(_,$,b)=>{let Z=new Date().toISOString();if(b)return`${q_.dim}${Z}${q_.reset} ${YH[_]}${_.toUpperCase()}${q_.reset} ${q_.bright}[Better Auth]:${q_.reset} ${$}`;return`${Z} ${_.toUpperCase()} [Better Auth]: ${$}`},KU=(_)=>{let $=_?.disabled!==!0,b=_?.level??"warn",Z=_?.disableColors!==void 0?!_.disableColors:yz()!==1,z=(A,J,U=[])=>{if(!$||!QU(b,A))return;let G=XH(A,J,Z);if(!_||typeof _.log!=="function"){if(A==="error")console.error(G,...U);else if(A==="warn")console.warn(G,...U);else console.log(G,...U);return}_.log(A==="success"?"info":A,J,...U)};return{...Object.fromEntries(M2.map((A)=>[A,(...[J,...U])=>z(A,J,U)])),get level(){return b}}},QH=KU();function W0(_){return Object.fromEntries(Object.entries(_).map(([$,b])=>[$,{code:$,message:b,toString:()=>$}]))}var KH=W0({USER_NOT_FOUND:"User not found",FAILED_TO_CREATE_USER:"Failed to create user",FAILED_TO_CREATE_SESSION:"Failed to create session",FAILED_TO_UPDATE_USER:"Failed to update user",FAILED_TO_GET_SESSION:"Failed to get session",INVALID_PASSWORD:"Invalid password",INVALID_EMAIL:"Invalid email",INVALID_EMAIL_OR_PASSWORD:"Invalid email or password",INVALID_USER:"Invalid user",SOCIAL_ACCOUNT_ALREADY_LINKED:"Social account already linked",PROVIDER_NOT_FOUND:"Provider not found",INVALID_TOKEN:"Invalid token",TOKEN_EXPIRED:"Token expired",ID_TOKEN_NOT_SUPPORTED:"id_token not supported",FAILED_TO_GET_USER_INFO:"Failed to get user info",USER_EMAIL_NOT_FOUND:"User email not found",EMAIL_NOT_VERIFIED:"Email not verified",PASSWORD_TOO_SHORT:"Password too short",PASSWORD_TOO_LONG:"Password too long",USER_ALREADY_EXISTS:"User already exists.",USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:"User already exists. Use another email.",EMAIL_CAN_NOT_BE_UPDATED:"Email can not be updated",CREDENTIAL_ACCOUNT_NOT_FOUND:"Credential account not found",SESSION_EXPIRED:"Session expired. Re-authenticate to perform this action.",FAILED_TO_UNLINK_LAST_ACCOUNT:"You can't unlink your last account",ACCOUNT_NOT_FOUND:"Account not found",USER_ALREADY_HAS_PASSWORD:"User already has a password. Provide that to delete the account.",CROSS_SITE_NAVIGATION_LOGIN_BLOCKED:"Cross-site navigation login blocked. This request appears to be a CSRF attack.",VERIFICATION_EMAIL_NOT_ENABLED:"Verification email isn't enabled",EMAIL_ALREADY_VERIFIED:"Email is already verified",EMAIL_MISMATCH:"Email mismatch",SESSION_NOT_FRESH:"Session is not fresh",LINKED_ACCOUNT_ALREADY_EXISTS:"Linked account already exists",INVALID_ORIGIN:"Invalid origin",INVALID_CALLBACK_URL:"Invalid callbackURL",INVALID_REDIRECT_URL:"Invalid redirectURL",INVALID_ERROR_CALLBACK_URL:"Invalid errorCallbackURL",INVALID_NEW_USER_CALLBACK_URL:"Invalid newUserCallbackURL",MISSING_OR_NULL_ORIGIN:"Missing or null Origin",CALLBACK_URL_REQUIRED:"callbackURL is required",FAILED_TO_CREATE_VERIFICATION:"Unable to create verification",FIELD_NOT_ALLOWED:"Field not allowed to be set",ASYNC_VALIDATION_NOT_SUPPORTED:"Async validation is not supported",VALIDATION_ERROR:"Validation Error",MISSING_FIELD:"Field is required",METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED:"POST method requires deferSessionRefresh to be enabled in session config",BODY_MUST_BE_AN_OBJECT:"Body must be an object",PASSWORD_ALREADY_SET:"User already has a password set"});function vH(){let _=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");if(_===void 0)return Object.isExtensible(Error);return Object.prototype.hasOwnProperty.call(_,"writable")?_.writable:_.set!==void 0}function FH(_){let $=_.split(`
35
+ `)G++}}let Q=_.slice(0,U),K=_.slice(G),v=Q+K,D=Q.trimEnd(),w=K.trimStart();if(D.endsWith(",")&&w.startsWith("}")){let P=Q.lastIndexOf(",");v=Q.slice(0,P)+Q.slice(P+1)+K}return v}function Hz(_,$){let b=_,Z=RU($);for(let{path:z,value:A}of Z)if(A===void 0)b=LU(b,z);else{let J=Jv(b,z,A,{});b=Zv(b,J)}return b}import*as t9 from"fs/promises";import*as M_ from"path";function qz(_){let $=_.match(/git@([^:]+):(.+?)(?:\.git)?$/);if($)return`${$[1]}/${$[2]}`;let b=_.match(/https?:\/\/([^/]+)\/(.+?)(?:\.git)?$/);if(b)return`${b[1]}/${b[2]}`;return null}async function Dz(_){let $=M_.resolve(_),{root:b}=M_.parse($);while(!0){let Z=M_.join($,".git");try{let A=await t9.stat(Z);if(A.isDirectory()||A.isFile())return $}catch{}if($===b)return null;let z=M_.dirname($);if(z===$)return null;$=z}}async function Qv(_){try{let $=M_.join(_,".git","config"),Z=(await t9.readFile($,"utf8")).match(/\[remote "origin"\]\s+url\s*=\s*(.+)/i);if(!Z||!Z[1])return null;return Z[1].trim()}catch{return null}}async function Vz(_){let $=await Qv(_);if(!$)return null;return qz($)}async function M0(_){let $=_??process.cwd(),b=await Dz($);if(!b)return null;return Vz(b)}async function TU(_,$){try{let b=M_.join(_,".git","HEAD"),z=(await t9.readFile(b,"utf8")).trim();if(z.startsWith("ref:")){let J=z.slice(4).trim().split("/");return J[J.length-1]??$??null}return z||$||null}catch{return $??null}}var gz=mU(Fv(),".config","agentlogs"),S4=mU(gz,"settings.json"),CU={allowMode:"denylist",repos:{}};function uU(){if(!kz(gz))Kv(gz,{recursive:!0})}function E_(){if(uU(),!kz(S4))return{...CU};try{let _=fU(S4,"utf-8"),$=vz(_,[]);return{allowMode:$.allowMode==="allowlist"?"allowlist":"denylist",repos:typeof $.repos==="object"&&$.repos!==null?$.repos:{}}}catch{return{...CU}}}function Wz(_){uU();try{if(kz(S4)){let $=fU(S4,"utf-8"),b=Hz($,_);yU(S4,b,"utf-8")}else yU(S4,JSON.stringify(_,null,2),"utf-8")}catch($){throw console.error("Failed to write settings file:",$),$}}function U_(_){if(!_)return E_().allowMode==="denylist";let $=E_(),b=$.repos[_];if($.allowMode==="denylist"){if(!b)return!0;return b.allow}else{if(!b)return!1;return b.allow}}function wz(_){if(!_)return;return E_().repos[_]?.visibility}function cU(_,$){let b=E_();b.repos[_]={allow:!0,...$&&{visibility:$}},Wz(b)}function hU(_){let $=E_();$.repos[_]={allow:!1},Wz($)}function rU(_){let $=E_();$.allowMode=_,Wz($)}function nU(){return S4}async function lU(_={}){let $=await M0();if(!$)console.error("Could not detect repository."),console.error("Make sure you are in a git repository with a remote origin configured."),process.exit(1);let b;if(_.public)b="public";else if(_.team)b="team";else if(_.private)b="private";else if(_.visibility){let A=_.visibility.toLowerCase();if(A!=="public"&&A!=="team"&&A!=="private")console.error("Invalid visibility. Use 'public', 'team', or 'private'."),process.exit(1);b=A}cU($,b);let z=E_().repos[$];if(console.log(`✓ Capture enabled for: ${$}`),z?.visibility)console.log(` Visibility: ${z.visibility}`);else console.log(" Visibility: (server default)");process.exit(0)}async function pU(){let _=await M0();if(!_)console.error("Could not detect repository."),console.error("Make sure you are in a git repository with a remote origin configured."),process.exit(1);hU(_),console.log(`✗ Capture disabled for: ${_}`),process.exit(0)}import Tz from"node:process";import X7 from"node:path";import{fileURLToPath as lv}from"node:url";import pv from"node:child_process";import dv,{constants as iv}from"node:fs/promises";import{promisify as xv}from"node:util";import Nv from"node:child_process";import Mz,{constants as sU}from"node:fs/promises";import oU from"node:process";import Vv from"node:os";import gv from"node:fs";import qv from"node:fs";import dU from"node:fs";var Bz;function vv(){try{return dU.statSync("/.dockerenv"),!0}catch{return!1}}function Hv(){try{return dU.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function xz(){if(Bz===void 0)Bz=vv()||Hv();return Bz}var Nz,Dv=()=>{try{return qv.statSync("/run/.containerenv"),!0}catch{return!1}};function $9(){if(Nz===void 0)Nz=Dv()||xz();return Nz}var iU=()=>{if(oU.platform!=="linux")return!1;if(Vv.release().toLowerCase().includes("microsoft")){if($9())return!1;return!0}try{return gv.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!$9():!1}catch{return!1}},a_=oU.env.__IS_WSL_TEST__?iU:iU();import aU from"node:process";import{Buffer as kv}from"node:buffer";import{promisify as Wv}from"node:util";import wv from"node:child_process";var Bv=Wv(wv.execFile),Iz=()=>`${aU.env.SYSTEMROOT||aU.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;var s0=async(_,$={})=>{let{powerShellPath:b,...Z}=$,z=s0.encodeCommand(_);return Bv(b??Iz(),[...s0.argumentsPrefix,z],{encoding:"utf8",...Z})};s0.argumentsPrefix=["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"];s0.encodeCommand=(_)=>kv.from(_,"utf16le").toString("base64");s0.escapeArgument=(_)=>`'${String(_).replaceAll("'","''")}'`;function eU(_){for(let $ of _.split(`
36
+ `)){if(/^\s*#/.test($))continue;let b=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec($);if(!b)continue;return b.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,"")}}var Iv=xv(Nv.execFile),Mv=(()=>{let $;return async function(){if($)return $;let b="/etc/wsl.conf",Z=!1;try{await Mz.access(b,sU.F_OK),Z=!0}catch{}if(!Z)return"/mnt/";let z=await Mz.readFile(b,{encoding:"utf8"}),A=eU(z);if(A===void 0)return"/mnt/";return $=A,$=$.endsWith("/")?$:`${$}/`,$}})(),Ev=async()=>{return`${await Mv()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`},F2=a_?Ev:Iz,tU,_7=async()=>{return tU??=(async()=>{try{let _=await F2();return await Mz.access(_,sU.X_OK),!0}catch{return!1}})(),tU},$7=async()=>{let _=await F2(),$=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{stdout:b}=await s0($,{powerShellPath:_});return b.trim()},z7=async(_)=>{if(/^[a-z]+:\/\//i.test(_))return _;try{let{stdout:$}=await Iv("wslpath",["-aw",_],{encoding:"utf8"});return $.trim()}catch{return _}};function R4(_,$,b){let Z=(z)=>Object.defineProperty(_,$,{value:z,enumerable:!0,writable:!0});return Object.defineProperty(_,$,{configurable:!0,enumerable:!0,get(){let z=b();return Z(z),z},set(z){Z(z)}}),_}import{promisify as uv}from"node:util";import Sz from"node:process";import{execFile as cv}from"node:child_process";import{promisify as Ov}from"node:util";import Pv from"node:process";import{execFile as jv}from"node:child_process";var Sv=Ov(jv);async function Ez(){if(Pv.platform!=="darwin")throw Error("macOS only");let{stdout:_}=await Sv("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),b=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(_)?.groups.id??"com.apple.Safari";if(b==="com.apple.safari")return"com.apple.Safari";return b}import Rv from"node:process";import{promisify as Lv}from"node:util";import{execFile as Tv,execFileSync as WE}from"node:child_process";var yv=Lv(Tv);async function b7(_,{humanReadableOutput:$=!0,signal:b}={}){if(Rv.platform!=="darwin")throw Error("macOS only");let Z=$?[]:["-ss"],z={};if(b)z.signal=b;let{stdout:A}=await yv("osascript",["-e",_,Z],z);return A.trim()}async function Oz(_){return b7(`tell application "Finder" to set app_path to application file id "${_}" as string
37
+ tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}import{promisify as Cv}from"node:util";import{execFile as fv}from"node:child_process";var mv=Cv(fv),Z7={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},v2=new Map(Object.entries(Z7));class Pz extends Error{}async function jz(_=mv){let{stdout:$}=await _("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),b=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec($);if(!b)throw new Pz(`Cannot find Windows browser in stdout: ${JSON.stringify($)}`);let{id:Z}=b.groups,z=Z7[Z];if(!z)throw new Pz(`Unknown browser ID: ${Z}`);return z}var hv=uv(cv),rv=(_)=>_.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,($)=>$.toUpperCase());async function Rz(){if(Sz.platform==="darwin"){let _=await Ez();return{name:await Oz(_),id:_}}if(Sz.platform==="linux"){let{stdout:_}=await hv("xdg-mime",["query","default","x-scheme-handler/http"]),$=_.trim();return{name:rv($.replace(/.desktop$/,"").replace("-"," ")),id:$}}if(Sz.platform==="win32")return jz();throw Error("Only macOS, Linux, and Windows are supported")}import Lz from"node:process";var nv=Boolean(Lz.env.SSH_CONNECTION||Lz.env.SSH_CLIENT||Lz.env.SSH_TTY),A7=nv;var H2=Symbol("fallbackAttempt"),yz=import.meta.url?X7.dirname(lv(import.meta.url)):"",J7=X7.join(yz,"xdg-open"),{platform:z9,arch:U7}=Tz,G7=async(_,$)=>{if(_.length===0)return;let b=[];for(let Z of _)try{return await $(Z)}catch(z){b.push(z)}throw AggregateError(b,"Failed to open in all supported apps")},q2=async(_)=>{_={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,..._};let $=_[H2]===!0;if(delete _[H2],Array.isArray(_.app))return G7(_.app,(Y)=>q2({..._,app:Y,[H2]:!0}));let{name:b,arguments:Z=[]}=_.app??{};if(Z=[...Z],Array.isArray(b))return G7(b,(Y)=>q2({..._,app:{name:Y,arguments:Z},[H2]:!0}));if(b==="browser"||b==="browserPrivate"){let Y={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge","com.apple.safari":"safari"},X={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},Q;if(a_){let K=await $7();Q=v2.get(K)??{}}else Q=await Rz();if(Q.id in Y){let K=Y[Q.id.toLowerCase()];if(b==="browserPrivate"){if(K==="safari")throw Error("Safari doesn't support opening in private mode via command line");Z.push(X[K])}return q2({..._,app:{name:b9[K],arguments:Z}})}throw Error(`${Q.name} is not supported as a default browser`)}let z,A=[],J={},U=!1;if(a_&&!$9()&&!A7&&!b)U=await _7();if(z9==="darwin"){if(z="open",_.wait)A.push("--wait-apps");if(_.background)A.push("--background");if(_.newInstance)A.push("--new");if(b)A.push("-a",b)}else if(z9==="win32"||U){if(z=await F2(),A.push(...s0.argumentsPrefix),!a_)J.windowsVerbatimArguments=!0;if(a_&&_.target)_.target=await z7(_.target);let Y=["$ProgressPreference = 'SilentlyContinue';","Start"];if(_.wait)Y.push("-Wait");if(b){if(Y.push(s0.escapeArgument(b)),_.target)Z.push(_.target)}else if(_.target)Y.push(s0.escapeArgument(_.target));if(Z.length>0)Z=Z.map((X)=>s0.escapeArgument(X)),Y.push("-ArgumentList",Z.join(","));if(_.target=s0.encodeCommand(Y.join(" ")),!_.wait)J.stdio="ignore"}else{if(b)z=b;else{let Y=!yz||yz==="/",X=!1;try{await dv.access(J7,iv.X_OK),X=!0}catch{}z=Tz.versions.electron??(z9==="android"||Y||!X)?"xdg-open":J7}if(Z.length>0)A.push(...Z);if(!_.wait)J.stdio="ignore",J.detached=!0}if(z9==="darwin"&&Z.length>0)A.push("--args",...Z);if(_.target)A.push(_.target);let G=pv.spawn(z,A,J);if(_.wait)return new Promise((Y,X)=>{G.once("error",X),G.once("close",(Q)=>{if(!_.allowNonzeroExitCode&&Q!==0){X(Error(`Exited with code ${Q}`));return}Y(G)})});if($)return new Promise((Y,X)=>{G.once("error",X),G.once("spawn",()=>{G.once("close",(Q)=>{if(G.off("error",X),Q!==0){X(Error(`Exited with code ${Q}`));return}G.unref(),Y(G)})})});return G.unref(),new Promise((Y,X)=>{G.once("error",X),G.once("spawn",()=>{G.off("error",X),Y(G)})})},ov=(_,$)=>{if(typeof _!=="string")throw TypeError("Expected a `target`");return q2({...$,target:_})};function Y7(_){if(typeof _==="string"||Array.isArray(_))return _;let{[U7]:$}=_;if(!$)throw Error(`${U7} is not supported`);return $}function s9({[z9]:_},{wsl:$}={}){if($&&a_)return Y7($);if(!_)throw Error(`${z9} is not supported`);return Y7(_)}var b9={browser:"browser",browserPrivate:"browserPrivate"};R4(b9,"chrome",()=>s9({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium","chromium-browser"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));R4(b9,"brave",()=>s9({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));R4(b9,"firefox",()=>s9({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));R4(b9,"edge",()=>s9({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));R4(b9,"safari",()=>s9({darwin:"Safari"}));var Q7=ov;var D2=Symbol.for("better-auth:broadcast-channel"),av=()=>Math.floor(Date.now()/1000),ev=class{listeners=new Set;name;constructor(_="better-auth.message"){this.name=_}subscribe(_){return this.listeners.add(_),()=>{this.listeners.delete(_)}}post(_){if(typeof window>"u")return;try{localStorage.setItem(this.name,JSON.stringify({..._,timestamp:av()}))}catch{}}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};let _=($)=>{if($.key!==this.name)return;let b=JSON.parse($.newValue??"{}");if(b?.event!=="session"||!b?.data)return;this.listeners.forEach((Z)=>Z(b))};return window.addEventListener("storage",_),()=>{window.removeEventListener("storage",_)}}};function _$(_="better-auth.message"){if(!globalThis[D2])globalThis[D2]=new ev(_);return globalThis[D2]}var V2=Symbol.for("better-auth:focus-manager"),tv=class{listeners=new Set;subscribe(_){return this.listeners.add(_),()=>{this.listeners.delete(_)}}setFocused(_){this.listeners.forEach(($)=>$(_))}setup(){if(typeof window>"u"||typeof document>"u"||typeof window.addEventListener>"u")return()=>{};let _=()=>{if(document.visibilityState==="visible")this.setFocused(!0)};return document.addEventListener("visibilitychange",_,!1),()=>{document.removeEventListener("visibilitychange",_,!1)}}};function Cz(){if(!globalThis[V2])globalThis[V2]=new tv;return globalThis[V2]}var g2=Symbol.for("better-auth:online-manager"),sv=class{listeners=new Set;isOnline=typeof navigator<"u"?navigator.onLine:!0;subscribe(_){return this.listeners.add(_),()=>{this.listeners.delete(_)}}setOnline(_){this.isOnline=_,this.listeners.forEach(($)=>$(_))}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};let _=()=>this.setOnline(!0),$=()=>this.setOnline(!1);return window.addEventListener("online",_,!1),window.addEventListener("offline",$,!1),()=>{window.removeEventListener("online",_,!1),window.removeEventListener("offline",$,!1)}}};function k2(){if(!globalThis[g2])globalThis[g2]=new sv;return globalThis[g2]}var _H={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},$H=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,K7={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},zH=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function bH(_){return _ instanceof Date&&!isNaN(_.getTime())}function ZH(_){let $=zH.exec(_);if(!$)return null;let[,b,Z,z,A,J,U,G,Y,X,Q]=$,K=new Date(Date.UTC(parseInt(b,10),parseInt(Z,10)-1,parseInt(z,10),parseInt(A,10),parseInt(J,10),parseInt(U,10),G?parseInt(G.padEnd(3,"0"),10):0));if(Y){let v=(parseInt(X,10)*60+parseInt(Q,10))*(Y==="+"?-1:1);K.setUTCMinutes(K.getUTCMinutes()+v)}return bH(K)?K:null}function AH(_,$={}){let{strict:b=!1,warnings:Z=!1,reviver:z,parseDates:A=!0}=$;if(typeof _!=="string")return _;let J=_.trim();if(J.length>0&&J[0]==='"'&&J.endsWith('"')&&!J.slice(1,-1).includes('"'))return J.slice(1,-1);let U=J.toLowerCase();if(U.length<=9&&U in K7)return K7[U];if(!$H.test(J)){if(b)throw SyntaxError("[better-json] Invalid JSON");return _}if(Object.entries(_H).some(([G,Y])=>{let X=Y.test(J);if(X&&Z)console.warn(`[better-json] Detected potential prototype pollution attempt using ${G} pattern`);return X})&&b)throw Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(J,(Y,X)=>{if(Y==="__proto__"||Y==="constructor"&&X&&typeof X==="object"&&"prototype"in X){if(Z)console.warn(`[better-json] Dropping "${Y}" key to prevent prototype pollution`);return}if(A&&typeof X==="string"){let Q=ZH(X);if(Q)return Q}return z?z(Y,X):X})}catch(G){if(b)throw G;return _}}function fz(_,$={strict:!0}){return AH(_,$)}var q_=[],K4=0,W2=4,JH=0,$$=(_)=>{let $=[],b={get(){if(!b.lc)b.listen(()=>{})();return b.value},lc:0,listen(Z){return b.lc=$.push(Z),()=>{for(let A=K4+W2;A<q_.length;)if(q_[A]===Z)q_.splice(A,W2);else A+=W2;let z=$.indexOf(Z);if(~z){if($.splice(z,1),!--b.lc)b.off()}}},notify(Z,z){JH++;let A=!q_.length;for(let J of $)q_.push(J,b.value,Z,z);if(A){for(K4=0;K4<q_.length;K4+=W2)q_[K4](q_[K4+1],q_[K4+2],q_[K4+3]);q_.length=0}},off(){},set(Z){let z=b.value;if(z!==Z)b.value=Z,b.notify(z)},subscribe(Z){let z=b.listen(Z);return Z(b.value),z},value:_};return b};var UH=5,w2=6,B2=10,GH=(_,$,b,Z)=>{if(_.events=_.events||{},!_.events[b+B2])_.events[b+B2]=Z((z)=>{_.events[b].reduceRight((A,J)=>(J(A),A),{shared:{},...z})});return _.events[b]=_.events[b]||[],_.events[b].push($),()=>{let z=_.events[b],A=z.indexOf($);if(z.splice(A,1),!z.length)delete _.events[b],_.events[b+B2](),delete _.events[b+B2]}};var F7=1000,z$=(_,$)=>{return GH(_,(Z)=>{let z=$(Z);if(z)_.events[w2].push(z)},UH,(Z)=>{let z=_.listen;_.listen=(...J)=>{if(!_.lc&&!_.active)_.active=!0,Z();return z(...J)};let A=_.off;return _.events[w2]=[],_.off=()=>{A(),setTimeout(()=>{if(_.active&&!_.lc){_.active=!1;for(let J of _.events[w2])J();_.events[w2]=[]}},F7)},()=>{_.listen=z,_.off=A}})};var YH=()=>typeof window>"u",x2=(_,$,b,Z)=>{let z=$$({data:null,error:null,isPending:!0,isRefetching:!1,refetch:(U)=>A(U)}),A=async(U)=>{return new Promise((G)=>{let Y=typeof Z==="function"?Z({data:z.get().data,error:z.get().error,isPending:z.get().isPending}):Z;b($,{...Y,query:{...Y?.query,...U?.query},async onSuccess(X){z.set({data:X.data,error:null,isPending:!1,isRefetching:!1,refetch:z.value.refetch}),await Y?.onSuccess?.(X)},async onError(X){let{request:Q}=X,K=typeof Q.retry==="number"?Q.retry:Q.retry?.attempts,v=Q.retryAttempt||0;if(K&&v<K)return;z.set({error:X.error,data:null,isPending:!1,isRefetching:!1,refetch:z.value.refetch}),await Y?.onError?.(X)},async onRequest(X){let Q=z.get();z.set({isPending:Q.data===null,data:Q.data,error:null,isRefetching:!0,refetch:z.value.refetch}),await Y?.onRequest?.(X)}}).catch((X)=>{z.set({error:X,data:null,isPending:!1,isRefetching:!1,refetch:z.value.refetch})}).finally(()=>{G(void 0)})})};_=Array.isArray(_)?_:[_];let J=!1;for(let U of _)U.subscribe(async()=>{if(YH())return;if(J)await A();else z$(z,()=>{let G=setTimeout(async()=>{if(!J)await A(),J=!0},0);return()=>{z.off(),U.off(),clearTimeout(G)}})});return z};var Z9=()=>Math.floor(Date.now()/1000),XH=5;function mz(_){let{sessionAtom:$,sessionSignal:b,$fetch:Z,options:z={}}=_,A=z.sessionOptions?.refetchInterval??0,J=z.sessionOptions?.refetchOnWindowFocus??!0,U=z.sessionOptions?.refetchWhenOffline??!1,G={lastSync:0,lastSessionRequest:0,cachedSession:void 0},Y=()=>{return U||k2().isOnline},X=(B)=>{if(!Y())return;if(B?.event==="storage"){G.lastSync=Z9(),b.set(!b.get());return}let C=$.get(),f=()=>{G.lastSessionRequest=Z9(),Z("/get-session").then(async(u)=>{let O=u.data,T=u.error||null;if(O?.needsRefresh)try{let H=await Z("/get-session",{method:"POST"});O=H.data,T=H.error||null}catch{}let F=O?.session&&O?.user?{session:O.session,user:O.user}:null;$.set({...C,data:F,error:T}),G.lastSync=Z9(),b.set(!b.get())}).catch(()=>{})};if(B?.event==="poll"){f();return}if(B?.event==="visibilitychange"){if(Z9()-G.lastSessionRequest<XH)return;G.lastSessionRequest=Z9()}if(B?.event==="visibilitychange"){f();return}if(C?.data===null||C?.data===void 0)G.lastSync=Z9(),b.set(!b.get())},Q=(B)=>{_$().post({event:"session",data:{trigger:B},clientId:Math.random().toString(36).substring(7)})},K=()=>{if(A&&A>0)G.pollInterval=setInterval(()=>{if($.get()?.data)X({event:"poll"})},A*1000)},v=()=>{G.unsubscribeBroadcast=_$().subscribe(()=>{X({event:"storage"})})},D=()=>{if(!J)return;G.unsubscribeFocus=Cz().subscribe(()=>{X({event:"visibilitychange"})})},w=()=>{G.unsubscribeOnline=k2().subscribe((B)=>{if(B)X({event:"visibilitychange"})})};return{init:()=>{K(),v(),D(),w(),_$().setup(),Cz().setup(),k2().setup()},cleanup:()=>{if(G.pollInterval)clearInterval(G.pollInterval),G.pollInterval=void 0;if(G.unsubscribeBroadcast)G.unsubscribeBroadcast(),G.unsubscribeBroadcast=void 0;if(G.unsubscribeFocus)G.unsubscribeFocus(),G.unsubscribeFocus=void 0;if(G.unsubscribeOnline)G.unsubscribeOnline(),G.unsubscribeOnline=void 0;G.lastSync=0,G.lastSessionRequest=0,G.cachedSession=void 0},triggerRefetch:X,broadcastSessionUpdate:Q}}var N2=Object.create(null),b$=(_)=>globalThis.process?.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(_?N2:globalThis),T0=new Proxy(N2,{get(_,$){return b$()[$]??N2[$]},has(_,$){return $ in b$()||$ in N2},set(_,$,b){let Z=b$(!0);return Z[$]=b,!0},deleteProperty(_,$){if(!$)return!1;let b=b$(!0);return delete b[$],!0},ownKeys(){let _=b$(!0);return Object.keys(_)}});var QH=typeof process<"u"&&process.env&&"production"||"";function U0(_,$){if(typeof process<"u"&&process.env)return process.env[_]??$;if(typeof Deno<"u")return Deno.env.get(_)??$;if(typeof Bun<"u")return Bun.env[_]??$;return $}var KH=Object.freeze({get BETTER_AUTH_SECRET(){return U0("BETTER_AUTH_SECRET")},get AUTH_SECRET(){return U0("AUTH_SECRET")},get BETTER_AUTH_TELEMETRY(){return U0("BETTER_AUTH_TELEMETRY")},get BETTER_AUTH_TELEMETRY_ID(){return U0("BETTER_AUTH_TELEMETRY_ID")},get NODE_ENV(){return U0("NODE_ENV","development")},get PACKAGE_VERSION(){return U0("PACKAGE_VERSION","0.0.0")},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return U0("BETTER_AUTH_TELEMETRY_ENDPOINT","")}});var Z$=1,N0=4,O_=8,__=24,v7={eterm:N0,cons25:N0,console:N0,cygwin:N0,dtterm:N0,gnome:N0,hurd:N0,jfbterm:N0,konsole:N0,kterm:N0,mlterm:N0,mosh:__,putty:N0,st:N0,"rxvt-unicode-24bit":__,terminator:__,"xterm-kitty":__},FH=new Map(Object.entries({APPVEYOR:O_,BUILDKITE:O_,CIRCLECI:__,DRONE:O_,GITEA_ACTIONS:__,GITHUB_ACTIONS:__,GITLAB_CI:O_,TRAVIS:O_})),vH=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function uz(){if(U0("FORCE_COLOR")!==void 0)switch(U0("FORCE_COLOR")){case"":case"1":case"true":return N0;case"2":return O_;case"3":return __;default:return Z$}if(U0("NODE_DISABLE_COLORS")!==void 0&&U0("NODE_DISABLE_COLORS")!==""||U0("NO_COLOR")!==void 0&&U0("NO_COLOR")!==""||U0("TERM")==="dumb")return Z$;if(U0("TMUX"))return __;if("TF_BUILD"in T0&&"AGENT_NAME"in T0)return N0;if("CI"in T0){for(let{0:_,1:$}of FH)if(_ in T0)return $;if(U0("CI_NAME")==="codeship")return O_;return Z$}if("TEAMCITY_VERSION"in T0)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(U0("TEAMCITY_VERSION"))!==null?N0:Z$;switch(U0("TERM_PROGRAM")){case"iTerm.app":if(!U0("TERM_PROGRAM_VERSION")||/^[0-2]\./.exec(U0("TERM_PROGRAM_VERSION"))!==null)return O_;return __;case"HyperTerm":case"MacTerm":return __;case"Apple_Terminal":return O_}if(U0("COLORTERM")==="truecolor"||U0("COLORTERM")==="24bit")return __;if(U0("TERM")){if(/truecolor/.exec(U0("TERM"))!==null)return __;if(/^xterm-256/.exec(U0("TERM"))!==null)return O_;let _=U0("TERM").toLowerCase();if(v7[_])return v7[_];if(vH.some(($)=>$.exec(_)!==null))return N0}if(U0("COLORTERM"))return N0;return Z$}var D_={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",undim:"\x1B[22m",underscore:"\x1B[4m",blink:"\x1B[5m",reverse:"\x1B[7m",hidden:"\x1B[8m",fg:{black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"},bg:{black:"\x1B[40m",red:"\x1B[41m",green:"\x1B[42m",yellow:"\x1B[43m",blue:"\x1B[44m",magenta:"\x1B[45m",cyan:"\x1B[46m",white:"\x1B[47m"}},I2=["debug","info","success","warn","error"];function H7(_,$){return I2.indexOf($)>=I2.indexOf(_)}var HH={info:D_.fg.blue,success:D_.fg.green,warn:D_.fg.yellow,error:D_.fg.red,debug:D_.fg.magenta},qH=(_,$,b)=>{let Z=new Date().toISOString();if(b)return`${D_.dim}${Z}${D_.reset} ${HH[_]}${_.toUpperCase()}${D_.reset} ${D_.bright}[Better Auth]:${D_.reset} ${$}`;return`${Z} ${_.toUpperCase()} [Better Auth]: ${$}`},q7=(_)=>{let $=_?.disabled!==!0,b=_?.level??"warn",Z=_?.disableColors!==void 0?!_.disableColors:uz()!==1,z=(A,J,U=[])=>{if(!$||!H7(b,A))return;let G=qH(A,J,Z);if(!_||typeof _.log!=="function"){if(A==="error")console.error(G,...U);else if(A==="warn")console.warn(G,...U);else console.log(G,...U);return}_.log(A==="success"?"info":A,J,...U)};return{...Object.fromEntries(I2.map((A)=>[A,(...[J,...U])=>z(A,J,U)])),get level(){return b}}},DH=q7();function k0(_){return Object.fromEntries(Object.entries(_).map(([$,b])=>[$,{code:$,message:b,toString:()=>$}]))}var VH=k0({USER_NOT_FOUND:"User not found",FAILED_TO_CREATE_USER:"Failed to create user",FAILED_TO_CREATE_SESSION:"Failed to create session",FAILED_TO_UPDATE_USER:"Failed to update user",FAILED_TO_GET_SESSION:"Failed to get session",INVALID_PASSWORD:"Invalid password",INVALID_EMAIL:"Invalid email",INVALID_EMAIL_OR_PASSWORD:"Invalid email or password",INVALID_USER:"Invalid user",SOCIAL_ACCOUNT_ALREADY_LINKED:"Social account already linked",PROVIDER_NOT_FOUND:"Provider not found",INVALID_TOKEN:"Invalid token",TOKEN_EXPIRED:"Token expired",ID_TOKEN_NOT_SUPPORTED:"id_token not supported",FAILED_TO_GET_USER_INFO:"Failed to get user info",USER_EMAIL_NOT_FOUND:"User email not found",EMAIL_NOT_VERIFIED:"Email not verified",PASSWORD_TOO_SHORT:"Password too short",PASSWORD_TOO_LONG:"Password too long",USER_ALREADY_EXISTS:"User already exists.",USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:"User already exists. Use another email.",EMAIL_CAN_NOT_BE_UPDATED:"Email can not be updated",CREDENTIAL_ACCOUNT_NOT_FOUND:"Credential account not found",SESSION_EXPIRED:"Session expired. Re-authenticate to perform this action.",FAILED_TO_UNLINK_LAST_ACCOUNT:"You can't unlink your last account",ACCOUNT_NOT_FOUND:"Account not found",USER_ALREADY_HAS_PASSWORD:"User already has a password. Provide that to delete the account.",CROSS_SITE_NAVIGATION_LOGIN_BLOCKED:"Cross-site navigation login blocked. This request appears to be a CSRF attack.",VERIFICATION_EMAIL_NOT_ENABLED:"Verification email isn't enabled",EMAIL_ALREADY_VERIFIED:"Email is already verified",EMAIL_MISMATCH:"Email mismatch",SESSION_NOT_FRESH:"Session is not fresh",LINKED_ACCOUNT_ALREADY_EXISTS:"Linked account already exists",INVALID_ORIGIN:"Invalid origin",INVALID_CALLBACK_URL:"Invalid callbackURL",INVALID_REDIRECT_URL:"Invalid redirectURL",INVALID_ERROR_CALLBACK_URL:"Invalid errorCallbackURL",INVALID_NEW_USER_CALLBACK_URL:"Invalid newUserCallbackURL",MISSING_OR_NULL_ORIGIN:"Missing or null Origin",CALLBACK_URL_REQUIRED:"callbackURL is required",FAILED_TO_CREATE_VERIFICATION:"Unable to create verification",FIELD_NOT_ALLOWED:"Field not allowed to be set",ASYNC_VALIDATION_NOT_SUPPORTED:"Async validation is not supported",VALIDATION_ERROR:"Validation Error",MISSING_FIELD:"Field is required",METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED:"POST method requires deferSessionRefresh to be enabled in session config",BODY_MUST_BE_AN_OBJECT:"Body must be an object",PASSWORD_ALREADY_SET:"User already has a password set"});function gH(){let _=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");if(_===void 0)return Object.isExtensible(Error);return Object.prototype.hasOwnProperty.call(_,"writable")?_.writable:_.set!==void 0}function kH(_){let $=_.split(`
38
38
  at `);if($.length<=1)return _;return $.splice(1,1),$.join(`
39
- at `)}function HH(_,$){class b extends _{#_;constructor(...Z){if(vH()){let A=Error.stackTraceLimit;Error.stackTraceLimit=0;super(...Z);Error.stackTraceLimit=A}else super(...Z);let z=Error().stack;if(z)this.#_=FH(z.replace(/^Error/,this.name))}get errorStack(){return this.#_}}return Object.defineProperty(b.prototype,"constructor",{get(){return $},enumerable:!1,configurable:!0}),b}var qH={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511},VH=class extends Error{constructor(_="INTERNAL_SERVER_ERROR",$=void 0,b={},Z=typeof _==="number"?_:qH[_]){super($?.message,$?.cause?{cause:$.cause}:void 0);this.status=_,this.body=$,this.headers=b,this.statusCode=Z,this.name="APIError",this.status=_,this.headers=b,this.statusCode=Z,this.body=$}};var DH=HH(VH,Error);var G4=class extends Error{constructor(_,$){super(_,$);this.name="BetterAuthError",this.message=_,this.stack=""}};function kH(_){try{return(new URL(_).pathname.replace(/\/+$/,"")||"/")!=="/"}catch{throw new G4(`Invalid base URL: ${_}. Please provide a valid base URL.`)}}function WH(_){try{let $=new URL(_);if($.protocol!=="http:"&&$.protocol!=="https:")throw new G4(`Invalid base URL: ${_}. URL must include 'http://' or 'https://'`)}catch($){if($ instanceof G4)throw $;throw new G4(`Invalid base URL: ${_}. Please provide a valid base URL.`,{cause:$})}}function J$(_,$="/api/auth"){if(WH(_),kH(_))return _;let b=_.replace(/\/+$/,"");if(!$||$==="/")return b;return $=$.startsWith("/")?$:`/${$}`,`${b}${$}`}function vU(_,$){if(!_||_.trim()==="")return!1;if($==="proto")return _==="http"||_==="https";if($==="host"){if([/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some((b)=>b.test(_)))return!1;return/^[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])?)*(:[0-9]{1,5})?$/.test(_)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(_)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(_)||/^localhost(:[0-9]{1,5})?$/i.test(_)}return!1}function FU(_,$,b,Z,z){if(_)return J$(_,$);if(Z!==!1){let U=T0.BETTER_AUTH_URL||T0.NEXT_PUBLIC_BETTER_AUTH_URL||T0.PUBLIC_BETTER_AUTH_URL||T0.NUXT_PUBLIC_BETTER_AUTH_URL||T0.NUXT_PUBLIC_AUTH_URL||(T0.BASE_URL!=="/"?T0.BASE_URL:void 0);if(U)return J$(U,$)}let A=b?.headers.get("x-forwarded-host"),J=b?.headers.get("x-forwarded-proto");if(A&&J&&z){if(vU(J,"proto")&&vU(A,"host"))try{return J$(`${J}://${A}`,$)}catch(U){}}if(b){let U=gH(b.url);if(!U)throw new G4("Could not get origin from request. Please provide a valid base URL.");return J$(U,$)}if(typeof window<"u"&&window.location)return J$(window.location.origin,$)}function gH(_){try{let $=new URL(_);return $.origin==="null"?null:$.origin}catch{return null}}var HU={id:"redirect",name:"Redirect",hooks:{onSuccess(_){if(_.data?.url&&_.data?.redirect){if(typeof window<"u"&&window.location){if(window.location)try{window.location.href=_.data.url}catch{}}}}}};function qU(_,$){let b=z$(!1),Z=N2(b,"/get-session",_,{method:"GET"}),z=()=>{};return b$(Z,()=>{let A=Tz({sessionAtom:Z,sessionSignal:b,$fetch:_,options:$});return A.init(),z=A.broadcastSessionUpdate,()=>{A.cleanup()}}),{session:Z,$sessionSignal:b,broadcastSessionUpdate:(A)=>z(A)}}function Cz(_){if(_===null||typeof _!=="object")return!1;let $=Object.getPrototypeOf(_);if($!==null&&$!==Object.prototype&&Object.getPrototypeOf($)!==null)return!1;if(Symbol.iterator in _)return!1;if(Symbol.toStringTag in _)return Object.prototype.toString.call(_)==="[object Module]";return!0}function fz(_,$,b=".",Z){if(!Cz($))return fz(_,{},b,Z);let z=Object.assign({},$);for(let A in _){if(A==="__proto__"||A==="constructor")continue;let J=_[A];if(J===null||J===void 0)continue;if(Z&&Z(z,A,J,b))continue;if(Array.isArray(J)&&Array.isArray(z[A]))z[A]=[...J,...z[A]];else if(Cz(J)&&Cz(z[A]))z[A]=fz(J,z[A],(b?`${b}.`:"")+A.toString(),Z);else z[A]=J}return z}function mz(_){return(...$)=>$.reduce((b,Z)=>fz(b,Z,"",_),{})}var VU=mz(),GP=mz((_,$,b)=>{if(_[$]!==void 0&&typeof b==="function")return _[$]=b(_[$]),!0}),YP=mz((_,$,b)=>{if(Array.isArray(_[$])&&typeof b==="function")return _[$]=b(_[$]),!0});var{defineProperty:BH,defineProperties:wH,getOwnPropertyDescriptors:xH,getOwnPropertySymbols:DU}=Object,NH=Object.prototype.hasOwnProperty,IH=Object.prototype.propertyIsEnumerable,kU=(_,$,b)=>($ in _)?BH(_,$,{enumerable:!0,configurable:!0,writable:!0,value:b}):_[$]=b,V_=(_,$)=>{for(var b in $||($={}))if(NH.call($,b))kU(_,b,$[b]);if(DU){for(var b of DU($))if(IH.call($,b))kU(_,b,$[b])}return _},O_=(_,$)=>wH(_,xH($)),MH=class extends Error{constructor(_,$,b){super($||_.toString(),{cause:b});this.status=_,this.statusText=$,this.error=b,Error.captureStackTrace(this,this.constructor)}},EH=async(_,$)=>{var b,Z,z,A,J,U;let G=$||{},Y={onRequest:[$==null?void 0:$.onRequest],onResponse:[$==null?void 0:$.onResponse],onSuccess:[$==null?void 0:$.onSuccess],onError:[$==null?void 0:$.onError],onRetry:[$==null?void 0:$.onRetry]};if(!$||!($==null?void 0:$.plugins))return{url:_,options:G,hooks:Y};for(let X of($==null?void 0:$.plugins)||[]){if(X.init){let Q=await((b=X.init)==null?void 0:b.call(X,_.toString(),$));G=Q.options||G,_=Q.url}Y.onRequest.push((Z=X.hooks)==null?void 0:Z.onRequest),Y.onResponse.push((z=X.hooks)==null?void 0:z.onResponse),Y.onSuccess.push((A=X.hooks)==null?void 0:A.onSuccess),Y.onError.push((J=X.hooks)==null?void 0:J.onError),Y.onRetry.push((U=X.hooks)==null?void 0:U.onRetry)}return{url:_,options:G,hooks:Y}},WU=class{constructor(_){this.options=_}shouldAttemptRetry(_,$){if(this.options.shouldRetry)return Promise.resolve(_<this.options.attempts&&this.options.shouldRetry($));return Promise.resolve(_<this.options.attempts)}getDelay(){return this.options.delay}},OH=class{constructor(_){this.options=_}shouldAttemptRetry(_,$){if(this.options.shouldRetry)return Promise.resolve(_<this.options.attempts&&this.options.shouldRetry($));return Promise.resolve(_<this.options.attempts)}getDelay(_){return Math.min(this.options.maxDelay,this.options.baseDelay*2**_)}};function PH(_){if(typeof _==="number")return new WU({type:"linear",attempts:_,delay:1000});switch(_.type){case"linear":return new WU(_);case"exponential":return new OH(_);default:throw Error("Invalid retry strategy")}}var jH=async(_)=>{let $={},b=async(Z)=>typeof Z==="function"?await Z():Z;if(_==null?void 0:_.auth){if(_.auth.type==="Bearer"){let Z=await b(_.auth.token);if(!Z)return $;$.authorization=`Bearer ${Z}`}else if(_.auth.type==="Basic"){let[Z,z]=await Promise.all([b(_.auth.username),b(_.auth.password)]);if(!Z||!z)return $;$.authorization=`Basic ${btoa(`${Z}:${z}`)}`}else if(_.auth.type==="Custom"){let[Z,z]=await Promise.all([b(_.auth.prefix),b(_.auth.value)]);if(!z)return $;$.authorization=`${Z!=null?Z:""} ${z}`}}return $},SH=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function RH(_){let $=_.headers.get("content-type"),b=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!$)return"json";let Z=$.split(";").shift()||"";if(SH.test(Z))return"json";if(b.has(Z)||Z.startsWith("text/"))return"text";return"blob"}function LH(_){try{return JSON.parse(_),!0}catch($){return!1}}function uz(_){if(_===void 0)return!1;let $=typeof _;if($==="string"||$==="number"||$==="boolean"||$===null)return!0;if($!=="object")return!1;if(Array.isArray(_))return!0;if(_.buffer)return!1;return _.constructor&&_.constructor.name==="Object"||typeof _.toJSON==="function"}function gU(_){try{return JSON.parse(_)}catch($){return _}}function BU(_){return typeof _==="function"}function TH(_){if(_==null?void 0:_.customFetchImpl)return _.customFetchImpl;if(typeof globalThis<"u"&&BU(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&BU(window.fetch))return window.fetch;throw Error("No fetch implementation found")}async function yH(_){let $=new Headers(_==null?void 0:_.headers),b=await jH(_);for(let[Z,z]of Object.entries(b||{}))$.set(Z,z);if(!$.has("content-type")){let Z=CH(_==null?void 0:_.body);if(Z)$.set("content-type",Z)}return $}function CH(_){if(uz(_))return"application/json";return null}function fH(_){if(!(_==null?void 0:_.body))return null;let $=new Headers(_==null?void 0:_.headers);if(uz(_.body)&&!$.has("content-type")){for(let[b,Z]of Object.entries(_==null?void 0:_.body))if(Z instanceof Date)_.body[b]=Z.toISOString();return JSON.stringify(_.body)}if($.has("content-type")&&$.get("content-type")==="application/x-www-form-urlencoded"){if(uz(_.body))return new URLSearchParams(_.body).toString();return _.body}return _.body}function mH(_,$){var b;if($==null?void 0:$.method)return $.method.toUpperCase();if(_.startsWith("@")){let Z=(b=_.split("@")[1])==null?void 0:b.split("/")[0];if(!wU.includes(Z))return($==null?void 0:$.body)?"POST":"GET";return Z.toUpperCase()}return($==null?void 0:$.body)?"POST":"GET"}function uH(_,$){let b;if(!(_==null?void 0:_.signal)&&(_==null?void 0:_.timeout))b=setTimeout(()=>$==null?void 0:$.abort(),_==null?void 0:_.timeout);return{abortTimeout:b,clearTimeout:()=>{if(b)clearTimeout(b)}}}var hH=class _ extends Error{constructor($,b){super(b||JSON.stringify($,null,2));this.issues=$,Object.setPrototypeOf(this,_.prototype)}};async function E2(_,$){let b=await _["~standard"].validate($);if(b.issues)throw new hH(b.issues);return b.value}var wU=["get","post","put","patch","delete"];var cH=(_)=>({id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init($,b){var Z,z,A,J;let U=((z=(Z=_.plugins)==null?void 0:Z.find((G)=>{var Y;return((Y=G.schema)==null?void 0:Y.config)?$.startsWith(G.schema.config.baseURL||"")||$.startsWith(G.schema.config.prefix||""):!1}))==null?void 0:z.schema)||_.schema;if(U){let G=$;if((A=U.config)==null?void 0:A.prefix){if(G.startsWith(U.config.prefix)){if(G=G.replace(U.config.prefix,""),U.config.baseURL)$=$.replace(U.config.prefix,U.config.baseURL)}}if((J=U.config)==null?void 0:J.baseURL){if(G.startsWith(U.config.baseURL))G=G.replace(U.config.baseURL,"")}let Y=U.schema[G];if(Y){let X=O_(V_({},b),{method:Y.method,output:Y.output});if(!(b==null?void 0:b.disableValidation))X=O_(V_({},X),{body:Y.input?await E2(Y.input,b==null?void 0:b.body):b==null?void 0:b.body,params:Y.params?await E2(Y.params,b==null?void 0:b.params):b==null?void 0:b.params,query:Y.query?await E2(Y.query,b==null?void 0:b.query):b==null?void 0:b.query});return{url:$,options:X}}}return{url:$,options:b}}}),xU=(_)=>{async function $(b,Z){let z=O_(V_(V_({},_),Z),{plugins:[...(_==null?void 0:_.plugins)||[],cH(_||{}),...(Z==null?void 0:Z.plugins)||[]]});if(_==null?void 0:_.catchAllError)try{return await hz(b,z)}catch(A){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:A}}}return await hz(b,z)}return $};function rH(_,$){let{baseURL:b,params:Z,query:z}=$||{query:{},params:{},baseURL:""},A=_.startsWith("http")?_.split("/").slice(0,3).join("/"):b||"";if(_.startsWith("@")){let Q=_.toString().split("@")[1].split("/")[0];if(wU.includes(Q))_=_.replace(`@${Q}/`,"/")}if(!A.endsWith("/"))A+="/";let[J,U]=_.replace(A,"").split("?"),G=new URLSearchParams(U);for(let[Q,K]of Object.entries(z||{})){if(K==null)continue;let v;if(typeof K==="string")v=K;else if(Array.isArray(K)){for(let V of K)G.append(Q,V);continue}else v=JSON.stringify(K);G.set(Q,v)}if(Z)if(Array.isArray(Z)){let Q=J.split("/").filter((K)=>K.startsWith(":"));for(let[K,v]of Q.entries()){let V=Z[K];J=J.replace(v,V)}}else for(let[Q,K]of Object.entries(Z))J=J.replace(`:${Q}`,String(K));if(J=J.split("/").map(encodeURIComponent).join("/"),J.startsWith("/"))J=J.slice(1);let Y=G.toString();if(Y=Y.length>0?`?${Y}`.replace(/\+/g,"%20"):"",!A.startsWith("http"))return`${A}${J}${Y}`;return new URL(`${J}${Y}`,A)}var hz=async(_,$)=>{var b,Z,z,A,J,U,G,Y;let{hooks:X,url:Q,options:K}=await EH(_,$),v=TH(K),V=new AbortController,w=(b=K.signal)!=null?b:V.signal,P=rH(Q,K),O=fH(K),B=await yH(K),T=mH(Q,K),y=O_(V_({},K),{url:P,headers:B,body:O,method:T,signal:w});for(let W of X.onRequest)if(W){let N=await W(y);if(typeof N==="object"&&N!==null)y=N}if("pipeTo"in y&&typeof y.pipeTo==="function"||typeof((Z=$==null?void 0:$.body)==null?void 0:Z.pipe)==="function"){if(!("duplex"in y))y.duplex="half"}let{clearTimeout:u}=uH(K,V),E=await v(y.url,y);u();let C={response:E,request:y};for(let W of X.onResponse)if(W){let N=await W(O_(V_({},C),{response:((z=$==null?void 0:$.hookOptions)==null?void 0:z.cloneResponse)?E.clone():E}));if(N instanceof Response)E=N;else if(typeof N==="object"&&N!==null)E=N.response}if(E.ok){if(y.method==="HEAD")return{data:"",error:null};let N=RH(E),k={data:null,response:E,request:y};if(N==="json"||N==="text"){let x=await E.text(),j=(A=y.jsonParser)!=null?A:gU;k.data=await j(x)}else k.data=await E[N]();if(y==null?void 0:y.output){if(y.output&&!y.disableValidation)k.data=await E2(y.output,k.data)}for(let x of X.onSuccess)if(x)await x(O_(V_({},k),{response:((J=$==null?void 0:$.hookOptions)==null?void 0:J.cloneResponse)?E.clone():E}));if($==null?void 0:$.throw)return k.data;return{data:k.data,error:null}}let F=(U=$==null?void 0:$.jsonParser)!=null?U:gU,H=await E.text(),q=LH(H),g=q?await F(H):null,D={response:E,responseText:H,request:y,error:O_(V_({},g),{status:E.status,statusText:E.statusText})};for(let W of X.onError)if(W)await W(O_(V_({},D),{response:((G=$==null?void 0:$.hookOptions)==null?void 0:G.cloneResponse)?E.clone():E}));if($==null?void 0:$.retry){let W=PH($.retry),N=(Y=$.retryAttempt)!=null?Y:0;if(await W.shouldAttemptRetry(N,E)){for(let x of X.onRetry)if(x)await x(C);let k=W.getDelay(N);return await new Promise((x)=>setTimeout(x,k)),await hz(_,O_(V_({},$),{retryAttempt:N+1}))}}if($==null?void 0:$.throw)throw new MH(E.status,E.statusText,q?g:H);return{data:null,error:O_(V_({},g),{status:E.status,statusText:E.statusText})}};var nH=(_)=>{if(typeof process>"u")return;let $=_??"/api/auth";if(process.env.NEXT_PUBLIC_AUTH_URL)return process.env.NEXT_PUBLIC_AUTH_URL;if(typeof window>"u"){if(process.env.NEXTAUTH_URL)try{return process.env.NEXTAUTH_URL}catch{}if(process.env.VERCEL_URL)try{let b=process.env.VERCEL_URL.startsWith("http")?"":"https://";return`${new URL(`${b}${process.env.VERCEL_URL}`).origin}${$}`}catch{}}},NU=(_,$)=>{let b="credentials"in Request.prototype,Z=FU(_?.baseURL,_?.basePath,void 0,$)??nH(_?.basePath)??"/api/auth",z=_?.plugins?.flatMap((u)=>u.fetchPlugins).filter((u)=>u!==void 0)||[],A={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:_?.fetchOptions?.onSuccess,onError:_?.fetchOptions?.onError,onRequest:_?.fetchOptions?.onRequest,onResponse:_?.fetchOptions?.onResponse}},{onSuccess:J,onError:U,onRequest:G,onResponse:Y,...X}=_?.fetchOptions||{},Q=xU({baseURL:Z,...b?{credentials:"include"}:{},method:"GET",jsonParser(u){if(!u)return null;return Lz(u,{strict:!1})},customFetchImpl:fetch,...X,plugins:[A,...X.plugins||[],..._?.disableDefaultFetchPlugins?[]:[HU],...z]}),{$sessionSignal:K,session:v,broadcastSessionUpdate:V}=qU(Q,_),w=_?.plugins||[],P={},O={$sessionSignal:K,session:v},B={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},T=[{signal:"$sessionSignal",matcher(u){return u==="/sign-out"||u==="/update-user"||u==="/update-session"||u==="/sign-up/email"||u==="/sign-in/email"||u==="/delete-user"||u==="/verify-email"||u==="/revoke-sessions"||u==="/revoke-session"||u==="/change-email"},callback(u){if(u==="/sign-out")V("signout");else if(u==="/update-user"||u==="/update-session")V("updateUser")}}];for(let u of w){if(u.getAtoms)Object.assign(O,u.getAtoms?.(Q));if(u.pathMethods)Object.assign(B,u.pathMethods);if(u.atomListeners)T.push(...u.atomListeners)}let y={notify:(u)=>{O[u].set(!O[u].get())},listen:(u,E)=>{O[u].subscribe(E)},atoms:O};for(let u of w)if(u.getActions)P=VU(u.getActions?.(Q,y,_)??{},P);return{get baseURL(){return Z},pluginsActions:P,pluginsAtoms:O,pluginPathMethods:B,atomListeners:T,$fetch:Q,$store:y}};function IU(_){return typeof _==="object"&&_!==null&&"get"in _&&typeof _.get==="function"&&"lc"in _&&typeof _.lc==="number"}function lH(_,$,b){let Z=$[_],{fetchOptions:z,query:A,...J}=b||{};if(Z)return Z;if(z?.method)return z.method;if(J&&Object.keys(J).length>0)return"POST";return"GET"}function MU(_,$,b,Z,z){function A(J=[]){return new Proxy(function(){},{get(U,G){if(typeof G!=="string")return;if(G==="then"||G==="catch"||G==="finally")return;let Y=[...J,G],X=_;for(let Q of Y)if(X&&typeof X==="object"&&Q in X)X=X[Q];else{X=void 0;break}if(typeof X==="function")return X;if(IU(X))return X;return A(Y)},apply:async(U,G,Y)=>{let X="/"+J.map((B)=>B.replace(/[A-Z]/g,(T)=>`-${T.toLowerCase()}`)).join("/"),Q=Y[0]||{},K=Y[1]||{},{query:v,fetchOptions:V,...w}=Q,P={...K,...V},O=lH(X,b,Q);return await $(X,{...P,body:O==="GET"?void 0:{...w,...P?.body||{}},query:v||P?.query,method:O,async onSuccess(B){if(await P?.onSuccess?.(B),!z||P.disableSignal)return;let T=z.filter((u)=>u.matcher(X));if(!T.length)return;let y=new Set;for(let u of T){let E=Z[u.signal];if(!E)return;if(y.has(u.signal))continue;y.add(u.signal);let C=E.get();setTimeout(()=>{E.set(!C)},10),u.callback?.(X)}}})}})}return A()}function EU(_){return _.charAt(0).toUpperCase()+_.slice(1)}function cz(_){let{pluginPathMethods:$,pluginsActions:b,pluginsAtoms:Z,$fetch:z,atomListeners:A,$store:J}=NU(_),U={};for(let[G,Y]of Object.entries(Z))U[`use${EU(G)}`]=Y;return MU({...b,...U,$fetch:z,$store:J},z,$,Z,A)}var OU=W0({FAILED_TO_CREATE_USER:"Failed to create user",USER_ALREADY_EXISTS:"User already exists.",USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:"User already exists. Use another email.",YOU_CANNOT_BAN_YOURSELF:"You cannot ban yourself",YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:"You are not allowed to change users role",YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:"You are not allowed to create users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:"You are not allowed to list users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:"You are not allowed to list users sessions",YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:"You are not allowed to ban users",YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:"You are not allowed to impersonate users",YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:"You are not allowed to revoke users sessions",YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:"You are not allowed to delete users",YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:"You are not allowed to set users password",BANNED_USER:"You have been banned from this application",YOU_ARE_NOT_ALLOWED_TO_GET_USER:"You are not allowed to get user",NO_DATA_TO_UPDATE:"No data to update",YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS:"You are not allowed to update users",YOU_CANNOT_REMOVE_YOURSELF:"You cannot remove yourself",YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE:"You are not allowed to set a non-existent role value",YOU_CANNOT_IMPERSONATE_ADMINS:"You cannot impersonate admins",INVALID_ROLE_TYPE:"Invalid role type"});function PU(_){return{authorize($,b="AND"){let Z=!1;for(let[z,A]of Object.entries($)){let J=_[z];if(!J)return{success:!1,error:`You are not allowed to access resource: ${z}`};if(Array.isArray(A))Z=A.every((U)=>J.includes(U));else if(typeof A==="object"){let U=A;if(U.connector==="OR")Z=U.actions.some((G)=>J.includes(G));else Z=U.actions.every((G)=>J.includes(G))}else throw new G4("Invalid access control request");if(Z&&b==="OR")return{success:Z};if(!Z&&b==="AND")return{success:!1,error:`unauthorized to access resource "${z}"`}}if(Z)return{success:Z};return{success:!1,error:"Not authorized"}},statements:_}}function U$(_){return{newRole($){return PU($)},statements:_}}var jU={user:["create","list","set-role","ban","impersonate","impersonate-admins","delete","set-password","get","update"],session:["list","revoke","delete"]},rz=U$(jU),SU=rz.newRole({user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]}),RU=rz.newRole({user:[],session:[]});var LU=W0({INVALID_EMAIL_FORMAT:"Email was not generated in a valid format",FAILED_TO_CREATE_USER:"Failed to create user",COULD_NOT_CREATE_SESSION:"Could not create session",ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY:"Anonymous users cannot sign in again anonymously",FAILED_TO_DELETE_ANONYMOUS_USER:"Failed to delete anonymous user",USER_IS_NOT_ANONYMOUS:"User is not anonymous",DELETE_ANONYMOUS_USER_DISABLED:"Deleting anonymous users is disabled"});var nz=()=>{return{id:"device-authorization",$InferServerPlugin:{},pathMethods:{"/device/code":"POST","/device/token":"POST","/device":"GET","/device/approve":"POST","/device/deny":"POST"}}};var TU=W0({OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",TOO_MANY_ATTEMPTS:"Too many attempts"});var yU=W0({INVALID_OAUTH_CONFIGURATION:"Invalid OAuth configuration",TOKEN_URL_NOT_FOUND:"Invalid OAuth configuration. Token URL not found.",PROVIDER_CONFIG_NOT_FOUND:"No config found for provider",PROVIDER_ID_REQUIRED:"Provider ID is required",INVALID_OAUTH_CONFIG:"Invalid OAuth configuration.",SESSION_REQUIRED:"Session is required",ISSUER_MISMATCH:"OAuth issuer mismatch. The authorization server issuer does not match the expected value (RFC 9207).",ISSUER_MISSING:"OAuth issuer parameter missing. The authorization server did not include the required iss parameter (RFC 9207)."});var CU=W0({INVALID_SESSION_TOKEN:"Invalid session token"});var fU=W0({YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:"You are not allowed to create a new organization",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:"You have reached the maximum number of organizations",ORGANIZATION_ALREADY_EXISTS:"Organization already exists",ORGANIZATION_SLUG_ALREADY_TAKEN:"Organization slug already taken",ORGANIZATION_NOT_FOUND:"Organization not found",USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:"User is not a member of the organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:"You are not allowed to update this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:"You are not allowed to delete this organization",NO_ACTIVE_ORGANIZATION:"No active organization",USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:"User is already a member of this organization",MEMBER_NOT_FOUND:"Member not found",ROLE_NOT_FOUND:"Role not found",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:"You are not allowed to create a new team",TEAM_ALREADY_EXISTS:"Team already exists",TEAM_NOT_FOUND:"Team not found",YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:"You cannot leave the organization as the only owner",YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER:"You cannot leave the organization without an owner",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:"You are not allowed to delete this member",YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:"You are not allowed to invite users to this organization",USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:"User is already invited to this organization",INVITATION_NOT_FOUND:"Invitation not found",YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:"You are not the recipient of the invitation",EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION:"Email verification required before accepting or rejecting invitation",YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:"You are not allowed to cancel this invitation",INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:"Inviter is no longer a member of the organization",YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:"You are not allowed to invite a user with this role",FAILED_TO_RETRIEVE_INVITATION:"Failed to retrieve invitation",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:"You have reached the maximum number of teams",UNABLE_TO_REMOVE_LAST_TEAM:"Unable to remove last team",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:"You are not allowed to update this member",ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:"Organization membership limit reached",YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to create teams in this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to delete teams in this organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:"You are not allowed to update this team",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:"You are not allowed to delete this team",INVITATION_LIMIT_REACHED:"Invitation limit reached",TEAM_MEMBER_LIMIT_REACHED:"Team member limit reached",USER_IS_NOT_A_MEMBER_OF_THE_TEAM:"User is not a member of the team",YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM:"You are not allowed to list the members of this team",YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM:"You do not have an active team",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER:"You are not allowed to create a new member",YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER:"You are not allowed to remove a team member",YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION:"You are not allowed to access this organization as an owner",YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION:"You are not a member of this organization",MISSING_AC_INSTANCE:"Dynamic Access Control requires a pre-defined ac instance on the server auth plugin. Read server logs for more information",YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE:"You must be in an organization to create a role",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE:"You are not allowed to create a role",YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE:"You are not allowed to update a role",YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE:"You are not allowed to delete a role",YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE:"You are not allowed to read a role",YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE:"You are not allowed to list a role",YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE:"You are not allowed to get a role",TOO_MANY_ROLES:"This organization has too many roles",INVALID_RESOURCE:"The provided permission includes an invalid resource",ROLE_NAME_IS_ALREADY_TAKEN:"That role name is already taken",CANNOT_DELETE_A_PRE_DEFINED_ROLE:"Cannot delete a pre-defined role",ROLE_IS_ASSIGNED_TO_MEMBERS:"Cannot delete a role that is assigned to members. Please reassign the members to a different role first"});var mU={organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]},O2=U$(mU),uU=O2.newRole({organization:["update"],invitation:["create","cancel"],member:["create","update","delete"],team:["create","update","delete"],ac:["create","read","update","delete"]}),hU=O2.newRole({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),cU=O2.newRole({organization:[],member:[],invitation:[],team:[],ac:["read"]});var rU=W0({INVALID_PHONE_NUMBER:"Invalid phone number",PHONE_NUMBER_EXIST:"Phone number already exists",PHONE_NUMBER_NOT_EXIST:"phone number isn't registered",INVALID_PHONE_NUMBER_OR_PASSWORD:"Invalid phone number or password",UNEXPECTED_ERROR:"Unexpected error",OTP_NOT_FOUND:"OTP not found",OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",PHONE_NUMBER_NOT_VERIFIED:"Phone number not verified",PHONE_NUMBER_CANNOT_BE_UPDATED:"Phone number cannot be updated",SEND_OTP_NOT_IMPLEMENTED:"sendOTP not implemented",TOO_MANY_ATTEMPTS:"Too many attempts"});var nU=W0({OTP_NOT_ENABLED:"OTP not enabled",OTP_HAS_EXPIRED:"OTP has expired",TOTP_NOT_ENABLED:"TOTP not enabled",TWO_FACTOR_NOT_ENABLED:"Two factor isn't enabled",BACKUP_CODES_NOT_ENABLED:"Backup codes aren't enabled",INVALID_BACKUP_CODE:"Invalid backup code",INVALID_CODE:"Invalid code",TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:"Too many attempts. Please request a new code.",INVALID_TWO_FACTOR_COOKIE:"Invalid two factor cookie"});var lU=W0({INVALID_USERNAME_OR_PASSWORD:"Invalid username or password",EMAIL_NOT_VERIFIED:"Email not verified",UNEXPECTED_ERROR:"Unexpected error",USERNAME_IS_ALREADY_TAKEN:"Username is already taken. Please try another.",USERNAME_TOO_SHORT:"Username is too short",USERNAME_TOO_LONG:"Username is too long",INVALID_USERNAME:"Username is invalid",INVALID_DISPLAY_USERNAME:"Display username is invalid"});function oH(_){let $=_.toLowerCase();return $==="localhost"||$.startsWith("localhost:")||$==="127.0.0.1"||$.startsWith("127.0.0.1:")||$==="[::1]"||$.startsWith("[::1]:")}function P2(_){let $=_.trim();if(!$)throw Error("Hostname is required.");let Z=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//.test($)?$:`${oH($)?"http":"https"}://${$}`,z;try{z=new URL(Z)}catch{throw Error(`Invalid hostname: ${_}`)}if(!z.hostname)throw Error(`Invalid hostname: ${_}`);if(z.pathname!=="/"||z.search||z.hash)throw Error("Hostname must not include a path, query, or fragment.");return{host:z.host.toLowerCase(),baseURL:`${z.protocol}//${z.host.toLowerCase()}`}}function j2(_){return cz({baseURL:_,plugins:[nz()]})}import{existsSync as qG,mkdirSync as Mq,readFileSync as Eq,writeFileSync as Oq}from"fs";import{homedir as Pq}from"os";import{join as VG}from"path";import{existsSync as gq,mkdirSync as Bq}from"fs";import{homedir as wq}from"os";import{join as HG}from"path";var S2=BigInt(4294967295),pU=BigInt(32);function aH(_,$=!1){if($)return{h:Number(_&S2),l:Number(_>>pU&S2)};return{h:Number(_>>pU&S2)|0,l:Number(_&S2)|0}}function dU(_,$=!1){let b=_.length,Z=new Uint32Array(b),z=new Uint32Array(b);for(let A=0;A<b;A++){let{h:J,l:U}=aH(_[A],$);[Z[A],z[A]]=[J,U]}return[Z,z]}var iU=(_,$,b)=>_<<b|$>>>32-b,oU=(_,$,b)=>$<<b|_>>>32-b,aU=(_,$,b)=>$<<b-32|_>>>64-b,eU=(_,$,b)=>_<<b-32|$>>>64-b;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function eH(_){return _ instanceof Uint8Array||ArrayBuffer.isView(_)&&_.constructor.name==="Uint8Array"}function lz(_,$=""){if(!Number.isSafeInteger(_)||_<0){let b=$&&`"${$}" `;throw Error(`${b}expected integer >= 0, got ${_}`)}}function R2(_,$,b=""){let Z=eH(_),z=_?.length,A=$!==void 0;if(!Z||A&&z!==$){let J=b&&`"${b}" `,U=A?` of length ${$}`:"",G=Z?`length=${z}`:`type=${typeof _}`;throw Error(J+"expected Uint8Array"+U+", got "+G)}return _}function pz(_,$=!0){if(_.destroyed)throw Error("Hash instance has been destroyed");if($&&_.finished)throw Error("Hash#digest() has already been called")}function tU(_,$){R2(_,void 0,"digestInto() output");let b=$.outputLen;if(_.length<b)throw Error('"digestInto() output" expected to be of length >='+b)}function sU(_){return new Uint32Array(_.buffer,_.byteOffset,Math.floor(_.byteLength/4))}function dz(..._){for(let $=0;$<_.length;$++)_[$].fill(0)}var tH=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function sH(_){return _<<24&4278190080|_<<8&16711680|_>>>8&65280|_>>>24&255}function _q(_){for(let $=0;$<_.length;$++)_[$]=sH(_[$]);return _}var iz=tH?(_)=>_:_q;function _G(_,$={}){let b=(z,A)=>_(A).update(z).digest(),Z=_(void 0);return b.outputLen=Z.outputLen,b.blockLen=Z.blockLen,b.create=(z)=>_(z),Object.assign(b,$),Object.freeze(b)}var $G=(_)=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,_])});var $q=BigInt(0),G$=BigInt(1),zq=BigInt(2),bq=BigInt(7),Zq=BigInt(256),Aq=BigInt(113),ZG=[],AG=[],JG=[];for(let _=0,$=G$,b=1,Z=0;_<24;_++){[b,Z]=[Z,(2*b+3*Z)%5],ZG.push(2*(5*Z+b)),AG.push((_+1)*(_+2)/2%64);let z=$q;for(let A=0;A<7;A++)if($=($<<G$^($>>bq)*Aq)%Zq,$&zq)z^=G$<<(G$<<BigInt(A))-G$;JG.push(z)}var UG=dU(JG,!0),Jq=UG[0],Uq=UG[1],zG=(_,$,b)=>b>32?aU(_,$,b):iU(_,$,b),bG=(_,$,b)=>b>32?eU(_,$,b):oU(_,$,b);function Gq(_,$=24){let b=new Uint32Array(10);for(let Z=24-$;Z<24;Z++){for(let J=0;J<10;J++)b[J]=_[J]^_[J+10]^_[J+20]^_[J+30]^_[J+40];for(let J=0;J<10;J+=2){let U=(J+8)%10,G=(J+2)%10,Y=b[G],X=b[G+1],Q=zG(Y,X,1)^b[U],K=bG(Y,X,1)^b[U+1];for(let v=0;v<50;v+=10)_[J+v]^=Q,_[J+v+1]^=K}let z=_[2],A=_[3];for(let J=0;J<24;J++){let U=AG[J],G=zG(z,A,U),Y=bG(z,A,U),X=ZG[J];z=_[X],A=_[X+1],_[X]=G,_[X+1]=Y}for(let J=0;J<50;J+=10){for(let U=0;U<10;U++)b[U]=_[J+U];for(let U=0;U<10;U++)_[J+U]^=~b[(U+2)%10]&b[(U+4)%10]}_[0]^=Jq[Z],_[1]^=Uq[Z]}dz(b)}class oz{state;pos=0;posOut=0;finished=!1;state32;destroyed=!1;blockLen;suffix;outputLen;enableXOF=!1;rounds;constructor(_,$,b,Z=!1,z=24){if(this.blockLen=_,this.suffix=$,this.outputLen=b,this.enableXOF=Z,this.rounds=z,lz(b,"outputLen"),!(0<_&&_<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=sU(this.state)}clone(){return this._cloneInto()}keccak(){iz(this.state32),Gq(this.state32,this.rounds),iz(this.state32),this.posOut=0,this.pos=0}update(_){pz(this),R2(_);let{blockLen:$,state:b}=this,Z=_.length;for(let z=0;z<Z;){let A=Math.min($-this.pos,Z-z);for(let J=0;J<A;J++)b[this.pos++]^=_[z++];if(this.pos===$)this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:_,suffix:$,pos:b,blockLen:Z}=this;if(_[b]^=$,($&128)!==0&&b===Z-1)this.keccak();_[Z-1]^=128,this.keccak()}writeInto(_){pz(this,!1),R2(_),this.finish();let $=this.state,{blockLen:b}=this;for(let Z=0,z=_.length;Z<z;){if(this.posOut>=b)this.keccak();let A=Math.min(b-this.posOut,z-Z);_.set($.subarray(this.posOut,this.posOut+A),Z),this.posOut+=A,Z+=A}return _}xofInto(_){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(_)}xof(_){return lz(_),this.xofInto(new Uint8Array(_))}digestInto(_){if(tU(_,this),this.finished)throw Error("digest() was already called");return this.writeInto(_),this.destroy(),_}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,dz(this.state)}_cloneInto(_){let{blockLen:$,suffix:b,outputLen:Z,rounds:z,enableXOF:A}=this;return _||=new oz($,b,Z,A,z),_.state32.set(this.state32),_.pos=this.pos,_.posOut=this.posOut,_.finished=this.finished,_.rounds=z,_.suffix=b,_.outputLen=Z,_.enableXOF=A,_.destroyed=this.destroyed,_}}var Yq=(_,$,b,Z={})=>_G(()=>new oz($,_,b),Z);var GG=Yq(6,72,64,$G(10));var Xq=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,az=Math.ceil,G_=Math.floor,c0="[BigNumber Error] ",YG=c0+"Number primitive has more than 15 significant digits: ",D_=100000000000000,o=14,ez=9007199254740991,tz=[1,10,100,1000,1e4,1e5,1e6,1e7,1e8,1e9,10000000000,100000000000,1000000000000,10000000000000],Y4=1e7,I0=1e9;function XG(_){var $,b,Z,z=B.prototype={constructor:B,toString:null,valueOf:null},A=new B(1),J=20,U=4,G=-7,Y=21,X=-1e7,Q=1e7,K=!1,v=1,V=0,w={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},P="0123456789abcdefghijklmnopqrstuvwxyz",O=!0;function B(F,H){var q,g,D,W,N,k,x,j,S=this;if(!(S instanceof B))return new B(F,H);if(H==null){if(F&&F._isBigNumber===!0){if(S.s=F.s,!F.c||F.e>Q)S.c=S.e=null;else if(F.e<X)S.c=[S.e=0];else S.e=F.e,S.c=F.c.slice();return}if((k=typeof F=="number")&&F*0==0){if(S.s=1/F<0?(F=-F,-1):1,F===~~F){for(W=0,N=F;N>=10;N/=10,W++);if(W>Q)S.c=S.e=null;else S.e=W,S.c=[F];return}j=String(F)}else{if(!Xq.test(j=String(F)))return Z(S,j,k);S.s=j.charCodeAt(0)==45?(j=j.slice(1),-1):1}if((W=j.indexOf("."))>-1)j=j.replace(".","");if((N=j.search(/e/i))>0){if(W<0)W=N;W+=+j.slice(N+1),j=j.substring(0,N)}else if(W<0)W=j.length}else{if(H0(H,2,P.length,"Base"),H==10&&O)return S=new B(F),E(S,J+S.e+1,U);if(j=String(F),k=typeof F=="number"){if(F*0!=0)return Z(S,j,k,H);if(S.s=1/F<0?(j=j.slice(1),-1):1,B.DEBUG&&j.replace(/^0\.0*|\./,"").length>15)throw Error(YG+F)}else S.s=j.charCodeAt(0)===45?(j=j.slice(1),-1):1;q=P.slice(0,H),W=N=0;for(x=j.length;N<x;N++)if(q.indexOf(g=j.charAt(N))<0){if(g=="."){if(N>W){W=x;continue}}else if(!D){if(j==j.toUpperCase()&&(j=j.toLowerCase())||j==j.toLowerCase()&&(j=j.toUpperCase())){D=!0,N=-1,W=0;continue}}return Z(S,String(F),k,H)}if(k=!1,j=b(j,H,10,S.s),(W=j.indexOf("."))>-1)j=j.replace(".","");else W=j.length}for(N=0;j.charCodeAt(N)===48;N++);for(x=j.length;j.charCodeAt(--x)===48;);if(j=j.slice(N,++x)){if(x-=N,k&&B.DEBUG&&x>15&&(F>ez||F!==G_(F)))throw Error(YG+S.s*F);if((W=W-N-1)>Q)S.c=S.e=null;else if(W<X)S.c=[S.e=0];else{if(S.e=W,S.c=[],N=(W+1)%o,W<0)N+=o;if(N<x){if(N)S.c.push(+j.slice(0,N));for(x-=o;N<x;)S.c.push(+j.slice(N,N+=o));N=o-(j=j.slice(N)).length}else N-=x;for(;N--;j+="0");S.c.push(+j)}}else S.c=[S.e=0]}B.clone=XG,B.ROUND_UP=0,B.ROUND_DOWN=1,B.ROUND_CEIL=2,B.ROUND_FLOOR=3,B.ROUND_HALF_UP=4,B.ROUND_HALF_DOWN=5,B.ROUND_HALF_EVEN=6,B.ROUND_HALF_CEIL=7,B.ROUND_HALF_FLOOR=8,B.EUCLID=9,B.config=B.set=function(F){var H,q;if(F!=null)if(typeof F=="object"){if(F.hasOwnProperty(H="DECIMAL_PLACES"))q=F[H],H0(q,0,I0,H),J=q;if(F.hasOwnProperty(H="ROUNDING_MODE"))q=F[H],H0(q,0,8,H),U=q;if(F.hasOwnProperty(H="EXPONENTIAL_AT"))if(q=F[H],q&&q.pop)H0(q[0],-I0,0,H),H0(q[1],0,I0,H),G=q[0],Y=q[1];else H0(q,-I0,I0,H),G=-(Y=q<0?-q:q);if(F.hasOwnProperty(H="RANGE"))if(q=F[H],q&&q.pop)H0(q[0],-I0,-1,H),H0(q[1],1,I0,H),X=q[0],Q=q[1];else if(H0(q,-I0,I0,H),q)X=-(Q=q<0?-q:q);else throw Error(c0+H+" cannot be zero: "+q);if(F.hasOwnProperty(H="CRYPTO"))if(q=F[H],q===!!q)if(q)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))K=q;else throw K=!q,Error(c0+"crypto unavailable");else K=q;else throw Error(c0+H+" not true or false: "+q);if(F.hasOwnProperty(H="MODULO_MODE"))q=F[H],H0(q,0,9,H),v=q;if(F.hasOwnProperty(H="POW_PRECISION"))q=F[H],H0(q,0,I0,H),V=q;if(F.hasOwnProperty(H="FORMAT"))if(q=F[H],typeof q=="object")w=q;else throw Error(c0+H+" not an object: "+q);if(F.hasOwnProperty(H="ALPHABET"))if(q=F[H],typeof q=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(q))O=q.slice(0,10)=="0123456789",P=q;else throw Error(c0+H+" invalid: "+q)}else throw Error(c0+"Object expected: "+F);return{DECIMAL_PLACES:J,ROUNDING_MODE:U,EXPONENTIAL_AT:[G,Y],RANGE:[X,Q],CRYPTO:K,MODULO_MODE:v,POW_PRECISION:V,FORMAT:w,ALPHABET:P}},B.isBigNumber=function(F){if(!F||F._isBigNumber!==!0)return!1;if(!B.DEBUG)return!0;var H,q,g=F.c,D=F.e,W=F.s;_:if({}.toString.call(g)=="[object Array]"){if((W===1||W===-1)&&D>=-I0&&D<=I0&&D===G_(D)){if(g[0]===0){if(D===0&&g.length===1)return!0;break _}if(H=(D+1)%o,H<1)H+=o;if(String(g[0]).length==H){for(H=0;H<g.length;H++)if(q=g[H],q<0||q>=D_||q!==G_(q))break _;if(q!==0)return!0}}}else if(g===null&&D===null&&(W===null||W===1||W===-1))return!0;throw Error(c0+"Invalid BigNumber: "+F)},B.maximum=B.max=function(){return y(arguments,-1)},B.minimum=B.min=function(){return y(arguments,1)},B.random=function(){var F=9007199254740992,H=Math.random()*F&2097151?function(){return G_(Math.random()*F)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(q){var g,D,W,N,k,x=0,j=[],S=new B(A);if(q==null)q=J;else H0(q,0,I0);if(N=az(q/o),K)if(crypto.getRandomValues){g=crypto.getRandomValues(new Uint32Array(N*=2));for(;x<N;)if(k=g[x]*131072+(g[x+1]>>>11),k>=9000000000000000)D=crypto.getRandomValues(new Uint32Array(2)),g[x]=D[0],g[x+1]=D[1];else j.push(k%100000000000000),x+=2;x=N/2}else if(crypto.randomBytes){g=crypto.randomBytes(N*=7);for(;x<N;)if(k=(g[x]&31)*281474976710656+g[x+1]*1099511627776+g[x+2]*4294967296+g[x+3]*16777216+(g[x+4]<<16)+(g[x+5]<<8)+g[x+6],k>=9000000000000000)crypto.randomBytes(7).copy(g,x);else j.push(k%100000000000000),x+=7;x=N/7}else throw K=!1,Error(c0+"crypto unavailable");if(!K){for(;x<N;)if(k=H(),k<9000000000000000)j[x++]=k%100000000000000}if(N=j[--x],q%=o,N&&q)k=tz[o-q],j[x]=G_(N/k)*k;for(;j[x]===0;j.pop(),x--);if(x<0)j=[W=0];else{for(W=-1;j[0]===0;j.splice(0,1),W-=o);for(x=1,k=j[0];k>=10;k/=10,x++);if(x<o)W-=o-x}return S.e=W,S.c=j,S}}(),B.sum=function(){var F=1,H=arguments,q=new B(H[0]);for(;F<H.length;)q=q.plus(H[F++]);return q},b=function(){var F="0123456789";function H(q,g,D,W){var N,k=[0],x,j=0,S=q.length;for(;j<S;){for(x=k.length;x--;k[x]*=g);k[0]+=W.indexOf(q.charAt(j++));for(N=0;N<k.length;N++)if(k[N]>D-1){if(k[N+1]==null)k[N+1]=0;k[N+1]+=k[N]/D|0,k[N]%=D}}return k.reverse()}return function(q,g,D,W,N){var k,x,j,S,f,l,p,b0,q0=q.indexOf("."),x0=J,$0=U;if(q0>=0)S=V,V=0,q=q.replace(".",""),b0=new B(g),l=b0.pow(q.length-q0),V=S,b0.c=H(p_(U_(l.c),l.e,"0"),10,D,F),b0.e=b0.c.length;p=H(q,g,D,N?(k=P,F):(k=F,P)),j=S=p.length;for(;p[--S]==0;p.pop());if(!p[0])return k.charAt(0);if(q0<0)--j;else l.c=p,l.e=j,l.s=W,l=$(l,b0,x0,$0,D),p=l.c,f=l.r,j=l.e;if(x=j+x0+1,q0=p[x],S=D/2,f=f||x<0||p[x+1]!=null,f=$0<4?(q0!=null||f)&&($0==0||$0==(l.s<0?3:2)):q0>S||q0==S&&($0==4||f||$0==6&&p[x-1]&1||$0==(l.s<0?8:7)),x<1||!p[0])q=f?p_(k.charAt(1),-x0,k.charAt(0)):k.charAt(0);else{if(p.length=x,f){for(--D;++p[--x]>D;)if(p[x]=0,!x)++j,p=[1].concat(p)}for(S=p.length;!p[--S];);for(q0=0,q="";q0<=S;q+=k.charAt(p[q0++]));q=p_(q,j,k.charAt(0))}return q}}(),$=function(){function F(g,D,W){var N,k,x,j,S=0,f=g.length,l=D%Y4,p=D/Y4|0;for(g=g.slice();f--;)x=g[f]%Y4,j=g[f]/Y4|0,N=p*x+j*l,k=l*x+N%Y4*Y4+S,S=(k/W|0)+(N/Y4|0)+p*j,g[f]=k%W;if(S)g=[S].concat(g);return g}function H(g,D,W,N){var k,x;if(W!=N)x=W>N?1:-1;else for(k=x=0;k<W;k++)if(g[k]!=D[k]){x=g[k]>D[k]?1:-1;break}return x}function q(g,D,W,N){var k=0;for(;W--;)g[W]-=k,k=g[W]<D[W]?1:0,g[W]=k*N+g[W]-D[W];for(;!g[0]&&g.length>1;g.splice(0,1));}return function(g,D,W,N,k){var x,j,S,f,l,p,b0,q0,x0,$0,Y0,P0,X2,t6,s6,N_,e9,A_=g.s==D.s?1:-1,L0=g.c,V0=D.c;if(!L0||!L0[0]||!V0||!V0[0])return new B(!g.s||!D.s||(L0?V0&&L0[0]==V0[0]:!V0)?NaN:L0&&L0[0]==0||!V0?A_*0:A_/0);if(q0=new B(A_),x0=q0.c=[],j=g.e-D.e,A_=W+j+1,!k)k=D_,j=Y_(g.e/o)-Y_(D.e/o),A_=A_/o|0;for(S=0;V0[S]==(L0[S]||0);S++);if(V0[S]>(L0[S]||0))j--;if(A_<0)x0.push(1),f=!0;else{if(t6=L0.length,N_=V0.length,S=0,A_+=2,l=G_(k/(V0[0]+1)),l>1)V0=F(V0,l,k),L0=F(L0,l,k),N_=V0.length,t6=L0.length;X2=N_,$0=L0.slice(0,N_),Y0=$0.length;for(;Y0<N_;$0[Y0++]=0);if(e9=V0.slice(),e9=[0].concat(e9),s6=V0[0],V0[1]>=k/2)s6++;do{if(l=0,x=H(V0,$0,N_,Y0),x<0){if(P0=$0[0],N_!=Y0)P0=P0*k+($0[1]||0);if(l=G_(P0/s6),l>1){if(l>=k)l=k-1;p=F(V0,l,k),b0=p.length,Y0=$0.length;while(H(p,$0,b0,Y0)==1)l--,q(p,N_<b0?e9:V0,b0,k),b0=p.length,x=1}else{if(l==0)x=l=1;p=V0.slice(),b0=p.length}if(b0<Y0)p=[0].concat(p);if(q($0,p,Y0,k),Y0=$0.length,x==-1)while(H(V0,$0,N_,Y0)<1)l++,q($0,N_<Y0?e9:V0,Y0,k),Y0=$0.length}else if(x===0)l++,$0=[0];if(x0[S++]=l,$0[0])$0[Y0++]=L0[X2]||0;else $0=[L0[X2]],Y0=1}while((X2++<t6||$0[0]!=null)&&A_--);if(f=$0[0]!=null,!x0[0])x0.splice(0,1)}if(k==D_){for(S=1,A_=x0[0];A_>=10;A_/=10,S++);E(q0,W+(q0.e=S+j*o-1)+1,N,f)}else q0.e=j,q0.r=+f;return q0}}();function T(F,H,q,g){var D,W,N,k,x;if(q==null)q=U;else H0(q,0,8);if(!F.c)return F.toString();if(D=F.c[0],N=F.e,H==null)x=U_(F.c),x=g==1||g==2&&(N<=G||N>=Y)?T2(x,N):p_(x,N,"0");else if(F=E(new B(F),H,q),W=F.e,x=U_(F.c),k=x.length,g==1||g==2&&(H<=W||W<=G)){for(;k<H;x+="0",k++);x=T2(x,W)}else if(H-=N+(g===2&&W>N),x=p_(x,W,"0"),W+1>k){if(--H>0)for(x+=".";H--;x+="0");}else if(H+=W-k,H>0){if(W+1==k)x+=".";for(;H--;x+="0");}return F.s<0&&D?"-"+x:x}function y(F,H){var q,g,D=1,W=new B(F[0]);for(;D<F.length;D++)if(g=new B(F[D]),!g.s||(q=R4(W,g))===H||q===0&&W.s===H)W=g;return W}function u(F,H,q){var g=1,D=H.length;for(;!H[--D];H.pop());for(D=H[0];D>=10;D/=10,g++);if((q=g+q*o-1)>Q)F.c=F.e=null;else if(q<X)F.c=[F.e=0];else F.e=q,F.c=H;return F}Z=function(){var F=/^(-?)0([xbo])(?=\w[\w.]*$)/i,H=/^([^.]+)\.$/,q=/^\.([^.]+)$/,g=/^-?(Infinity|NaN)$/,D=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(W,N,k,x){var j,S=k?N:N.replace(D,"");if(g.test(S))W.s=isNaN(S)?null:S<0?-1:1;else{if(!k){if(S=S.replace(F,function(f,l,p){return j=(p=p.toLowerCase())=="x"?16:p=="b"?2:8,!x||x==j?l:f}),x)j=x,S=S.replace(H,"$1").replace(q,"0.$1");if(N!=S)return new B(S,j)}if(B.DEBUG)throw Error(c0+"Not a"+(x?" base "+x:"")+" number: "+N);W.s=null}W.c=W.e=null}}();function E(F,H,q,g){var D,W,N,k,x,j,S,f=F.c,l=tz;if(f){_:{for(D=1,k=f[0];k>=10;k/=10,D++);if(W=H-D,W<0)W+=o,N=H,x=f[j=0],S=G_(x/l[D-N-1]%10);else if(j=az((W+1)/o),j>=f.length)if(g){for(;f.length<=j;f.push(0));x=S=0,D=1,W%=o,N=W-o+1}else break _;else{x=k=f[j];for(D=1;k>=10;k/=10,D++);W%=o,N=W-o+D,S=N<0?0:G_(x/l[D-N-1]%10)}if(g=g||H<0||f[j+1]!=null||(N<0?x:x%l[D-N-1]),g=q<4?(S||g)&&(q==0||q==(F.s<0?3:2)):S>5||S==5&&(q==4||g||q==6&&(W>0?N>0?x/l[D-N]:0:f[j-1])%10&1||q==(F.s<0?8:7)),H<1||!f[0]){if(f.length=0,g)H-=F.e+1,f[0]=l[(o-H%o)%o],F.e=-H||0;else f[0]=F.e=0;return F}if(W==0)f.length=j,k=1,j--;else f.length=j+1,k=l[o-W],f[j]=N>0?G_(x/l[D-N]%l[N])*k:0;if(g)for(;;)if(j==0){for(W=1,N=f[0];N>=10;N/=10,W++);N=f[0]+=k;for(k=1;N>=10;N/=10,k++);if(W!=k){if(F.e++,f[0]==D_)f[0]=1}break}else{if(f[j]+=k,f[j]!=D_)break;f[j--]=0,k=1}for(W=f.length;f[--W]===0;f.pop());}if(F.e>Q)F.c=F.e=null;else if(F.e<X)F.c=[F.e=0]}return F}function C(F){var H,q=F.e;if(q===null)return F.toString();return H=U_(F.c),H=q<=G||q>=Y?T2(H,q):p_(H,q,"0"),F.s<0?"-"+H:H}if(z.absoluteValue=z.abs=function(){var F=new B(this);if(F.s<0)F.s=1;return F},z.comparedTo=function(F,H){return R4(this,new B(F,H))},z.decimalPlaces=z.dp=function(F,H){var q,g,D,W=this;if(F!=null){if(H0(F,0,I0),H==null)H=U;else H0(H,0,8);return E(new B(W),F+W.e+1,H)}if(!(q=W.c))return null;if(g=((D=q.length-1)-Y_(this.e/o))*o,D=q[D])for(;D%10==0;D/=10,g--);if(g<0)g=0;return g},z.dividedBy=z.div=function(F,H){return $(this,new B(F,H),J,U)},z.dividedToIntegerBy=z.idiv=function(F,H){return $(this,new B(F,H),0,1)},z.exponentiatedBy=z.pow=function(F,H){var q,g,D,W,N,k,x,j,S,f=this;if(F=new B(F),F.c&&!F.isInteger())throw Error(c0+"Exponent not an integer: "+C(F));if(H!=null)H=new B(H);if(k=F.e>14,!f.c||!f.c[0]||f.c[0]==1&&!f.e&&f.c.length==1||!F.c||!F.c[0])return S=new B(Math.pow(+C(f),k?F.s*(2-L2(F)):+C(F))),H?S.mod(H):S;if(x=F.s<0,H){if(H.c?!H.c[0]:!H.s)return new B(NaN);if(g=!x&&f.isInteger()&&H.isInteger(),g)f=f.mod(H)}else if(F.e>9&&(f.e>0||f.e<-1||(f.e==0?f.c[0]>1||k&&f.c[1]>=240000000:f.c[0]<80000000000000||k&&f.c[0]<=99999750000000))){if(W=f.s<0&&L2(F)?-0:0,f.e>-1)W=1/W;return new B(x?1/W:W)}else if(V)W=az(V/o+2);if(k){if(q=new B(0.5),x)F.s=1;j=L2(F)}else D=Math.abs(+C(F)),j=D%2;S=new B(A);for(;;){if(j){if(S=S.times(f),!S.c)break;if(W){if(S.c.length>W)S.c.length=W}else if(g)S=S.mod(H)}if(D){if(D=G_(D/2),D===0)break;j=D%2}else if(F=F.times(q),E(F,F.e+1,1),F.e>14)j=L2(F);else{if(D=+C(F),D===0)break;j=D%2}if(f=f.times(f),W){if(f.c&&f.c.length>W)f.c.length=W}else if(g)f=f.mod(H)}if(g)return S;if(x)S=A.div(S);return H?S.mod(H):W?E(S,V,U,N):S},z.integerValue=function(F){var H=new B(this);if(F==null)F=U;else H0(F,0,8);return E(H,H.e+1,F)},z.isEqualTo=z.eq=function(F,H){return R4(this,new B(F,H))===0},z.isFinite=function(){return!!this.c},z.isGreaterThan=z.gt=function(F,H){return R4(this,new B(F,H))>0},z.isGreaterThanOrEqualTo=z.gte=function(F,H){return(H=R4(this,new B(F,H)))===1||H===0},z.isInteger=function(){return!!this.c&&Y_(this.e/o)>this.c.length-2},z.isLessThan=z.lt=function(F,H){return R4(this,new B(F,H))<0},z.isLessThanOrEqualTo=z.lte=function(F,H){return(H=R4(this,new B(F,H)))===-1||H===0},z.isNaN=function(){return!this.s},z.isNegative=function(){return this.s<0},z.isPositive=function(){return this.s>0},z.isZero=function(){return!!this.c&&this.c[0]==0},z.minus=function(F,H){var q,g,D,W,N=this,k=N.s;if(F=new B(F,H),H=F.s,!k||!H)return new B(NaN);if(k!=H)return F.s=-H,N.plus(F);var x=N.e/o,j=F.e/o,S=N.c,f=F.c;if(!x||!j){if(!S||!f)return S?(F.s=-H,F):new B(f?N:NaN);if(!S[0]||!f[0])return f[0]?(F.s=-H,F):new B(S[0]?N:U==3?-0:0)}if(x=Y_(x),j=Y_(j),S=S.slice(),k=x-j){if(W=k<0)k=-k,D=S;else j=x,D=f;D.reverse();for(H=k;H--;D.push(0));D.reverse()}else{g=(W=(k=S.length)<(H=f.length))?k:H;for(k=H=0;H<g;H++)if(S[H]!=f[H]){W=S[H]<f[H];break}}if(W)D=S,S=f,f=D,F.s=-F.s;if(H=(g=f.length)-(q=S.length),H>0)for(;H--;S[q++]=0);H=D_-1;for(;g>k;){if(S[--g]<f[g]){for(q=g;q&&!S[--q];S[q]=H);--S[q],S[g]+=D_}S[g]-=f[g]}for(;S[0]==0;S.splice(0,1),--j);if(!S[0])return F.s=U==3?-1:1,F.c=[F.e=0],F;return u(F,S,j)},z.modulo=z.mod=function(F,H){var q,g,D=this;if(F=new B(F,H),!D.c||!F.s||F.c&&!F.c[0])return new B(NaN);else if(!F.c||D.c&&!D.c[0])return new B(D);if(v==9)g=F.s,F.s=1,q=$(D,F,0,3),F.s=g,q.s*=g;else q=$(D,F,0,v);if(F=D.minus(q.times(F)),!F.c[0]&&v==1)F.s=D.s;return F},z.multipliedBy=z.times=function(F,H){var q,g,D,W,N,k,x,j,S,f,l,p,b0,q0,x0,$0=this,Y0=$0.c,P0=(F=new B(F,H)).c;if(!Y0||!P0||!Y0[0]||!P0[0]){if(!$0.s||!F.s||Y0&&!Y0[0]&&!P0||P0&&!P0[0]&&!Y0)F.c=F.e=F.s=null;else if(F.s*=$0.s,!Y0||!P0)F.c=F.e=null;else F.c=[0],F.e=0;return F}if(g=Y_($0.e/o)+Y_(F.e/o),F.s*=$0.s,x=Y0.length,f=P0.length,x<f)b0=Y0,Y0=P0,P0=b0,D=x,x=f,f=D;for(D=x+f,b0=[];D--;b0.push(0));q0=D_,x0=Y4;for(D=f;--D>=0;){q=0,l=P0[D]%x0,p=P0[D]/x0|0;for(N=x,W=D+N;W>D;)j=Y0[--N]%x0,S=Y0[N]/x0|0,k=p*j+S*l,j=l*j+k%x0*x0+b0[W]+q,q=(j/q0|0)+(k/x0|0)+p*S,b0[W--]=j%q0;b0[W]=q}if(q)++g;else b0.splice(0,1);return u(F,b0,g)},z.negated=function(){var F=new B(this);return F.s=-F.s||null,F},z.plus=function(F,H){var q,g=this,D=g.s;if(F=new B(F,H),H=F.s,!D||!H)return new B(NaN);if(D!=H)return F.s=-H,g.minus(F);var W=g.e/o,N=F.e/o,k=g.c,x=F.c;if(!W||!N){if(!k||!x)return new B(D/0);if(!k[0]||!x[0])return x[0]?F:new B(k[0]?g:D*0)}if(W=Y_(W),N=Y_(N),k=k.slice(),D=W-N){if(D>0)N=W,q=x;else D=-D,q=k;q.reverse();for(;D--;q.push(0));q.reverse()}if(D=k.length,H=x.length,D-H<0)q=x,x=k,k=q,H=D;for(D=0;H;)D=(k[--H]=k[H]+x[H]+D)/D_|0,k[H]=D_===k[H]?0:k[H]%D_;if(D)k=[D].concat(k),++N;return u(F,k,N)},z.precision=z.sd=function(F,H){var q,g,D,W=this;if(F!=null&&F!==!!F){if(H0(F,1,I0),H==null)H=U;else H0(H,0,8);return E(new B(W),F,H)}if(!(q=W.c))return null;if(D=q.length-1,g=D*o+1,D=q[D]){for(;D%10==0;D/=10,g--);for(D=q[0];D>=10;D/=10,g++);}if(F&&W.e+1>g)g=W.e+1;return g},z.shiftedBy=function(F){return H0(F,-ez,ez),this.times("1e"+F)},z.squareRoot=z.sqrt=function(){var F,H,q,g,D,W=this,N=W.c,k=W.s,x=W.e,j=J+4,S=new B("0.5");if(k!==1||!N||!N[0])return new B(!k||k<0&&(!N||N[0])?NaN:N?W:1/0);if(k=Math.sqrt(+C(W)),k==0||k==1/0){if(H=U_(N),(H.length+x)%2==0)H+="0";if(k=Math.sqrt(+H),x=Y_((x+1)/2)-(x<0||x%2),k==1/0)H="5e"+x;else H=k.toExponential(),H=H.slice(0,H.indexOf("e")+1)+x;q=new B(H)}else q=new B(k+"");if(q.c[0]){if(x=q.e,k=x+j,k<3)k=0;for(;;)if(D=q,q=S.times(D.plus($(W,D,j,1))),U_(D.c).slice(0,k)===(H=U_(q.c)).slice(0,k)){if(q.e<x)--k;if(H=H.slice(k-3,k+1),H=="9999"||!g&&H=="4999"){if(!g){if(E(D,D.e+J+2,0),D.times(D).eq(W)){q=D;break}}j+=4,k+=4,g=1}else{if(!+H||!+H.slice(1)&&H.charAt(0)=="5")E(q,q.e+J+2,1),F=!q.times(q).eq(W);break}}}return E(q,q.e+J+1,U,F)},z.toExponential=function(F,H){if(F!=null)H0(F,0,I0),F++;return T(this,F,H,1)},z.toFixed=function(F,H){if(F!=null)H0(F,0,I0),F=F+this.e+1;return T(this,F,H)},z.toFormat=function(F,H,q){var g,D=this;if(q==null)if(F!=null&&H&&typeof H=="object")q=H,H=null;else if(F&&typeof F=="object")q=F,F=H=null;else q=w;else if(typeof q!="object")throw Error(c0+"Argument not an object: "+q);if(g=D.toFixed(F,H),D.c){var W,N=g.split("."),k=+q.groupSize,x=+q.secondaryGroupSize,j=q.groupSeparator||"",S=N[0],f=N[1],l=D.s<0,p=l?S.slice(1):S,b0=p.length;if(x)W=k,k=x,x=W,b0-=W;if(k>0&&b0>0){W=b0%k||k,S=p.substr(0,W);for(;W<b0;W+=k)S+=j+p.substr(W,k);if(x>0)S+=j+p.slice(W);if(l)S="-"+S}g=f?S+(q.decimalSeparator||"")+((x=+q.fractionGroupSize)?f.replace(new RegExp("\\d{"+x+"}\\B","g"),"$&"+(q.fractionGroupSeparator||"")):f):S}return(q.prefix||"")+g+(q.suffix||"")},z.toFraction=function(F){var H,q,g,D,W,N,k,x,j,S,f,l,p=this,b0=p.c;if(F!=null){if(k=new B(F),!k.isInteger()&&(k.c||k.s!==1)||k.lt(A))throw Error(c0+"Argument "+(k.isInteger()?"out of range: ":"not an integer: ")+C(k))}if(!b0)return new B(p);H=new B(A),j=q=new B(A),g=x=new B(A),l=U_(b0),W=H.e=l.length-p.e-1,H.c[0]=tz[(N=W%o)<0?o+N:N],F=!F||k.comparedTo(H)>0?W>0?H:j:k,N=Q,Q=1/0,k=new B(l),x.c[0]=0;for(;;){if(S=$(k,H,0,1),D=q.plus(S.times(g)),D.comparedTo(F)==1)break;q=g,g=D,j=x.plus(S.times(D=j)),x=D,H=k.minus(S.times(D=H)),k=D}return D=$(F.minus(q),g,0,1),x=x.plus(D.times(j)),q=q.plus(D.times(g)),x.s=j.s=p.s,W=W*2,f=$(j,g,W,U).minus(p).abs().comparedTo($(x,q,W,U).minus(p).abs())<1?[j,g]:[x,q],Q=N,f},z.toNumber=function(){return+C(this)},z.toPrecision=function(F,H){if(F!=null)H0(F,1,I0);return T(this,F,H,2)},z.toString=function(F){var H,q=this,g=q.s,D=q.e;if(D===null)if(g){if(H="Infinity",g<0)H="-"+H}else H="NaN";else{if(F==null)H=D<=G||D>=Y?T2(U_(q.c),D):p_(U_(q.c),D,"0");else if(F===10&&O)q=E(new B(q),J+D+1,U),H=p_(U_(q.c),q.e,"0");else H0(F,2,P.length,"Base"),H=b(p_(U_(q.c),D,"0"),10,F,g,!0);if(g<0&&q.c[0])H="-"+H}return H},z.valueOf=z.toJSON=function(){return C(this)},z._isBigNumber=!0,z[Symbol.toStringTag]="BigNumber",z[Symbol.for("nodejs.util.inspect.custom")]=z.valueOf,_!=null)B.set(_);return B}function Y_(_){var $=_|0;return _>0||_===$?$:$-1}function U_(_){var $,b,Z=1,z=_.length,A=_[0]+"";for(;Z<z;){$=_[Z++]+"",b=o-$.length;for(;b--;$="0"+$);A+=$}for(z=A.length;A.charCodeAt(--z)===48;);return A.slice(0,z+1||1)}function R4(_,$){var b,Z,z=_.c,A=$.c,J=_.s,U=$.s,G=_.e,Y=$.e;if(!J||!U)return null;if(b=z&&!z[0],Z=A&&!A[0],b||Z)return b?Z?0:-U:J;if(J!=U)return J;if(b=J<0,Z=G==Y,!z||!A)return Z?0:!z^b?1:-1;if(!Z)return G>Y^b?1:-1;U=(G=z.length)<(Y=A.length)?G:Y;for(J=0;J<U;J++)if(z[J]!=A[J])return z[J]>A[J]^b?1:-1;return G==Y?0:G>Y^b?1:-1}function H0(_,$,b,Z){if(_<$||_>b||_!==G_(_))throw Error(c0+(Z||"Argument")+(typeof _=="number"?_<$||_>b?" out of range: ":" not an integer: ":" not a primitive number: ")+String(_))}function L2(_){var $=_.c.length-1;return Y_(_.e/o)==$&&_.c[$]%2!=0}function T2(_,$){return(_.length>1?_.charAt(0)+"."+_.slice(1):_)+($<0?"e":"e+")+$}function p_(_,$,b){var Z,z;if($<0){for(z=b+".";++$;z+=b);_=z+_}else if(Z=_.length,++$>Z){for(z=b,$-=Z;--$;z+=b);_+=z}else if($<Z)_=_.slice(0,$)+"."+_.slice($);return _}var Qq=XG(),QG=Qq;var Kq=24,Y$=32,vq=()=>{if(typeof globalThis<"u"&&globalThis.crypto&&typeof globalThis.crypto.getRandomValues==="function")return()=>{let _=new Uint32Array(1);return globalThis.crypto.getRandomValues(_),_[0]/4294967296};return Math.random},_b=vq(),sz=(_=4,$=_b)=>{let b="";while(b.length<_)b=b+Math.floor($()*36).toString(36);return b};function Fq(_){let $=new QG(0);for(let b of _.values())$=$.multipliedBy(256).plus(b);return $}var vG=(_="")=>{return Fq(GG(new TextEncoder().encode(_))).toString(36).slice(1)},KG=Array.from({length:26},(_,$)=>String.fromCharCode($+97)),Hq=(_)=>KG[Math.floor(_()*KG.length)],qq=({globalObj:_=typeof global<"u"?global:typeof window<"u"?window:{},random:$=_b}={})=>{let b=Object.keys(_).toString(),Z=b.length?b+sz(Y$,$):sz(Y$,$);return vG(Z).substring(0,Y$)},Vq=(_)=>()=>{return _++},Dq=476782367,y2=({random:_=_b,counter:$=Vq(Math.floor(_()*Dq)),length:b=Kq,fingerprint:Z=qq({random:_})}={})=>{if(b>Y$)throw Error(`Length must be between 2 and ${Y$}. Received: ${b}`);return function(){let A=Hq(_),J=Date.now().toString(36),U=$().toString(36),G=sz(b,_),Y=`${J+G+U+Z}`;return`${A+vG(Y).substring(1,b)}`}},kq=Wq(y2);function Wq(_){let $;return()=>{if(!$)$=_();return $()}}var zb=HG(wq(),".config","agentlogs"),FG=HG(zb,"local.db"),xq=typeof globalThis.Bun<"u",A9=null,$b=null;function Nq(){if(!$b)$b=y2();return $b}function Iq(){if(!gq(zb))Bq(zb,{recursive:!0})}async function C2(){if(A9)return A9;if(Iq(),xq){let{Database:_}=await import("bun:sqlite"),$=new _(FG);A9={exec:(b)=>$.run(b),get:(b,...Z)=>$.query(b).get(...Z),run:(b,...Z)=>$.run(b,Z),all:(b,...Z)=>$.query(b).all(...Z)}}else{let{default:_}=await import("libsql"),$=new _(FG);A9={exec:(b)=>$.exec(b),get:(b,...Z)=>$.prepare(b).get(...Z),run:(b,...Z)=>$.prepare(b).run(...Z),all:(b,...Z)=>$.prepare(b).all(...Z)}}return A9.exec(`
39
+ at `)}function WH(_,$){class b extends _{#_;constructor(...Z){if(gH()){let A=Error.stackTraceLimit;Error.stackTraceLimit=0;super(...Z);Error.stackTraceLimit=A}else super(...Z);let z=Error().stack;if(z)this.#_=kH(z.replace(/^Error/,this.name))}get errorStack(){return this.#_}}return Object.defineProperty(b.prototype,"constructor",{get(){return $},enumerable:!1,configurable:!0}),b}var wH={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511},BH=class extends Error{constructor(_="INTERNAL_SERVER_ERROR",$=void 0,b={},Z=typeof _==="number"?_:wH[_]){super($?.message,$?.cause?{cause:$.cause}:void 0);this.status=_,this.body=$,this.headers=b,this.statusCode=Z,this.name="APIError",this.status=_,this.headers=b,this.statusCode=Z,this.body=$}};var xH=WH(BH,Error);var F4=class extends Error{constructor(_,$){super(_,$);this.name="BetterAuthError",this.message=_,this.stack=""}};function NH(_){try{return(new URL(_).pathname.replace(/\/+$/,"")||"/")!=="/"}catch{throw new F4(`Invalid base URL: ${_}. Please provide a valid base URL.`)}}function IH(_){try{let $=new URL(_);if($.protocol!=="http:"&&$.protocol!=="https:")throw new F4(`Invalid base URL: ${_}. URL must include 'http://' or 'https://'`)}catch($){if($ instanceof F4)throw $;throw new F4(`Invalid base URL: ${_}. Please provide a valid base URL.`,{cause:$})}}function A$(_,$="/api/auth"){if(IH(_),NH(_))return _;let b=_.replace(/\/+$/,"");if(!$||$==="/")return b;return $=$.startsWith("/")?$:`/${$}`,`${b}${$}`}function D7(_,$){if(!_||_.trim()==="")return!1;if($==="proto")return _==="http"||_==="https";if($==="host"){if([/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some((b)=>b.test(_)))return!1;return/^[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])?)*(:[0-9]{1,5})?$/.test(_)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(_)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(_)||/^localhost(:[0-9]{1,5})?$/i.test(_)}return!1}function V7(_,$,b,Z,z){if(_)return A$(_,$);if(Z!==!1){let U=T0.BETTER_AUTH_URL||T0.NEXT_PUBLIC_BETTER_AUTH_URL||T0.PUBLIC_BETTER_AUTH_URL||T0.NUXT_PUBLIC_BETTER_AUTH_URL||T0.NUXT_PUBLIC_AUTH_URL||(T0.BASE_URL!=="/"?T0.BASE_URL:void 0);if(U)return A$(U,$)}let A=b?.headers.get("x-forwarded-host"),J=b?.headers.get("x-forwarded-proto");if(A&&J&&z){if(D7(J,"proto")&&D7(A,"host"))try{return A$(`${J}://${A}`,$)}catch(U){}}if(b){let U=MH(b.url);if(!U)throw new F4("Could not get origin from request. Please provide a valid base URL.");return A$(U,$)}if(typeof window<"u"&&window.location)return A$(window.location.origin,$)}function MH(_){try{let $=new URL(_);return $.origin==="null"?null:$.origin}catch{return null}}var g7={id:"redirect",name:"Redirect",hooks:{onSuccess(_){if(_.data?.url&&_.data?.redirect){if(typeof window<"u"&&window.location){if(window.location)try{window.location.href=_.data.url}catch{}}}}}};function k7(_,$){let b=$$(!1),Z=x2(b,"/get-session",_,{method:"GET"}),z=()=>{};return z$(Z,()=>{let A=mz({sessionAtom:Z,sessionSignal:b,$fetch:_,options:$});return A.init(),z=A.broadcastSessionUpdate,()=>{A.cleanup()}}),{session:Z,$sessionSignal:b,broadcastSessionUpdate:(A)=>z(A)}}function cz(_){if(_===null||typeof _!=="object")return!1;let $=Object.getPrototypeOf(_);if($!==null&&$!==Object.prototype&&Object.getPrototypeOf($)!==null)return!1;if(Symbol.iterator in _)return!1;if(Symbol.toStringTag in _)return Object.prototype.toString.call(_)==="[object Module]";return!0}function hz(_,$,b=".",Z){if(!cz($))return hz(_,{},b,Z);let z=Object.assign({},$);for(let A in _){if(A==="__proto__"||A==="constructor")continue;let J=_[A];if(J===null||J===void 0)continue;if(Z&&Z(z,A,J,b))continue;if(Array.isArray(J)&&Array.isArray(z[A]))z[A]=[...J,...z[A]];else if(cz(J)&&cz(z[A]))z[A]=hz(J,z[A],(b?`${b}.`:"")+A.toString(),Z);else z[A]=J}return z}function rz(_){return(...$)=>$.reduce((b,Z)=>hz(b,Z,"",_),{})}var W7=rz(),IP=rz((_,$,b)=>{if(_[$]!==void 0&&typeof b==="function")return _[$]=b(_[$]),!0}),MP=rz((_,$,b)=>{if(Array.isArray(_[$])&&typeof b==="function")return _[$]=b(_[$]),!0});var{defineProperty:EH,defineProperties:OH,getOwnPropertyDescriptors:PH,getOwnPropertySymbols:w7}=Object,jH=Object.prototype.hasOwnProperty,SH=Object.prototype.propertyIsEnumerable,B7=(_,$,b)=>($ in _)?EH(_,$,{enumerable:!0,configurable:!0,writable:!0,value:b}):_[$]=b,V_=(_,$)=>{for(var b in $||($={}))if(jH.call($,b))B7(_,b,$[b]);if(w7){for(var b of w7($))if(SH.call($,b))B7(_,b,$[b])}return _},P_=(_,$)=>OH(_,PH($)),RH=class extends Error{constructor(_,$,b){super($||_.toString(),{cause:b});this.status=_,this.statusText=$,this.error=b,Error.captureStackTrace(this,this.constructor)}},LH=async(_,$)=>{var b,Z,z,A,J,U;let G=$||{},Y={onRequest:[$==null?void 0:$.onRequest],onResponse:[$==null?void 0:$.onResponse],onSuccess:[$==null?void 0:$.onSuccess],onError:[$==null?void 0:$.onError],onRetry:[$==null?void 0:$.onRetry]};if(!$||!($==null?void 0:$.plugins))return{url:_,options:G,hooks:Y};for(let X of($==null?void 0:$.plugins)||[]){if(X.init){let Q=await((b=X.init)==null?void 0:b.call(X,_.toString(),$));G=Q.options||G,_=Q.url}Y.onRequest.push((Z=X.hooks)==null?void 0:Z.onRequest),Y.onResponse.push((z=X.hooks)==null?void 0:z.onResponse),Y.onSuccess.push((A=X.hooks)==null?void 0:A.onSuccess),Y.onError.push((J=X.hooks)==null?void 0:J.onError),Y.onRetry.push((U=X.hooks)==null?void 0:U.onRetry)}return{url:_,options:G,hooks:Y}},x7=class{constructor(_){this.options=_}shouldAttemptRetry(_,$){if(this.options.shouldRetry)return Promise.resolve(_<this.options.attempts&&this.options.shouldRetry($));return Promise.resolve(_<this.options.attempts)}getDelay(){return this.options.delay}},TH=class{constructor(_){this.options=_}shouldAttemptRetry(_,$){if(this.options.shouldRetry)return Promise.resolve(_<this.options.attempts&&this.options.shouldRetry($));return Promise.resolve(_<this.options.attempts)}getDelay(_){return Math.min(this.options.maxDelay,this.options.baseDelay*2**_)}};function yH(_){if(typeof _==="number")return new x7({type:"linear",attempts:_,delay:1000});switch(_.type){case"linear":return new x7(_);case"exponential":return new TH(_);default:throw Error("Invalid retry strategy")}}var CH=async(_)=>{let $={},b=async(Z)=>typeof Z==="function"?await Z():Z;if(_==null?void 0:_.auth){if(_.auth.type==="Bearer"){let Z=await b(_.auth.token);if(!Z)return $;$.authorization=`Bearer ${Z}`}else if(_.auth.type==="Basic"){let[Z,z]=await Promise.all([b(_.auth.username),b(_.auth.password)]);if(!Z||!z)return $;$.authorization=`Basic ${btoa(`${Z}:${z}`)}`}else if(_.auth.type==="Custom"){let[Z,z]=await Promise.all([b(_.auth.prefix),b(_.auth.value)]);if(!z)return $;$.authorization=`${Z!=null?Z:""} ${z}`}}return $},fH=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function mH(_){let $=_.headers.get("content-type"),b=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!$)return"json";let Z=$.split(";").shift()||"";if(fH.test(Z))return"json";if(b.has(Z)||Z.startsWith("text/"))return"text";return"blob"}function uH(_){try{return JSON.parse(_),!0}catch($){return!1}}function nz(_){if(_===void 0)return!1;let $=typeof _;if($==="string"||$==="number"||$==="boolean"||$===null)return!0;if($!=="object")return!1;if(Array.isArray(_))return!0;if(_.buffer)return!1;return _.constructor&&_.constructor.name==="Object"||typeof _.toJSON==="function"}function N7(_){try{return JSON.parse(_)}catch($){return _}}function I7(_){return typeof _==="function"}function cH(_){if(_==null?void 0:_.customFetchImpl)return _.customFetchImpl;if(typeof globalThis<"u"&&I7(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&I7(window.fetch))return window.fetch;throw Error("No fetch implementation found")}async function hH(_){let $=new Headers(_==null?void 0:_.headers),b=await CH(_);for(let[Z,z]of Object.entries(b||{}))$.set(Z,z);if(!$.has("content-type")){let Z=rH(_==null?void 0:_.body);if(Z)$.set("content-type",Z)}return $}function rH(_){if(nz(_))return"application/json";return null}function nH(_){if(!(_==null?void 0:_.body))return null;let $=new Headers(_==null?void 0:_.headers);if(nz(_.body)&&!$.has("content-type")){for(let[b,Z]of Object.entries(_==null?void 0:_.body))if(Z instanceof Date)_.body[b]=Z.toISOString();return JSON.stringify(_.body)}if($.has("content-type")&&$.get("content-type")==="application/x-www-form-urlencoded"){if(nz(_.body))return new URLSearchParams(_.body).toString();return _.body}return _.body}function lH(_,$){var b;if($==null?void 0:$.method)return $.method.toUpperCase();if(_.startsWith("@")){let Z=(b=_.split("@")[1])==null?void 0:b.split("/")[0];if(!M7.includes(Z))return($==null?void 0:$.body)?"POST":"GET";return Z.toUpperCase()}return($==null?void 0:$.body)?"POST":"GET"}function pH(_,$){let b;if(!(_==null?void 0:_.signal)&&(_==null?void 0:_.timeout))b=setTimeout(()=>$==null?void 0:$.abort(),_==null?void 0:_.timeout);return{abortTimeout:b,clearTimeout:()=>{if(b)clearTimeout(b)}}}var dH=class _ extends Error{constructor($,b){super(b||JSON.stringify($,null,2));this.issues=$,Object.setPrototypeOf(this,_.prototype)}};async function M2(_,$){let b=await _["~standard"].validate($);if(b.issues)throw new dH(b.issues);return b.value}var M7=["get","post","put","patch","delete"];var iH=(_)=>({id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init($,b){var Z,z,A,J;let U=((z=(Z=_.plugins)==null?void 0:Z.find((G)=>{var Y;return((Y=G.schema)==null?void 0:Y.config)?$.startsWith(G.schema.config.baseURL||"")||$.startsWith(G.schema.config.prefix||""):!1}))==null?void 0:z.schema)||_.schema;if(U){let G=$;if((A=U.config)==null?void 0:A.prefix){if(G.startsWith(U.config.prefix)){if(G=G.replace(U.config.prefix,""),U.config.baseURL)$=$.replace(U.config.prefix,U.config.baseURL)}}if((J=U.config)==null?void 0:J.baseURL){if(G.startsWith(U.config.baseURL))G=G.replace(U.config.baseURL,"")}let Y=U.schema[G];if(Y){let X=P_(V_({},b),{method:Y.method,output:Y.output});if(!(b==null?void 0:b.disableValidation))X=P_(V_({},X),{body:Y.input?await M2(Y.input,b==null?void 0:b.body):b==null?void 0:b.body,params:Y.params?await M2(Y.params,b==null?void 0:b.params):b==null?void 0:b.params,query:Y.query?await M2(Y.query,b==null?void 0:b.query):b==null?void 0:b.query});return{url:$,options:X}}}return{url:$,options:b}}}),E7=(_)=>{async function $(b,Z){let z=P_(V_(V_({},_),Z),{plugins:[...(_==null?void 0:_.plugins)||[],iH(_||{}),...(Z==null?void 0:Z.plugins)||[]]});if(_==null?void 0:_.catchAllError)try{return await lz(b,z)}catch(A){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:A}}}return await lz(b,z)}return $};function oH(_,$){let{baseURL:b,params:Z,query:z}=$||{query:{},params:{},baseURL:""},A=_.startsWith("http")?_.split("/").slice(0,3).join("/"):b||"";if(_.startsWith("@")){let Q=_.toString().split("@")[1].split("/")[0];if(M7.includes(Q))_=_.replace(`@${Q}/`,"/")}if(!A.endsWith("/"))A+="/";let[J,U]=_.replace(A,"").split("?"),G=new URLSearchParams(U);for(let[Q,K]of Object.entries(z||{})){if(K==null)continue;let v;if(typeof K==="string")v=K;else if(Array.isArray(K)){for(let D of K)G.append(Q,D);continue}else v=JSON.stringify(K);G.set(Q,v)}if(Z)if(Array.isArray(Z)){let Q=J.split("/").filter((K)=>K.startsWith(":"));for(let[K,v]of Q.entries()){let D=Z[K];J=J.replace(v,D)}}else for(let[Q,K]of Object.entries(Z))J=J.replace(`:${Q}`,String(K));if(J=J.split("/").map(encodeURIComponent).join("/"),J.startsWith("/"))J=J.slice(1);let Y=G.toString();if(Y=Y.length>0?`?${Y}`.replace(/\+/g,"%20"):"",!A.startsWith("http"))return`${A}${J}${Y}`;return new URL(`${J}${Y}`,A)}var lz=async(_,$)=>{var b,Z,z,A,J,U,G,Y;let{hooks:X,url:Q,options:K}=await LH(_,$),v=cH(K),D=new AbortController,w=(b=K.signal)!=null?b:D.signal,P=oH(Q,K),E=nH(K),B=await hH(K),C=lH(Q,K),f=P_(V_({},K),{url:P,headers:B,body:E,method:C,signal:w});for(let k of X.onRequest)if(k){let N=await k(f);if(typeof N==="object"&&N!==null)f=N}if("pipeTo"in f&&typeof f.pipeTo==="function"||typeof((Z=$==null?void 0:$.body)==null?void 0:Z.pipe)==="function"){if(!("duplex"in f))f.duplex="half"}let{clearTimeout:u}=pH(K,D),O=await v(f.url,f);u();let T={response:O,request:f};for(let k of X.onResponse)if(k){let N=await k(P_(V_({},T),{response:((z=$==null?void 0:$.hookOptions)==null?void 0:z.cloneResponse)?O.clone():O}));if(N instanceof Response)O=N;else if(typeof N==="object"&&N!==null)O=N.response}if(O.ok){if(f.method==="HEAD")return{data:"",error:null};let N=mH(O),g={data:null,response:O,request:f};if(N==="json"||N==="text"){let x=await O.text(),j=(A=f.jsonParser)!=null?A:N7;g.data=await j(x)}else g.data=await O[N]();if(f==null?void 0:f.output){if(f.output&&!f.disableValidation)g.data=await M2(f.output,g.data)}for(let x of X.onSuccess)if(x)await x(P_(V_({},g),{response:((J=$==null?void 0:$.hookOptions)==null?void 0:J.cloneResponse)?O.clone():O}));if($==null?void 0:$.throw)return g.data;return{data:g.data,error:null}}let F=(U=$==null?void 0:$.jsonParser)!=null?U:N7,H=await O.text(),q=uH(H),W=q?await F(H):null,V={response:O,responseText:H,request:f,error:P_(V_({},W),{status:O.status,statusText:O.statusText})};for(let k of X.onError)if(k)await k(P_(V_({},V),{response:((G=$==null?void 0:$.hookOptions)==null?void 0:G.cloneResponse)?O.clone():O}));if($==null?void 0:$.retry){let k=yH($.retry),N=(Y=$.retryAttempt)!=null?Y:0;if(await k.shouldAttemptRetry(N,O)){for(let x of X.onRetry)if(x)await x(T);let g=k.getDelay(N);return await new Promise((x)=>setTimeout(x,g)),await lz(_,P_(V_({},$),{retryAttempt:N+1}))}}if($==null?void 0:$.throw)throw new RH(O.status,O.statusText,q?W:H);return{data:null,error:P_(V_({},W),{status:O.status,statusText:O.statusText})}};var aH=(_)=>{if(typeof process>"u")return;let $=_??"/api/auth";if(process.env.NEXT_PUBLIC_AUTH_URL)return process.env.NEXT_PUBLIC_AUTH_URL;if(typeof window>"u"){if(process.env.NEXTAUTH_URL)try{return process.env.NEXTAUTH_URL}catch{}if(process.env.VERCEL_URL)try{let b=process.env.VERCEL_URL.startsWith("http")?"":"https://";return`${new URL(`${b}${process.env.VERCEL_URL}`).origin}${$}`}catch{}}},O7=(_,$)=>{let b="credentials"in Request.prototype,Z=V7(_?.baseURL,_?.basePath,void 0,$)??aH(_?.basePath)??"/api/auth",z=_?.plugins?.flatMap((u)=>u.fetchPlugins).filter((u)=>u!==void 0)||[],A={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:_?.fetchOptions?.onSuccess,onError:_?.fetchOptions?.onError,onRequest:_?.fetchOptions?.onRequest,onResponse:_?.fetchOptions?.onResponse}},{onSuccess:J,onError:U,onRequest:G,onResponse:Y,...X}=_?.fetchOptions||{},Q=E7({baseURL:Z,...b?{credentials:"include"}:{},method:"GET",jsonParser(u){if(!u)return null;return fz(u,{strict:!1})},customFetchImpl:fetch,...X,plugins:[A,...X.plugins||[],..._?.disableDefaultFetchPlugins?[]:[g7],...z]}),{$sessionSignal:K,session:v,broadcastSessionUpdate:D}=k7(Q,_),w=_?.plugins||[],P={},E={$sessionSignal:K,session:v},B={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},C=[{signal:"$sessionSignal",matcher(u){return u==="/sign-out"||u==="/update-user"||u==="/update-session"||u==="/sign-up/email"||u==="/sign-in/email"||u==="/delete-user"||u==="/verify-email"||u==="/revoke-sessions"||u==="/revoke-session"||u==="/change-email"},callback(u){if(u==="/sign-out")D("signout");else if(u==="/update-user"||u==="/update-session")D("updateUser")}}];for(let u of w){if(u.getAtoms)Object.assign(E,u.getAtoms?.(Q));if(u.pathMethods)Object.assign(B,u.pathMethods);if(u.atomListeners)C.push(...u.atomListeners)}let f={notify:(u)=>{E[u].set(!E[u].get())},listen:(u,O)=>{E[u].subscribe(O)},atoms:E};for(let u of w)if(u.getActions)P=W7(u.getActions?.(Q,f,_)??{},P);return{get baseURL(){return Z},pluginsActions:P,pluginsAtoms:E,pluginPathMethods:B,atomListeners:C,$fetch:Q,$store:f}};function P7(_){return typeof _==="object"&&_!==null&&"get"in _&&typeof _.get==="function"&&"lc"in _&&typeof _.lc==="number"}function eH(_,$,b){let Z=$[_],{fetchOptions:z,query:A,...J}=b||{};if(Z)return Z;if(z?.method)return z.method;if(J&&Object.keys(J).length>0)return"POST";return"GET"}function j7(_,$,b,Z,z){function A(J=[]){return new Proxy(function(){},{get(U,G){if(typeof G!=="string")return;if(G==="then"||G==="catch"||G==="finally")return;let Y=[...J,G],X=_;for(let Q of Y)if(X&&typeof X==="object"&&Q in X)X=X[Q];else{X=void 0;break}if(typeof X==="function")return X;if(P7(X))return X;return A(Y)},apply:async(U,G,Y)=>{let X="/"+J.map((B)=>B.replace(/[A-Z]/g,(C)=>`-${C.toLowerCase()}`)).join("/"),Q=Y[0]||{},K=Y[1]||{},{query:v,fetchOptions:D,...w}=Q,P={...K,...D},E=eH(X,b,Q);return await $(X,{...P,body:E==="GET"?void 0:{...w,...P?.body||{}},query:v||P?.query,method:E,async onSuccess(B){if(await P?.onSuccess?.(B),!z||P.disableSignal)return;let C=z.filter((u)=>u.matcher(X));if(!C.length)return;let f=new Set;for(let u of C){let O=Z[u.signal];if(!O)return;if(f.has(u.signal))continue;f.add(u.signal);let T=O.get();setTimeout(()=>{O.set(!T)},10),u.callback?.(X)}}})}})}return A()}function S7(_){return _.charAt(0).toUpperCase()+_.slice(1)}function pz(_){let{pluginPathMethods:$,pluginsActions:b,pluginsAtoms:Z,$fetch:z,atomListeners:A,$store:J}=O7(_),U={};for(let[G,Y]of Object.entries(Z))U[`use${S7(G)}`]=Y;return j7({...b,...U,$fetch:z,$store:J},z,$,Z,A)}var R7=k0({FAILED_TO_CREATE_USER:"Failed to create user",USER_ALREADY_EXISTS:"User already exists.",USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:"User already exists. Use another email.",YOU_CANNOT_BAN_YOURSELF:"You cannot ban yourself",YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:"You are not allowed to change users role",YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:"You are not allowed to create users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:"You are not allowed to list users",YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:"You are not allowed to list users sessions",YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:"You are not allowed to ban users",YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:"You are not allowed to impersonate users",YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:"You are not allowed to revoke users sessions",YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:"You are not allowed to delete users",YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:"You are not allowed to set users password",BANNED_USER:"You have been banned from this application",YOU_ARE_NOT_ALLOWED_TO_GET_USER:"You are not allowed to get user",NO_DATA_TO_UPDATE:"No data to update",YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS:"You are not allowed to update users",YOU_CANNOT_REMOVE_YOURSELF:"You cannot remove yourself",YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE:"You are not allowed to set a non-existent role value",YOU_CANNOT_IMPERSONATE_ADMINS:"You cannot impersonate admins",INVALID_ROLE_TYPE:"Invalid role type"});function L7(_){return{authorize($,b="AND"){let Z=!1;for(let[z,A]of Object.entries($)){let J=_[z];if(!J)return{success:!1,error:`You are not allowed to access resource: ${z}`};if(Array.isArray(A))Z=A.every((U)=>J.includes(U));else if(typeof A==="object"){let U=A;if(U.connector==="OR")Z=U.actions.some((G)=>J.includes(G));else Z=U.actions.every((G)=>J.includes(G))}else throw new F4("Invalid access control request");if(Z&&b==="OR")return{success:Z};if(!Z&&b==="AND")return{success:!1,error:`unauthorized to access resource "${z}"`}}if(Z)return{success:Z};return{success:!1,error:"Not authorized"}},statements:_}}function J$(_){return{newRole($){return L7($)},statements:_}}var T7={user:["create","list","set-role","ban","impersonate","impersonate-admins","delete","set-password","get","update"],session:["list","revoke","delete"]},dz=J$(T7),y7=dz.newRole({user:["create","list","set-role","ban","impersonate","delete","set-password","get","update"],session:["list","revoke","delete"]}),C7=dz.newRole({user:[],session:[]});var f7=k0({INVALID_EMAIL_FORMAT:"Email was not generated in a valid format",FAILED_TO_CREATE_USER:"Failed to create user",COULD_NOT_CREATE_SESSION:"Could not create session",ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY:"Anonymous users cannot sign in again anonymously",FAILED_TO_DELETE_ANONYMOUS_USER:"Failed to delete anonymous user",USER_IS_NOT_ANONYMOUS:"User is not anonymous",DELETE_ANONYMOUS_USER_DISABLED:"Deleting anonymous users is disabled"});var iz=()=>{return{id:"device-authorization",$InferServerPlugin:{},pathMethods:{"/device/code":"POST","/device/token":"POST","/device":"GET","/device/approve":"POST","/device/deny":"POST"}}};var m7=k0({OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",TOO_MANY_ATTEMPTS:"Too many attempts"});var u7=k0({INVALID_OAUTH_CONFIGURATION:"Invalid OAuth configuration",TOKEN_URL_NOT_FOUND:"Invalid OAuth configuration. Token URL not found.",PROVIDER_CONFIG_NOT_FOUND:"No config found for provider",PROVIDER_ID_REQUIRED:"Provider ID is required",INVALID_OAUTH_CONFIG:"Invalid OAuth configuration.",SESSION_REQUIRED:"Session is required",ISSUER_MISMATCH:"OAuth issuer mismatch. The authorization server issuer does not match the expected value (RFC 9207).",ISSUER_MISSING:"OAuth issuer parameter missing. The authorization server did not include the required iss parameter (RFC 9207)."});var c7=k0({INVALID_SESSION_TOKEN:"Invalid session token"});var h7=k0({YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:"You are not allowed to create a new organization",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:"You have reached the maximum number of organizations",ORGANIZATION_ALREADY_EXISTS:"Organization already exists",ORGANIZATION_SLUG_ALREADY_TAKEN:"Organization slug already taken",ORGANIZATION_NOT_FOUND:"Organization not found",USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:"User is not a member of the organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:"You are not allowed to update this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:"You are not allowed to delete this organization",NO_ACTIVE_ORGANIZATION:"No active organization",USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:"User is already a member of this organization",MEMBER_NOT_FOUND:"Member not found",ROLE_NOT_FOUND:"Role not found",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:"You are not allowed to create a new team",TEAM_ALREADY_EXISTS:"Team already exists",TEAM_NOT_FOUND:"Team not found",YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:"You cannot leave the organization as the only owner",YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER:"You cannot leave the organization without an owner",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:"You are not allowed to delete this member",YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:"You are not allowed to invite users to this organization",USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:"User is already invited to this organization",INVITATION_NOT_FOUND:"Invitation not found",YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:"You are not the recipient of the invitation",EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION:"Email verification required before accepting or rejecting invitation",YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:"You are not allowed to cancel this invitation",INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:"Inviter is no longer a member of the organization",YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:"You are not allowed to invite a user with this role",FAILED_TO_RETRIEVE_INVITATION:"Failed to retrieve invitation",YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:"You have reached the maximum number of teams",UNABLE_TO_REMOVE_LAST_TEAM:"Unable to remove last team",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:"You are not allowed to update this member",ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:"Organization membership limit reached",YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to create teams in this organization",YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:"You are not allowed to delete teams in this organization",YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:"You are not allowed to update this team",YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:"You are not allowed to delete this team",INVITATION_LIMIT_REACHED:"Invitation limit reached",TEAM_MEMBER_LIMIT_REACHED:"Team member limit reached",USER_IS_NOT_A_MEMBER_OF_THE_TEAM:"User is not a member of the team",YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM:"You are not allowed to list the members of this team",YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM:"You do not have an active team",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER:"You are not allowed to create a new member",YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER:"You are not allowed to remove a team member",YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION:"You are not allowed to access this organization as an owner",YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION:"You are not a member of this organization",MISSING_AC_INSTANCE:"Dynamic Access Control requires a pre-defined ac instance on the server auth plugin. Read server logs for more information",YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE:"You must be in an organization to create a role",YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE:"You are not allowed to create a role",YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE:"You are not allowed to update a role",YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE:"You are not allowed to delete a role",YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE:"You are not allowed to read a role",YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE:"You are not allowed to list a role",YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE:"You are not allowed to get a role",TOO_MANY_ROLES:"This organization has too many roles",INVALID_RESOURCE:"The provided permission includes an invalid resource",ROLE_NAME_IS_ALREADY_TAKEN:"That role name is already taken",CANNOT_DELETE_A_PRE_DEFINED_ROLE:"Cannot delete a pre-defined role",ROLE_IS_ASSIGNED_TO_MEMBERS:"Cannot delete a role that is assigned to members. Please reassign the members to a different role first"});var r7={organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]},E2=J$(r7),n7=E2.newRole({organization:["update"],invitation:["create","cancel"],member:["create","update","delete"],team:["create","update","delete"],ac:["create","read","update","delete"]}),l7=E2.newRole({organization:["update","delete"],member:["create","update","delete"],invitation:["create","cancel"],team:["create","update","delete"],ac:["create","read","update","delete"]}),p7=E2.newRole({organization:[],member:[],invitation:[],team:[],ac:["read"]});var d7=k0({INVALID_PHONE_NUMBER:"Invalid phone number",PHONE_NUMBER_EXIST:"Phone number already exists",PHONE_NUMBER_NOT_EXIST:"phone number isn't registered",INVALID_PHONE_NUMBER_OR_PASSWORD:"Invalid phone number or password",UNEXPECTED_ERROR:"Unexpected error",OTP_NOT_FOUND:"OTP not found",OTP_EXPIRED:"OTP expired",INVALID_OTP:"Invalid OTP",PHONE_NUMBER_NOT_VERIFIED:"Phone number not verified",PHONE_NUMBER_CANNOT_BE_UPDATED:"Phone number cannot be updated",SEND_OTP_NOT_IMPLEMENTED:"sendOTP not implemented",TOO_MANY_ATTEMPTS:"Too many attempts"});var i7=k0({OTP_NOT_ENABLED:"OTP not enabled",OTP_HAS_EXPIRED:"OTP has expired",TOTP_NOT_ENABLED:"TOTP not enabled",TWO_FACTOR_NOT_ENABLED:"Two factor isn't enabled",BACKUP_CODES_NOT_ENABLED:"Backup codes aren't enabled",INVALID_BACKUP_CODE:"Invalid backup code",INVALID_CODE:"Invalid code",TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:"Too many attempts. Please request a new code.",INVALID_TWO_FACTOR_COOKIE:"Invalid two factor cookie"});var o7=k0({INVALID_USERNAME_OR_PASSWORD:"Invalid username or password",EMAIL_NOT_VERIFIED:"Email not verified",UNEXPECTED_ERROR:"Unexpected error",USERNAME_IS_ALREADY_TAKEN:"Username is already taken. Please try another.",USERNAME_TOO_SHORT:"Username is too short",USERNAME_TOO_LONG:"Username is too long",INVALID_USERNAME:"Username is invalid",INVALID_DISPLAY_USERNAME:"Display username is invalid"});function $q(_){let $=_.toLowerCase();return $==="localhost"||$.startsWith("localhost:")||$==="127.0.0.1"||$.startsWith("127.0.0.1:")||$==="[::1]"||$.startsWith("[::1]:")}function O2(_){let $=_.trim();if(!$)throw Error("Hostname is required.");let Z=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//.test($)?$:`${$q($)?"http":"https"}://${$}`,z;try{z=new URL(Z)}catch{throw Error(`Invalid hostname: ${_}`)}if(!z.hostname)throw Error(`Invalid hostname: ${_}`);if(z.pathname!=="/"||z.search||z.hash)throw Error("Hostname must not include a path, query, or fragment.");return{host:z.host.toLowerCase(),baseURL:`${z.protocol}//${z.host.toLowerCase()}`}}function P2(_){return pz({baseURL:_,plugins:[iz()]})}import{existsSync as kG,mkdirSync as Rq,readFileSync as Lq,writeFileSync as Tq}from"fs";import{homedir as yq}from"os";import{join as WG}from"path";import{existsSync as Mq,mkdirSync as Eq}from"fs";import{homedir as Oq}from"os";import{join as gG}from"path";var j2=BigInt(4294967295),a7=BigInt(32);function zq(_,$=!1){if($)return{h:Number(_&j2),l:Number(_>>a7&j2)};return{h:Number(_>>a7&j2)|0,l:Number(_&j2)|0}}function e7(_,$=!1){let b=_.length,Z=new Uint32Array(b),z=new Uint32Array(b);for(let A=0;A<b;A++){let{h:J,l:U}=zq(_[A],$);[Z[A],z[A]]=[J,U]}return[Z,z]}var t7=(_,$,b)=>_<<b|$>>>32-b,s7=(_,$,b)=>$<<b|_>>>32-b,_G=(_,$,b)=>$<<b-32|_>>>64-b,$G=(_,$,b)=>_<<b-32|$>>>64-b;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function bq(_){return _ instanceof Uint8Array||ArrayBuffer.isView(_)&&_.constructor.name==="Uint8Array"}function oz(_,$=""){if(!Number.isSafeInteger(_)||_<0){let b=$&&`"${$}" `;throw Error(`${b}expected integer >= 0, got ${_}`)}}function S2(_,$,b=""){let Z=bq(_),z=_?.length,A=$!==void 0;if(!Z||A&&z!==$){let J=b&&`"${b}" `,U=A?` of length ${$}`:"",G=Z?`length=${z}`:`type=${typeof _}`;throw Error(J+"expected Uint8Array"+U+", got "+G)}return _}function az(_,$=!0){if(_.destroyed)throw Error("Hash instance has been destroyed");if($&&_.finished)throw Error("Hash#digest() has already been called")}function zG(_,$){S2(_,void 0,"digestInto() output");let b=$.outputLen;if(_.length<b)throw Error('"digestInto() output" expected to be of length >='+b)}function bG(_){return new Uint32Array(_.buffer,_.byteOffset,Math.floor(_.byteLength/4))}function ez(..._){for(let $=0;$<_.length;$++)_[$].fill(0)}var Zq=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function Aq(_){return _<<24&4278190080|_<<8&16711680|_>>>8&65280|_>>>24&255}function Jq(_){for(let $=0;$<_.length;$++)_[$]=Aq(_[$]);return _}var tz=Zq?(_)=>_:Jq;function ZG(_,$={}){let b=(z,A)=>_(A).update(z).digest(),Z=_(void 0);return b.outputLen=Z.outputLen,b.blockLen=Z.blockLen,b.create=(z)=>_(z),Object.assign(b,$),Object.freeze(b)}var AG=(_)=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,_])});var Uq=BigInt(0),U$=BigInt(1),Gq=BigInt(2),Yq=BigInt(7),Xq=BigInt(256),Qq=BigInt(113),GG=[],YG=[],XG=[];for(let _=0,$=U$,b=1,Z=0;_<24;_++){[b,Z]=[Z,(2*b+3*Z)%5],GG.push(2*(5*Z+b)),YG.push((_+1)*(_+2)/2%64);let z=Uq;for(let A=0;A<7;A++)if($=($<<U$^($>>Yq)*Qq)%Xq,$&Gq)z^=U$<<(U$<<BigInt(A))-U$;XG.push(z)}var QG=e7(XG,!0),Kq=QG[0],Fq=QG[1],JG=(_,$,b)=>b>32?_G(_,$,b):t7(_,$,b),UG=(_,$,b)=>b>32?$G(_,$,b):s7(_,$,b);function vq(_,$=24){let b=new Uint32Array(10);for(let Z=24-$;Z<24;Z++){for(let J=0;J<10;J++)b[J]=_[J]^_[J+10]^_[J+20]^_[J+30]^_[J+40];for(let J=0;J<10;J+=2){let U=(J+8)%10,G=(J+2)%10,Y=b[G],X=b[G+1],Q=JG(Y,X,1)^b[U],K=UG(Y,X,1)^b[U+1];for(let v=0;v<50;v+=10)_[J+v]^=Q,_[J+v+1]^=K}let z=_[2],A=_[3];for(let J=0;J<24;J++){let U=YG[J],G=JG(z,A,U),Y=UG(z,A,U),X=GG[J];z=_[X],A=_[X+1],_[X]=G,_[X+1]=Y}for(let J=0;J<50;J+=10){for(let U=0;U<10;U++)b[U]=_[J+U];for(let U=0;U<10;U++)_[J+U]^=~b[(U+2)%10]&b[(U+4)%10]}_[0]^=Kq[Z],_[1]^=Fq[Z]}ez(b)}class sz{state;pos=0;posOut=0;finished=!1;state32;destroyed=!1;blockLen;suffix;outputLen;enableXOF=!1;rounds;constructor(_,$,b,Z=!1,z=24){if(this.blockLen=_,this.suffix=$,this.outputLen=b,this.enableXOF=Z,this.rounds=z,oz(b,"outputLen"),!(0<_&&_<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=bG(this.state)}clone(){return this._cloneInto()}keccak(){tz(this.state32),vq(this.state32,this.rounds),tz(this.state32),this.posOut=0,this.pos=0}update(_){az(this),S2(_);let{blockLen:$,state:b}=this,Z=_.length;for(let z=0;z<Z;){let A=Math.min($-this.pos,Z-z);for(let J=0;J<A;J++)b[this.pos++]^=_[z++];if(this.pos===$)this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:_,suffix:$,pos:b,blockLen:Z}=this;if(_[b]^=$,($&128)!==0&&b===Z-1)this.keccak();_[Z-1]^=128,this.keccak()}writeInto(_){az(this,!1),S2(_),this.finish();let $=this.state,{blockLen:b}=this;for(let Z=0,z=_.length;Z<z;){if(this.posOut>=b)this.keccak();let A=Math.min(b-this.posOut,z-Z);_.set($.subarray(this.posOut,this.posOut+A),Z),this.posOut+=A,Z+=A}return _}xofInto(_){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(_)}xof(_){return oz(_),this.xofInto(new Uint8Array(_))}digestInto(_){if(zG(_,this),this.finished)throw Error("digest() was already called");return this.writeInto(_),this.destroy(),_}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,ez(this.state)}_cloneInto(_){let{blockLen:$,suffix:b,outputLen:Z,rounds:z,enableXOF:A}=this;return _||=new sz($,b,Z,A,z),_.state32.set(this.state32),_.pos=this.pos,_.posOut=this.posOut,_.finished=this.finished,_.rounds=z,_.suffix=b,_.outputLen=Z,_.enableXOF=A,_.destroyed=this.destroyed,_}}var Hq=(_,$,b,Z={})=>ZG(()=>new sz($,_,b),Z);var KG=Hq(6,72,64,AG(10));var qq=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,_b=Math.ceil,Y_=Math.floor,h0="[BigNumber Error] ",FG=h0+"Number primitive has more than 15 significant digits: ",g_=100000000000000,o=14,$b=9007199254740991,zb=[1,10,100,1000,1e4,1e5,1e6,1e7,1e8,1e9,10000000000,100000000000,1000000000000,10000000000000],v4=1e7,I0=1e9;function vG(_){var $,b,Z,z=B.prototype={constructor:B,toString:null,valueOf:null},A=new B(1),J=20,U=4,G=-7,Y=21,X=-1e7,Q=1e7,K=!1,v=1,D=0,w={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},P="0123456789abcdefghijklmnopqrstuvwxyz",E=!0;function B(F,H){var q,W,V,k,N,g,x,j,S=this;if(!(S instanceof B))return new B(F,H);if(H==null){if(F&&F._isBigNumber===!0){if(S.s=F.s,!F.c||F.e>Q)S.c=S.e=null;else if(F.e<X)S.c=[S.e=0];else S.e=F.e,S.c=F.c.slice();return}if((g=typeof F=="number")&&F*0==0){if(S.s=1/F<0?(F=-F,-1):1,F===~~F){for(k=0,N=F;N>=10;N/=10,k++);if(k>Q)S.c=S.e=null;else S.e=k,S.c=[F];return}j=String(F)}else{if(!qq.test(j=String(F)))return Z(S,j,g);S.s=j.charCodeAt(0)==45?(j=j.slice(1),-1):1}if((k=j.indexOf("."))>-1)j=j.replace(".","");if((N=j.search(/e/i))>0){if(k<0)k=N;k+=+j.slice(N+1),j=j.substring(0,N)}else if(k<0)k=j.length}else{if(H0(H,2,P.length,"Base"),H==10&&E)return S=new B(F),O(S,J+S.e+1,U);if(j=String(F),g=typeof F=="number"){if(F*0!=0)return Z(S,j,g,H);if(S.s=1/F<0?(j=j.slice(1),-1):1,B.DEBUG&&j.replace(/^0\.0*|\./,"").length>15)throw Error(FG+F)}else S.s=j.charCodeAt(0)===45?(j=j.slice(1),-1):1;q=P.slice(0,H),k=N=0;for(x=j.length;N<x;N++)if(q.indexOf(W=j.charAt(N))<0){if(W=="."){if(N>k){k=x;continue}}else if(!V){if(j==j.toUpperCase()&&(j=j.toLowerCase())||j==j.toLowerCase()&&(j=j.toUpperCase())){V=!0,N=-1,k=0;continue}}return Z(S,String(F),g,H)}if(g=!1,j=b(j,H,10,S.s),(k=j.indexOf("."))>-1)j=j.replace(".","");else k=j.length}for(N=0;j.charCodeAt(N)===48;N++);for(x=j.length;j.charCodeAt(--x)===48;);if(j=j.slice(N,++x)){if(x-=N,g&&B.DEBUG&&x>15&&(F>$b||F!==Y_(F)))throw Error(FG+S.s*F);if((k=k-N-1)>Q)S.c=S.e=null;else if(k<X)S.c=[S.e=0];else{if(S.e=k,S.c=[],N=(k+1)%o,k<0)N+=o;if(N<x){if(N)S.c.push(+j.slice(0,N));for(x-=o;N<x;)S.c.push(+j.slice(N,N+=o));N=o-(j=j.slice(N)).length}else N-=x;for(;N--;j+="0");S.c.push(+j)}}else S.c=[S.e=0]}B.clone=vG,B.ROUND_UP=0,B.ROUND_DOWN=1,B.ROUND_CEIL=2,B.ROUND_FLOOR=3,B.ROUND_HALF_UP=4,B.ROUND_HALF_DOWN=5,B.ROUND_HALF_EVEN=6,B.ROUND_HALF_CEIL=7,B.ROUND_HALF_FLOOR=8,B.EUCLID=9,B.config=B.set=function(F){var H,q;if(F!=null)if(typeof F=="object"){if(F.hasOwnProperty(H="DECIMAL_PLACES"))q=F[H],H0(q,0,I0,H),J=q;if(F.hasOwnProperty(H="ROUNDING_MODE"))q=F[H],H0(q,0,8,H),U=q;if(F.hasOwnProperty(H="EXPONENTIAL_AT"))if(q=F[H],q&&q.pop)H0(q[0],-I0,0,H),H0(q[1],0,I0,H),G=q[0],Y=q[1];else H0(q,-I0,I0,H),G=-(Y=q<0?-q:q);if(F.hasOwnProperty(H="RANGE"))if(q=F[H],q&&q.pop)H0(q[0],-I0,-1,H),H0(q[1],1,I0,H),X=q[0],Q=q[1];else if(H0(q,-I0,I0,H),q)X=-(Q=q<0?-q:q);else throw Error(h0+H+" cannot be zero: "+q);if(F.hasOwnProperty(H="CRYPTO"))if(q=F[H],q===!!q)if(q)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))K=q;else throw K=!q,Error(h0+"crypto unavailable");else K=q;else throw Error(h0+H+" not true or false: "+q);if(F.hasOwnProperty(H="MODULO_MODE"))q=F[H],H0(q,0,9,H),v=q;if(F.hasOwnProperty(H="POW_PRECISION"))q=F[H],H0(q,0,I0,H),D=q;if(F.hasOwnProperty(H="FORMAT"))if(q=F[H],typeof q=="object")w=q;else throw Error(h0+H+" not an object: "+q);if(F.hasOwnProperty(H="ALPHABET"))if(q=F[H],typeof q=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(q))E=q.slice(0,10)=="0123456789",P=q;else throw Error(h0+H+" invalid: "+q)}else throw Error(h0+"Object expected: "+F);return{DECIMAL_PLACES:J,ROUNDING_MODE:U,EXPONENTIAL_AT:[G,Y],RANGE:[X,Q],CRYPTO:K,MODULO_MODE:v,POW_PRECISION:D,FORMAT:w,ALPHABET:P}},B.isBigNumber=function(F){if(!F||F._isBigNumber!==!0)return!1;if(!B.DEBUG)return!0;var H,q,W=F.c,V=F.e,k=F.s;_:if({}.toString.call(W)=="[object Array]"){if((k===1||k===-1)&&V>=-I0&&V<=I0&&V===Y_(V)){if(W[0]===0){if(V===0&&W.length===1)return!0;break _}if(H=(V+1)%o,H<1)H+=o;if(String(W[0]).length==H){for(H=0;H<W.length;H++)if(q=W[H],q<0||q>=g_||q!==Y_(q))break _;if(q!==0)return!0}}}else if(W===null&&V===null&&(k===null||k===1||k===-1))return!0;throw Error(h0+"Invalid BigNumber: "+F)},B.maximum=B.max=function(){return f(arguments,-1)},B.minimum=B.min=function(){return f(arguments,1)},B.random=function(){var F=9007199254740992,H=Math.random()*F&2097151?function(){return Y_(Math.random()*F)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(q){var W,V,k,N,g,x=0,j=[],S=new B(A);if(q==null)q=J;else H0(q,0,I0);if(N=_b(q/o),K)if(crypto.getRandomValues){W=crypto.getRandomValues(new Uint32Array(N*=2));for(;x<N;)if(g=W[x]*131072+(W[x+1]>>>11),g>=9000000000000000)V=crypto.getRandomValues(new Uint32Array(2)),W[x]=V[0],W[x+1]=V[1];else j.push(g%100000000000000),x+=2;x=N/2}else if(crypto.randomBytes){W=crypto.randomBytes(N*=7);for(;x<N;)if(g=(W[x]&31)*281474976710656+W[x+1]*1099511627776+W[x+2]*4294967296+W[x+3]*16777216+(W[x+4]<<16)+(W[x+5]<<8)+W[x+6],g>=9000000000000000)crypto.randomBytes(7).copy(W,x);else j.push(g%100000000000000),x+=7;x=N/7}else throw K=!1,Error(h0+"crypto unavailable");if(!K){for(;x<N;)if(g=H(),g<9000000000000000)j[x++]=g%100000000000000}if(N=j[--x],q%=o,N&&q)g=zb[o-q],j[x]=Y_(N/g)*g;for(;j[x]===0;j.pop(),x--);if(x<0)j=[k=0];else{for(k=-1;j[0]===0;j.splice(0,1),k-=o);for(x=1,g=j[0];g>=10;g/=10,x++);if(x<o)k-=o-x}return S.e=k,S.c=j,S}}(),B.sum=function(){var F=1,H=arguments,q=new B(H[0]);for(;F<H.length;)q=q.plus(H[F++]);return q},b=function(){var F="0123456789";function H(q,W,V,k){var N,g=[0],x,j=0,S=q.length;for(;j<S;){for(x=g.length;x--;g[x]*=W);g[0]+=k.indexOf(q.charAt(j++));for(N=0;N<g.length;N++)if(g[N]>V-1){if(g[N+1]==null)g[N+1]=0;g[N+1]+=g[N]/V|0,g[N]%=V}}return g.reverse()}return function(q,W,V,k,N){var g,x,j,S,y,l,p,b0,q0=q.indexOf("."),x0=J,$0=U;if(q0>=0)S=D,D=0,q=q.replace(".",""),b0=new B(W),l=b0.pow(q.length-q0),D=S,b0.c=H(e_(G_(l.c),l.e,"0"),10,V,F),b0.e=b0.c.length;p=H(q,W,V,N?(g=P,F):(g=F,P)),j=S=p.length;for(;p[--S]==0;p.pop());if(!p[0])return g.charAt(0);if(q0<0)--j;else l.c=p,l.e=j,l.s=k,l=$(l,b0,x0,$0,V),p=l.c,y=l.r,j=l.e;if(x=j+x0+1,q0=p[x],S=V/2,y=y||x<0||p[x+1]!=null,y=$0<4?(q0!=null||y)&&($0==0||$0==(l.s<0?3:2)):q0>S||q0==S&&($0==4||y||$0==6&&p[x-1]&1||$0==(l.s<0?8:7)),x<1||!p[0])q=y?e_(g.charAt(1),-x0,g.charAt(0)):g.charAt(0);else{if(p.length=x,y){for(--V;++p[--x]>V;)if(p[x]=0,!x)++j,p=[1].concat(p)}for(S=p.length;!p[--S];);for(q0=0,q="";q0<=S;q+=g.charAt(p[q0++]));q=e_(q,j,g.charAt(0))}return q}}(),$=function(){function F(W,V,k){var N,g,x,j,S=0,y=W.length,l=V%v4,p=V/v4|0;for(W=W.slice();y--;)x=W[y]%v4,j=W[y]/v4|0,N=p*x+j*l,g=l*x+N%v4*v4+S,S=(g/k|0)+(N/v4|0)+p*j,W[y]=g%k;if(S)W=[S].concat(W);return W}function H(W,V,k,N){var g,x;if(k!=N)x=k>N?1:-1;else for(g=x=0;g<k;g++)if(W[g]!=V[g]){x=W[g]>V[g]?1:-1;break}return x}function q(W,V,k,N){var g=0;for(;k--;)W[k]-=g,g=W[k]<V[k]?1:0,W[k]=g*N+W[k]-V[k];for(;!W[0]&&W.length>1;W.splice(0,1));}return function(W,V,k,N,g){var x,j,S,y,l,p,b0,q0,x0,$0,Y0,P0,Y2,zz,bz,I_,a9,J_=W.s==V.s?1:-1,L0=W.c,D0=V.c;if(!L0||!L0[0]||!D0||!D0[0])return new B(!W.s||!V.s||(L0?D0&&L0[0]==D0[0]:!D0)?NaN:L0&&L0[0]==0||!D0?J_*0:J_/0);if(q0=new B(J_),x0=q0.c=[],j=W.e-V.e,J_=k+j+1,!g)g=g_,j=X_(W.e/o)-X_(V.e/o),J_=J_/o|0;for(S=0;D0[S]==(L0[S]||0);S++);if(D0[S]>(L0[S]||0))j--;if(J_<0)x0.push(1),y=!0;else{if(zz=L0.length,I_=D0.length,S=0,J_+=2,l=Y_(g/(D0[0]+1)),l>1)D0=F(D0,l,g),L0=F(L0,l,g),I_=D0.length,zz=L0.length;Y2=I_,$0=L0.slice(0,I_),Y0=$0.length;for(;Y0<I_;$0[Y0++]=0);if(a9=D0.slice(),a9=[0].concat(a9),bz=D0[0],D0[1]>=g/2)bz++;do{if(l=0,x=H(D0,$0,I_,Y0),x<0){if(P0=$0[0],I_!=Y0)P0=P0*g+($0[1]||0);if(l=Y_(P0/bz),l>1){if(l>=g)l=g-1;p=F(D0,l,g),b0=p.length,Y0=$0.length;while(H(p,$0,b0,Y0)==1)l--,q(p,I_<b0?a9:D0,b0,g),b0=p.length,x=1}else{if(l==0)x=l=1;p=D0.slice(),b0=p.length}if(b0<Y0)p=[0].concat(p);if(q($0,p,Y0,g),Y0=$0.length,x==-1)while(H(D0,$0,I_,Y0)<1)l++,q($0,I_<Y0?a9:D0,Y0,g),Y0=$0.length}else if(x===0)l++,$0=[0];if(x0[S++]=l,$0[0])$0[Y0++]=L0[Y2]||0;else $0=[L0[Y2]],Y0=1}while((Y2++<zz||$0[0]!=null)&&J_--);if(y=$0[0]!=null,!x0[0])x0.splice(0,1)}if(g==g_){for(S=1,J_=x0[0];J_>=10;J_/=10,S++);O(q0,k+(q0.e=S+j*o-1)+1,N,y)}else q0.e=j,q0.r=+y;return q0}}();function C(F,H,q,W){var V,k,N,g,x;if(q==null)q=U;else H0(q,0,8);if(!F.c)return F.toString();if(V=F.c[0],N=F.e,H==null)x=G_(F.c),x=W==1||W==2&&(N<=G||N>=Y)?L2(x,N):e_(x,N,"0");else if(F=O(new B(F),H,q),k=F.e,x=G_(F.c),g=x.length,W==1||W==2&&(H<=k||k<=G)){for(;g<H;x+="0",g++);x=L2(x,k)}else if(H-=N+(W===2&&k>N),x=e_(x,k,"0"),k+1>g){if(--H>0)for(x+=".";H--;x+="0");}else if(H+=k-g,H>0){if(k+1==g)x+=".";for(;H--;x+="0");}return F.s<0&&V?"-"+x:x}function f(F,H){var q,W,V=1,k=new B(F[0]);for(;V<F.length;V++)if(W=new B(F[V]),!W.s||(q=L4(k,W))===H||q===0&&k.s===H)k=W;return k}function u(F,H,q){var W=1,V=H.length;for(;!H[--V];H.pop());for(V=H[0];V>=10;V/=10,W++);if((q=W+q*o-1)>Q)F.c=F.e=null;else if(q<X)F.c=[F.e=0];else F.e=q,F.c=H;return F}Z=function(){var F=/^(-?)0([xbo])(?=\w[\w.]*$)/i,H=/^([^.]+)\.$/,q=/^\.([^.]+)$/,W=/^-?(Infinity|NaN)$/,V=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(k,N,g,x){var j,S=g?N:N.replace(V,"");if(W.test(S))k.s=isNaN(S)?null:S<0?-1:1;else{if(!g){if(S=S.replace(F,function(y,l,p){return j=(p=p.toLowerCase())=="x"?16:p=="b"?2:8,!x||x==j?l:y}),x)j=x,S=S.replace(H,"$1").replace(q,"0.$1");if(N!=S)return new B(S,j)}if(B.DEBUG)throw Error(h0+"Not a"+(x?" base "+x:"")+" number: "+N);k.s=null}k.c=k.e=null}}();function O(F,H,q,W){var V,k,N,g,x,j,S,y=F.c,l=zb;if(y){_:{for(V=1,g=y[0];g>=10;g/=10,V++);if(k=H-V,k<0)k+=o,N=H,x=y[j=0],S=Y_(x/l[V-N-1]%10);else if(j=_b((k+1)/o),j>=y.length)if(W){for(;y.length<=j;y.push(0));x=S=0,V=1,k%=o,N=k-o+1}else break _;else{x=g=y[j];for(V=1;g>=10;g/=10,V++);k%=o,N=k-o+V,S=N<0?0:Y_(x/l[V-N-1]%10)}if(W=W||H<0||y[j+1]!=null||(N<0?x:x%l[V-N-1]),W=q<4?(S||W)&&(q==0||q==(F.s<0?3:2)):S>5||S==5&&(q==4||W||q==6&&(k>0?N>0?x/l[V-N]:0:y[j-1])%10&1||q==(F.s<0?8:7)),H<1||!y[0]){if(y.length=0,W)H-=F.e+1,y[0]=l[(o-H%o)%o],F.e=-H||0;else y[0]=F.e=0;return F}if(k==0)y.length=j,g=1,j--;else y.length=j+1,g=l[o-k],y[j]=N>0?Y_(x/l[V-N]%l[N])*g:0;if(W)for(;;)if(j==0){for(k=1,N=y[0];N>=10;N/=10,k++);N=y[0]+=g;for(g=1;N>=10;N/=10,g++);if(k!=g){if(F.e++,y[0]==g_)y[0]=1}break}else{if(y[j]+=g,y[j]!=g_)break;y[j--]=0,g=1}for(k=y.length;y[--k]===0;y.pop());}if(F.e>Q)F.c=F.e=null;else if(F.e<X)F.c=[F.e=0]}return F}function T(F){var H,q=F.e;if(q===null)return F.toString();return H=G_(F.c),H=q<=G||q>=Y?L2(H,q):e_(H,q,"0"),F.s<0?"-"+H:H}if(z.absoluteValue=z.abs=function(){var F=new B(this);if(F.s<0)F.s=1;return F},z.comparedTo=function(F,H){return L4(this,new B(F,H))},z.decimalPlaces=z.dp=function(F,H){var q,W,V,k=this;if(F!=null){if(H0(F,0,I0),H==null)H=U;else H0(H,0,8);return O(new B(k),F+k.e+1,H)}if(!(q=k.c))return null;if(W=((V=q.length-1)-X_(this.e/o))*o,V=q[V])for(;V%10==0;V/=10,W--);if(W<0)W=0;return W},z.dividedBy=z.div=function(F,H){return $(this,new B(F,H),J,U)},z.dividedToIntegerBy=z.idiv=function(F,H){return $(this,new B(F,H),0,1)},z.exponentiatedBy=z.pow=function(F,H){var q,W,V,k,N,g,x,j,S,y=this;if(F=new B(F),F.c&&!F.isInteger())throw Error(h0+"Exponent not an integer: "+T(F));if(H!=null)H=new B(H);if(g=F.e>14,!y.c||!y.c[0]||y.c[0]==1&&!y.e&&y.c.length==1||!F.c||!F.c[0])return S=new B(Math.pow(+T(y),g?F.s*(2-R2(F)):+T(F))),H?S.mod(H):S;if(x=F.s<0,H){if(H.c?!H.c[0]:!H.s)return new B(NaN);if(W=!x&&y.isInteger()&&H.isInteger(),W)y=y.mod(H)}else if(F.e>9&&(y.e>0||y.e<-1||(y.e==0?y.c[0]>1||g&&y.c[1]>=240000000:y.c[0]<80000000000000||g&&y.c[0]<=99999750000000))){if(k=y.s<0&&R2(F)?-0:0,y.e>-1)k=1/k;return new B(x?1/k:k)}else if(D)k=_b(D/o+2);if(g){if(q=new B(0.5),x)F.s=1;j=R2(F)}else V=Math.abs(+T(F)),j=V%2;S=new B(A);for(;;){if(j){if(S=S.times(y),!S.c)break;if(k){if(S.c.length>k)S.c.length=k}else if(W)S=S.mod(H)}if(V){if(V=Y_(V/2),V===0)break;j=V%2}else if(F=F.times(q),O(F,F.e+1,1),F.e>14)j=R2(F);else{if(V=+T(F),V===0)break;j=V%2}if(y=y.times(y),k){if(y.c&&y.c.length>k)y.c.length=k}else if(W)y=y.mod(H)}if(W)return S;if(x)S=A.div(S);return H?S.mod(H):k?O(S,D,U,N):S},z.integerValue=function(F){var H=new B(this);if(F==null)F=U;else H0(F,0,8);return O(H,H.e+1,F)},z.isEqualTo=z.eq=function(F,H){return L4(this,new B(F,H))===0},z.isFinite=function(){return!!this.c},z.isGreaterThan=z.gt=function(F,H){return L4(this,new B(F,H))>0},z.isGreaterThanOrEqualTo=z.gte=function(F,H){return(H=L4(this,new B(F,H)))===1||H===0},z.isInteger=function(){return!!this.c&&X_(this.e/o)>this.c.length-2},z.isLessThan=z.lt=function(F,H){return L4(this,new B(F,H))<0},z.isLessThanOrEqualTo=z.lte=function(F,H){return(H=L4(this,new B(F,H)))===-1||H===0},z.isNaN=function(){return!this.s},z.isNegative=function(){return this.s<0},z.isPositive=function(){return this.s>0},z.isZero=function(){return!!this.c&&this.c[0]==0},z.minus=function(F,H){var q,W,V,k,N=this,g=N.s;if(F=new B(F,H),H=F.s,!g||!H)return new B(NaN);if(g!=H)return F.s=-H,N.plus(F);var x=N.e/o,j=F.e/o,S=N.c,y=F.c;if(!x||!j){if(!S||!y)return S?(F.s=-H,F):new B(y?N:NaN);if(!S[0]||!y[0])return y[0]?(F.s=-H,F):new B(S[0]?N:U==3?-0:0)}if(x=X_(x),j=X_(j),S=S.slice(),g=x-j){if(k=g<0)g=-g,V=S;else j=x,V=y;V.reverse();for(H=g;H--;V.push(0));V.reverse()}else{W=(k=(g=S.length)<(H=y.length))?g:H;for(g=H=0;H<W;H++)if(S[H]!=y[H]){k=S[H]<y[H];break}}if(k)V=S,S=y,y=V,F.s=-F.s;if(H=(W=y.length)-(q=S.length),H>0)for(;H--;S[q++]=0);H=g_-1;for(;W>g;){if(S[--W]<y[W]){for(q=W;q&&!S[--q];S[q]=H);--S[q],S[W]+=g_}S[W]-=y[W]}for(;S[0]==0;S.splice(0,1),--j);if(!S[0])return F.s=U==3?-1:1,F.c=[F.e=0],F;return u(F,S,j)},z.modulo=z.mod=function(F,H){var q,W,V=this;if(F=new B(F,H),!V.c||!F.s||F.c&&!F.c[0])return new B(NaN);else if(!F.c||V.c&&!V.c[0])return new B(V);if(v==9)W=F.s,F.s=1,q=$(V,F,0,3),F.s=W,q.s*=W;else q=$(V,F,0,v);if(F=V.minus(q.times(F)),!F.c[0]&&v==1)F.s=V.s;return F},z.multipliedBy=z.times=function(F,H){var q,W,V,k,N,g,x,j,S,y,l,p,b0,q0,x0,$0=this,Y0=$0.c,P0=(F=new B(F,H)).c;if(!Y0||!P0||!Y0[0]||!P0[0]){if(!$0.s||!F.s||Y0&&!Y0[0]&&!P0||P0&&!P0[0]&&!Y0)F.c=F.e=F.s=null;else if(F.s*=$0.s,!Y0||!P0)F.c=F.e=null;else F.c=[0],F.e=0;return F}if(W=X_($0.e/o)+X_(F.e/o),F.s*=$0.s,x=Y0.length,y=P0.length,x<y)b0=Y0,Y0=P0,P0=b0,V=x,x=y,y=V;for(V=x+y,b0=[];V--;b0.push(0));q0=g_,x0=v4;for(V=y;--V>=0;){q=0,l=P0[V]%x0,p=P0[V]/x0|0;for(N=x,k=V+N;k>V;)j=Y0[--N]%x0,S=Y0[N]/x0|0,g=p*j+S*l,j=l*j+g%x0*x0+b0[k]+q,q=(j/q0|0)+(g/x0|0)+p*S,b0[k--]=j%q0;b0[k]=q}if(q)++W;else b0.splice(0,1);return u(F,b0,W)},z.negated=function(){var F=new B(this);return F.s=-F.s||null,F},z.plus=function(F,H){var q,W=this,V=W.s;if(F=new B(F,H),H=F.s,!V||!H)return new B(NaN);if(V!=H)return F.s=-H,W.minus(F);var k=W.e/o,N=F.e/o,g=W.c,x=F.c;if(!k||!N){if(!g||!x)return new B(V/0);if(!g[0]||!x[0])return x[0]?F:new B(g[0]?W:V*0)}if(k=X_(k),N=X_(N),g=g.slice(),V=k-N){if(V>0)N=k,q=x;else V=-V,q=g;q.reverse();for(;V--;q.push(0));q.reverse()}if(V=g.length,H=x.length,V-H<0)q=x,x=g,g=q,H=V;for(V=0;H;)V=(g[--H]=g[H]+x[H]+V)/g_|0,g[H]=g_===g[H]?0:g[H]%g_;if(V)g=[V].concat(g),++N;return u(F,g,N)},z.precision=z.sd=function(F,H){var q,W,V,k=this;if(F!=null&&F!==!!F){if(H0(F,1,I0),H==null)H=U;else H0(H,0,8);return O(new B(k),F,H)}if(!(q=k.c))return null;if(V=q.length-1,W=V*o+1,V=q[V]){for(;V%10==0;V/=10,W--);for(V=q[0];V>=10;V/=10,W++);}if(F&&k.e+1>W)W=k.e+1;return W},z.shiftedBy=function(F){return H0(F,-$b,$b),this.times("1e"+F)},z.squareRoot=z.sqrt=function(){var F,H,q,W,V,k=this,N=k.c,g=k.s,x=k.e,j=J+4,S=new B("0.5");if(g!==1||!N||!N[0])return new B(!g||g<0&&(!N||N[0])?NaN:N?k:1/0);if(g=Math.sqrt(+T(k)),g==0||g==1/0){if(H=G_(N),(H.length+x)%2==0)H+="0";if(g=Math.sqrt(+H),x=X_((x+1)/2)-(x<0||x%2),g==1/0)H="5e"+x;else H=g.toExponential(),H=H.slice(0,H.indexOf("e")+1)+x;q=new B(H)}else q=new B(g+"");if(q.c[0]){if(x=q.e,g=x+j,g<3)g=0;for(;;)if(V=q,q=S.times(V.plus($(k,V,j,1))),G_(V.c).slice(0,g)===(H=G_(q.c)).slice(0,g)){if(q.e<x)--g;if(H=H.slice(g-3,g+1),H=="9999"||!W&&H=="4999"){if(!W){if(O(V,V.e+J+2,0),V.times(V).eq(k)){q=V;break}}j+=4,g+=4,W=1}else{if(!+H||!+H.slice(1)&&H.charAt(0)=="5")O(q,q.e+J+2,1),F=!q.times(q).eq(k);break}}}return O(q,q.e+J+1,U,F)},z.toExponential=function(F,H){if(F!=null)H0(F,0,I0),F++;return C(this,F,H,1)},z.toFixed=function(F,H){if(F!=null)H0(F,0,I0),F=F+this.e+1;return C(this,F,H)},z.toFormat=function(F,H,q){var W,V=this;if(q==null)if(F!=null&&H&&typeof H=="object")q=H,H=null;else if(F&&typeof F=="object")q=F,F=H=null;else q=w;else if(typeof q!="object")throw Error(h0+"Argument not an object: "+q);if(W=V.toFixed(F,H),V.c){var k,N=W.split("."),g=+q.groupSize,x=+q.secondaryGroupSize,j=q.groupSeparator||"",S=N[0],y=N[1],l=V.s<0,p=l?S.slice(1):S,b0=p.length;if(x)k=g,g=x,x=k,b0-=k;if(g>0&&b0>0){k=b0%g||g,S=p.substr(0,k);for(;k<b0;k+=g)S+=j+p.substr(k,g);if(x>0)S+=j+p.slice(k);if(l)S="-"+S}W=y?S+(q.decimalSeparator||"")+((x=+q.fractionGroupSize)?y.replace(new RegExp("\\d{"+x+"}\\B","g"),"$&"+(q.fractionGroupSeparator||"")):y):S}return(q.prefix||"")+W+(q.suffix||"")},z.toFraction=function(F){var H,q,W,V,k,N,g,x,j,S,y,l,p=this,b0=p.c;if(F!=null){if(g=new B(F),!g.isInteger()&&(g.c||g.s!==1)||g.lt(A))throw Error(h0+"Argument "+(g.isInteger()?"out of range: ":"not an integer: ")+T(g))}if(!b0)return new B(p);H=new B(A),j=q=new B(A),W=x=new B(A),l=G_(b0),k=H.e=l.length-p.e-1,H.c[0]=zb[(N=k%o)<0?o+N:N],F=!F||g.comparedTo(H)>0?k>0?H:j:g,N=Q,Q=1/0,g=new B(l),x.c[0]=0;for(;;){if(S=$(g,H,0,1),V=q.plus(S.times(W)),V.comparedTo(F)==1)break;q=W,W=V,j=x.plus(S.times(V=j)),x=V,H=g.minus(S.times(V=H)),g=V}return V=$(F.minus(q),W,0,1),x=x.plus(V.times(j)),q=q.plus(V.times(W)),x.s=j.s=p.s,k=k*2,y=$(j,W,k,U).minus(p).abs().comparedTo($(x,q,k,U).minus(p).abs())<1?[j,W]:[x,q],Q=N,y},z.toNumber=function(){return+T(this)},z.toPrecision=function(F,H){if(F!=null)H0(F,1,I0);return C(this,F,H,2)},z.toString=function(F){var H,q=this,W=q.s,V=q.e;if(V===null)if(W){if(H="Infinity",W<0)H="-"+H}else H="NaN";else{if(F==null)H=V<=G||V>=Y?L2(G_(q.c),V):e_(G_(q.c),V,"0");else if(F===10&&E)q=O(new B(q),J+V+1,U),H=e_(G_(q.c),q.e,"0");else H0(F,2,P.length,"Base"),H=b(e_(G_(q.c),V,"0"),10,F,W,!0);if(W<0&&q.c[0])H="-"+H}return H},z.valueOf=z.toJSON=function(){return T(this)},z._isBigNumber=!0,z[Symbol.toStringTag]="BigNumber",z[Symbol.for("nodejs.util.inspect.custom")]=z.valueOf,_!=null)B.set(_);return B}function X_(_){var $=_|0;return _>0||_===$?$:$-1}function G_(_){var $,b,Z=1,z=_.length,A=_[0]+"";for(;Z<z;){$=_[Z++]+"",b=o-$.length;for(;b--;$="0"+$);A+=$}for(z=A.length;A.charCodeAt(--z)===48;);return A.slice(0,z+1||1)}function L4(_,$){var b,Z,z=_.c,A=$.c,J=_.s,U=$.s,G=_.e,Y=$.e;if(!J||!U)return null;if(b=z&&!z[0],Z=A&&!A[0],b||Z)return b?Z?0:-U:J;if(J!=U)return J;if(b=J<0,Z=G==Y,!z||!A)return Z?0:!z^b?1:-1;if(!Z)return G>Y^b?1:-1;U=(G=z.length)<(Y=A.length)?G:Y;for(J=0;J<U;J++)if(z[J]!=A[J])return z[J]>A[J]^b?1:-1;return G==Y?0:G>Y^b?1:-1}function H0(_,$,b,Z){if(_<$||_>b||_!==Y_(_))throw Error(h0+(Z||"Argument")+(typeof _=="number"?_<$||_>b?" out of range: ":" not an integer: ":" not a primitive number: ")+String(_))}function R2(_){var $=_.c.length-1;return X_(_.e/o)==$&&_.c[$]%2!=0}function L2(_,$){return(_.length>1?_.charAt(0)+"."+_.slice(1):_)+($<0?"e":"e+")+$}function e_(_,$,b){var Z,z;if($<0){for(z=b+".";++$;z+=b);_=z+_}else if(Z=_.length,++$>Z){for(z=b,$-=Z;--$;z+=b);_+=z}else if($<Z)_=_.slice(0,$)+"."+_.slice($);return _}var Dq=vG(),HG=Dq;var Vq=24,G$=32,gq=()=>{if(typeof globalThis<"u"&&globalThis.crypto&&typeof globalThis.crypto.getRandomValues==="function")return()=>{let _=new Uint32Array(1);return globalThis.crypto.getRandomValues(_),_[0]/4294967296};return Math.random},Zb=gq(),bb=(_=4,$=Zb)=>{let b="";while(b.length<_)b=b+Math.floor($()*36).toString(36);return b};function kq(_){let $=new HG(0);for(let b of _.values())$=$.multipliedBy(256).plus(b);return $}var DG=(_="")=>{return kq(KG(new TextEncoder().encode(_))).toString(36).slice(1)},qG=Array.from({length:26},(_,$)=>String.fromCharCode($+97)),Wq=(_)=>qG[Math.floor(_()*qG.length)],wq=({globalObj:_=typeof global<"u"?global:typeof window<"u"?window:{},random:$=Zb}={})=>{let b=Object.keys(_).toString(),Z=b.length?b+bb(G$,$):bb(G$,$);return DG(Z).substring(0,G$)},Bq=(_)=>()=>{return _++},xq=476782367,T2=({random:_=Zb,counter:$=Bq(Math.floor(_()*xq)),length:b=Vq,fingerprint:Z=wq({random:_})}={})=>{if(b>G$)throw Error(`Length must be between 2 and ${G$}. Received: ${b}`);return function(){let A=Wq(_),J=Date.now().toString(36),U=$().toString(36),G=bb(b,_),Y=`${J+G+U+Z}`;return`${A+DG(Y).substring(1,b)}`}},Nq=Iq(T2);function Iq(_){let $;return()=>{if(!$)$=_();return $()}}var Jb=gG(Oq(),".config","agentlogs"),VG=gG(Jb,"local.db"),Pq=typeof globalThis.Bun<"u",A9=null,Ab=null;function jq(){if(!Ab)Ab=T2();return Ab}function Sq(){if(!Mq(Jb))Eq(Jb,{recursive:!0})}async function y2(){if(A9)return A9;if(Sq(),Pq){let{Database:_}=await import("bun:sqlite"),$=new _(VG);A9={exec:(b)=>$.run(b),get:(b,...Z)=>$.query(b).get(...Z),run:(b,...Z)=>$.run(b,Z),all:(b,...Z)=>$.query(b).all(...Z)}}else{let{default:_}=await import("libsql"),$=new _(VG);A9={exec:(b)=>$.exec(b),get:(b,...Z)=>$.prepare(b).get(...Z),run:(b,...Z)=>$.prepare(b).run(...Z),all:(b,...Z)=>$.prepare(b).all(...Z)}}return A9.exec(`
40
40
  CREATE TABLE IF NOT EXISTS kv (
41
41
  key TEXT PRIMARY KEY,
42
42
  value TEXT NOT NULL
43
43
  )
44
- `),A9}function d_(){return{async get(_,$){let Z=(await C2()).get("SELECT value FROM kv WHERE key = ?",_);if(!Z)return $;try{return JSON.parse(Z.value)}catch{return $}},async set(_,$){let b=await C2(),Z=JSON.stringify($);b.run("INSERT OR REPLACE INTO kv (key, value) VALUES (?, ?)",_,Z)},async delete(_){(await C2()).run("DELETE FROM kv WHERE key = ?",_)},async keys(_){let $=await C2();if(_)return $.all("SELECT key FROM kv WHERE key LIKE ?",`${_}%`).map((z)=>z.key);return $.all("SELECT key FROM kv").map((Z)=>Z.key)}}}async function X_(_){let $=d_(),b=`transcript.${_}.id`,Z=await $.get(b);if(Z)return Z;let z=Nq()();return await $.set(b,z),z}async function bb(_,$){let b=d_(),Z=`transcript.${_}.id`;await b.set(Z,$)}async function X$(_,$){let b=d_(),Z=`call.${_}.transcriptId`;await b.set(Z,$)}async function Q$(_){let $=d_(),b=`call.${_}.transcriptId`;return $.get(b)}async function K$(_){let $=d_(),b=`call.${_}.transcriptId`;await $.delete(b)}var Zb=VG(Pq(),".config","agentlogs"),Ab=VG(Zb,"config.json");function DG(){if(!qG(Zb))Mq(Zb,{recursive:!0})}function Jb(){if(DG(),!qG(Ab))return{environments:[]};try{let _=Eq(Ab,"utf-8"),$=JSON.parse(_);return{environments:Array.isArray($.environments)?$.environments:[]}}catch{return{environments:[]}}}function kG(_){DG();try{Oq(Ab,JSON.stringify(_,null,2),"utf-8")}catch($){throw console.error("Failed to write config file:",$),$}}function J9(){return Jb().environments}function f2(_){return J9().find(($)=>$.name===_)}function Ub(_){return`auth.token.${_}`}async function Gb(_){let $=process.env.AGENTLOGS_AUTH_TOKEN?.trim();if($)return $;try{if(!f2(_)?.user?.email)return null;return await d_().get(Ub(_))??null}catch{return null}}async function Yb(_,$,b){try{await d_().set(Ub(_),b)}catch(Z){throw console.error("Failed to store token:",Z),Z}}async function WG(_){try{await d_().delete(Ub(_))}catch{}}function Xb(_){let $=Jb(),b=$.environments.findIndex((Z)=>Z.name===_.name);if(b>=0)$.environments[b]=_;else $.environments.push(_);kG($)}function gG(_){let $=Jb();$.environments=$.environments.filter((b)=>b.name!==_),kG($)}function jq(_){try{return new URL(_).host.toLowerCase()}catch{return"custom"}}async function k_(){let _=J9(),$=[];for(let b of _){let Z=await Gb(b.name);if(Z)$.push({...b,token:Z})}if($.length===0){let b=process.env.AGENTLOGS_AUTH_TOKEN?.trim();if(b){let Z=process.env.AGENTLOGS_SERVER_URL?.trim()||"https://agentlogs.ai"?.trim()||"https://agentlogs.ai";$.push({name:jq(Z),baseURL:Z,user:{id:"ci",email:"ci@agentlogs.ai",name:"CI"},lastLoginTime:new Date().toISOString(),token:b})}}return $}async function BG(_){try{let{host:$,baseURL:b}=P2(_.hostname);if(_.token){console.log("\uD83D\uDD10 Token exchange..."),console.log(`\uD83C\uDF10 Server: ${b}`);let v=await fetch(`${b}/api/auth/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:_.token})}),V=await v.text();if(!v.ok){let B=V;try{let T=JSON.parse(V);B=T.error??T.message??V}catch{if(B=`HTTP ${v.status} ${v.statusText}`,V&&V.length<200)B+=`: ${V}`}console.error("❌ Token exchange failed:",B),process.exit(1)}let w;try{w=JSON.parse(V)}catch{console.error("❌ Token exchange failed: server returned unexpected response (not JSON)"),console.error(" Response:",V.slice(0,200)),process.exit(1)}let{token:P,user:O}=w;await Yb($,O.email,P),Xb({name:$,baseURL:b,user:{id:O.id,email:O.email,name:O.name},lastLoginTime:new Date().toISOString()}),console.log(`✅ Logged in as ${O.name} (${O.email})`),console.log(`\uD83C\uDF10 Environment: ${$}`),process.exit(0)}console.log("\uD83D\uDD10 AgentLogs Device Authorization"),console.log(`\uD83C\uDF10 Server: ${b}`),console.log("⏳ Requesting device authorization...");let Z=j2(b),{data:z,error:A}=await Z.device.code({client_id:"agentlogs-cli",scope:"openid profile email"});if(A||!z)console.error("❌ Error:",A?.error_description||"Failed to request device code"),process.exit(1);let{device_code:J,user_code:U,verification_uri:G,verification_uri_complete:Y,interval:X=5}=z;console.log(`
44
+ `),A9}function t_(){return{async get(_,$){let Z=(await y2()).get("SELECT value FROM kv WHERE key = ?",_);if(!Z)return $;try{return JSON.parse(Z.value)}catch{return $}},async set(_,$){let b=await y2(),Z=JSON.stringify($);b.run("INSERT OR REPLACE INTO kv (key, value) VALUES (?, ?)",_,Z)},async delete(_){(await y2()).run("DELETE FROM kv WHERE key = ?",_)},async keys(_){let $=await y2();if(_)return $.all("SELECT key FROM kv WHERE key LIKE ?",`${_}%`).map((z)=>z.key);return $.all("SELECT key FROM kv").map((Z)=>Z.key)}}}async function r0(_){let $=t_(),b=`transcript.${_}.id`,Z=await $.get(b);if(Z)return Z;let z=jq()();return await $.set(b,z),z}async function Ub(_,$){let b=t_(),Z=`transcript.${_}.id`;await b.set(Z,$)}async function Y$(_,$){let b=t_(),Z=`call.${_}.transcriptId`;await b.set(Z,$)}async function X$(_){let $=t_(),b=`call.${_}.transcriptId`;return $.get(b)}async function Q$(_){let $=t_(),b=`call.${_}.transcriptId`;await $.delete(b)}var Gb=WG(yq(),".config","agentlogs"),Yb=WG(Gb,"config.json");function wG(){if(!kG(Gb))Rq(Gb,{recursive:!0})}function Xb(){if(wG(),!kG(Yb))return{environments:[]};try{let _=Lq(Yb,"utf-8"),$=JSON.parse(_);return{environments:Array.isArray($.environments)?$.environments:[]}}catch{return{environments:[]}}}function BG(_){wG();try{Tq(Yb,JSON.stringify(_,null,2),"utf-8")}catch($){throw console.error("Failed to write config file:",$),$}}function J9(){return Xb().environments}function C2(_){return J9().find(($)=>$.name===_)}function Qb(_){return`auth.token.${_}`}async function Kb(_){let $=process.env.AGENTLOGS_AUTH_TOKEN?.trim();if($)return $;try{if(!C2(_)?.user?.email)return null;return await t_().get(Qb(_))??null}catch{return null}}async function Fb(_,$,b){try{await t_().set(Qb(_),b)}catch(Z){throw console.error("Failed to store token:",Z),Z}}async function xG(_){try{await t_().delete(Qb(_))}catch{}}function vb(_){let $=Xb(),b=$.environments.findIndex((Z)=>Z.name===_.name);if(b>=0)$.environments[b]=_;else $.environments.push(_);BG($)}function NG(_){let $=Xb();$.environments=$.environments.filter((b)=>b.name!==_),BG($)}function Cq(_){try{return new URL(_).host.toLowerCase()}catch{return"custom"}}async function k_(){let _=J9(),$=[];for(let b of _){let Z=await Kb(b.name);if(Z)$.push({...b,token:Z})}if($.length===0){let b=process.env.AGENTLOGS_AUTH_TOKEN?.trim();if(b){let Z=process.env.AGENTLOGS_SERVER_URL?.trim()||"https://agentlogs.ai"?.trim()||"https://agentlogs.ai";$.push({name:Cq(Z),baseURL:Z,user:{id:"ci",email:"ci@agentlogs.ai",name:"CI"},lastLoginTime:new Date().toISOString(),token:b})}}return $}async function IG(_){try{let{host:$,baseURL:b}=O2(_.hostname);if(_.token){console.log("\uD83D\uDD10 Token exchange..."),console.log(`\uD83C\uDF10 Server: ${b}`);let v=await fetch(`${b}/api/auth/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:_.token})}),D=await v.text();if(!v.ok){let B=D;try{let C=JSON.parse(D);B=C.error??C.message??D}catch{if(B=`HTTP ${v.status} ${v.statusText}`,D&&D.length<200)B+=`: ${D}`}console.error("❌ Token exchange failed:",B),process.exit(1)}let w;try{w=JSON.parse(D)}catch{console.error("❌ Token exchange failed: server returned unexpected response (not JSON)"),console.error(" Response:",D.slice(0,200)),process.exit(1)}let{token:P,user:E}=w;await Fb($,E.email,P),vb({name:$,baseURL:b,user:{id:E.id,email:E.email,name:E.name},lastLoginTime:new Date().toISOString()}),console.log(`✅ Logged in as ${E.name} (${E.email})`),console.log(`\uD83C\uDF10 Environment: ${$}`),process.exit(0)}console.log("\uD83D\uDD10 AgentLogs Device Authorization"),console.log(`\uD83C\uDF10 Server: ${b}`),console.log("⏳ Requesting device authorization...");let Z=P2(b),{data:z,error:A}=await Z.device.code({client_id:"agentlogs-cli",scope:"openid profile email"});if(A||!z)console.error("❌ Error:",A?.error_description||"Failed to request device code"),process.exit(1);let{device_code:J,user_code:U,verification_uri:G,verification_uri_complete:Y,interval:X=5}=z;console.log(`
45
45
  \uD83D\uDCF1 Device Authorization in Progress`),console.log(`Please visit: ${G}`),console.log(`Enter code: ${U}
46
46
  `);let Q=Y||G,K=!process.stdout.isTTY||!!process.env.CI;if(Q)if(K)console.log("\uD83D\uDDA5️ Headless environment detected — open this URL in your browser:"),console.log(`
47
47
  ${Q}
48
- `);else console.log("\uD83C\uDF10 Opening browser..."),await UU(Q);console.log(`⏳ Waiting for authorization... (polling every ${X}s)`),await Sq(Z,J,X,$,b)}catch($){console.error("❌ Error:",$ instanceof Error?$.message:"Unknown error"),process.exit(1)}}async function Sq(_,$,b,Z,z){let A=b;return new Promise((J)=>{let U=async()=>{try{let{data:G,error:Y}=await _.device.token({grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:$,client_id:"agentlogs-cli"});if(G?.access_token){console.log(`
49
- ✅ Authorization Successful!`),console.log("\uD83D\uDD11 Access token received!");let{data:X}=await _.getSession({fetchOptions:{headers:{Authorization:`Bearer ${G.access_token}`}}});if(X?.user)await Yb(Z,X.user.email,G.access_token),Xb({name:Z,baseURL:z,user:{id:X.user.id,email:X.user.email,name:X.user.name},lastLoginTime:new Date().toISOString()}),console.log(`\uD83D\uDC4B Hello, ${X.user.name}!`),console.log(`\uD83D\uDCE7 Logged in as: ${X.user.email}`),console.log(`\uD83C\uDF10 Environment: ${Z}`);else console.log("⚠️ Warning: Could not retrieve user session");J(),process.exit(0)}else if(Y)switch(Y.error){case"authorization_pending":break;case"slow_down":A+=5,console.log(`⚠️ Slowing down polling to ${A}s`);break;case"access_denied":console.error("❌ Access was denied by the user"),process.exit(1);break;case"expired_token":console.error("❌ The device code has expired. Please try again."),process.exit(1);break;default:console.error("❌ Error:",Y.error_description||Y.error),process.exit(1)}}catch(G){console.error("❌ Error:",G instanceof Error?G.message:"Unknown error"),process.exit(1)}setTimeout(U,A*1000)};setTimeout(U,A*1000)})}async function wG(_={}){let $;try{$=Rq(_.hostname)}catch(Z){console.error("❌ Error:",Z instanceof Error?Z.message:"Invalid hostname"),process.exit(1)}if($.length===0){if(_.hostname)console.log(`ℹ️ Not currently logged in to ${_.hostname}`);else console.log("ℹ️ Not currently logged in to any environment");return}let b=[];for(let Z of $){let z=f2(Z);if(!z)continue;try{await WG(Z),gG(Z),b.push(z)}catch(A){console.error(`⚠️ Warning: Could not completely clear credentials for ${Z}:`,A instanceof Error?A.message:"Unknown error")}}if(b.length===0){console.log("ℹ️ No environments were logged out");return}if(b.length===1){console.log(`✅ Logged out from ${b[0].name} successfully`),console.log(`\uD83D\uDCE7 Was logged in as: ${b[0].user.email}`);return}console.log(`✅ Logged out from ${b.length} environments:`);for(let Z of b)console.log(`- ${Z.name} (${Z.user.email})`)}function Rq(_){if(_){let{host:$}=P2(_);return f2($)?[$]:[]}return J9().map(($)=>$.name)}async function xG(_={}){if(_.allowMode){let Z=_.allowMode.toLowerCase();if(Z!=="allowlist"&&Z!=="denylist")console.error("Invalid allowMode. Use 'allowlist' or 'denylist'."),process.exit(1);m7(Z),console.log(`Allow mode set to: ${Z}`),console.log()}let $=M_();console.log("AgentLogs Settings"),console.log("──────────────────"),console.log(`Mode: ${$.allowMode}`),console.log(`Config: ${u7()}`),console.log();let b=Object.keys($.repos);if(b.length===0)console.log("Repos: (none configured)");else{console.log("Repos:");for(let Z of b){let z=$.repos[Z];if(z.allow){let A=z.visibility??"(server default)";console.log(` ✓ ${Z} ${A}`)}else console.log(` ✗ ${Z} (denied)`)}}process.exit(0)}async function NG(){let _=J9();if(_.length===0)console.log("❌ Not logged in"),console.log("Run `agentlogs login agentlogs.ai` to authenticate"),process.exit(1);console.log(`\uD83D\uDD10 AgentLogs Authentication Status
50
- `);let $=!1;for(let b of _){let Z=await Gb(b.name);if(!Z){console.log(`${b.name} (${b.baseURL})`),console.log(" ❌ Token not found"),console.log(` \uD83D\uDCE7 Was: ${b.user.email}`),console.log("");continue}try{let z=j2(b.baseURL),{data:A,error:J}=await z.getSession({fetchOptions:{headers:{Authorization:`Bearer ${Z}`}}});if(J||!A?.user){console.log(`${b.name} (${b.baseURL})`),console.log(" ⚠️ Token invalid or expired"),console.log(` \uD83D\uDCE7 Was: ${b.user.email}`),console.log(` Run \`agentlogs login ${b.name}\` to re-authenticate`),console.log("");continue}if($=!0,console.log(`${b.name} (${b.baseURL})`),console.log(" ✅ Logged in"),console.log(` \uD83D\uDC64 ${A.user.name}`),console.log(` \uD83D\uDCE7 ${A.user.email}`),b.lastLoginTime){let U=new Date(b.lastLoginTime);console.log(` \uD83D\uDD50 Last login: ${U.toLocaleString()}`)}console.log("")}catch(z){console.log(`${b.name} (${b.baseURL})`),console.log(` ❌ Error verifying session: ${z instanceof Error?z.message:"Unknown error"}`),console.log("")}}if(!$)process.exit(1)}import{resolve as XK}from"path";import{spawnSync as ox}from"child_process";import{existsSync as eJ,readFileSync as tJ}from"fs";var M={};r_(M,{xor:()=>tY,xid:()=>gY,void:()=>pY,uuidv7:()=>vY,uuidv6:()=>KY,uuidv4:()=>QY,uuid:()=>XY,util:()=>c,url:()=>FY,uppercase:()=>D9,unknown:()=>h4,union:()=>K6,undefined:()=>nY,ulid:()=>WY,uint64:()=>cY,uint32:()=>mY,tuple:()=>M5,trim:()=>x9,treeifyError:()=>Bb,transform:()=>F6,toUpperCase:()=>I9,toLowerCase:()=>N9,toJSONSchema:()=>m1,templateLiteral:()=>QX,symbol:()=>rY,superRefine:()=>_J,success:()=>GX,stringbool:()=>kX,stringFormat:()=>SY,string:()=>l1,strictObject:()=>aY,startsWith:()=>W9,slugify:()=>M9,size:()=>f4,setErrorMap:()=>Xk,set:()=>bX,safeParseAsync:()=>$5,safeParse:()=>_5,safeEncodeAsync:()=>G5,safeEncode:()=>J5,safeDecodeAsync:()=>Y5,safeDecode:()=>U5,registry:()=>X1,regexes:()=>K_,regex:()=>q9,refine:()=>s5,record:()=>E5,readonly:()=>d5,property:()=>T1,promise:()=>KX,prettifyError:()=>wb,preprocess:()=>gX,prefault:()=>u5,positive:()=>j1,pipe:()=>u$,partialRecord:()=>_X,parseAsync:()=>s8,parse:()=>t8,overwrite:()=>W_,optional:()=>f$,object:()=>oY,number:()=>Q5,nullish:()=>UX,nullable:()=>m$,null:()=>q5,normalize:()=>w9,nonpositive:()=>R1,nonoptional:()=>h5,nonnegative:()=>L1,never:()=>Q6,negative:()=>S1,nativeEnum:()=>ZX,nanoid:()=>VY,nan:()=>YX,multipleOf:()=>F4,minSize:()=>R_,minLength:()=>o_,mime:()=>B9,meta:()=>VX,maxSize:()=>H4,maxLength:()=>m4,map:()=>zX,mac:()=>xY,lte:()=>$_,lt:()=>j_,lowercase:()=>V9,looseRecord:()=>$X,looseObject:()=>eY,locales:()=>R$,literal:()=>AX,length:()=>u4,lazy:()=>a5,ksuid:()=>BY,keyof:()=>iY,jwt:()=>jY,json:()=>WX,iso:()=>P9,ipv6:()=>NY,ipv4:()=>wY,intersection:()=>N5,int64:()=>hY,int32:()=>fY,int:()=>p1,instanceof:()=>DX,includes:()=>k9,httpUrl:()=>HY,hostname:()=>RY,hex:()=>LY,hash:()=>TY,guid:()=>YY,gte:()=>C0,gt:()=>S_,globalRegistry:()=>E0,getErrorMap:()=>Qk,function:()=>vX,fromJSONSchema:()=>wX,formatError:()=>B$,float64:()=>CY,float32:()=>yY,flattenError:()=>g$,file:()=>JX,exactOptional:()=>T5,enum:()=>v6,endsWith:()=>g9,encodeAsync:()=>Z5,encode:()=>z5,emoji:()=>qY,email:()=>GY,e164:()=>PY,discriminatedUnion:()=>sY,describe:()=>qX,decodeAsync:()=>A5,decode:()=>b5,date:()=>dY,custom:()=>HX,cuid2:()=>kY,cuid:()=>DY,core:()=>a_,config:()=>D0,coerce:()=>zJ,codec:()=>XX,clone:()=>y0,cidrv6:()=>MY,cidrv4:()=>IY,check:()=>FX,catch:()=>n5,boolean:()=>K5,bigint:()=>uY,base64url:()=>OY,base64:()=>EY,array:()=>r$,any:()=>lY,_function:()=>vX,_default:()=>f5,_ZodString:()=>d1,ZodXor:()=>B5,ZodXID:()=>_6,ZodVoid:()=>W5,ZodUnknown:()=>D5,ZodUnion:()=>l$,ZodUndefined:()=>F5,ZodUUID:()=>L_,ZodURL:()=>h$,ZodULID:()=>s1,ZodType:()=>e,ZodTuple:()=>I5,ZodTransform:()=>R5,ZodTemplateLiteral:()=>i5,ZodSymbol:()=>v5,ZodSuccess:()=>c5,ZodStringFormat:()=>Q0,ZodString:()=>S9,ZodSet:()=>P5,ZodRecord:()=>p$,ZodRealError:()=>l0,ZodReadonly:()=>p5,ZodPromise:()=>e5,ZodPrefault:()=>m5,ZodPipe:()=>V6,ZodOptional:()=>H6,ZodObject:()=>n$,ZodNumberFormat:()=>c4,ZodNumber:()=>L9,ZodNullable:()=>y5,ZodNull:()=>H5,ZodNonOptional:()=>q6,ZodNever:()=>k5,ZodNanoID:()=>a1,ZodNaN:()=>l5,ZodMap:()=>O5,ZodMAC:()=>X5,ZodLiteral:()=>j5,ZodLazy:()=>o5,ZodKSUID:()=>$6,ZodJWT:()=>Y6,ZodIssueCode:()=>Yk,ZodIntersection:()=>x5,ZodISOTime:()=>r1,ZodISODuration:()=>n1,ZodISODateTime:()=>h1,ZodISODate:()=>c1,ZodIPv6:()=>b6,ZodIPv4:()=>z6,ZodGUID:()=>C$,ZodFunction:()=>t5,ZodFirstPartyTypeKind:()=>$J,ZodFile:()=>S5,ZodExactOptional:()=>L5,ZodError:()=>Uk,ZodEnum:()=>j9,ZodEmoji:()=>o1,ZodEmail:()=>i1,ZodE164:()=>G6,ZodDiscriminatedUnion:()=>w5,ZodDefault:()=>C5,ZodDate:()=>c$,ZodCustomStringFormat:()=>R9,ZodCustom:()=>d$,ZodCodec:()=>D6,ZodCatch:()=>r5,ZodCUID2:()=>t1,ZodCUID:()=>e1,ZodCIDRv6:()=>A6,ZodCIDRv4:()=>Z6,ZodBoolean:()=>T9,ZodBigIntFormat:()=>X6,ZodBigInt:()=>y9,ZodBase64URL:()=>U6,ZodBase64:()=>J6,ZodArray:()=>g5,ZodAny:()=>V5,TimePrecision:()=>MA,NEVER:()=>Qb,$output:()=>gA,$input:()=>BA,$brand:()=>Kb});var a_={};r_(a_,{version:()=>DZ,util:()=>c,treeifyError:()=>Bb,toJSONSchema:()=>m1,toDotPath:()=>jG,safeParseAsync:()=>Nb,safeParse:()=>xb,safeEncodeAsync:()=>KV,safeEncode:()=>XV,safeDecodeAsync:()=>vV,safeDecode:()=>QV,registry:()=>X1,regexes:()=>K_,process:()=>A0,prettifyError:()=>wb,parseAsync:()=>c2,parse:()=>h2,meta:()=>U8,locales:()=>R$,isValidJWT:()=>aG,isValidBase64URL:()=>oG,isValidBase64:()=>uZ,initializeContext:()=>q4,globalRegistry:()=>E0,globalConfig:()=>v$,formatError:()=>B$,flattenError:()=>g$,finalize:()=>D4,extractDefs:()=>V4,encodeAsync:()=>GV,encode:()=>JV,describe:()=>J8,decodeAsync:()=>YV,decode:()=>UV,createToJSONSchemaMethod:()=>Y8,createStandardJSONSchemaMethod:()=>O9,config:()=>D0,clone:()=>y0,_xor:()=>CD,_xid:()=>g1,_void:()=>eA,_uuidv7:()=>H1,_uuidv6:()=>F1,_uuidv4:()=>v1,_uuid:()=>K1,_url:()=>T$,_uppercase:()=>D9,_unknown:()=>oA,_union:()=>yD,_undefined:()=>pA,_ulid:()=>W1,_uint64:()=>nA,_uint32:()=>fA,_tuple:()=>uD,_trim:()=>x9,_transform:()=>dD,_toUpperCase:()=>I9,_toLowerCase:()=>N9,_templateLiteral:()=>zk,_symbol:()=>lA,_superRefine:()=>A8,_success:()=>tD,_stringbool:()=>G8,_stringFormat:()=>E9,_string:()=>xA,_startsWith:()=>W9,_slugify:()=>M9,_size:()=>f4,_set:()=>rD,_safeParseAsync:()=>v9,_safeParse:()=>K9,_safeEncodeAsync:()=>o2,_safeEncode:()=>d2,_safeDecodeAsync:()=>a2,_safeDecode:()=>i2,_regex:()=>q9,_refine:()=>Z8,_record:()=>hD,_readonly:()=>$k,_property:()=>T1,_promise:()=>Zk,_positive:()=>j1,_pipe:()=>_k,_parseAsync:()=>Q9,_parse:()=>X9,_overwrite:()=>W_,_optional:()=>iD,_number:()=>SA,_nullable:()=>oD,_null:()=>dA,_normalize:()=>w9,_nonpositive:()=>R1,_nonoptional:()=>eD,_nonnegative:()=>L1,_never:()=>aA,_negative:()=>S1,_nativeEnum:()=>lD,_nanoid:()=>V1,_nan:()=>_8,_multipleOf:()=>F4,_minSize:()=>R_,_minLength:()=>o_,_min:()=>C0,_mime:()=>B9,_maxSize:()=>H4,_maxLength:()=>m4,_max:()=>$_,_map:()=>cD,_mac:()=>IA,_lte:()=>$_,_lt:()=>j_,_lowercase:()=>V9,_literal:()=>pD,_length:()=>u4,_lazy:()=>bk,_ksuid:()=>B1,_jwt:()=>P1,_isoTime:()=>PA,_isoDuration:()=>jA,_isoDateTime:()=>EA,_isoDate:()=>OA,_ipv6:()=>x1,_ipv4:()=>w1,_intersection:()=>mD,_int64:()=>rA,_int32:()=>CA,_int:()=>LA,_includes:()=>k9,_guid:()=>L$,_gte:()=>C0,_gt:()=>S_,_float64:()=>yA,_float32:()=>TA,_file:()=>z8,_enum:()=>nD,_endsWith:()=>g9,_encodeAsync:()=>l2,_encode:()=>r2,_emoji:()=>q1,_email:()=>Q1,_e164:()=>O1,_discriminatedUnion:()=>fD,_default:()=>aD,_decodeAsync:()=>p2,_decode:()=>n2,_date:()=>tA,_custom:()=>b8,_cuid2:()=>k1,_cuid:()=>D1,_coercedString:()=>NA,_coercedNumber:()=>RA,_coercedDate:()=>sA,_coercedBoolean:()=>uA,_coercedBigint:()=>cA,_cidrv6:()=>I1,_cidrv4:()=>N1,_check:()=>AY,_catch:()=>sD,_boolean:()=>mA,_bigint:()=>hA,_base64url:()=>E1,_base64:()=>M1,_array:()=>$8,_any:()=>iA,TimePrecision:()=>MA,NEVER:()=>Qb,JSONSchemaGenerator:()=>d8,JSONSchema:()=>JY,Doc:()=>_1,$output:()=>gA,$input:()=>BA,$constructor:()=>I,$brand:()=>Kb,$ZodXor:()=>Z3,$ZodXID:()=>OZ,$ZodVoid:()=>_3,$ZodUnknown:()=>tZ,$ZodUnion:()=>M$,$ZodUndefined:()=>oZ,$ZodUUID:()=>gZ,$ZodURL:()=>wZ,$ZodULID:()=>EZ,$ZodType:()=>i,$ZodTuple:()=>G1,$ZodTransform:()=>v3,$ZodTemplateLiteral:()=>x3,$ZodSymbol:()=>iZ,$ZodSuccess:()=>k3,$ZodStringFormat:()=>X0,$ZodString:()=>C4,$ZodSet:()=>Y3,$ZodRegistry:()=>wA,$ZodRecord:()=>U3,$ZodRealError:()=>n0,$ZodReadonly:()=>w3,$ZodPromise:()=>I3,$ZodPrefault:()=>V3,$ZodPipe:()=>B3,$ZodOptional:()=>Y1,$ZodObjectJIT:()=>b3,$ZodObject:()=>sG,$ZodNumberFormat:()=>pZ,$ZodNumber:()=>J1,$ZodNullable:()=>H3,$ZodNull:()=>aZ,$ZodNonOptional:()=>D3,$ZodNever:()=>sZ,$ZodNanoID:()=>NZ,$ZodNaN:()=>g3,$ZodMap:()=>G3,$ZodMAC:()=>CZ,$ZodLiteral:()=>Q3,$ZodLazy:()=>M3,$ZodKSUID:()=>PZ,$ZodJWT:()=>nZ,$ZodIntersection:()=>J3,$ZodISOTime:()=>RZ,$ZodISODuration:()=>LZ,$ZodISODateTime:()=>jZ,$ZodISODate:()=>SZ,$ZodIPv6:()=>yZ,$ZodIPv4:()=>TZ,$ZodGUID:()=>WZ,$ZodFunction:()=>N3,$ZodFile:()=>K3,$ZodExactOptional:()=>F3,$ZodError:()=>W$,$ZodEnum:()=>X3,$ZodEncodeError:()=>L4,$ZodEmoji:()=>xZ,$ZodEmail:()=>BZ,$ZodE164:()=>rZ,$ZodDiscriminatedUnion:()=>A3,$ZodDefault:()=>q3,$ZodDate:()=>$3,$ZodCustomStringFormat:()=>lZ,$ZodCustom:()=>E3,$ZodCodec:()=>E$,$ZodCheckUpperCase:()=>QZ,$ZodCheckStringFormat:()=>F9,$ZodCheckStartsWith:()=>vZ,$ZodCheckSizeEquals:()=>AZ,$ZodCheckRegex:()=>YZ,$ZodCheckProperty:()=>HZ,$ZodCheckOverwrite:()=>VZ,$ZodCheckNumberFormat:()=>$Z,$ZodCheckMultipleOf:()=>_Z,$ZodCheckMinSize:()=>ZZ,$ZodCheckMinLength:()=>UZ,$ZodCheckMimeType:()=>qZ,$ZodCheckMaxSize:()=>bZ,$ZodCheckMaxLength:()=>JZ,$ZodCheckLowerCase:()=>XZ,$ZodCheckLessThan:()=>t2,$ZodCheckLengthEquals:()=>GZ,$ZodCheckIncludes:()=>KZ,$ZodCheckGreaterThan:()=>s2,$ZodCheckEndsWith:()=>FZ,$ZodCheckBigIntFormat:()=>zZ,$ZodCheck:()=>K0,$ZodCatch:()=>W3,$ZodCUID2:()=>MZ,$ZodCUID:()=>IZ,$ZodCIDRv6:()=>mZ,$ZodCIDRv4:()=>fZ,$ZodBoolean:()=>I$,$ZodBigIntFormat:()=>dZ,$ZodBigInt:()=>U1,$ZodBase64URL:()=>cZ,$ZodBase64:()=>hZ,$ZodAsyncError:()=>P_,$ZodArray:()=>z3,$ZodAny:()=>eZ});var Qb=Object.freeze({status:"aborted"});function I(_,$,b){function Z(U,G){if(!U._zod)Object.defineProperty(U,"_zod",{value:{def:G,constr:J,traits:new Set},enumerable:!1});if(U._zod.traits.has(_))return;U._zod.traits.add(_),$(U,G);let Y=J.prototype,X=Object.keys(Y);for(let Q=0;Q<X.length;Q++){let K=X[Q];if(!(K in U))U[K]=Y[K].bind(U)}}let z=b?.Parent??Object;class A extends z{}Object.defineProperty(A,"name",{value:_});function J(U){var G;let Y=b?.Parent?new A:this;Z(Y,U),(G=Y._zod).deferred??(G.deferred=[]);for(let X of Y._zod.deferred)X();return Y}return Object.defineProperty(J,"init",{value:Z}),Object.defineProperty(J,Symbol.hasInstance,{value:(U)=>{if(b?.Parent&&U instanceof b.Parent)return!0;return U?._zod?.traits?.has(_)}}),Object.defineProperty(J,"name",{value:_}),J}var Kb=Symbol("zod_brand");class P_ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class L4 extends Error{constructor(_){super(`Encountered unidirectional transform during encode: ${_}`);this.name="ZodEncodeError"}}var v$={};function D0(_){if(_)Object.assign(v$,_);return v$}var c={};r_(c,{unwrapMessage:()=>F$,uint8ArrayToHex:()=>ZV,uint8ArrayToBase64url:()=>zV,uint8ArrayToBase64:()=>EG,stringifyPrimitive:()=>m,slugify:()=>Hb,shallowClone:()=>Vb,safeExtend:()=>aq,required:()=>sq,randomString:()=>rq,propertyKeyTypes:()=>V$,promiseAllObject:()=>cq,primitiveTypes:()=>Db,prefixIssues:()=>__,pick:()=>dq,partial:()=>tq,parsedType:()=>h,optionalKeys:()=>kb,omit:()=>iq,objectClone:()=>mq,numKeys:()=>nq,nullish:()=>X4,normalizeParams:()=>r,mergeDefs:()=>i_,merge:()=>eq,jsonStringifyReplacer:()=>U9,joinValues:()=>R,issue:()=>Y9,isPlainObject:()=>K4,isObject:()=>T4,hexToUint8Array:()=>bV,getSizableOrigin:()=>D$,getParsedType:()=>lq,getLengthableOrigin:()=>k$,getEnumValues:()=>H$,getElementAtPath:()=>hq,floatSafeRemainder:()=>Fb,finalizeIssue:()=>r0,extend:()=>oq,escapeRegex:()=>Q_,esc:()=>m2,defineLazy:()=>t,createTransparentProxy:()=>pq,cloneDef:()=>uq,clone:()=>y0,cleanRegex:()=>q$,cleanEnum:()=>_V,captureStackTrace:()=>u2,cached:()=>G9,base64urlToUint8Array:()=>$V,base64ToUint8Array:()=>MG,assignProp:()=>Q4,assertNotEqual:()=>Tq,assertNever:()=>Cq,assertIs:()=>yq,assertEqual:()=>Lq,assert:()=>fq,allowsEval:()=>qb,aborted:()=>v4,NUMBER_FORMAT_RANGES:()=>Wb,Class:()=>OG,BIGINT_FORMAT_RANGES:()=>gb});function Lq(_){return _}function Tq(_){return _}function yq(_){}function Cq(_){throw Error("Unexpected value in exhaustive check")}function fq(_){}function H$(_){let $=Object.values(_).filter((Z)=>typeof Z==="number");return Object.entries(_).filter(([Z,z])=>$.indexOf(+Z)===-1).map(([Z,z])=>z)}function R(_,$="|"){return _.map((b)=>m(b)).join($)}function U9(_,$){if(typeof $==="bigint")return $.toString();return $}function G9(_){return{get value(){{let b=_();return Object.defineProperty(this,"value",{value:b}),b}throw Error("cached value already set")}}}function X4(_){return _===null||_===void 0}function q$(_){let $=_.startsWith("^")?1:0,b=_.endsWith("$")?_.length-1:_.length;return _.slice($,b)}function Fb(_,$){let b=(_.toString().split(".")[1]||"").length,Z=$.toString(),z=(Z.split(".")[1]||"").length;if(z===0&&/\d?e-\d?/.test(Z)){let G=Z.match(/\d?e-(\d?)/);if(G?.[1])z=Number.parseInt(G[1])}let A=b>z?b:z,J=Number.parseInt(_.toFixed(A).replace(".","")),U=Number.parseInt($.toFixed(A).replace(".",""));return J%U/10**A}var IG=Symbol("evaluating");function t(_,$,b){let Z=void 0;Object.defineProperty(_,$,{get(){if(Z===IG)return;if(Z===void 0)Z=IG,Z=b();return Z},set(z){Object.defineProperty(_,$,{value:z})},configurable:!0})}function mq(_){return Object.create(Object.getPrototypeOf(_),Object.getOwnPropertyDescriptors(_))}function Q4(_,$,b){Object.defineProperty(_,$,{value:b,writable:!0,enumerable:!0,configurable:!0})}function i_(..._){let $={};for(let b of _){let Z=Object.getOwnPropertyDescriptors(b);Object.assign($,Z)}return Object.defineProperties({},$)}function uq(_){return i_(_._zod.def)}function hq(_,$){if(!$)return _;return $.reduce((b,Z)=>b?.[Z],_)}function cq(_){let $=Object.keys(_),b=$.map((Z)=>_[Z]);return Promise.all(b).then((Z)=>{let z={};for(let A=0;A<$.length;A++)z[$[A]]=Z[A];return z})}function rq(_=10){let b="";for(let Z=0;Z<_;Z++)b+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return b}function m2(_){return JSON.stringify(_)}function Hb(_){return _.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var u2="captureStackTrace"in Error?Error.captureStackTrace:(..._)=>{};function T4(_){return typeof _==="object"&&_!==null&&!Array.isArray(_)}var qb=G9(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(_){return!1}});function K4(_){if(T4(_)===!1)return!1;let $=_.constructor;if($===void 0)return!0;if(typeof $!=="function")return!0;let b=$.prototype;if(T4(b)===!1)return!1;if(Object.prototype.hasOwnProperty.call(b,"isPrototypeOf")===!1)return!1;return!0}function Vb(_){if(K4(_))return{..._};if(Array.isArray(_))return[..._];return _}function nq(_){let $=0;for(let b in _)if(Object.prototype.hasOwnProperty.call(_,b))$++;return $}var lq=(_)=>{let $=typeof _;switch($){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(_)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(_))return"array";if(_===null)return"null";if(_.then&&typeof _.then==="function"&&_.catch&&typeof _.catch==="function")return"promise";if(typeof Map<"u"&&_ instanceof Map)return"map";if(typeof Set<"u"&&_ instanceof Set)return"set";if(typeof Date<"u"&&_ instanceof Date)return"date";if(typeof File<"u"&&_ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${$}`)}},V$=new Set(["string","number","symbol"]),Db=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Q_(_){return _.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function y0(_,$,b){let Z=new _._zod.constr($??_._zod.def);if(!$||b?.parent)Z._zod.parent=_;return Z}function r(_){let $=_;if(!$)return{};if(typeof $==="string")return{error:()=>$};if($?.message!==void 0){if($?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");$.error=$.message}if(delete $.message,typeof $.error==="string")return{...$,error:()=>$.error};return $}function pq(_){let $;return new Proxy({},{get(b,Z,z){return $??($=_()),Reflect.get($,Z,z)},set(b,Z,z,A){return $??($=_()),Reflect.set($,Z,z,A)},has(b,Z){return $??($=_()),Reflect.has($,Z)},deleteProperty(b,Z){return $??($=_()),Reflect.deleteProperty($,Z)},ownKeys(b){return $??($=_()),Reflect.ownKeys($)},getOwnPropertyDescriptor(b,Z){return $??($=_()),Reflect.getOwnPropertyDescriptor($,Z)},defineProperty(b,Z,z){return $??($=_()),Reflect.defineProperty($,Z,z)}})}function m(_){if(typeof _==="bigint")return _.toString()+"n";if(typeof _==="string")return`"${_}"`;return`${_}`}function kb(_){return Object.keys(_).filter(($)=>{return _[$]._zod.optin==="optional"&&_[$]._zod.optout==="optional"})}var Wb={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]},gb={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function dq(_,$){let b=_._zod.def,Z=b.checks;if(Z&&Z.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let A=i_(_._zod.def,{get shape(){let J={};for(let U in $){if(!(U in b.shape))throw Error(`Unrecognized key: "${U}"`);if(!$[U])continue;J[U]=b.shape[U]}return Q4(this,"shape",J),J},checks:[]});return y0(_,A)}function iq(_,$){let b=_._zod.def,Z=b.checks;if(Z&&Z.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let A=i_(_._zod.def,{get shape(){let J={..._._zod.def.shape};for(let U in $){if(!(U in b.shape))throw Error(`Unrecognized key: "${U}"`);if(!$[U])continue;delete J[U]}return Q4(this,"shape",J),J},checks:[]});return y0(_,A)}function oq(_,$){if(!K4($))throw Error("Invalid input to extend: expected a plain object");let b=_._zod.def.checks;if(b&&b.length>0){let A=_._zod.def.shape;for(let J in $)if(Object.getOwnPropertyDescriptor(A,J)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let z=i_(_._zod.def,{get shape(){let A={..._._zod.def.shape,...$};return Q4(this,"shape",A),A}});return y0(_,z)}function aq(_,$){if(!K4($))throw Error("Invalid input to safeExtend: expected a plain object");let b=i_(_._zod.def,{get shape(){let Z={..._._zod.def.shape,...$};return Q4(this,"shape",Z),Z}});return y0(_,b)}function eq(_,$){let b=i_(_._zod.def,{get shape(){let Z={..._._zod.def.shape,...$._zod.def.shape};return Q4(this,"shape",Z),Z},get catchall(){return $._zod.def.catchall},checks:[]});return y0(_,b)}function tq(_,$,b){let z=$._zod.def.checks;if(z&&z.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let J=i_($._zod.def,{get shape(){let U=$._zod.def.shape,G={...U};if(b)for(let Y in b){if(!(Y in U))throw Error(`Unrecognized key: "${Y}"`);if(!b[Y])continue;G[Y]=_?new _({type:"optional",innerType:U[Y]}):U[Y]}else for(let Y in U)G[Y]=_?new _({type:"optional",innerType:U[Y]}):U[Y];return Q4(this,"shape",G),G},checks:[]});return y0($,J)}function sq(_,$,b){let Z=i_($._zod.def,{get shape(){let z=$._zod.def.shape,A={...z};if(b)for(let J in b){if(!(J in A))throw Error(`Unrecognized key: "${J}"`);if(!b[J])continue;A[J]=new _({type:"nonoptional",innerType:z[J]})}else for(let J in z)A[J]=new _({type:"nonoptional",innerType:z[J]});return Q4(this,"shape",A),A}});return y0($,Z)}function v4(_,$=0){if(_.aborted===!0)return!0;for(let b=$;b<_.issues.length;b++)if(_.issues[b]?.continue!==!0)return!0;return!1}function __(_,$){return $.map((b)=>{var Z;return(Z=b).path??(Z.path=[]),b.path.unshift(_),b})}function F$(_){return typeof _==="string"?_:_?.message}function r0(_,$,b){let Z={..._,path:_.path??[]};if(!_.message){let z=F$(_.inst?._zod.def?.error?.(_))??F$($?.error?.(_))??F$(b.customError?.(_))??F$(b.localeError?.(_))??"Invalid input";Z.message=z}if(delete Z.inst,delete Z.continue,!$?.reportInput)delete Z.input;return Z}function D$(_){if(_ instanceof Set)return"set";if(_ instanceof Map)return"map";if(_ instanceof File)return"file";return"unknown"}function k$(_){if(Array.isArray(_))return"array";if(typeof _==="string")return"string";return"unknown"}function h(_){let $=typeof _;switch($){case"number":return Number.isNaN(_)?"nan":"number";case"object":{if(_===null)return"null";if(Array.isArray(_))return"array";let b=_;if(b&&Object.getPrototypeOf(b)!==Object.prototype&&"constructor"in b&&b.constructor)return b.constructor.name}}return $}function Y9(..._){let[$,b,Z]=_;if(typeof $==="string")return{message:$,code:"custom",input:b,inst:Z};return{...$}}function _V(_){return Object.entries(_).filter(([$,b])=>{return Number.isNaN(Number.parseInt($,10))}).map(($)=>$[1])}function MG(_){let $=atob(_),b=new Uint8Array($.length);for(let Z=0;Z<$.length;Z++)b[Z]=$.charCodeAt(Z);return b}function EG(_){let $="";for(let b=0;b<_.length;b++)$+=String.fromCharCode(_[b]);return btoa($)}function $V(_){let $=_.replace(/-/g,"+").replace(/_/g,"/"),b="=".repeat((4-$.length%4)%4);return MG($+b)}function zV(_){return EG(_).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function bV(_){let $=_.replace(/^0x/,"");if($.length%2!==0)throw Error("Invalid hex string length");let b=new Uint8Array($.length/2);for(let Z=0;Z<$.length;Z+=2)b[Z/2]=Number.parseInt($.slice(Z,Z+2),16);return b}function ZV(_){return Array.from(_).map(($)=>$.toString(16).padStart(2,"0")).join("")}class OG{constructor(..._){}}var PG=(_,$)=>{_.name="$ZodError",Object.defineProperty(_,"_zod",{value:_._zod,enumerable:!1}),Object.defineProperty(_,"issues",{value:$,enumerable:!1}),_.message=JSON.stringify($,U9,2),Object.defineProperty(_,"toString",{value:()=>_.message,enumerable:!1})},W$=I("$ZodError",PG),n0=I("$ZodError",PG,{Parent:Error});function g$(_,$=(b)=>b.message){let b={},Z=[];for(let z of _.issues)if(z.path.length>0)b[z.path[0]]=b[z.path[0]]||[],b[z.path[0]].push($(z));else Z.push($(z));return{formErrors:Z,fieldErrors:b}}function B$(_,$=(b)=>b.message){let b={_errors:[]},Z=(z)=>{for(let A of z.issues)if(A.code==="invalid_union"&&A.errors.length)A.errors.map((J)=>Z({issues:J}));else if(A.code==="invalid_key")Z({issues:A.issues});else if(A.code==="invalid_element")Z({issues:A.issues});else if(A.path.length===0)b._errors.push($(A));else{let J=b,U=0;while(U<A.path.length){let G=A.path[U];if(U!==A.path.length-1)J[G]=J[G]||{_errors:[]};else J[G]=J[G]||{_errors:[]},J[G]._errors.push($(A));J=J[G],U++}}};return Z(_),b}function Bb(_,$=(b)=>b.message){let b={errors:[]},Z=(z,A=[])=>{var J,U;for(let G of z.issues)if(G.code==="invalid_union"&&G.errors.length)G.errors.map((Y)=>Z({issues:Y},G.path));else if(G.code==="invalid_key")Z({issues:G.issues},G.path);else if(G.code==="invalid_element")Z({issues:G.issues},G.path);else{let Y=[...A,...G.path];if(Y.length===0){b.errors.push($(G));continue}let X=b,Q=0;while(Q<Y.length){let K=Y[Q],v=Q===Y.length-1;if(typeof K==="string")X.properties??(X.properties={}),(J=X.properties)[K]??(J[K]={errors:[]}),X=X.properties[K];else X.items??(X.items=[]),(U=X.items)[K]??(U[K]={errors:[]}),X=X.items[K];if(v)X.errors.push($(G));Q++}}};return Z(_),b}function jG(_){let $=[],b=_.map((Z)=>typeof Z==="object"?Z.key:Z);for(let Z of b)if(typeof Z==="number")$.push(`[${Z}]`);else if(typeof Z==="symbol")$.push(`[${JSON.stringify(String(Z))}]`);else if(/[^\w$]/.test(Z))$.push(`[${JSON.stringify(Z)}]`);else{if($.length)$.push(".");$.push(Z)}return $.join("")}function wb(_){let $=[],b=[..._.issues].sort((Z,z)=>(Z.path??[]).length-(z.path??[]).length);for(let Z of b)if($.push(`✖ ${Z.message}`),Z.path?.length)$.push(` → at ${jG(Z.path)}`);return $.join(`
51
- `)}var X9=(_)=>($,b,Z,z)=>{let A=Z?Object.assign(Z,{async:!1}):{async:!1},J=$._zod.run({value:b,issues:[]},A);if(J instanceof Promise)throw new P_;if(J.issues.length){let U=new(z?.Err??_)(J.issues.map((G)=>r0(G,A,D0())));throw u2(U,z?.callee),U}return J.value},h2=X9(n0),Q9=(_)=>async($,b,Z,z)=>{let A=Z?Object.assign(Z,{async:!0}):{async:!0},J=$._zod.run({value:b,issues:[]},A);if(J instanceof Promise)J=await J;if(J.issues.length){let U=new(z?.Err??_)(J.issues.map((G)=>r0(G,A,D0())));throw u2(U,z?.callee),U}return J.value},c2=Q9(n0),K9=(_)=>($,b,Z)=>{let z=Z?{...Z,async:!1}:{async:!1},A=$._zod.run({value:b,issues:[]},z);if(A instanceof Promise)throw new P_;return A.issues.length?{success:!1,error:new(_??W$)(A.issues.map((J)=>r0(J,z,D0())))}:{success:!0,data:A.value}},xb=K9(n0),v9=(_)=>async($,b,Z)=>{let z=Z?Object.assign(Z,{async:!0}):{async:!0},A=$._zod.run({value:b,issues:[]},z);if(A instanceof Promise)A=await A;return A.issues.length?{success:!1,error:new _(A.issues.map((J)=>r0(J,z,D0())))}:{success:!0,data:A.value}},Nb=v9(n0),r2=(_)=>($,b,Z)=>{let z=Z?Object.assign(Z,{direction:"backward"}):{direction:"backward"};return X9(_)($,b,z)},JV=r2(n0),n2=(_)=>($,b,Z)=>{return X9(_)($,b,Z)},UV=n2(n0),l2=(_)=>async($,b,Z)=>{let z=Z?Object.assign(Z,{direction:"backward"}):{direction:"backward"};return Q9(_)($,b,z)},GV=l2(n0),p2=(_)=>async($,b,Z)=>{return Q9(_)($,b,Z)},YV=p2(n0),d2=(_)=>($,b,Z)=>{let z=Z?Object.assign(Z,{direction:"backward"}):{direction:"backward"};return K9(_)($,b,z)},XV=d2(n0),i2=(_)=>($,b,Z)=>{return K9(_)($,b,Z)},QV=i2(n0),o2=(_)=>async($,b,Z)=>{let z=Z?Object.assign(Z,{direction:"backward"}):{direction:"backward"};return v9(_)($,b,z)},KV=o2(n0),a2=(_)=>async($,b,Z)=>{return v9(_)($,b,Z)},vV=a2(n0);var K_={};r_(K_,{xid:()=>Ob,uuid7:()=>VV,uuid6:()=>qV,uuid4:()=>HV,uuid:()=>y4,uppercase:()=>sb,unicodeEmail:()=>SG,undefined:()=>eb,ulid:()=>Eb,time:()=>nb,string:()=>pb,sha512_hex:()=>fV,sha512_base64url:()=>uV,sha512_base64:()=>mV,sha384_hex:()=>TV,sha384_base64url:()=>CV,sha384_base64:()=>yV,sha256_hex:()=>SV,sha256_base64url:()=>LV,sha256_base64:()=>RV,sha1_hex:()=>OV,sha1_base64url:()=>jV,sha1_base64:()=>PV,rfc5322Email:()=>kV,number:()=>w$,null:()=>ab,nanoid:()=>jb,md5_hex:()=>IV,md5_base64url:()=>EV,md5_base64:()=>MV,mac:()=>fb,lowercase:()=>tb,ksuid:()=>Pb,ipv6:()=>Cb,ipv4:()=>yb,integer:()=>ib,idnEmail:()=>WV,html5Email:()=>DV,hostname:()=>wV,hex:()=>NV,guid:()=>Rb,extendedDuration:()=>FV,emoji:()=>Tb,email:()=>Lb,e164:()=>cb,duration:()=>Sb,domain:()=>xV,datetime:()=>lb,date:()=>rb,cuid2:()=>Mb,cuid:()=>Ib,cidrv6:()=>ub,cidrv4:()=>mb,browserEmail:()=>gV,boolean:()=>ob,bigint:()=>db,base64url:()=>e2,base64:()=>hb});var Ib=/^[cC][^\s-]{8,}$/,Mb=/^[0-9a-z]+$/,Eb=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ob=/^[0-9a-vA-V]{20}$/,Pb=/^[A-Za-z0-9]{27}$/,jb=/^[a-zA-Z0-9_-]{21}$/,Sb=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,FV=/^[-+]?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)?)??$/,Rb=/^([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})$/,y4=(_)=>{if(!_)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|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${_}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},HV=y4(4),qV=y4(6),VV=y4(7),Lb=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,DV=/^[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])?)*$/,kV=/^(([^<>()\[\]\\.,;:\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,}))$/,SG=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,WV=SG,gV=/^[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])?)*$/,BV="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Tb(){return new RegExp(BV,"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])$/,Cb=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,fb=(_)=>{let $=Q_(_??":");return new RegExp(`^(?:[0-9A-F]{2}${$}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${$}){5}[0-9a-f]{2}$`)},mb=/^((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])$/,ub=/^(([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])$/,hb=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,e2=/^[A-Za-z0-9_-]*$/,wV=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,xV=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,cb=/^\+[1-9]\d{6,14}$/,RG="(?:(?:\\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])))",rb=new RegExp(`^${RG}$`);function LG(_){return typeof _.precision==="number"?_.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":_.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{${_.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function nb(_){return new RegExp(`^${LG(_)}$`)}function lb(_){let $=LG({precision:_.precision}),b=["Z"];if(_.local)b.push("");if(_.offset)b.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let Z=`${$}(?:${b.join("|")})`;return new RegExp(`^${RG}T(?:${Z})$`)}var pb=(_)=>{let $=_?`[\\s\\S]{${_?.minimum??0},${_?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${$}$`)},db=/^-?\d+n?$/,ib=/^-?\d+$/,w$=/^-?\d+(?:\.\d+)?$/,ob=/^(?:true|false)$/i,ab=/^null$/i;var eb=/^undefined$/i;var tb=/^[^A-Z]*$/,sb=/^[^a-z]*$/,NV=/^[0-9a-fA-F]*$/;function x$(_,$){return new RegExp(`^[A-Za-z0-9+/]{${_}}${$}$`)}function N$(_){return new RegExp(`^[A-Za-z0-9_-]{${_}}$`)}var IV=/^[0-9a-fA-F]{32}$/,MV=x$(22,"=="),EV=N$(22),OV=/^[0-9a-fA-F]{40}$/,PV=x$(27,"="),jV=N$(27),SV=/^[0-9a-fA-F]{64}$/,RV=x$(43,"="),LV=N$(43),TV=/^[0-9a-fA-F]{96}$/,yV=x$(64,""),CV=N$(64),fV=/^[0-9a-fA-F]{128}$/,mV=x$(86,"=="),uV=N$(86);var K0=I("$ZodCheck",(_,$)=>{var b;_._zod??(_._zod={}),_._zod.def=$,(b=_._zod).onattach??(b.onattach=[])}),yG={number:"number",bigint:"bigint",object:"date"},t2=I("$ZodCheckLessThan",(_,$)=>{K0.init(_,$);let b=yG[typeof $.value];_._zod.onattach.push((Z)=>{let z=Z._zod.bag,A=($.inclusive?z.maximum:z.exclusiveMaximum)??Number.POSITIVE_INFINITY;if($.value<A)if($.inclusive)z.maximum=$.value;else z.exclusiveMaximum=$.value}),_._zod.check=(Z)=>{if($.inclusive?Z.value<=$.value:Z.value<$.value)return;Z.issues.push({origin:b,code:"too_big",maximum:typeof $.value==="object"?$.value.getTime():$.value,input:Z.value,inclusive:$.inclusive,inst:_,continue:!$.abort})}}),s2=I("$ZodCheckGreaterThan",(_,$)=>{K0.init(_,$);let b=yG[typeof $.value];_._zod.onattach.push((Z)=>{let z=Z._zod.bag,A=($.inclusive?z.minimum:z.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if($.value>A)if($.inclusive)z.minimum=$.value;else z.exclusiveMinimum=$.value}),_._zod.check=(Z)=>{if($.inclusive?Z.value>=$.value:Z.value>$.value)return;Z.issues.push({origin:b,code:"too_small",minimum:typeof $.value==="object"?$.value.getTime():$.value,input:Z.value,inclusive:$.inclusive,inst:_,continue:!$.abort})}}),_Z=I("$ZodCheckMultipleOf",(_,$)=>{K0.init(_,$),_._zod.onattach.push((b)=>{var Z;(Z=b._zod.bag).multipleOf??(Z.multipleOf=$.value)}),_._zod.check=(b)=>{if(typeof b.value!==typeof $.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof b.value==="bigint"?b.value%$.value===BigInt(0):Fb(b.value,$.value)===0)return;b.issues.push({origin:typeof b.value,code:"not_multiple_of",divisor:$.value,input:b.value,inst:_,continue:!$.abort})}}),$Z=I("$ZodCheckNumberFormat",(_,$)=>{K0.init(_,$),$.format=$.format||"float64";let b=$.format?.includes("int"),Z=b?"int":"number",[z,A]=Wb[$.format];_._zod.onattach.push((J)=>{let U=J._zod.bag;if(U.format=$.format,U.minimum=z,U.maximum=A,b)U.pattern=ib}),_._zod.check=(J)=>{let U=J.value;if(b){if(!Number.isInteger(U)){J.issues.push({expected:Z,format:$.format,code:"invalid_type",continue:!1,input:U,inst:_});return}if(!Number.isSafeInteger(U)){if(U>0)J.issues.push({input:U,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:_,origin:Z,inclusive:!0,continue:!$.abort});else J.issues.push({input:U,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:_,origin:Z,inclusive:!0,continue:!$.abort});return}}if(U<z)J.issues.push({origin:"number",input:U,code:"too_small",minimum:z,inclusive:!0,inst:_,continue:!$.abort});if(U>A)J.issues.push({origin:"number",input:U,code:"too_big",maximum:A,inclusive:!0,inst:_,continue:!$.abort})}}),zZ=I("$ZodCheckBigIntFormat",(_,$)=>{K0.init(_,$);let[b,Z]=gb[$.format];_._zod.onattach.push((z)=>{let A=z._zod.bag;A.format=$.format,A.minimum=b,A.maximum=Z}),_._zod.check=(z)=>{let A=z.value;if(A<b)z.issues.push({origin:"bigint",input:A,code:"too_small",minimum:b,inclusive:!0,inst:_,continue:!$.abort});if(A>Z)z.issues.push({origin:"bigint",input:A,code:"too_big",maximum:Z,inclusive:!0,inst:_,continue:!$.abort})}}),bZ=I("$ZodCheckMaxSize",(_,$)=>{var b;K0.init(_,$),(b=_._zod.def).when??(b.when=(Z)=>{let z=Z.value;return!X4(z)&&z.size!==void 0}),_._zod.onattach.push((Z)=>{let z=Z._zod.bag.maximum??Number.POSITIVE_INFINITY;if($.maximum<z)Z._zod.bag.maximum=$.maximum}),_._zod.check=(Z)=>{let z=Z.value;if(z.size<=$.maximum)return;Z.issues.push({origin:D$(z),code:"too_big",maximum:$.maximum,inclusive:!0,input:z,inst:_,continue:!$.abort})}}),ZZ=I("$ZodCheckMinSize",(_,$)=>{var b;K0.init(_,$),(b=_._zod.def).when??(b.when=(Z)=>{let z=Z.value;return!X4(z)&&z.size!==void 0}),_._zod.onattach.push((Z)=>{let z=Z._zod.bag.minimum??Number.NEGATIVE_INFINITY;if($.minimum>z)Z._zod.bag.minimum=$.minimum}),_._zod.check=(Z)=>{let z=Z.value;if(z.size>=$.minimum)return;Z.issues.push({origin:D$(z),code:"too_small",minimum:$.minimum,inclusive:!0,input:z,inst:_,continue:!$.abort})}}),AZ=I("$ZodCheckSizeEquals",(_,$)=>{var b;K0.init(_,$),(b=_._zod.def).when??(b.when=(Z)=>{let z=Z.value;return!X4(z)&&z.size!==void 0}),_._zod.onattach.push((Z)=>{let z=Z._zod.bag;z.minimum=$.size,z.maximum=$.size,z.size=$.size}),_._zod.check=(Z)=>{let z=Z.value,A=z.size;if(A===$.size)return;let J=A>$.size;Z.issues.push({origin:D$(z),...J?{code:"too_big",maximum:$.size}:{code:"too_small",minimum:$.size},inclusive:!0,exact:!0,input:Z.value,inst:_,continue:!$.abort})}}),JZ=I("$ZodCheckMaxLength",(_,$)=>{var b;K0.init(_,$),(b=_._zod.def).when??(b.when=(Z)=>{let z=Z.value;return!X4(z)&&z.length!==void 0}),_._zod.onattach.push((Z)=>{let z=Z._zod.bag.maximum??Number.POSITIVE_INFINITY;if($.maximum<z)Z._zod.bag.maximum=$.maximum}),_._zod.check=(Z)=>{let z=Z.value;if(z.length<=$.maximum)return;let J=k$(z);Z.issues.push({origin:J,code:"too_big",maximum:$.maximum,inclusive:!0,input:z,inst:_,continue:!$.abort})}}),UZ=I("$ZodCheckMinLength",(_,$)=>{var b;K0.init(_,$),(b=_._zod.def).when??(b.when=(Z)=>{let z=Z.value;return!X4(z)&&z.length!==void 0}),_._zod.onattach.push((Z)=>{let z=Z._zod.bag.minimum??Number.NEGATIVE_INFINITY;if($.minimum>z)Z._zod.bag.minimum=$.minimum}),_._zod.check=(Z)=>{let z=Z.value;if(z.length>=$.minimum)return;let J=k$(z);Z.issues.push({origin:J,code:"too_small",minimum:$.minimum,inclusive:!0,input:z,inst:_,continue:!$.abort})}}),GZ=I("$ZodCheckLengthEquals",(_,$)=>{var b;K0.init(_,$),(b=_._zod.def).when??(b.when=(Z)=>{let z=Z.value;return!X4(z)&&z.length!==void 0}),_._zod.onattach.push((Z)=>{let z=Z._zod.bag;z.minimum=$.length,z.maximum=$.length,z.length=$.length}),_._zod.check=(Z)=>{let z=Z.value,A=z.length;if(A===$.length)return;let J=k$(z),U=A>$.length;Z.issues.push({origin:J,...U?{code:"too_big",maximum:$.length}:{code:"too_small",minimum:$.length},inclusive:!0,exact:!0,input:Z.value,inst:_,continue:!$.abort})}}),F9=I("$ZodCheckStringFormat",(_,$)=>{var b,Z;if(K0.init(_,$),_._zod.onattach.push((z)=>{let A=z._zod.bag;if(A.format=$.format,$.pattern)A.patterns??(A.patterns=new Set),A.patterns.add($.pattern)}),$.pattern)(b=_._zod).check??(b.check=(z)=>{if($.pattern.lastIndex=0,$.pattern.test(z.value))return;z.issues.push({origin:"string",code:"invalid_format",format:$.format,input:z.value,...$.pattern?{pattern:$.pattern.toString()}:{},inst:_,continue:!$.abort})});else(Z=_._zod).check??(Z.check=()=>{})}),YZ=I("$ZodCheckRegex",(_,$)=>{F9.init(_,$),_._zod.check=(b)=>{if($.pattern.lastIndex=0,$.pattern.test(b.value))return;b.issues.push({origin:"string",code:"invalid_format",format:"regex",input:b.value,pattern:$.pattern.toString(),inst:_,continue:!$.abort})}}),XZ=I("$ZodCheckLowerCase",(_,$)=>{$.pattern??($.pattern=tb),F9.init(_,$)}),QZ=I("$ZodCheckUpperCase",(_,$)=>{$.pattern??($.pattern=sb),F9.init(_,$)}),KZ=I("$ZodCheckIncludes",(_,$)=>{K0.init(_,$);let b=Q_($.includes),Z=new RegExp(typeof $.position==="number"?`^.{${$.position}}${b}`:b);$.pattern=Z,_._zod.onattach.push((z)=>{let A=z._zod.bag;A.patterns??(A.patterns=new Set),A.patterns.add(Z)}),_._zod.check=(z)=>{if(z.value.includes($.includes,$.position))return;z.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:$.includes,input:z.value,inst:_,continue:!$.abort})}}),vZ=I("$ZodCheckStartsWith",(_,$)=>{K0.init(_,$);let b=new RegExp(`^${Q_($.prefix)}.*`);$.pattern??($.pattern=b),_._zod.onattach.push((Z)=>{let z=Z._zod.bag;z.patterns??(z.patterns=new Set),z.patterns.add(b)}),_._zod.check=(Z)=>{if(Z.value.startsWith($.prefix))return;Z.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:$.prefix,input:Z.value,inst:_,continue:!$.abort})}}),FZ=I("$ZodCheckEndsWith",(_,$)=>{K0.init(_,$);let b=new RegExp(`.*${Q_($.suffix)}$`);$.pattern??($.pattern=b),_._zod.onattach.push((Z)=>{let z=Z._zod.bag;z.patterns??(z.patterns=new Set),z.patterns.add(b)}),_._zod.check=(Z)=>{if(Z.value.endsWith($.suffix))return;Z.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:$.suffix,input:Z.value,inst:_,continue:!$.abort})}});function TG(_,$,b){if(_.issues.length)$.issues.push(...__(b,_.issues))}var HZ=I("$ZodCheckProperty",(_,$)=>{K0.init(_,$),_._zod.check=(b)=>{let Z=$.schema._zod.run({value:b.value[$.property],issues:[]},{});if(Z instanceof Promise)return Z.then((z)=>TG(z,b,$.property));TG(Z,b,$.property);return}}),qZ=I("$ZodCheckMimeType",(_,$)=>{K0.init(_,$);let b=new Set($.mime);_._zod.onattach.push((Z)=>{Z._zod.bag.mime=$.mime}),_._zod.check=(Z)=>{if(b.has(Z.value.type))return;Z.issues.push({code:"invalid_value",values:$.mime,input:Z.value.type,inst:_,continue:!$.abort})}}),VZ=I("$ZodCheckOverwrite",(_,$)=>{K0.init(_,$),_._zod.check=(b)=>{b.value=$.tx(b.value)}});class _1{constructor(_=[]){if(this.content=[],this.indent=0,this)this.args=_}indented(_){this.indent+=1,_(this),this.indent-=1}write(_){if(typeof _==="function"){_(this,{execution:"sync"}),_(this,{execution:"async"});return}let b=_.split(`
48
+ `);else console.log("\uD83C\uDF10 Opening browser..."),await Q7(Q);console.log(`⏳ Waiting for authorization... (polling every ${X}s)`),await fq(Z,J,X,$,b)}catch($){console.error("❌ Error:",$ instanceof Error?$.message:"Unknown error"),process.exit(1)}}async function fq(_,$,b,Z,z){let A=b;return new Promise((J)=>{let U=async()=>{try{let{data:G,error:Y}=await _.device.token({grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:$,client_id:"agentlogs-cli"});if(G?.access_token){console.log(`
49
+ ✅ Authorization Successful!`),console.log("\uD83D\uDD11 Access token received!");let{data:X}=await _.getSession({fetchOptions:{headers:{Authorization:`Bearer ${G.access_token}`}}});if(X?.user)await Fb(Z,X.user.email,G.access_token),vb({name:Z,baseURL:z,user:{id:X.user.id,email:X.user.email,name:X.user.name},lastLoginTime:new Date().toISOString()}),console.log(`\uD83D\uDC4B Hello, ${X.user.name}!`),console.log(`\uD83D\uDCE7 Logged in as: ${X.user.email}`),console.log(`\uD83C\uDF10 Environment: ${Z}`);else console.log("⚠️ Warning: Could not retrieve user session");J(),process.exit(0)}else if(Y)switch(Y.error){case"authorization_pending":break;case"slow_down":A+=5,console.log(`⚠️ Slowing down polling to ${A}s`);break;case"access_denied":console.error("❌ Access was denied by the user"),process.exit(1);break;case"expired_token":console.error("❌ The device code has expired. Please try again."),process.exit(1);break;default:console.error("❌ Error:",Y.error_description||Y.error),process.exit(1)}}catch(G){console.error("❌ Error:",G instanceof Error?G.message:"Unknown error"),process.exit(1)}setTimeout(U,A*1000)};setTimeout(U,A*1000)})}async function MG(_={}){let $;try{$=mq(_.hostname)}catch(Z){console.error("❌ Error:",Z instanceof Error?Z.message:"Invalid hostname"),process.exit(1)}if($.length===0){if(_.hostname)console.log(`ℹ️ Not currently logged in to ${_.hostname}`);else console.log("ℹ️ Not currently logged in to any environment");return}let b=[];for(let Z of $){let z=C2(Z);if(!z)continue;try{await xG(Z),NG(Z),b.push(z)}catch(A){console.error(`⚠️ Warning: Could not completely clear credentials for ${Z}:`,A instanceof Error?A.message:"Unknown error")}}if(b.length===0){console.log("ℹ️ No environments were logged out");return}if(b.length===1){console.log(`✅ Logged out from ${b[0].name} successfully`),console.log(`\uD83D\uDCE7 Was logged in as: ${b[0].user.email}`);return}console.log(`✅ Logged out from ${b.length} environments:`);for(let Z of b)console.log(`- ${Z.name} (${Z.user.email})`)}function mq(_){if(_){let{host:$}=O2(_);return C2($)?[$]:[]}return J9().map(($)=>$.name)}async function EG(_={}){if(_.allowMode){let Z=_.allowMode.toLowerCase();if(Z!=="allowlist"&&Z!=="denylist")console.error("Invalid allowMode. Use 'allowlist' or 'denylist'."),process.exit(1);rU(Z),console.log(`Allow mode set to: ${Z}`),console.log()}let $=E_();console.log("AgentLogs Settings"),console.log("──────────────────"),console.log(`Mode: ${$.allowMode}`),console.log(`Config: ${nU()}`),console.log();let b=Object.keys($.repos);if(b.length===0)console.log("Repos: (none configured)");else{console.log("Repos:");for(let Z of b){let z=$.repos[Z];if(z.allow){let A=z.visibility??"(server default)";console.log(` ✓ ${Z} ${A}`)}else console.log(` ✗ ${Z} (denied)`)}}process.exit(0)}async function OG(){let _=J9();if(_.length===0)console.log("❌ Not logged in"),console.log("Run `agentlogs login agentlogs.ai` to authenticate"),process.exit(1);console.log(`\uD83D\uDD10 AgentLogs Authentication Status
50
+ `);let $=!1;for(let b of _){let Z=await Kb(b.name);if(!Z){console.log(`${b.name} (${b.baseURL})`),console.log(" ❌ Token not found"),console.log(` \uD83D\uDCE7 Was: ${b.user.email}`),console.log("");continue}try{let z=P2(b.baseURL),{data:A,error:J}=await z.getSession({fetchOptions:{headers:{Authorization:`Bearer ${Z}`}}});if(J||!A?.user){console.log(`${b.name} (${b.baseURL})`),console.log(" ⚠️ Token invalid or expired"),console.log(` \uD83D\uDCE7 Was: ${b.user.email}`),console.log(` Run \`agentlogs login ${b.name}\` to re-authenticate`),console.log("");continue}if($=!0,console.log(`${b.name} (${b.baseURL})`),console.log(" ✅ Logged in"),console.log(` \uD83D\uDC64 ${A.user.name}`),console.log(` \uD83D\uDCE7 ${A.user.email}`),b.lastLoginTime){let U=new Date(b.lastLoginTime);console.log(` \uD83D\uDD50 Last login: ${U.toLocaleString()}`)}console.log("")}catch(z){console.log(`${b.name} (${b.baseURL})`),console.log(` ❌ Error verifying session: ${z instanceof Error?z.message:"Unknown error"}`),console.log("")}}if(!$)process.exit(1)}import{resolve as HK}from"path";import{spawnSync as KN}from"child_process";import{existsSync as _U,readFileSync as $U}from"fs";var M={};i_(M,{xor:()=>zX,xid:()=>NY,void:()=>aY,uuidv7:()=>DY,uuidv6:()=>qY,uuidv4:()=>HY,uuid:()=>vY,util:()=>h,url:()=>VY,uppercase:()=>V9,unknown:()=>h4,union:()=>Q6,undefined:()=>iY,ulid:()=>xY,uint64:()=>pY,uint32:()=>rY,tuple:()=>j5,trim:()=>x9,treeifyError:()=>Ib,transform:()=>F6,toUpperCase:()=>I9,toLowerCase:()=>N9,toJSONSchema:()=>f1,templateLiteral:()=>HX,symbol:()=>dY,superRefine:()=>ZJ,success:()=>KX,stringbool:()=>BX,stringFormat:()=>yY,string:()=>n1,strictObject:()=>_X,startsWith:()=>k9,slugify:()=>M9,size:()=>m4,setErrorMap:()=>qg,set:()=>UX,safeParseAsync:()=>A5,safeParse:()=>Z5,safeEncodeAsync:()=>K5,safeEncode:()=>X5,safeDecodeAsync:()=>F5,safeDecode:()=>Q5,registry:()=>Y1,regexes:()=>K_,regex:()=>q9,refine:()=>bJ,record:()=>S5,readonly:()=>e5,property:()=>L1,promise:()=>qX,prettifyError:()=>Mb,preprocess:()=>NX,prefault:()=>n5,positive:()=>P1,pipe:()=>m$,partialRecord:()=>ZX,parseAsync:()=>b5,parse:()=>z5,overwrite:()=>W_,optional:()=>C$,object:()=>sY,number:()=>H5,nullish:()=>QX,nullable:()=>f$,null:()=>k5,normalize:()=>B9,nonpositive:()=>S1,nonoptional:()=>l5,nonnegative:()=>R1,never:()=>X6,negative:()=>j1,nativeEnum:()=>GX,nanoid:()=>WY,nan:()=>FX,multipleOf:()=>g4,minSize:()=>L_,minLength:()=>_4,mime:()=>w9,meta:()=>WX,maxSize:()=>k4,maxLength:()=>u4,map:()=>JX,mac:()=>EY,lte:()=>z_,lt:()=>S_,lowercase:()=>D9,looseRecord:()=>AX,looseObject:()=>$X,locales:()=>S$,literal:()=>YX,length:()=>c4,lazy:()=>_J,ksuid:()=>IY,keyof:()=>tY,jwt:()=>TY,json:()=>xX,iso:()=>P9,ipv6:()=>OY,ipv4:()=>MY,intersection:()=>O5,int64:()=>lY,int32:()=>hY,int:()=>l1,instanceof:()=>wX,includes:()=>g9,httpUrl:()=>gY,hostname:()=>CY,hex:()=>fY,hash:()=>mY,guid:()=>FY,gte:()=>C0,gt:()=>R_,globalRegistry:()=>E0,getErrorMap:()=>Dg,function:()=>DX,fromJSONSchema:()=>MX,formatError:()=>W$,float64:()=>cY,float32:()=>uY,flattenError:()=>k$,file:()=>XX,exactOptional:()=>m5,enum:()=>K6,endsWith:()=>W9,encodeAsync:()=>G5,encode:()=>J5,emoji:()=>kY,email:()=>KY,e164:()=>LY,discriminatedUnion:()=>bX,describe:()=>kX,decodeAsync:()=>Y5,decode:()=>U5,date:()=>eY,custom:()=>gX,cuid2:()=>BY,cuid:()=>wY,core:()=>$4,config:()=>V0,coerce:()=>JJ,codec:()=>vX,clone:()=>y0,cidrv6:()=>jY,cidrv4:()=>PY,check:()=>VX,catch:()=>i5,boolean:()=>q5,bigint:()=>nY,base64url:()=>RY,base64:()=>SY,array:()=>h$,any:()=>oY,_function:()=>DX,_default:()=>h5,_ZodString:()=>p1,ZodXor:()=>I5,ZodXID:()=>s1,ZodVoid:()=>x5,ZodUnknown:()=>w5,ZodUnion:()=>n$,ZodUndefined:()=>V5,ZodUUID:()=>T_,ZodURL:()=>u$,ZodULID:()=>t1,ZodType:()=>e,ZodTuple:()=>P5,ZodTransform:()=>C5,ZodTemplateLiteral:()=>t5,ZodSymbol:()=>D5,ZodSuccess:()=>p5,ZodStringFormat:()=>Q0,ZodString:()=>S9,ZodSet:()=>L5,ZodRecord:()=>l$,ZodRealError:()=>p0,ZodReadonly:()=>a5,ZodPromise:()=>$J,ZodPrefault:()=>r5,ZodPipe:()=>q6,ZodOptional:()=>v6,ZodObject:()=>r$,ZodNumberFormat:()=>r4,ZodNumber:()=>L9,ZodNullable:()=>u5,ZodNull:()=>g5,ZodNonOptional:()=>H6,ZodNever:()=>B5,ZodNanoID:()=>o1,ZodNaN:()=>o5,ZodMap:()=>R5,ZodMAC:()=>v5,ZodLiteral:()=>T5,ZodLazy:()=>s5,ZodKSUID:()=>_6,ZodJWT:()=>G6,ZodIssueCode:()=>Hg,ZodIntersection:()=>E5,ZodISOTime:()=>h1,ZodISODuration:()=>r1,ZodISODateTime:()=>u1,ZodISODate:()=>c1,ZodIPv6:()=>z6,ZodIPv4:()=>$6,ZodGUID:()=>y$,ZodFunction:()=>zJ,ZodFirstPartyTypeKind:()=>AJ,ZodFile:()=>y5,ZodExactOptional:()=>f5,ZodError:()=>Fg,ZodEnum:()=>j9,ZodEmoji:()=>i1,ZodEmail:()=>d1,ZodE164:()=>U6,ZodDiscriminatedUnion:()=>M5,ZodDefault:()=>c5,ZodDate:()=>c$,ZodCustomStringFormat:()=>R9,ZodCustom:()=>p$,ZodCodec:()=>D6,ZodCatch:()=>d5,ZodCUID2:()=>e1,ZodCUID:()=>a1,ZodCIDRv6:()=>Z6,ZodCIDRv4:()=>b6,ZodBoolean:()=>T9,ZodBigIntFormat:()=>Y6,ZodBigInt:()=>y9,ZodBase64URL:()=>J6,ZodBase64:()=>A6,ZodArray:()=>N5,ZodAny:()=>W5,TimePrecision:()=>jA,NEVER:()=>Hb,$output:()=>NA,$input:()=>IA,$brand:()=>qb});var $4={};i_($4,{version:()=>wZ,util:()=>h,treeifyError:()=>Ib,toJSONSchema:()=>f1,toDotPath:()=>TG,safeParseAsync:()=>Ob,safeParse:()=>Eb,safeEncodeAsync:()=>VD,safeEncode:()=>qD,safeDecodeAsync:()=>gD,safeDecode:()=>DD,registry:()=>Y1,regexes:()=>K_,process:()=>A0,prettifyError:()=>Mb,parseAsync:()=>c2,parse:()=>u2,meta:()=>Q8,locales:()=>S$,isValidJWT:()=>_Y,isValidBase64URL:()=>sG,isValidBase64:()=>nZ,initializeContext:()=>W4,globalRegistry:()=>E0,globalConfig:()=>K$,formatError:()=>W$,flattenError:()=>k$,finalize:()=>B4,extractDefs:()=>w4,encodeAsync:()=>vD,encode:()=>KD,describe:()=>X8,decodeAsync:()=>HD,decode:()=>FD,createToJSONSchemaMethod:()=>F8,createStandardJSONSchemaMethod:()=>O9,config:()=>V0,clone:()=>y0,_xor:()=>rV,_xid:()=>k1,_void:()=>$8,_uuidv7:()=>v1,_uuidv6:()=>F1,_uuidv4:()=>K1,_uuid:()=>Q1,_url:()=>L$,_uppercase:()=>V9,_unknown:()=>sA,_union:()=>hV,_undefined:()=>aA,_ulid:()=>g1,_uint64:()=>iA,_uint32:()=>hA,_tuple:()=>pV,_trim:()=>x9,_transform:()=>sV,_toUpperCase:()=>I9,_toLowerCase:()=>N9,_templateLiteral:()=>Gg,_symbol:()=>oA,_superRefine:()=>Y8,_success:()=>Zg,_stringbool:()=>K8,_stringFormat:()=>E9,_string:()=>EA,_startsWith:()=>k9,_slugify:()=>M9,_size:()=>m4,_set:()=>oV,_safeParseAsync:()=>F9,_safeParse:()=>K9,_safeEncodeAsync:()=>i2,_safeEncode:()=>p2,_safeDecodeAsync:()=>o2,_safeDecode:()=>d2,_regex:()=>q9,_refine:()=>G8,_record:()=>dV,_readonly:()=>Ug,_property:()=>L1,_promise:()=>Xg,_positive:()=>P1,_pipe:()=>Jg,_parseAsync:()=>Q9,_parse:()=>X9,_overwrite:()=>W_,_optional:()=>_g,_number:()=>yA,_nullable:()=>$g,_null:()=>eA,_normalize:()=>B9,_nonpositive:()=>S1,_nonoptional:()=>bg,_nonnegative:()=>R1,_never:()=>_8,_negative:()=>j1,_nativeEnum:()=>eV,_nanoid:()=>q1,_nan:()=>Z8,_multipleOf:()=>g4,_minSize:()=>L_,_minLength:()=>_4,_min:()=>C0,_mime:()=>w9,_maxSize:()=>k4,_maxLength:()=>u4,_max:()=>z_,_map:()=>iV,_mac:()=>PA,_lte:()=>z_,_lt:()=>S_,_lowercase:()=>D9,_literal:()=>tV,_length:()=>c4,_lazy:()=>Yg,_ksuid:()=>W1,_jwt:()=>O1,_isoTime:()=>LA,_isoDuration:()=>TA,_isoDateTime:()=>SA,_isoDate:()=>RA,_ipv6:()=>B1,_ipv4:()=>w1,_intersection:()=>lV,_int64:()=>dA,_int32:()=>cA,_int:()=>fA,_includes:()=>g9,_guid:()=>R$,_gte:()=>C0,_gt:()=>R_,_float64:()=>uA,_float32:()=>mA,_file:()=>J8,_enum:()=>aV,_endsWith:()=>W9,_encodeAsync:()=>n2,_encode:()=>h2,_emoji:()=>H1,_email:()=>X1,_e164:()=>E1,_discriminatedUnion:()=>nV,_default:()=>zg,_decodeAsync:()=>l2,_decode:()=>r2,_date:()=>z8,_custom:()=>U8,_cuid2:()=>V1,_cuid:()=>D1,_coercedString:()=>OA,_coercedNumber:()=>CA,_coercedDate:()=>b8,_coercedBoolean:()=>nA,_coercedBigint:()=>pA,_cidrv6:()=>N1,_cidrv4:()=>x1,_check:()=>YY,_catch:()=>Ag,_boolean:()=>rA,_bigint:()=>lA,_base64url:()=>M1,_base64:()=>I1,_array:()=>A8,_any:()=>tA,TimePrecision:()=>jA,NEVER:()=>Hb,JSONSchemaGenerator:()=>e8,JSONSchema:()=>XY,Doc:()=>s2,$output:()=>NA,$input:()=>IA,$constructor:()=>I,$brand:()=>qb,$ZodXor:()=>G3,$ZodXID:()=>RZ,$ZodVoid:()=>Z3,$ZodUnknown:()=>z3,$ZodUnion:()=>I$,$ZodUndefined:()=>sZ,$ZodUUID:()=>NZ,$ZodURL:()=>MZ,$ZodULID:()=>SZ,$ZodType:()=>i,$ZodTuple:()=>U1,$ZodTransform:()=>D3,$ZodTemplateLiteral:()=>E3,$ZodSymbol:()=>tZ,$ZodSuccess:()=>B3,$ZodStringFormat:()=>X0,$ZodString:()=>f4,$ZodSet:()=>F3,$ZodRegistry:()=>MA,$ZodRecord:()=>Q3,$ZodRealError:()=>l0,$ZodReadonly:()=>M3,$ZodPromise:()=>P3,$ZodPrefault:()=>W3,$ZodPipe:()=>I3,$ZodOptional:()=>G1,$ZodObjectJIT:()=>U3,$ZodObject:()=>bY,$ZodNumberFormat:()=>aZ,$ZodNumber:()=>A1,$ZodNullable:()=>g3,$ZodNull:()=>_3,$ZodNonOptional:()=>w3,$ZodNever:()=>b3,$ZodNanoID:()=>OZ,$ZodNaN:()=>N3,$ZodMap:()=>K3,$ZodMAC:()=>cZ,$ZodLiteral:()=>H3,$ZodLazy:()=>j3,$ZodKSUID:()=>LZ,$ZodJWT:()=>iZ,$ZodIntersection:()=>X3,$ZodISOTime:()=>CZ,$ZodISODuration:()=>fZ,$ZodISODateTime:()=>TZ,$ZodISODate:()=>yZ,$ZodIPv6:()=>uZ,$ZodIPv4:()=>mZ,$ZodGUID:()=>xZ,$ZodFunction:()=>O3,$ZodFile:()=>q3,$ZodExactOptional:()=>V3,$ZodError:()=>g$,$ZodEnum:()=>v3,$ZodEncodeError:()=>T4,$ZodEmoji:()=>EZ,$ZodEmail:()=>IZ,$ZodE164:()=>dZ,$ZodDiscriminatedUnion:()=>Y3,$ZodDefault:()=>k3,$ZodDate:()=>A3,$ZodCustomStringFormat:()=>oZ,$ZodCustom:()=>S3,$ZodCodec:()=>M$,$ZodCheckUpperCase:()=>HZ,$ZodCheckStringFormat:()=>v9,$ZodCheckStartsWith:()=>DZ,$ZodCheckSizeEquals:()=>YZ,$ZodCheckRegex:()=>FZ,$ZodCheckProperty:()=>gZ,$ZodCheckOverwrite:()=>WZ,$ZodCheckNumberFormat:()=>AZ,$ZodCheckMultipleOf:()=>ZZ,$ZodCheckMinSize:()=>GZ,$ZodCheckMinLength:()=>QZ,$ZodCheckMimeType:()=>kZ,$ZodCheckMaxSize:()=>UZ,$ZodCheckMaxLength:()=>XZ,$ZodCheckLowerCase:()=>vZ,$ZodCheckLessThan:()=>e2,$ZodCheckLengthEquals:()=>KZ,$ZodCheckIncludes:()=>qZ,$ZodCheckGreaterThan:()=>t2,$ZodCheckEndsWith:()=>VZ,$ZodCheckBigIntFormat:()=>JZ,$ZodCheck:()=>K0,$ZodCatch:()=>x3,$ZodCUID2:()=>jZ,$ZodCUID:()=>PZ,$ZodCIDRv6:()=>rZ,$ZodCIDRv4:()=>hZ,$ZodBoolean:()=>N$,$ZodBigIntFormat:()=>eZ,$ZodBigInt:()=>J1,$ZodBase64URL:()=>pZ,$ZodBase64:()=>lZ,$ZodAsyncError:()=>j_,$ZodArray:()=>J3,$ZodAny:()=>$3});var Hb=Object.freeze({status:"aborted"});function I(_,$,b){function Z(U,G){if(!U._zod)Object.defineProperty(U,"_zod",{value:{def:G,constr:J,traits:new Set},enumerable:!1});if(U._zod.traits.has(_))return;U._zod.traits.add(_),$(U,G);let Y=J.prototype,X=Object.keys(Y);for(let Q=0;Q<X.length;Q++){let K=X[Q];if(!(K in U))U[K]=Y[K].bind(U)}}let z=b?.Parent??Object;class A extends z{}Object.defineProperty(A,"name",{value:_});function J(U){var G;let Y=b?.Parent?new A:this;Z(Y,U),(G=Y._zod).deferred??(G.deferred=[]);for(let X of Y._zod.deferred)X();return Y}return Object.defineProperty(J,"init",{value:Z}),Object.defineProperty(J,Symbol.hasInstance,{value:(U)=>{if(b?.Parent&&U instanceof b.Parent)return!0;return U?._zod?.traits?.has(_)}}),Object.defineProperty(J,"name",{value:_}),J}var qb=Symbol("zod_brand");class j_ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class T4 extends Error{constructor(_){super(`Encountered unidirectional transform during encode: ${_}`);this.name="ZodEncodeError"}}var K$={};function V0(_){if(_)Object.assign(K$,_);return K$}var h={};i_(h,{unwrapMessage:()=>F$,uint8ArrayToHex:()=>XD,uint8ArrayToBase64url:()=>GD,uint8ArrayToBase64:()=>SG,stringifyPrimitive:()=>m,slugify:()=>gb,shallowClone:()=>Wb,safeExtend:()=>zD,required:()=>AD,randomString:()=>oq,propertyKeyTypes:()=>q$,promiseAllObject:()=>iq,primitiveTypes:()=>wb,prefixIssues:()=>$_,pick:()=>sq,partial:()=>ZD,parsedType:()=>c,optionalKeys:()=>Bb,omit:()=>_D,objectClone:()=>lq,numKeys:()=>aq,nullish:()=>H4,normalizeParams:()=>r,mergeDefs:()=>s_,merge:()=>bD,jsonStringifyReplacer:()=>U9,joinValues:()=>R,issue:()=>Y9,isPlainObject:()=>D4,isObject:()=>y4,hexToUint8Array:()=>YD,getSizableOrigin:()=>D$,getParsedType:()=>eq,getLengthableOrigin:()=>V$,getEnumValues:()=>v$,getElementAtPath:()=>dq,floatSafeRemainder:()=>Vb,finalizeIssue:()=>n0,extend:()=>$D,escapeRegex:()=>Q_,esc:()=>f2,defineLazy:()=>t,createTransparentProxy:()=>tq,cloneDef:()=>pq,clone:()=>y0,cleanRegex:()=>H$,cleanEnum:()=>JD,captureStackTrace:()=>m2,cached:()=>G9,base64urlToUint8Array:()=>UD,base64ToUint8Array:()=>jG,assignProp:()=>q4,assertNotEqual:()=>cq,assertNever:()=>rq,assertIs:()=>hq,assertEqual:()=>uq,assert:()=>nq,allowsEval:()=>kb,aborted:()=>V4,NUMBER_FORMAT_RANGES:()=>xb,Class:()=>RG,BIGINT_FORMAT_RANGES:()=>Nb});function uq(_){return _}function cq(_){return _}function hq(_){}function rq(_){throw Error("Unexpected value in exhaustive check")}function nq(_){}function v$(_){let $=Object.values(_).filter((Z)=>typeof Z==="number");return Object.entries(_).filter(([Z,z])=>$.indexOf(+Z)===-1).map(([Z,z])=>z)}function R(_,$="|"){return _.map((b)=>m(b)).join($)}function U9(_,$){if(typeof $==="bigint")return $.toString();return $}function G9(_){return{get value(){{let b=_();return Object.defineProperty(this,"value",{value:b}),b}throw Error("cached value already set")}}}function H4(_){return _===null||_===void 0}function H$(_){let $=_.startsWith("^")?1:0,b=_.endsWith("$")?_.length-1:_.length;return _.slice($,b)}function Vb(_,$){let b=(_.toString().split(".")[1]||"").length,Z=$.toString(),z=(Z.split(".")[1]||"").length;if(z===0&&/\d?e-\d?/.test(Z)){let G=Z.match(/\d?e-(\d?)/);if(G?.[1])z=Number.parseInt(G[1])}let A=b>z?b:z,J=Number.parseInt(_.toFixed(A).replace(".","")),U=Number.parseInt($.toFixed(A).replace(".",""));return J%U/10**A}var PG=Symbol("evaluating");function t(_,$,b){let Z=void 0;Object.defineProperty(_,$,{get(){if(Z===PG)return;if(Z===void 0)Z=PG,Z=b();return Z},set(z){Object.defineProperty(_,$,{value:z})},configurable:!0})}function lq(_){return Object.create(Object.getPrototypeOf(_),Object.getOwnPropertyDescriptors(_))}function q4(_,$,b){Object.defineProperty(_,$,{value:b,writable:!0,enumerable:!0,configurable:!0})}function s_(..._){let $={};for(let b of _){let Z=Object.getOwnPropertyDescriptors(b);Object.assign($,Z)}return Object.defineProperties({},$)}function pq(_){return s_(_._zod.def)}function dq(_,$){if(!$)return _;return $.reduce((b,Z)=>b?.[Z],_)}function iq(_){let $=Object.keys(_),b=$.map((Z)=>_[Z]);return Promise.all(b).then((Z)=>{let z={};for(let A=0;A<$.length;A++)z[$[A]]=Z[A];return z})}function oq(_=10){let b="";for(let Z=0;Z<_;Z++)b+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return b}function f2(_){return JSON.stringify(_)}function gb(_){return _.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var m2="captureStackTrace"in Error?Error.captureStackTrace:(..._)=>{};function y4(_){return typeof _==="object"&&_!==null&&!Array.isArray(_)}var kb=G9(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(_){return!1}});function D4(_){if(y4(_)===!1)return!1;let $=_.constructor;if($===void 0)return!0;if(typeof $!=="function")return!0;let b=$.prototype;if(y4(b)===!1)return!1;if(Object.prototype.hasOwnProperty.call(b,"isPrototypeOf")===!1)return!1;return!0}function Wb(_){if(D4(_))return{..._};if(Array.isArray(_))return[..._];return _}function aq(_){let $=0;for(let b in _)if(Object.prototype.hasOwnProperty.call(_,b))$++;return $}var eq=(_)=>{let $=typeof _;switch($){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(_)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(_))return"array";if(_===null)return"null";if(_.then&&typeof _.then==="function"&&_.catch&&typeof _.catch==="function")return"promise";if(typeof Map<"u"&&_ instanceof Map)return"map";if(typeof Set<"u"&&_ instanceof Set)return"set";if(typeof Date<"u"&&_ instanceof Date)return"date";if(typeof File<"u"&&_ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${$}`)}},q$=new Set(["string","number","symbol"]),wb=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Q_(_){return _.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function y0(_,$,b){let Z=new _._zod.constr($??_._zod.def);if(!$||b?.parent)Z._zod.parent=_;return Z}function r(_){let $=_;if(!$)return{};if(typeof $==="string")return{error:()=>$};if($?.message!==void 0){if($?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");$.error=$.message}if(delete $.message,typeof $.error==="string")return{...$,error:()=>$.error};return $}function tq(_){let $;return new Proxy({},{get(b,Z,z){return $??($=_()),Reflect.get($,Z,z)},set(b,Z,z,A){return $??($=_()),Reflect.set($,Z,z,A)},has(b,Z){return $??($=_()),Reflect.has($,Z)},deleteProperty(b,Z){return $??($=_()),Reflect.deleteProperty($,Z)},ownKeys(b){return $??($=_()),Reflect.ownKeys($)},getOwnPropertyDescriptor(b,Z){return $??($=_()),Reflect.getOwnPropertyDescriptor($,Z)},defineProperty(b,Z,z){return $??($=_()),Reflect.defineProperty($,Z,z)}})}function m(_){if(typeof _==="bigint")return _.toString()+"n";if(typeof _==="string")return`"${_}"`;return`${_}`}function Bb(_){return Object.keys(_).filter(($)=>{return _[$]._zod.optin==="optional"&&_[$]._zod.optout==="optional"})}var xb={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]},Nb={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function sq(_,$){let b=_._zod.def,Z=b.checks;if(Z&&Z.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let A=s_(_._zod.def,{get shape(){let J={};for(let U in $){if(!(U in b.shape))throw Error(`Unrecognized key: "${U}"`);if(!$[U])continue;J[U]=b.shape[U]}return q4(this,"shape",J),J},checks:[]});return y0(_,A)}function _D(_,$){let b=_._zod.def,Z=b.checks;if(Z&&Z.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let A=s_(_._zod.def,{get shape(){let J={..._._zod.def.shape};for(let U in $){if(!(U in b.shape))throw Error(`Unrecognized key: "${U}"`);if(!$[U])continue;delete J[U]}return q4(this,"shape",J),J},checks:[]});return y0(_,A)}function $D(_,$){if(!D4($))throw Error("Invalid input to extend: expected a plain object");let b=_._zod.def.checks;if(b&&b.length>0){let A=_._zod.def.shape;for(let J in $)if(Object.getOwnPropertyDescriptor(A,J)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let z=s_(_._zod.def,{get shape(){let A={..._._zod.def.shape,...$};return q4(this,"shape",A),A}});return y0(_,z)}function zD(_,$){if(!D4($))throw Error("Invalid input to safeExtend: expected a plain object");let b=s_(_._zod.def,{get shape(){let Z={..._._zod.def.shape,...$};return q4(this,"shape",Z),Z}});return y0(_,b)}function bD(_,$){let b=s_(_._zod.def,{get shape(){let Z={..._._zod.def.shape,...$._zod.def.shape};return q4(this,"shape",Z),Z},get catchall(){return $._zod.def.catchall},checks:[]});return y0(_,b)}function ZD(_,$,b){let z=$._zod.def.checks;if(z&&z.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let J=s_($._zod.def,{get shape(){let U=$._zod.def.shape,G={...U};if(b)for(let Y in b){if(!(Y in U))throw Error(`Unrecognized key: "${Y}"`);if(!b[Y])continue;G[Y]=_?new _({type:"optional",innerType:U[Y]}):U[Y]}else for(let Y in U)G[Y]=_?new _({type:"optional",innerType:U[Y]}):U[Y];return q4(this,"shape",G),G},checks:[]});return y0($,J)}function AD(_,$,b){let Z=s_($._zod.def,{get shape(){let z=$._zod.def.shape,A={...z};if(b)for(let J in b){if(!(J in A))throw Error(`Unrecognized key: "${J}"`);if(!b[J])continue;A[J]=new _({type:"nonoptional",innerType:z[J]})}else for(let J in z)A[J]=new _({type:"nonoptional",innerType:z[J]});return q4(this,"shape",A),A}});return y0($,Z)}function V4(_,$=0){if(_.aborted===!0)return!0;for(let b=$;b<_.issues.length;b++)if(_.issues[b]?.continue!==!0)return!0;return!1}function $_(_,$){return $.map((b)=>{var Z;return(Z=b).path??(Z.path=[]),b.path.unshift(_),b})}function F$(_){return typeof _==="string"?_:_?.message}function n0(_,$,b){let Z={..._,path:_.path??[]};if(!_.message){let z=F$(_.inst?._zod.def?.error?.(_))??F$($?.error?.(_))??F$(b.customError?.(_))??F$(b.localeError?.(_))??"Invalid input";Z.message=z}if(delete Z.inst,delete Z.continue,!$?.reportInput)delete Z.input;return Z}function D$(_){if(_ instanceof Set)return"set";if(_ instanceof Map)return"map";if(_ instanceof File)return"file";return"unknown"}function V$(_){if(Array.isArray(_))return"array";if(typeof _==="string")return"string";return"unknown"}function c(_){let $=typeof _;switch($){case"number":return Number.isNaN(_)?"nan":"number";case"object":{if(_===null)return"null";if(Array.isArray(_))return"array";let b=_;if(b&&Object.getPrototypeOf(b)!==Object.prototype&&"constructor"in b&&b.constructor)return b.constructor.name}}return $}function Y9(..._){let[$,b,Z]=_;if(typeof $==="string")return{message:$,code:"custom",input:b,inst:Z};return{...$}}function JD(_){return Object.entries(_).filter(([$,b])=>{return Number.isNaN(Number.parseInt($,10))}).map(($)=>$[1])}function jG(_){let $=atob(_),b=new Uint8Array($.length);for(let Z=0;Z<$.length;Z++)b[Z]=$.charCodeAt(Z);return b}function SG(_){let $="";for(let b=0;b<_.length;b++)$+=String.fromCharCode(_[b]);return btoa($)}function UD(_){let $=_.replace(/-/g,"+").replace(/_/g,"/"),b="=".repeat((4-$.length%4)%4);return jG($+b)}function GD(_){return SG(_).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function YD(_){let $=_.replace(/^0x/,"");if($.length%2!==0)throw Error("Invalid hex string length");let b=new Uint8Array($.length/2);for(let Z=0;Z<$.length;Z+=2)b[Z/2]=Number.parseInt($.slice(Z,Z+2),16);return b}function XD(_){return Array.from(_).map(($)=>$.toString(16).padStart(2,"0")).join("")}class RG{constructor(..._){}}var LG=(_,$)=>{_.name="$ZodError",Object.defineProperty(_,"_zod",{value:_._zod,enumerable:!1}),Object.defineProperty(_,"issues",{value:$,enumerable:!1}),_.message=JSON.stringify($,U9,2),Object.defineProperty(_,"toString",{value:()=>_.message,enumerable:!1})},g$=I("$ZodError",LG),l0=I("$ZodError",LG,{Parent:Error});function k$(_,$=(b)=>b.message){let b={},Z=[];for(let z of _.issues)if(z.path.length>0)b[z.path[0]]=b[z.path[0]]||[],b[z.path[0]].push($(z));else Z.push($(z));return{formErrors:Z,fieldErrors:b}}function W$(_,$=(b)=>b.message){let b={_errors:[]},Z=(z)=>{for(let A of z.issues)if(A.code==="invalid_union"&&A.errors.length)A.errors.map((J)=>Z({issues:J}));else if(A.code==="invalid_key")Z({issues:A.issues});else if(A.code==="invalid_element")Z({issues:A.issues});else if(A.path.length===0)b._errors.push($(A));else{let J=b,U=0;while(U<A.path.length){let G=A.path[U];if(U!==A.path.length-1)J[G]=J[G]||{_errors:[]};else J[G]=J[G]||{_errors:[]},J[G]._errors.push($(A));J=J[G],U++}}};return Z(_),b}function Ib(_,$=(b)=>b.message){let b={errors:[]},Z=(z,A=[])=>{var J,U;for(let G of z.issues)if(G.code==="invalid_union"&&G.errors.length)G.errors.map((Y)=>Z({issues:Y},G.path));else if(G.code==="invalid_key")Z({issues:G.issues},G.path);else if(G.code==="invalid_element")Z({issues:G.issues},G.path);else{let Y=[...A,...G.path];if(Y.length===0){b.errors.push($(G));continue}let X=b,Q=0;while(Q<Y.length){let K=Y[Q],v=Q===Y.length-1;if(typeof K==="string")X.properties??(X.properties={}),(J=X.properties)[K]??(J[K]={errors:[]}),X=X.properties[K];else X.items??(X.items=[]),(U=X.items)[K]??(U[K]={errors:[]}),X=X.items[K];if(v)X.errors.push($(G));Q++}}};return Z(_),b}function TG(_){let $=[],b=_.map((Z)=>typeof Z==="object"?Z.key:Z);for(let Z of b)if(typeof Z==="number")$.push(`[${Z}]`);else if(typeof Z==="symbol")$.push(`[${JSON.stringify(String(Z))}]`);else if(/[^\w$]/.test(Z))$.push(`[${JSON.stringify(Z)}]`);else{if($.length)$.push(".");$.push(Z)}return $.join("")}function Mb(_){let $=[],b=[..._.issues].sort((Z,z)=>(Z.path??[]).length-(z.path??[]).length);for(let Z of b)if($.push(`✖ ${Z.message}`),Z.path?.length)$.push(` → at ${TG(Z.path)}`);return $.join(`
51
+ `)}var X9=(_)=>($,b,Z,z)=>{let A=Z?Object.assign(Z,{async:!1}):{async:!1},J=$._zod.run({value:b,issues:[]},A);if(J instanceof Promise)throw new j_;if(J.issues.length){let U=new(z?.Err??_)(J.issues.map((G)=>n0(G,A,V0())));throw m2(U,z?.callee),U}return J.value},u2=X9(l0),Q9=(_)=>async($,b,Z,z)=>{let A=Z?Object.assign(Z,{async:!0}):{async:!0},J=$._zod.run({value:b,issues:[]},A);if(J instanceof Promise)J=await J;if(J.issues.length){let U=new(z?.Err??_)(J.issues.map((G)=>n0(G,A,V0())));throw m2(U,z?.callee),U}return J.value},c2=Q9(l0),K9=(_)=>($,b,Z)=>{let z=Z?{...Z,async:!1}:{async:!1},A=$._zod.run({value:b,issues:[]},z);if(A instanceof Promise)throw new j_;return A.issues.length?{success:!1,error:new(_??g$)(A.issues.map((J)=>n0(J,z,V0())))}:{success:!0,data:A.value}},Eb=K9(l0),F9=(_)=>async($,b,Z)=>{let z=Z?Object.assign(Z,{async:!0}):{async:!0},A=$._zod.run({value:b,issues:[]},z);if(A instanceof Promise)A=await A;return A.issues.length?{success:!1,error:new _(A.issues.map((J)=>n0(J,z,V0())))}:{success:!0,data:A.value}},Ob=F9(l0),h2=(_)=>($,b,Z)=>{let z=Z?Object.assign(Z,{direction:"backward"}):{direction:"backward"};return X9(_)($,b,z)},KD=h2(l0),r2=(_)=>($,b,Z)=>{return X9(_)($,b,Z)},FD=r2(l0),n2=(_)=>async($,b,Z)=>{let z=Z?Object.assign(Z,{direction:"backward"}):{direction:"backward"};return Q9(_)($,b,z)},vD=n2(l0),l2=(_)=>async($,b,Z)=>{return Q9(_)($,b,Z)},HD=l2(l0),p2=(_)=>($,b,Z)=>{let z=Z?Object.assign(Z,{direction:"backward"}):{direction:"backward"};return K9(_)($,b,z)},qD=p2(l0),d2=(_)=>($,b,Z)=>{return K9(_)($,b,Z)},DD=d2(l0),i2=(_)=>async($,b,Z)=>{let z=Z?Object.assign(Z,{direction:"backward"}):{direction:"backward"};return F9(_)($,b,z)},VD=i2(l0),o2=(_)=>async($,b,Z)=>{return F9(_)($,b,Z)},gD=o2(l0);var K_={};i_(K_,{xid:()=>Rb,uuid7:()=>BD,uuid6:()=>wD,uuid4:()=>WD,uuid:()=>C4,uppercase:()=>bZ,unicodeEmail:()=>yG,undefined:()=>$Z,ulid:()=>Sb,time:()=>ib,string:()=>ab,sha512_hex:()=>nD,sha512_base64url:()=>pD,sha512_base64:()=>lD,sha384_hex:()=>cD,sha384_base64url:()=>rD,sha384_base64:()=>hD,sha256_hex:()=>fD,sha256_base64url:()=>uD,sha256_base64:()=>mD,sha1_hex:()=>TD,sha1_base64url:()=>CD,sha1_base64:()=>yD,rfc5322Email:()=>ND,number:()=>w$,null:()=>_Z,nanoid:()=>Tb,md5_hex:()=>SD,md5_base64url:()=>LD,md5_base64:()=>RD,mac:()=>hb,lowercase:()=>zZ,ksuid:()=>Lb,ipv6:()=>cb,ipv4:()=>ub,integer:()=>tb,idnEmail:()=>ID,html5Email:()=>xD,hostname:()=>OD,hex:()=>jD,guid:()=>Cb,extendedDuration:()=>kD,emoji:()=>mb,email:()=>fb,e164:()=>pb,duration:()=>yb,domain:()=>PD,datetime:()=>ob,date:()=>db,cuid2:()=>jb,cuid:()=>Pb,cidrv6:()=>nb,cidrv4:()=>rb,browserEmail:()=>MD,boolean:()=>sb,bigint:()=>eb,base64url:()=>a2,base64:()=>lb});var Pb=/^[cC][^\s-]{8,}$/,jb=/^[0-9a-z]+$/,Sb=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Rb=/^[0-9a-vA-V]{20}$/,Lb=/^[A-Za-z0-9]{27}$/,Tb=/^[a-zA-Z0-9_-]{21}$/,yb=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,kD=/^[-+]?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)?)??$/,Cb=/^([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})$/,C4=(_)=>{if(!_)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|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${_}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},WD=C4(4),wD=C4(6),BD=C4(7),fb=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,xD=/^[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])?)*$/,ND=/^(([^<>()\[\]\\.,;:\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,}))$/,yG=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ID=yG,MD=/^[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])?)*$/,ED="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function mb(){return new RegExp(ED,"u")}var ub=/^(?:(?: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])$/,cb=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,hb=(_)=>{let $=Q_(_??":");return new RegExp(`^(?:[0-9A-F]{2}${$}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${$}){5}[0-9a-f]{2}$`)},rb=/^((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])$/,nb=/^(([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])$/,lb=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,a2=/^[A-Za-z0-9_-]*$/,OD=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,PD=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,pb=/^\+[1-9]\d{6,14}$/,CG="(?:(?:\\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])))",db=new RegExp(`^${CG}$`);function fG(_){return typeof _.precision==="number"?_.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":_.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{${_.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function ib(_){return new RegExp(`^${fG(_)}$`)}function ob(_){let $=fG({precision:_.precision}),b=["Z"];if(_.local)b.push("");if(_.offset)b.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let Z=`${$}(?:${b.join("|")})`;return new RegExp(`^${CG}T(?:${Z})$`)}var ab=(_)=>{let $=_?`[\\s\\S]{${_?.minimum??0},${_?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${$}$`)},eb=/^-?\d+n?$/,tb=/^-?\d+$/,w$=/^-?\d+(?:\.\d+)?$/,sb=/^(?:true|false)$/i,_Z=/^null$/i;var $Z=/^undefined$/i;var zZ=/^[^A-Z]*$/,bZ=/^[^a-z]*$/,jD=/^[0-9a-fA-F]*$/;function B$(_,$){return new RegExp(`^[A-Za-z0-9+/]{${_}}${$}$`)}function x$(_){return new RegExp(`^[A-Za-z0-9_-]{${_}}$`)}var SD=/^[0-9a-fA-F]{32}$/,RD=B$(22,"=="),LD=x$(22),TD=/^[0-9a-fA-F]{40}$/,yD=B$(27,"="),CD=x$(27),fD=/^[0-9a-fA-F]{64}$/,mD=B$(43,"="),uD=x$(43),cD=/^[0-9a-fA-F]{96}$/,hD=B$(64,""),rD=x$(64),nD=/^[0-9a-fA-F]{128}$/,lD=B$(86,"=="),pD=x$(86);var K0=I("$ZodCheck",(_,$)=>{var b;_._zod??(_._zod={}),_._zod.def=$,(b=_._zod).onattach??(b.onattach=[])}),uG={number:"number",bigint:"bigint",object:"date"},e2=I("$ZodCheckLessThan",(_,$)=>{K0.init(_,$);let b=uG[typeof $.value];_._zod.onattach.push((Z)=>{let z=Z._zod.bag,A=($.inclusive?z.maximum:z.exclusiveMaximum)??Number.POSITIVE_INFINITY;if($.value<A)if($.inclusive)z.maximum=$.value;else z.exclusiveMaximum=$.value}),_._zod.check=(Z)=>{if($.inclusive?Z.value<=$.value:Z.value<$.value)return;Z.issues.push({origin:b,code:"too_big",maximum:typeof $.value==="object"?$.value.getTime():$.value,input:Z.value,inclusive:$.inclusive,inst:_,continue:!$.abort})}}),t2=I("$ZodCheckGreaterThan",(_,$)=>{K0.init(_,$);let b=uG[typeof $.value];_._zod.onattach.push((Z)=>{let z=Z._zod.bag,A=($.inclusive?z.minimum:z.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if($.value>A)if($.inclusive)z.minimum=$.value;else z.exclusiveMinimum=$.value}),_._zod.check=(Z)=>{if($.inclusive?Z.value>=$.value:Z.value>$.value)return;Z.issues.push({origin:b,code:"too_small",minimum:typeof $.value==="object"?$.value.getTime():$.value,input:Z.value,inclusive:$.inclusive,inst:_,continue:!$.abort})}}),ZZ=I("$ZodCheckMultipleOf",(_,$)=>{K0.init(_,$),_._zod.onattach.push((b)=>{var Z;(Z=b._zod.bag).multipleOf??(Z.multipleOf=$.value)}),_._zod.check=(b)=>{if(typeof b.value!==typeof $.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof b.value==="bigint"?b.value%$.value===BigInt(0):Vb(b.value,$.value)===0)return;b.issues.push({origin:typeof b.value,code:"not_multiple_of",divisor:$.value,input:b.value,inst:_,continue:!$.abort})}}),AZ=I("$ZodCheckNumberFormat",(_,$)=>{K0.init(_,$),$.format=$.format||"float64";let b=$.format?.includes("int"),Z=b?"int":"number",[z,A]=xb[$.format];_._zod.onattach.push((J)=>{let U=J._zod.bag;if(U.format=$.format,U.minimum=z,U.maximum=A,b)U.pattern=tb}),_._zod.check=(J)=>{let U=J.value;if(b){if(!Number.isInteger(U)){J.issues.push({expected:Z,format:$.format,code:"invalid_type",continue:!1,input:U,inst:_});return}if(!Number.isSafeInteger(U)){if(U>0)J.issues.push({input:U,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:_,origin:Z,inclusive:!0,continue:!$.abort});else J.issues.push({input:U,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:_,origin:Z,inclusive:!0,continue:!$.abort});return}}if(U<z)J.issues.push({origin:"number",input:U,code:"too_small",minimum:z,inclusive:!0,inst:_,continue:!$.abort});if(U>A)J.issues.push({origin:"number",input:U,code:"too_big",maximum:A,inclusive:!0,inst:_,continue:!$.abort})}}),JZ=I("$ZodCheckBigIntFormat",(_,$)=>{K0.init(_,$);let[b,Z]=Nb[$.format];_._zod.onattach.push((z)=>{let A=z._zod.bag;A.format=$.format,A.minimum=b,A.maximum=Z}),_._zod.check=(z)=>{let A=z.value;if(A<b)z.issues.push({origin:"bigint",input:A,code:"too_small",minimum:b,inclusive:!0,inst:_,continue:!$.abort});if(A>Z)z.issues.push({origin:"bigint",input:A,code:"too_big",maximum:Z,inclusive:!0,inst:_,continue:!$.abort})}}),UZ=I("$ZodCheckMaxSize",(_,$)=>{var b;K0.init(_,$),(b=_._zod.def).when??(b.when=(Z)=>{let z=Z.value;return!H4(z)&&z.size!==void 0}),_._zod.onattach.push((Z)=>{let z=Z._zod.bag.maximum??Number.POSITIVE_INFINITY;if($.maximum<z)Z._zod.bag.maximum=$.maximum}),_._zod.check=(Z)=>{let z=Z.value;if(z.size<=$.maximum)return;Z.issues.push({origin:D$(z),code:"too_big",maximum:$.maximum,inclusive:!0,input:z,inst:_,continue:!$.abort})}}),GZ=I("$ZodCheckMinSize",(_,$)=>{var b;K0.init(_,$),(b=_._zod.def).when??(b.when=(Z)=>{let z=Z.value;return!H4(z)&&z.size!==void 0}),_._zod.onattach.push((Z)=>{let z=Z._zod.bag.minimum??Number.NEGATIVE_INFINITY;if($.minimum>z)Z._zod.bag.minimum=$.minimum}),_._zod.check=(Z)=>{let z=Z.value;if(z.size>=$.minimum)return;Z.issues.push({origin:D$(z),code:"too_small",minimum:$.minimum,inclusive:!0,input:z,inst:_,continue:!$.abort})}}),YZ=I("$ZodCheckSizeEquals",(_,$)=>{var b;K0.init(_,$),(b=_._zod.def).when??(b.when=(Z)=>{let z=Z.value;return!H4(z)&&z.size!==void 0}),_._zod.onattach.push((Z)=>{let z=Z._zod.bag;z.minimum=$.size,z.maximum=$.size,z.size=$.size}),_._zod.check=(Z)=>{let z=Z.value,A=z.size;if(A===$.size)return;let J=A>$.size;Z.issues.push({origin:D$(z),...J?{code:"too_big",maximum:$.size}:{code:"too_small",minimum:$.size},inclusive:!0,exact:!0,input:Z.value,inst:_,continue:!$.abort})}}),XZ=I("$ZodCheckMaxLength",(_,$)=>{var b;K0.init(_,$),(b=_._zod.def).when??(b.when=(Z)=>{let z=Z.value;return!H4(z)&&z.length!==void 0}),_._zod.onattach.push((Z)=>{let z=Z._zod.bag.maximum??Number.POSITIVE_INFINITY;if($.maximum<z)Z._zod.bag.maximum=$.maximum}),_._zod.check=(Z)=>{let z=Z.value;if(z.length<=$.maximum)return;let J=V$(z);Z.issues.push({origin:J,code:"too_big",maximum:$.maximum,inclusive:!0,input:z,inst:_,continue:!$.abort})}}),QZ=I("$ZodCheckMinLength",(_,$)=>{var b;K0.init(_,$),(b=_._zod.def).when??(b.when=(Z)=>{let z=Z.value;return!H4(z)&&z.length!==void 0}),_._zod.onattach.push((Z)=>{let z=Z._zod.bag.minimum??Number.NEGATIVE_INFINITY;if($.minimum>z)Z._zod.bag.minimum=$.minimum}),_._zod.check=(Z)=>{let z=Z.value;if(z.length>=$.minimum)return;let J=V$(z);Z.issues.push({origin:J,code:"too_small",minimum:$.minimum,inclusive:!0,input:z,inst:_,continue:!$.abort})}}),KZ=I("$ZodCheckLengthEquals",(_,$)=>{var b;K0.init(_,$),(b=_._zod.def).when??(b.when=(Z)=>{let z=Z.value;return!H4(z)&&z.length!==void 0}),_._zod.onattach.push((Z)=>{let z=Z._zod.bag;z.minimum=$.length,z.maximum=$.length,z.length=$.length}),_._zod.check=(Z)=>{let z=Z.value,A=z.length;if(A===$.length)return;let J=V$(z),U=A>$.length;Z.issues.push({origin:J,...U?{code:"too_big",maximum:$.length}:{code:"too_small",minimum:$.length},inclusive:!0,exact:!0,input:Z.value,inst:_,continue:!$.abort})}}),v9=I("$ZodCheckStringFormat",(_,$)=>{var b,Z;if(K0.init(_,$),_._zod.onattach.push((z)=>{let A=z._zod.bag;if(A.format=$.format,$.pattern)A.patterns??(A.patterns=new Set),A.patterns.add($.pattern)}),$.pattern)(b=_._zod).check??(b.check=(z)=>{if($.pattern.lastIndex=0,$.pattern.test(z.value))return;z.issues.push({origin:"string",code:"invalid_format",format:$.format,input:z.value,...$.pattern?{pattern:$.pattern.toString()}:{},inst:_,continue:!$.abort})});else(Z=_._zod).check??(Z.check=()=>{})}),FZ=I("$ZodCheckRegex",(_,$)=>{v9.init(_,$),_._zod.check=(b)=>{if($.pattern.lastIndex=0,$.pattern.test(b.value))return;b.issues.push({origin:"string",code:"invalid_format",format:"regex",input:b.value,pattern:$.pattern.toString(),inst:_,continue:!$.abort})}}),vZ=I("$ZodCheckLowerCase",(_,$)=>{$.pattern??($.pattern=zZ),v9.init(_,$)}),HZ=I("$ZodCheckUpperCase",(_,$)=>{$.pattern??($.pattern=bZ),v9.init(_,$)}),qZ=I("$ZodCheckIncludes",(_,$)=>{K0.init(_,$);let b=Q_($.includes),Z=new RegExp(typeof $.position==="number"?`^.{${$.position}}${b}`:b);$.pattern=Z,_._zod.onattach.push((z)=>{let A=z._zod.bag;A.patterns??(A.patterns=new Set),A.patterns.add(Z)}),_._zod.check=(z)=>{if(z.value.includes($.includes,$.position))return;z.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:$.includes,input:z.value,inst:_,continue:!$.abort})}}),DZ=I("$ZodCheckStartsWith",(_,$)=>{K0.init(_,$);let b=new RegExp(`^${Q_($.prefix)}.*`);$.pattern??($.pattern=b),_._zod.onattach.push((Z)=>{let z=Z._zod.bag;z.patterns??(z.patterns=new Set),z.patterns.add(b)}),_._zod.check=(Z)=>{if(Z.value.startsWith($.prefix))return;Z.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:$.prefix,input:Z.value,inst:_,continue:!$.abort})}}),VZ=I("$ZodCheckEndsWith",(_,$)=>{K0.init(_,$);let b=new RegExp(`.*${Q_($.suffix)}$`);$.pattern??($.pattern=b),_._zod.onattach.push((Z)=>{let z=Z._zod.bag;z.patterns??(z.patterns=new Set),z.patterns.add(b)}),_._zod.check=(Z)=>{if(Z.value.endsWith($.suffix))return;Z.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:$.suffix,input:Z.value,inst:_,continue:!$.abort})}});function mG(_,$,b){if(_.issues.length)$.issues.push(...$_(b,_.issues))}var gZ=I("$ZodCheckProperty",(_,$)=>{K0.init(_,$),_._zod.check=(b)=>{let Z=$.schema._zod.run({value:b.value[$.property],issues:[]},{});if(Z instanceof Promise)return Z.then((z)=>mG(z,b,$.property));mG(Z,b,$.property);return}}),kZ=I("$ZodCheckMimeType",(_,$)=>{K0.init(_,$);let b=new Set($.mime);_._zod.onattach.push((Z)=>{Z._zod.bag.mime=$.mime}),_._zod.check=(Z)=>{if(b.has(Z.value.type))return;Z.issues.push({code:"invalid_value",values:$.mime,input:Z.value.type,inst:_,continue:!$.abort})}}),WZ=I("$ZodCheckOverwrite",(_,$)=>{K0.init(_,$),_._zod.check=(b)=>{b.value=$.tx(b.value)}});class s2{constructor(_=[]){if(this.content=[],this.indent=0,this)this.args=_}indented(_){this.indent+=1,_(this),this.indent-=1}write(_){if(typeof _==="function"){_(this,{execution:"sync"}),_(this,{execution:"async"});return}let b=_.split(`
52
52
  `).filter((A)=>A),Z=Math.min(...b.map((A)=>A.length-A.trimStart().length)),z=b.map((A)=>A.slice(Z)).map((A)=>" ".repeat(this.indent*2)+A);for(let A of z)this.content.push(A)}compile(){let _=Function,$=this?.args,Z=[...(this?.content??[""]).map((z)=>` ${z}`)];return new _(...$,Z.join(`
53
- `))}}var DZ={major:4,minor:3,patch:6};var i=I("$ZodType",(_,$)=>{var b;_??(_={}),_._zod.def=$,_._zod.bag=_._zod.bag||{},_._zod.version=DZ;let Z=[..._._zod.def.checks??[]];if(_._zod.traits.has("$ZodCheck"))Z.unshift(_);for(let z of Z)for(let A of z._zod.onattach)A(_);if(Z.length===0)(b=_._zod).deferred??(b.deferred=[]),_._zod.deferred?.push(()=>{_._zod.run=_._zod.parse});else{let z=(J,U,G)=>{let Y=v4(J),X;for(let Q of U){if(Q._zod.def.when){if(!Q._zod.def.when(J))continue}else if(Y)continue;let K=J.issues.length,v=Q._zod.check(J);if(v instanceof Promise&&G?.async===!1)throw new P_;if(X||v instanceof Promise)X=(X??Promise.resolve()).then(async()=>{if(await v,J.issues.length===K)return;if(!Y)Y=v4(J,K)});else{if(J.issues.length===K)continue;if(!Y)Y=v4(J,K)}}if(X)return X.then(()=>{return J});return J},A=(J,U,G)=>{if(v4(J))return J.aborted=!0,J;let Y=z(U,Z,G);if(Y instanceof Promise){if(G.async===!1)throw new P_;return Y.then((X)=>_._zod.parse(X,G))}return _._zod.parse(Y,G)};_._zod.run=(J,U)=>{if(U.skipChecks)return _._zod.parse(J,U);if(U.direction==="backward"){let Y=_._zod.parse({value:J.value,issues:[]},{...U,skipChecks:!0});if(Y instanceof Promise)return Y.then((X)=>{return A(X,J,U)});return A(Y,J,U)}let G=_._zod.parse(J,U);if(G instanceof Promise){if(U.async===!1)throw new P_;return G.then((Y)=>z(Y,Z,U))}return z(G,Z,U)}}t(_,"~standard",()=>({validate:(z)=>{try{let A=xb(_,z);return A.success?{value:A.data}:{issues:A.error?.issues}}catch(A){return Nb(_,z).then((J)=>J.success?{value:J.data}:{issues:J.error?.issues})}},vendor:"zod",version:1}))}),C4=I("$ZodString",(_,$)=>{i.init(_,$),_._zod.pattern=[..._?._zod.bag?.patterns??[]].pop()??pb(_._zod.bag),_._zod.parse=(b,Z)=>{if($.coerce)try{b.value=String(b.value)}catch(z){}if(typeof b.value==="string")return b;return b.issues.push({expected:"string",code:"invalid_type",input:b.value,inst:_}),b}}),X0=I("$ZodStringFormat",(_,$)=>{F9.init(_,$),C4.init(_,$)}),WZ=I("$ZodGUID",(_,$)=>{$.pattern??($.pattern=Rb),X0.init(_,$)}),gZ=I("$ZodUUID",(_,$)=>{if($.version){let Z={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[$.version];if(Z===void 0)throw Error(`Invalid UUID version: "${$.version}"`);$.pattern??($.pattern=y4(Z))}else $.pattern??($.pattern=y4());X0.init(_,$)}),BZ=I("$ZodEmail",(_,$)=>{$.pattern??($.pattern=Lb),X0.init(_,$)}),wZ=I("$ZodURL",(_,$)=>{X0.init(_,$),_._zod.check=(b)=>{try{let Z=b.value.trim(),z=new URL(Z);if($.hostname){if($.hostname.lastIndex=0,!$.hostname.test(z.hostname))b.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:$.hostname.source,input:b.value,inst:_,continue:!$.abort})}if($.protocol){if($.protocol.lastIndex=0,!$.protocol.test(z.protocol.endsWith(":")?z.protocol.slice(0,-1):z.protocol))b.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:$.protocol.source,input:b.value,inst:_,continue:!$.abort})}if($.normalize)b.value=z.href;else b.value=Z;return}catch(Z){b.issues.push({code:"invalid_format",format:"url",input:b.value,inst:_,continue:!$.abort})}}}),xZ=I("$ZodEmoji",(_,$)=>{$.pattern??($.pattern=Tb()),X0.init(_,$)}),NZ=I("$ZodNanoID",(_,$)=>{$.pattern??($.pattern=jb),X0.init(_,$)}),IZ=I("$ZodCUID",(_,$)=>{$.pattern??($.pattern=Ib),X0.init(_,$)}),MZ=I("$ZodCUID2",(_,$)=>{$.pattern??($.pattern=Mb),X0.init(_,$)}),EZ=I("$ZodULID",(_,$)=>{$.pattern??($.pattern=Eb),X0.init(_,$)}),OZ=I("$ZodXID",(_,$)=>{$.pattern??($.pattern=Ob),X0.init(_,$)}),PZ=I("$ZodKSUID",(_,$)=>{$.pattern??($.pattern=Pb),X0.init(_,$)}),jZ=I("$ZodISODateTime",(_,$)=>{$.pattern??($.pattern=lb($)),X0.init(_,$)}),SZ=I("$ZodISODate",(_,$)=>{$.pattern??($.pattern=rb),X0.init(_,$)}),RZ=I("$ZodISOTime",(_,$)=>{$.pattern??($.pattern=nb($)),X0.init(_,$)}),LZ=I("$ZodISODuration",(_,$)=>{$.pattern??($.pattern=Sb),X0.init(_,$)}),TZ=I("$ZodIPv4",(_,$)=>{$.pattern??($.pattern=yb),X0.init(_,$),_._zod.bag.format="ipv4"}),yZ=I("$ZodIPv6",(_,$)=>{$.pattern??($.pattern=Cb),X0.init(_,$),_._zod.bag.format="ipv6",_._zod.check=(b)=>{try{new URL(`http://[${b.value}]`)}catch{b.issues.push({code:"invalid_format",format:"ipv6",input:b.value,inst:_,continue:!$.abort})}}}),CZ=I("$ZodMAC",(_,$)=>{$.pattern??($.pattern=fb($.delimiter)),X0.init(_,$),_._zod.bag.format="mac"}),fZ=I("$ZodCIDRv4",(_,$)=>{$.pattern??($.pattern=mb),X0.init(_,$)}),mZ=I("$ZodCIDRv6",(_,$)=>{$.pattern??($.pattern=ub),X0.init(_,$),_._zod.check=(b)=>{let Z=b.value.split("/");try{if(Z.length!==2)throw Error();let[z,A]=Z;if(!A)throw Error();let J=Number(A);if(`${J}`!==A)throw Error();if(J<0||J>128)throw Error();new URL(`http://[${z}]`)}catch{b.issues.push({code:"invalid_format",format:"cidrv6",input:b.value,inst:_,continue:!$.abort})}}});function uZ(_){if(_==="")return!0;if(_.length%4!==0)return!1;try{return atob(_),!0}catch{return!1}}var hZ=I("$ZodBase64",(_,$)=>{$.pattern??($.pattern=hb),X0.init(_,$),_._zod.bag.contentEncoding="base64",_._zod.check=(b)=>{if(uZ(b.value))return;b.issues.push({code:"invalid_format",format:"base64",input:b.value,inst:_,continue:!$.abort})}});function oG(_){if(!e2.test(_))return!1;let $=_.replace(/[-_]/g,(Z)=>Z==="-"?"+":"/"),b=$.padEnd(Math.ceil($.length/4)*4,"=");return uZ(b)}var cZ=I("$ZodBase64URL",(_,$)=>{$.pattern??($.pattern=e2),X0.init(_,$),_._zod.bag.contentEncoding="base64url",_._zod.check=(b)=>{if(oG(b.value))return;b.issues.push({code:"invalid_format",format:"base64url",input:b.value,inst:_,continue:!$.abort})}}),rZ=I("$ZodE164",(_,$)=>{$.pattern??($.pattern=cb),X0.init(_,$)});function aG(_,$=null){try{let b=_.split(".");if(b.length!==3)return!1;let[Z]=b;if(!Z)return!1;let z=JSON.parse(atob(Z));if("typ"in z&&z?.typ!=="JWT")return!1;if(!z.alg)return!1;if($&&(!("alg"in z)||z.alg!==$))return!1;return!0}catch{return!1}}var nZ=I("$ZodJWT",(_,$)=>{X0.init(_,$),_._zod.check=(b)=>{if(aG(b.value,$.alg))return;b.issues.push({code:"invalid_format",format:"jwt",input:b.value,inst:_,continue:!$.abort})}}),lZ=I("$ZodCustomStringFormat",(_,$)=>{X0.init(_,$),_._zod.check=(b)=>{if($.fn(b.value))return;b.issues.push({code:"invalid_format",format:$.format,input:b.value,inst:_,continue:!$.abort})}}),J1=I("$ZodNumber",(_,$)=>{i.init(_,$),_._zod.pattern=_._zod.bag.pattern??w$,_._zod.parse=(b,Z)=>{if($.coerce)try{b.value=Number(b.value)}catch(J){}let z=b.value;if(typeof z==="number"&&!Number.isNaN(z)&&Number.isFinite(z))return b;let A=typeof z==="number"?Number.isNaN(z)?"NaN":!Number.isFinite(z)?"Infinity":void 0:void 0;return b.issues.push({expected:"number",code:"invalid_type",input:z,inst:_,...A?{received:A}:{}}),b}}),pZ=I("$ZodNumberFormat",(_,$)=>{$Z.init(_,$),J1.init(_,$)}),I$=I("$ZodBoolean",(_,$)=>{i.init(_,$),_._zod.pattern=ob,_._zod.parse=(b,Z)=>{if($.coerce)try{b.value=Boolean(b.value)}catch(A){}let z=b.value;if(typeof z==="boolean")return b;return b.issues.push({expected:"boolean",code:"invalid_type",input:z,inst:_}),b}}),U1=I("$ZodBigInt",(_,$)=>{i.init(_,$),_._zod.pattern=db,_._zod.parse=(b,Z)=>{if($.coerce)try{b.value=BigInt(b.value)}catch(z){}if(typeof b.value==="bigint")return b;return b.issues.push({expected:"bigint",code:"invalid_type",input:b.value,inst:_}),b}}),dZ=I("$ZodBigIntFormat",(_,$)=>{zZ.init(_,$),U1.init(_,$)}),iZ=I("$ZodSymbol",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{let z=b.value;if(typeof z==="symbol")return b;return b.issues.push({expected:"symbol",code:"invalid_type",input:z,inst:_}),b}}),oZ=I("$ZodUndefined",(_,$)=>{i.init(_,$),_._zod.pattern=eb,_._zod.values=new Set([void 0]),_._zod.optin="optional",_._zod.optout="optional",_._zod.parse=(b,Z)=>{let z=b.value;if(typeof z>"u")return b;return b.issues.push({expected:"undefined",code:"invalid_type",input:z,inst:_}),b}}),aZ=I("$ZodNull",(_,$)=>{i.init(_,$),_._zod.pattern=ab,_._zod.values=new Set([null]),_._zod.parse=(b,Z)=>{let z=b.value;if(z===null)return b;return b.issues.push({expected:"null",code:"invalid_type",input:z,inst:_}),b}}),eZ=I("$ZodAny",(_,$)=>{i.init(_,$),_._zod.parse=(b)=>b}),tZ=I("$ZodUnknown",(_,$)=>{i.init(_,$),_._zod.parse=(b)=>b}),sZ=I("$ZodNever",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{return b.issues.push({expected:"never",code:"invalid_type",input:b.value,inst:_}),b}}),_3=I("$ZodVoid",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{let z=b.value;if(typeof z>"u")return b;return b.issues.push({expected:"void",code:"invalid_type",input:z,inst:_}),b}}),$3=I("$ZodDate",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{if($.coerce)try{b.value=new Date(b.value)}catch(U){}let z=b.value,A=z instanceof Date;if(A&&!Number.isNaN(z.getTime()))return b;return b.issues.push({expected:"date",code:"invalid_type",input:z,...A?{received:"Invalid Date"}:{},inst:_}),b}});function fG(_,$,b){if(_.issues.length)$.issues.push(...__(b,_.issues));$.value[b]=_.value}var z3=I("$ZodArray",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{let z=b.value;if(!Array.isArray(z))return b.issues.push({expected:"array",code:"invalid_type",input:z,inst:_}),b;b.value=Array(z.length);let A=[];for(let J=0;J<z.length;J++){let U=z[J],G=$.element._zod.run({value:U,issues:[]},Z);if(G instanceof Promise)A.push(G.then((Y)=>fG(Y,b,J)));else fG(G,b,J)}if(A.length)return Promise.all(A).then(()=>b);return b}});function A1(_,$,b,Z,z){if(_.issues.length){if(z&&!(b in Z))return;$.issues.push(...__(b,_.issues))}if(_.value===void 0){if(b in Z)$.value[b]=void 0}else $.value[b]=_.value}function eG(_){let $=Object.keys(_.shape);for(let Z of $)if(!_.shape?.[Z]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${Z}": expected a Zod schema`);let b=kb(_.shape);return{..._,keys:$,keySet:new Set($),numKeys:$.length,optionalKeys:new Set(b)}}function tG(_,$,b,Z,z,A){let J=[],U=z.keySet,G=z.catchall._zod,Y=G.def.type,X=G.optout==="optional";for(let Q in $){if(U.has(Q))continue;if(Y==="never"){J.push(Q);continue}let K=G.run({value:$[Q],issues:[]},Z);if(K instanceof Promise)_.push(K.then((v)=>A1(v,b,Q,$,X)));else A1(K,b,Q,$,X)}if(J.length)b.issues.push({code:"unrecognized_keys",keys:J,input:$,inst:A});if(!_.length)return b;return Promise.all(_).then(()=>{return b})}var sG=I("$ZodObject",(_,$)=>{if(i.init(_,$),!Object.getOwnPropertyDescriptor($,"shape")?.get){let U=$.shape;Object.defineProperty($,"shape",{get:()=>{let G={...U};return Object.defineProperty($,"shape",{value:G}),G}})}let Z=G9(()=>eG($));t(_._zod,"propValues",()=>{let U=$.shape,G={};for(let Y in U){let X=U[Y]._zod;if(X.values){G[Y]??(G[Y]=new Set);for(let Q of X.values)G[Y].add(Q)}}return G});let z=T4,A=$.catchall,J;_._zod.parse=(U,G)=>{J??(J=Z.value);let Y=U.value;if(!z(Y))return U.issues.push({expected:"object",code:"invalid_type",input:Y,inst:_}),U;U.value={};let X=[],Q=J.shape;for(let K of J.keys){let v=Q[K],V=v._zod.optout==="optional",w=v._zod.run({value:Y[K],issues:[]},G);if(w instanceof Promise)X.push(w.then((P)=>A1(P,U,K,Y,V)));else A1(w,U,K,Y,V)}if(!A)return X.length?Promise.all(X).then(()=>U):U;return tG(X,Y,U,G,Z.value,_)}}),b3=I("$ZodObjectJIT",(_,$)=>{sG.init(_,$);let b=_._zod.parse,Z=G9(()=>eG($)),z=(K)=>{let v=new _1(["shape","payload","ctx"]),V=Z.value,w=(T)=>{let y=m2(T);return`shape[${y}]._zod.run({ value: input[${y}], issues: [] }, ctx)`};v.write("const input = payload.value;");let P=Object.create(null),O=0;for(let T of V.keys)P[T]=`key_${O++}`;v.write("const newResult = {};");for(let T of V.keys){let y=P[T],u=m2(T),C=K[T]?._zod?.optout==="optional";if(v.write(`const ${y} = ${w(T)};`),C)v.write(`
54
- if (${y}.issues.length) {
53
+ `))}}var wZ={major:4,minor:3,patch:6};var i=I("$ZodType",(_,$)=>{var b;_??(_={}),_._zod.def=$,_._zod.bag=_._zod.bag||{},_._zod.version=wZ;let Z=[..._._zod.def.checks??[]];if(_._zod.traits.has("$ZodCheck"))Z.unshift(_);for(let z of Z)for(let A of z._zod.onattach)A(_);if(Z.length===0)(b=_._zod).deferred??(b.deferred=[]),_._zod.deferred?.push(()=>{_._zod.run=_._zod.parse});else{let z=(J,U,G)=>{let Y=V4(J),X;for(let Q of U){if(Q._zod.def.when){if(!Q._zod.def.when(J))continue}else if(Y)continue;let K=J.issues.length,v=Q._zod.check(J);if(v instanceof Promise&&G?.async===!1)throw new j_;if(X||v instanceof Promise)X=(X??Promise.resolve()).then(async()=>{if(await v,J.issues.length===K)return;if(!Y)Y=V4(J,K)});else{if(J.issues.length===K)continue;if(!Y)Y=V4(J,K)}}if(X)return X.then(()=>{return J});return J},A=(J,U,G)=>{if(V4(J))return J.aborted=!0,J;let Y=z(U,Z,G);if(Y instanceof Promise){if(G.async===!1)throw new j_;return Y.then((X)=>_._zod.parse(X,G))}return _._zod.parse(Y,G)};_._zod.run=(J,U)=>{if(U.skipChecks)return _._zod.parse(J,U);if(U.direction==="backward"){let Y=_._zod.parse({value:J.value,issues:[]},{...U,skipChecks:!0});if(Y instanceof Promise)return Y.then((X)=>{return A(X,J,U)});return A(Y,J,U)}let G=_._zod.parse(J,U);if(G instanceof Promise){if(U.async===!1)throw new j_;return G.then((Y)=>z(Y,Z,U))}return z(G,Z,U)}}t(_,"~standard",()=>({validate:(z)=>{try{let A=Eb(_,z);return A.success?{value:A.data}:{issues:A.error?.issues}}catch(A){return Ob(_,z).then((J)=>J.success?{value:J.data}:{issues:J.error?.issues})}},vendor:"zod",version:1}))}),f4=I("$ZodString",(_,$)=>{i.init(_,$),_._zod.pattern=[..._?._zod.bag?.patterns??[]].pop()??ab(_._zod.bag),_._zod.parse=(b,Z)=>{if($.coerce)try{b.value=String(b.value)}catch(z){}if(typeof b.value==="string")return b;return b.issues.push({expected:"string",code:"invalid_type",input:b.value,inst:_}),b}}),X0=I("$ZodStringFormat",(_,$)=>{v9.init(_,$),f4.init(_,$)}),xZ=I("$ZodGUID",(_,$)=>{$.pattern??($.pattern=Cb),X0.init(_,$)}),NZ=I("$ZodUUID",(_,$)=>{if($.version){let Z={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[$.version];if(Z===void 0)throw Error(`Invalid UUID version: "${$.version}"`);$.pattern??($.pattern=C4(Z))}else $.pattern??($.pattern=C4());X0.init(_,$)}),IZ=I("$ZodEmail",(_,$)=>{$.pattern??($.pattern=fb),X0.init(_,$)}),MZ=I("$ZodURL",(_,$)=>{X0.init(_,$),_._zod.check=(b)=>{try{let Z=b.value.trim(),z=new URL(Z);if($.hostname){if($.hostname.lastIndex=0,!$.hostname.test(z.hostname))b.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:$.hostname.source,input:b.value,inst:_,continue:!$.abort})}if($.protocol){if($.protocol.lastIndex=0,!$.protocol.test(z.protocol.endsWith(":")?z.protocol.slice(0,-1):z.protocol))b.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:$.protocol.source,input:b.value,inst:_,continue:!$.abort})}if($.normalize)b.value=z.href;else b.value=Z;return}catch(Z){b.issues.push({code:"invalid_format",format:"url",input:b.value,inst:_,continue:!$.abort})}}}),EZ=I("$ZodEmoji",(_,$)=>{$.pattern??($.pattern=mb()),X0.init(_,$)}),OZ=I("$ZodNanoID",(_,$)=>{$.pattern??($.pattern=Tb),X0.init(_,$)}),PZ=I("$ZodCUID",(_,$)=>{$.pattern??($.pattern=Pb),X0.init(_,$)}),jZ=I("$ZodCUID2",(_,$)=>{$.pattern??($.pattern=jb),X0.init(_,$)}),SZ=I("$ZodULID",(_,$)=>{$.pattern??($.pattern=Sb),X0.init(_,$)}),RZ=I("$ZodXID",(_,$)=>{$.pattern??($.pattern=Rb),X0.init(_,$)}),LZ=I("$ZodKSUID",(_,$)=>{$.pattern??($.pattern=Lb),X0.init(_,$)}),TZ=I("$ZodISODateTime",(_,$)=>{$.pattern??($.pattern=ob($)),X0.init(_,$)}),yZ=I("$ZodISODate",(_,$)=>{$.pattern??($.pattern=db),X0.init(_,$)}),CZ=I("$ZodISOTime",(_,$)=>{$.pattern??($.pattern=ib($)),X0.init(_,$)}),fZ=I("$ZodISODuration",(_,$)=>{$.pattern??($.pattern=yb),X0.init(_,$)}),mZ=I("$ZodIPv4",(_,$)=>{$.pattern??($.pattern=ub),X0.init(_,$),_._zod.bag.format="ipv4"}),uZ=I("$ZodIPv6",(_,$)=>{$.pattern??($.pattern=cb),X0.init(_,$),_._zod.bag.format="ipv6",_._zod.check=(b)=>{try{new URL(`http://[${b.value}]`)}catch{b.issues.push({code:"invalid_format",format:"ipv6",input:b.value,inst:_,continue:!$.abort})}}}),cZ=I("$ZodMAC",(_,$)=>{$.pattern??($.pattern=hb($.delimiter)),X0.init(_,$),_._zod.bag.format="mac"}),hZ=I("$ZodCIDRv4",(_,$)=>{$.pattern??($.pattern=rb),X0.init(_,$)}),rZ=I("$ZodCIDRv6",(_,$)=>{$.pattern??($.pattern=nb),X0.init(_,$),_._zod.check=(b)=>{let Z=b.value.split("/");try{if(Z.length!==2)throw Error();let[z,A]=Z;if(!A)throw Error();let J=Number(A);if(`${J}`!==A)throw Error();if(J<0||J>128)throw Error();new URL(`http://[${z}]`)}catch{b.issues.push({code:"invalid_format",format:"cidrv6",input:b.value,inst:_,continue:!$.abort})}}});function nZ(_){if(_==="")return!0;if(_.length%4!==0)return!1;try{return atob(_),!0}catch{return!1}}var lZ=I("$ZodBase64",(_,$)=>{$.pattern??($.pattern=lb),X0.init(_,$),_._zod.bag.contentEncoding="base64",_._zod.check=(b)=>{if(nZ(b.value))return;b.issues.push({code:"invalid_format",format:"base64",input:b.value,inst:_,continue:!$.abort})}});function sG(_){if(!a2.test(_))return!1;let $=_.replace(/[-_]/g,(Z)=>Z==="-"?"+":"/"),b=$.padEnd(Math.ceil($.length/4)*4,"=");return nZ(b)}var pZ=I("$ZodBase64URL",(_,$)=>{$.pattern??($.pattern=a2),X0.init(_,$),_._zod.bag.contentEncoding="base64url",_._zod.check=(b)=>{if(sG(b.value))return;b.issues.push({code:"invalid_format",format:"base64url",input:b.value,inst:_,continue:!$.abort})}}),dZ=I("$ZodE164",(_,$)=>{$.pattern??($.pattern=pb),X0.init(_,$)});function _Y(_,$=null){try{let b=_.split(".");if(b.length!==3)return!1;let[Z]=b;if(!Z)return!1;let z=JSON.parse(atob(Z));if("typ"in z&&z?.typ!=="JWT")return!1;if(!z.alg)return!1;if($&&(!("alg"in z)||z.alg!==$))return!1;return!0}catch{return!1}}var iZ=I("$ZodJWT",(_,$)=>{X0.init(_,$),_._zod.check=(b)=>{if(_Y(b.value,$.alg))return;b.issues.push({code:"invalid_format",format:"jwt",input:b.value,inst:_,continue:!$.abort})}}),oZ=I("$ZodCustomStringFormat",(_,$)=>{X0.init(_,$),_._zod.check=(b)=>{if($.fn(b.value))return;b.issues.push({code:"invalid_format",format:$.format,input:b.value,inst:_,continue:!$.abort})}}),A1=I("$ZodNumber",(_,$)=>{i.init(_,$),_._zod.pattern=_._zod.bag.pattern??w$,_._zod.parse=(b,Z)=>{if($.coerce)try{b.value=Number(b.value)}catch(J){}let z=b.value;if(typeof z==="number"&&!Number.isNaN(z)&&Number.isFinite(z))return b;let A=typeof z==="number"?Number.isNaN(z)?"NaN":!Number.isFinite(z)?"Infinity":void 0:void 0;return b.issues.push({expected:"number",code:"invalid_type",input:z,inst:_,...A?{received:A}:{}}),b}}),aZ=I("$ZodNumberFormat",(_,$)=>{AZ.init(_,$),A1.init(_,$)}),N$=I("$ZodBoolean",(_,$)=>{i.init(_,$),_._zod.pattern=sb,_._zod.parse=(b,Z)=>{if($.coerce)try{b.value=Boolean(b.value)}catch(A){}let z=b.value;if(typeof z==="boolean")return b;return b.issues.push({expected:"boolean",code:"invalid_type",input:z,inst:_}),b}}),J1=I("$ZodBigInt",(_,$)=>{i.init(_,$),_._zod.pattern=eb,_._zod.parse=(b,Z)=>{if($.coerce)try{b.value=BigInt(b.value)}catch(z){}if(typeof b.value==="bigint")return b;return b.issues.push({expected:"bigint",code:"invalid_type",input:b.value,inst:_}),b}}),eZ=I("$ZodBigIntFormat",(_,$)=>{JZ.init(_,$),J1.init(_,$)}),tZ=I("$ZodSymbol",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{let z=b.value;if(typeof z==="symbol")return b;return b.issues.push({expected:"symbol",code:"invalid_type",input:z,inst:_}),b}}),sZ=I("$ZodUndefined",(_,$)=>{i.init(_,$),_._zod.pattern=$Z,_._zod.values=new Set([void 0]),_._zod.optin="optional",_._zod.optout="optional",_._zod.parse=(b,Z)=>{let z=b.value;if(typeof z>"u")return b;return b.issues.push({expected:"undefined",code:"invalid_type",input:z,inst:_}),b}}),_3=I("$ZodNull",(_,$)=>{i.init(_,$),_._zod.pattern=_Z,_._zod.values=new Set([null]),_._zod.parse=(b,Z)=>{let z=b.value;if(z===null)return b;return b.issues.push({expected:"null",code:"invalid_type",input:z,inst:_}),b}}),$3=I("$ZodAny",(_,$)=>{i.init(_,$),_._zod.parse=(b)=>b}),z3=I("$ZodUnknown",(_,$)=>{i.init(_,$),_._zod.parse=(b)=>b}),b3=I("$ZodNever",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{return b.issues.push({expected:"never",code:"invalid_type",input:b.value,inst:_}),b}}),Z3=I("$ZodVoid",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{let z=b.value;if(typeof z>"u")return b;return b.issues.push({expected:"void",code:"invalid_type",input:z,inst:_}),b}}),A3=I("$ZodDate",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{if($.coerce)try{b.value=new Date(b.value)}catch(U){}let z=b.value,A=z instanceof Date;if(A&&!Number.isNaN(z.getTime()))return b;return b.issues.push({expected:"date",code:"invalid_type",input:z,...A?{received:"Invalid Date"}:{},inst:_}),b}});function hG(_,$,b){if(_.issues.length)$.issues.push(...$_(b,_.issues));$.value[b]=_.value}var J3=I("$ZodArray",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{let z=b.value;if(!Array.isArray(z))return b.issues.push({expected:"array",code:"invalid_type",input:z,inst:_}),b;b.value=Array(z.length);let A=[];for(let J=0;J<z.length;J++){let U=z[J],G=$.element._zod.run({value:U,issues:[]},Z);if(G instanceof Promise)A.push(G.then((Y)=>hG(Y,b,J)));else hG(G,b,J)}if(A.length)return Promise.all(A).then(()=>b);return b}});function Z1(_,$,b,Z,z){if(_.issues.length){if(z&&!(b in Z))return;$.issues.push(...$_(b,_.issues))}if(_.value===void 0){if(b in Z)$.value[b]=void 0}else $.value[b]=_.value}function $Y(_){let $=Object.keys(_.shape);for(let Z of $)if(!_.shape?.[Z]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${Z}": expected a Zod schema`);let b=Bb(_.shape);return{..._,keys:$,keySet:new Set($),numKeys:$.length,optionalKeys:new Set(b)}}function zY(_,$,b,Z,z,A){let J=[],U=z.keySet,G=z.catchall._zod,Y=G.def.type,X=G.optout==="optional";for(let Q in $){if(U.has(Q))continue;if(Y==="never"){J.push(Q);continue}let K=G.run({value:$[Q],issues:[]},Z);if(K instanceof Promise)_.push(K.then((v)=>Z1(v,b,Q,$,X)));else Z1(K,b,Q,$,X)}if(J.length)b.issues.push({code:"unrecognized_keys",keys:J,input:$,inst:A});if(!_.length)return b;return Promise.all(_).then(()=>{return b})}var bY=I("$ZodObject",(_,$)=>{if(i.init(_,$),!Object.getOwnPropertyDescriptor($,"shape")?.get){let U=$.shape;Object.defineProperty($,"shape",{get:()=>{let G={...U};return Object.defineProperty($,"shape",{value:G}),G}})}let Z=G9(()=>$Y($));t(_._zod,"propValues",()=>{let U=$.shape,G={};for(let Y in U){let X=U[Y]._zod;if(X.values){G[Y]??(G[Y]=new Set);for(let Q of X.values)G[Y].add(Q)}}return G});let z=y4,A=$.catchall,J;_._zod.parse=(U,G)=>{J??(J=Z.value);let Y=U.value;if(!z(Y))return U.issues.push({expected:"object",code:"invalid_type",input:Y,inst:_}),U;U.value={};let X=[],Q=J.shape;for(let K of J.keys){let v=Q[K],D=v._zod.optout==="optional",w=v._zod.run({value:Y[K],issues:[]},G);if(w instanceof Promise)X.push(w.then((P)=>Z1(P,U,K,Y,D)));else Z1(w,U,K,Y,D)}if(!A)return X.length?Promise.all(X).then(()=>U):U;return zY(X,Y,U,G,Z.value,_)}}),U3=I("$ZodObjectJIT",(_,$)=>{bY.init(_,$);let b=_._zod.parse,Z=G9(()=>$Y($)),z=(K)=>{let v=new s2(["shape","payload","ctx"]),D=Z.value,w=(C)=>{let f=f2(C);return`shape[${f}]._zod.run({ value: input[${f}], issues: [] }, ctx)`};v.write("const input = payload.value;");let P=Object.create(null),E=0;for(let C of D.keys)P[C]=`key_${E++}`;v.write("const newResult = {};");for(let C of D.keys){let f=P[C],u=f2(C),T=K[C]?._zod?.optout==="optional";if(v.write(`const ${f} = ${w(C)};`),T)v.write(`
54
+ if (${f}.issues.length) {
55
55
  if (${u} in input) {
56
- payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
56
+ payload.issues = payload.issues.concat(${f}.issues.map(iss => ({
57
57
  ...iss,
58
58
  path: iss.path ? [${u}, ...iss.path] : [${u}]
59
59
  })));
60
60
  }
61
61
  }
62
62
 
63
- if (${y}.value === undefined) {
63
+ if (${f}.value === undefined) {
64
64
  if (${u} in input) {
65
65
  newResult[${u}] = undefined;
66
66
  }
67
67
  } else {
68
- newResult[${u}] = ${y}.value;
68
+ newResult[${u}] = ${f}.value;
69
69
  }
70
70
 
71
71
  `);else v.write(`
72
- if (${y}.issues.length) {
73
- payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
72
+ if (${f}.issues.length) {
73
+ payload.issues = payload.issues.concat(${f}.issues.map(iss => ({
74
74
  ...iss,
75
75
  path: iss.path ? [${u}, ...iss.path] : [${u}]
76
76
  })));
77
77
  }
78
78
 
79
- if (${y}.value === undefined) {
79
+ if (${f}.value === undefined) {
80
80
  if (${u} in input) {
81
81
  newResult[${u}] = undefined;
82
82
  }
83
83
  } else {
84
- newResult[${u}] = ${y}.value;
84
+ newResult[${u}] = ${f}.value;
85
85
  }
86
86
 
87
- `)}v.write("payload.value = newResult;"),v.write("return payload;");let B=v.compile();return(T,y)=>B(K,T,y)},A,J=T4,U=!v$.jitless,Y=U&&qb.value,X=$.catchall,Q;_._zod.parse=(K,v)=>{Q??(Q=Z.value);let V=K.value;if(!J(V))return K.issues.push({expected:"object",code:"invalid_type",input:V,inst:_}),K;if(U&&Y&&v?.async===!1&&v.jitless!==!0){if(!A)A=z($.shape);if(K=A(K,v),!X)return K;return tG([],V,K,v,Q,_)}return b(K,v)}});function mG(_,$,b,Z){for(let A of _)if(A.issues.length===0)return $.value=A.value,$;let z=_.filter((A)=>!v4(A));if(z.length===1)return $.value=z[0].value,z[0];return $.issues.push({code:"invalid_union",input:$.value,inst:b,errors:_.map((A)=>A.issues.map((J)=>r0(J,Z,D0())))}),$}var M$=I("$ZodUnion",(_,$)=>{i.init(_,$),t(_._zod,"optin",()=>$.options.some((z)=>z._zod.optin==="optional")?"optional":void 0),t(_._zod,"optout",()=>$.options.some((z)=>z._zod.optout==="optional")?"optional":void 0),t(_._zod,"values",()=>{if($.options.every((z)=>z._zod.values))return new Set($.options.flatMap((z)=>Array.from(z._zod.values)));return}),t(_._zod,"pattern",()=>{if($.options.every((z)=>z._zod.pattern)){let z=$.options.map((A)=>A._zod.pattern);return new RegExp(`^(${z.map((A)=>q$(A.source)).join("|")})$`)}return});let b=$.options.length===1,Z=$.options[0]._zod.run;_._zod.parse=(z,A)=>{if(b)return Z(z,A);let J=!1,U=[];for(let G of $.options){let Y=G._zod.run({value:z.value,issues:[]},A);if(Y instanceof Promise)U.push(Y),J=!0;else{if(Y.issues.length===0)return Y;U.push(Y)}}if(!J)return mG(U,z,_,A);return Promise.all(U).then((G)=>{return mG(G,z,_,A)})}});function uG(_,$,b,Z){let z=_.filter((A)=>A.issues.length===0);if(z.length===1)return $.value=z[0].value,$;if(z.length===0)$.issues.push({code:"invalid_union",input:$.value,inst:b,errors:_.map((A)=>A.issues.map((J)=>r0(J,Z,D0())))});else $.issues.push({code:"invalid_union",input:$.value,inst:b,errors:[],inclusive:!1});return $}var Z3=I("$ZodXor",(_,$)=>{M$.init(_,$),$.inclusive=!1;let b=$.options.length===1,Z=$.options[0]._zod.run;_._zod.parse=(z,A)=>{if(b)return Z(z,A);let J=!1,U=[];for(let G of $.options){let Y=G._zod.run({value:z.value,issues:[]},A);if(Y instanceof Promise)U.push(Y),J=!0;else U.push(Y)}if(!J)return uG(U,z,_,A);return Promise.all(U).then((G)=>{return uG(G,z,_,A)})}}),A3=I("$ZodDiscriminatedUnion",(_,$)=>{$.inclusive=!1,M$.init(_,$);let b=_._zod.parse;t(_._zod,"propValues",()=>{let z={};for(let A of $.options){let J=A._zod.propValues;if(!J||Object.keys(J).length===0)throw Error(`Invalid discriminated union option at index "${$.options.indexOf(A)}"`);for(let[U,G]of Object.entries(J)){if(!z[U])z[U]=new Set;for(let Y of G)z[U].add(Y)}}return z});let Z=G9(()=>{let z=$.options,A=new Map;for(let J of z){let U=J._zod.propValues?.[$.discriminator];if(!U||U.size===0)throw Error(`Invalid discriminated union option at index "${$.options.indexOf(J)}"`);for(let G of U){if(A.has(G))throw Error(`Duplicate discriminator value "${String(G)}"`);A.set(G,J)}}return A});_._zod.parse=(z,A)=>{let J=z.value;if(!T4(J))return z.issues.push({code:"invalid_type",expected:"object",input:J,inst:_}),z;let U=Z.value.get(J?.[$.discriminator]);if(U)return U._zod.run(z,A);if($.unionFallback)return b(z,A);return z.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:$.discriminator,input:J,path:[$.discriminator],inst:_}),z}}),J3=I("$ZodIntersection",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{let z=b.value,A=$.left._zod.run({value:z,issues:[]},Z),J=$.right._zod.run({value:z,issues:[]},Z);if(A instanceof Promise||J instanceof Promise)return Promise.all([A,J]).then(([G,Y])=>{return hG(b,G,Y)});return hG(b,A,J)}});function kZ(_,$){if(_===$)return{valid:!0,data:_};if(_ instanceof Date&&$ instanceof Date&&+_===+$)return{valid:!0,data:_};if(K4(_)&&K4($)){let b=Object.keys($),Z=Object.keys(_).filter((A)=>b.indexOf(A)!==-1),z={..._,...$};for(let A of Z){let J=kZ(_[A],$[A]);if(!J.valid)return{valid:!1,mergeErrorPath:[A,...J.mergeErrorPath]};z[A]=J.data}return{valid:!0,data:z}}if(Array.isArray(_)&&Array.isArray($)){if(_.length!==$.length)return{valid:!1,mergeErrorPath:[]};let b=[];for(let Z=0;Z<_.length;Z++){let z=_[Z],A=$[Z],J=kZ(z,A);if(!J.valid)return{valid:!1,mergeErrorPath:[Z,...J.mergeErrorPath]};b.push(J.data)}return{valid:!0,data:b}}return{valid:!1,mergeErrorPath:[]}}function hG(_,$,b){let Z=new Map,z;for(let U of $.issues)if(U.code==="unrecognized_keys"){z??(z=U);for(let G of U.keys){if(!Z.has(G))Z.set(G,{});Z.get(G).l=!0}}else _.issues.push(U);for(let U of b.issues)if(U.code==="unrecognized_keys")for(let G of U.keys){if(!Z.has(G))Z.set(G,{});Z.get(G).r=!0}else _.issues.push(U);let A=[...Z].filter(([,U])=>U.l&&U.r).map(([U])=>U);if(A.length&&z)_.issues.push({...z,keys:A});if(v4(_))return _;let J=kZ($.value,b.value);if(!J.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(J.mergeErrorPath)}`);return _.value=J.data,_}var G1=I("$ZodTuple",(_,$)=>{i.init(_,$);let b=$.items;_._zod.parse=(Z,z)=>{let A=Z.value;if(!Array.isArray(A))return Z.issues.push({input:A,inst:_,expected:"tuple",code:"invalid_type"}),Z;Z.value=[];let J=[],U=[...b].reverse().findIndex((X)=>X._zod.optin!=="optional"),G=U===-1?0:b.length-U;if(!$.rest){let X=A.length>b.length,Q=A.length<G-1;if(X||Q)return Z.issues.push({...X?{code:"too_big",maximum:b.length,inclusive:!0}:{code:"too_small",minimum:b.length},input:A,inst:_,origin:"array"}),Z}let Y=-1;for(let X of b){if(Y++,Y>=A.length){if(Y>=G)continue}let Q=X._zod.run({value:A[Y],issues:[]},z);if(Q instanceof Promise)J.push(Q.then((K)=>$1(K,Z,Y)));else $1(Q,Z,Y)}if($.rest){let X=A.slice(b.length);for(let Q of X){Y++;let K=$.rest._zod.run({value:Q,issues:[]},z);if(K instanceof Promise)J.push(K.then((v)=>$1(v,Z,Y)));else $1(K,Z,Y)}}if(J.length)return Promise.all(J).then(()=>Z);return Z}});function $1(_,$,b){if(_.issues.length)$.issues.push(...__(b,_.issues));$.value[b]=_.value}var U3=I("$ZodRecord",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{let z=b.value;if(!K4(z))return b.issues.push({expected:"record",code:"invalid_type",input:z,inst:_}),b;let A=[],J=$.keyType._zod.values;if(J){b.value={};let U=new Set;for(let Y of J)if(typeof Y==="string"||typeof Y==="number"||typeof Y==="symbol"){U.add(typeof Y==="number"?Y.toString():Y);let X=$.valueType._zod.run({value:z[Y],issues:[]},Z);if(X instanceof Promise)A.push(X.then((Q)=>{if(Q.issues.length)b.issues.push(...__(Y,Q.issues));b.value[Y]=Q.value}));else{if(X.issues.length)b.issues.push(...__(Y,X.issues));b.value[Y]=X.value}}let G;for(let Y in z)if(!U.has(Y))G=G??[],G.push(Y);if(G&&G.length>0)b.issues.push({code:"unrecognized_keys",input:z,inst:_,keys:G})}else{b.value={};for(let U of Reflect.ownKeys(z)){if(U==="__proto__")continue;let G=$.keyType._zod.run({value:U,issues:[]},Z);if(G instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof U==="string"&&w$.test(U)&&G.issues.length){let Q=$.keyType._zod.run({value:Number(U),issues:[]},Z);if(Q instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(Q.issues.length===0)G=Q}if(G.issues.length){if($.mode==="loose")b.value[U]=z[U];else b.issues.push({code:"invalid_key",origin:"record",issues:G.issues.map((Q)=>r0(Q,Z,D0())),input:U,path:[U],inst:_});continue}let X=$.valueType._zod.run({value:z[U],issues:[]},Z);if(X instanceof Promise)A.push(X.then((Q)=>{if(Q.issues.length)b.issues.push(...__(U,Q.issues));b.value[G.value]=Q.value}));else{if(X.issues.length)b.issues.push(...__(U,X.issues));b.value[G.value]=X.value}}}if(A.length)return Promise.all(A).then(()=>b);return b}}),G3=I("$ZodMap",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{let z=b.value;if(!(z instanceof Map))return b.issues.push({expected:"map",code:"invalid_type",input:z,inst:_}),b;let A=[];b.value=new Map;for(let[J,U]of z){let G=$.keyType._zod.run({value:J,issues:[]},Z),Y=$.valueType._zod.run({value:U,issues:[]},Z);if(G instanceof Promise||Y instanceof Promise)A.push(Promise.all([G,Y]).then(([X,Q])=>{cG(X,Q,b,J,z,_,Z)}));else cG(G,Y,b,J,z,_,Z)}if(A.length)return Promise.all(A).then(()=>b);return b}});function cG(_,$,b,Z,z,A,J){if(_.issues.length)if(V$.has(typeof Z))b.issues.push(...__(Z,_.issues));else b.issues.push({code:"invalid_key",origin:"map",input:z,inst:A,issues:_.issues.map((U)=>r0(U,J,D0()))});if($.issues.length)if(V$.has(typeof Z))b.issues.push(...__(Z,$.issues));else b.issues.push({origin:"map",code:"invalid_element",input:z,inst:A,key:Z,issues:$.issues.map((U)=>r0(U,J,D0()))});b.value.set(_.value,$.value)}var Y3=I("$ZodSet",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{let z=b.value;if(!(z instanceof Set))return b.issues.push({input:z,inst:_,expected:"set",code:"invalid_type"}),b;let A=[];b.value=new Set;for(let J of z){let U=$.valueType._zod.run({value:J,issues:[]},Z);if(U instanceof Promise)A.push(U.then((G)=>rG(G,b)));else rG(U,b)}if(A.length)return Promise.all(A).then(()=>b);return b}});function rG(_,$){if(_.issues.length)$.issues.push(..._.issues);$.value.add(_.value)}var X3=I("$ZodEnum",(_,$)=>{i.init(_,$);let b=H$($.entries),Z=new Set(b);_._zod.values=Z,_._zod.pattern=new RegExp(`^(${b.filter((z)=>V$.has(typeof z)).map((z)=>typeof z==="string"?Q_(z):z.toString()).join("|")})$`),_._zod.parse=(z,A)=>{let J=z.value;if(Z.has(J))return z;return z.issues.push({code:"invalid_value",values:b,input:J,inst:_}),z}}),Q3=I("$ZodLiteral",(_,$)=>{if(i.init(_,$),$.values.length===0)throw Error("Cannot create literal schema with no valid values");let b=new Set($.values);_._zod.values=b,_._zod.pattern=new RegExp(`^(${$.values.map((Z)=>typeof Z==="string"?Q_(Z):Z?Q_(Z.toString()):String(Z)).join("|")})$`),_._zod.parse=(Z,z)=>{let A=Z.value;if(b.has(A))return Z;return Z.issues.push({code:"invalid_value",values:$.values,input:A,inst:_}),Z}}),K3=I("$ZodFile",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{let z=b.value;if(z instanceof File)return b;return b.issues.push({expected:"file",code:"invalid_type",input:z,inst:_}),b}}),v3=I("$ZodTransform",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{if(Z.direction==="backward")throw new L4(_.constructor.name);let z=$.transform(b.value,b);if(Z.async)return(z instanceof Promise?z:Promise.resolve(z)).then((J)=>{return b.value=J,b});if(z instanceof Promise)throw new P_;return b.value=z,b}});function nG(_,$){if(_.issues.length&&$===void 0)return{issues:[],value:void 0};return _}var Y1=I("$ZodOptional",(_,$)=>{i.init(_,$),_._zod.optin="optional",_._zod.optout="optional",t(_._zod,"values",()=>{return $.innerType._zod.values?new Set([...$.innerType._zod.values,void 0]):void 0}),t(_._zod,"pattern",()=>{let b=$.innerType._zod.pattern;return b?new RegExp(`^(${q$(b.source)})?$`):void 0}),_._zod.parse=(b,Z)=>{if($.innerType._zod.optin==="optional"){let z=$.innerType._zod.run(b,Z);if(z instanceof Promise)return z.then((A)=>nG(A,b.value));return nG(z,b.value)}if(b.value===void 0)return b;return $.innerType._zod.run(b,Z)}}),F3=I("$ZodExactOptional",(_,$)=>{Y1.init(_,$),t(_._zod,"values",()=>$.innerType._zod.values),t(_._zod,"pattern",()=>$.innerType._zod.pattern),_._zod.parse=(b,Z)=>{return $.innerType._zod.run(b,Z)}}),H3=I("$ZodNullable",(_,$)=>{i.init(_,$),t(_._zod,"optin",()=>$.innerType._zod.optin),t(_._zod,"optout",()=>$.innerType._zod.optout),t(_._zod,"pattern",()=>{let b=$.innerType._zod.pattern;return b?new RegExp(`^(${q$(b.source)}|null)$`):void 0}),t(_._zod,"values",()=>{return $.innerType._zod.values?new Set([...$.innerType._zod.values,null]):void 0}),_._zod.parse=(b,Z)=>{if(b.value===null)return b;return $.innerType._zod.run(b,Z)}}),q3=I("$ZodDefault",(_,$)=>{i.init(_,$),_._zod.optin="optional",t(_._zod,"values",()=>$.innerType._zod.values),_._zod.parse=(b,Z)=>{if(Z.direction==="backward")return $.innerType._zod.run(b,Z);if(b.value===void 0)return b.value=$.defaultValue,b;let z=$.innerType._zod.run(b,Z);if(z instanceof Promise)return z.then((A)=>lG(A,$));return lG(z,$)}});function lG(_,$){if(_.value===void 0)_.value=$.defaultValue;return _}var V3=I("$ZodPrefault",(_,$)=>{i.init(_,$),_._zod.optin="optional",t(_._zod,"values",()=>$.innerType._zod.values),_._zod.parse=(b,Z)=>{if(Z.direction==="backward")return $.innerType._zod.run(b,Z);if(b.value===void 0)b.value=$.defaultValue;return $.innerType._zod.run(b,Z)}}),D3=I("$ZodNonOptional",(_,$)=>{i.init(_,$),t(_._zod,"values",()=>{let b=$.innerType._zod.values;return b?new Set([...b].filter((Z)=>Z!==void 0)):void 0}),_._zod.parse=(b,Z)=>{let z=$.innerType._zod.run(b,Z);if(z instanceof Promise)return z.then((A)=>pG(A,_));return pG(z,_)}});function pG(_,$){if(!_.issues.length&&_.value===void 0)_.issues.push({code:"invalid_type",expected:"nonoptional",input:_.value,inst:$});return _}var k3=I("$ZodSuccess",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{if(Z.direction==="backward")throw new L4("ZodSuccess");let z=$.innerType._zod.run(b,Z);if(z instanceof Promise)return z.then((A)=>{return b.value=A.issues.length===0,b});return b.value=z.issues.length===0,b}}),W3=I("$ZodCatch",(_,$)=>{i.init(_,$),t(_._zod,"optin",()=>$.innerType._zod.optin),t(_._zod,"optout",()=>$.innerType._zod.optout),t(_._zod,"values",()=>$.innerType._zod.values),_._zod.parse=(b,Z)=>{if(Z.direction==="backward")return $.innerType._zod.run(b,Z);let z=$.innerType._zod.run(b,Z);if(z instanceof Promise)return z.then((A)=>{if(b.value=A.value,A.issues.length)b.value=$.catchValue({...b,error:{issues:A.issues.map((J)=>r0(J,Z,D0()))},input:b.value}),b.issues=[];return b});if(b.value=z.value,z.issues.length)b.value=$.catchValue({...b,error:{issues:z.issues.map((A)=>r0(A,Z,D0()))},input:b.value}),b.issues=[];return b}}),g3=I("$ZodNaN",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{if(typeof b.value!=="number"||!Number.isNaN(b.value))return b.issues.push({input:b.value,inst:_,expected:"nan",code:"invalid_type"}),b;return b}}),B3=I("$ZodPipe",(_,$)=>{i.init(_,$),t(_._zod,"values",()=>$.in._zod.values),t(_._zod,"optin",()=>$.in._zod.optin),t(_._zod,"optout",()=>$.out._zod.optout),t(_._zod,"propValues",()=>$.in._zod.propValues),_._zod.parse=(b,Z)=>{if(Z.direction==="backward"){let A=$.out._zod.run(b,Z);if(A instanceof Promise)return A.then((J)=>z1(J,$.in,Z));return z1(A,$.in,Z)}let z=$.in._zod.run(b,Z);if(z instanceof Promise)return z.then((A)=>z1(A,$.out,Z));return z1(z,$.out,Z)}});function z1(_,$,b){if(_.issues.length)return _.aborted=!0,_;return $._zod.run({value:_.value,issues:_.issues},b)}var E$=I("$ZodCodec",(_,$)=>{i.init(_,$),t(_._zod,"values",()=>$.in._zod.values),t(_._zod,"optin",()=>$.in._zod.optin),t(_._zod,"optout",()=>$.out._zod.optout),t(_._zod,"propValues",()=>$.in._zod.propValues),_._zod.parse=(b,Z)=>{if((Z.direction||"forward")==="forward"){let A=$.in._zod.run(b,Z);if(A instanceof Promise)return A.then((J)=>b1(J,$,Z));return b1(A,$,Z)}else{let A=$.out._zod.run(b,Z);if(A instanceof Promise)return A.then((J)=>b1(J,$,Z));return b1(A,$,Z)}}});function b1(_,$,b){if(_.issues.length)return _.aborted=!0,_;if((b.direction||"forward")==="forward"){let z=$.transform(_.value,_);if(z instanceof Promise)return z.then((A)=>Z1(_,A,$.out,b));return Z1(_,z,$.out,b)}else{let z=$.reverseTransform(_.value,_);if(z instanceof Promise)return z.then((A)=>Z1(_,A,$.in,b));return Z1(_,z,$.in,b)}}function Z1(_,$,b,Z){if(_.issues.length)return _.aborted=!0,_;return b._zod.run({value:$,issues:_.issues},Z)}var w3=I("$ZodReadonly",(_,$)=>{i.init(_,$),t(_._zod,"propValues",()=>$.innerType._zod.propValues),t(_._zod,"values",()=>$.innerType._zod.values),t(_._zod,"optin",()=>$.innerType?._zod?.optin),t(_._zod,"optout",()=>$.innerType?._zod?.optout),_._zod.parse=(b,Z)=>{if(Z.direction==="backward")return $.innerType._zod.run(b,Z);let z=$.innerType._zod.run(b,Z);if(z instanceof Promise)return z.then(dG);return dG(z)}});function dG(_){return _.value=Object.freeze(_.value),_}var x3=I("$ZodTemplateLiteral",(_,$)=>{i.init(_,$);let b=[];for(let Z of $.parts)if(typeof Z==="object"&&Z!==null){if(!Z._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...Z._zod.traits].shift()}`);let z=Z._zod.pattern instanceof RegExp?Z._zod.pattern.source:Z._zod.pattern;if(!z)throw Error(`Invalid template literal part: ${Z._zod.traits}`);let A=z.startsWith("^")?1:0,J=z.endsWith("$")?z.length-1:z.length;b.push(z.slice(A,J))}else if(Z===null||Db.has(typeof Z))b.push(Q_(`${Z}`));else throw Error(`Invalid template literal part: ${Z}`);_._zod.pattern=new RegExp(`^${b.join("")}$`),_._zod.parse=(Z,z)=>{if(typeof Z.value!=="string")return Z.issues.push({input:Z.value,inst:_,expected:"string",code:"invalid_type"}),Z;if(_._zod.pattern.lastIndex=0,!_._zod.pattern.test(Z.value))return Z.issues.push({input:Z.value,inst:_,code:"invalid_format",format:$.format??"template_literal",pattern:_._zod.pattern.source}),Z;return Z}}),N3=I("$ZodFunction",(_,$)=>{return i.init(_,$),_._def=$,_._zod.def=$,_.implement=(b)=>{if(typeof b!=="function")throw Error("implement() must be called with a function");return function(...Z){let z=_._def.input?h2(_._def.input,Z):Z,A=Reflect.apply(b,this,z);if(_._def.output)return h2(_._def.output,A);return A}},_.implementAsync=(b)=>{if(typeof b!=="function")throw Error("implementAsync() must be called with a function");return async function(...Z){let z=_._def.input?await c2(_._def.input,Z):Z,A=await Reflect.apply(b,this,z);if(_._def.output)return await c2(_._def.output,A);return A}},_._zod.parse=(b,Z)=>{if(typeof b.value!=="function")return b.issues.push({code:"invalid_type",expected:"function",input:b.value,inst:_}),b;if(_._def.output&&_._def.output._zod.def.type==="promise")b.value=_.implementAsync(b.value);else b.value=_.implement(b.value);return b},_.input=(...b)=>{let Z=_.constructor;if(Array.isArray(b[0]))return new Z({type:"function",input:new G1({type:"tuple",items:b[0],rest:b[1]}),output:_._def.output});return new Z({type:"function",input:b[0],output:_._def.output})},_.output=(b)=>{return new _.constructor({type:"function",input:_._def.input,output:b})},_}),I3=I("$ZodPromise",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{return Promise.resolve(b.value).then((z)=>$.innerType._zod.run({value:z,issues:[]},Z))}}),M3=I("$ZodLazy",(_,$)=>{i.init(_,$),t(_._zod,"innerType",()=>$.getter()),t(_._zod,"pattern",()=>_._zod.innerType?._zod?.pattern),t(_._zod,"propValues",()=>_._zod.innerType?._zod?.propValues),t(_._zod,"optin",()=>_._zod.innerType?._zod?.optin??void 0),t(_._zod,"optout",()=>_._zod.innerType?._zod?.optout??void 0),_._zod.parse=(b,Z)=>{return _._zod.innerType._zod.run(b,Z)}}),E3=I("$ZodCustom",(_,$)=>{K0.init(_,$),i.init(_,$),_._zod.parse=(b,Z)=>{return b},_._zod.check=(b)=>{let Z=b.value,z=$.fn(Z);if(z instanceof Promise)return z.then((A)=>iG(A,b,Z,_));iG(z,b,Z,_);return}});function iG(_,$,b,Z){if(!_){let z={code:"custom",input:b,inst:Z,path:[...Z._zod.def.path??[]],continue:!Z._zod.def.abort};if(Z._zod.def.params)z.params=Z._zod.def.params;$.issues.push(Y9(z))}}var R$={};r_(R$,{zhTW:()=>kA,zhCN:()=>DA,yo:()=>WA,vi:()=>VA,uz:()=>qA,ur:()=>HA,uk:()=>S$,ua:()=>FA,tr:()=>vA,th:()=>KA,ta:()=>QA,sv:()=>XA,sl:()=>YA,ru:()=>GA,pt:()=>UA,ps:()=>AA,pl:()=>JA,ota:()=>ZA,no:()=>bA,nl:()=>zA,ms:()=>$A,mk:()=>_A,lt:()=>s3,ko:()=>t3,km:()=>P$,kh:()=>e3,ka:()=>a3,ja:()=>o3,it:()=>i3,is:()=>d3,id:()=>p3,hy:()=>l3,hu:()=>n3,he:()=>r3,frCA:()=>c3,fr:()=>h3,fi:()=>u3,fa:()=>m3,es:()=>f3,eo:()=>C3,en:()=>O$,de:()=>y3,da:()=>T3,cs:()=>L3,ca:()=>R3,bg:()=>S3,be:()=>j3,az:()=>P3,ar:()=>O3});var cV=()=>{let _={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function $(z){return _[z]??null}let b={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:"مدخل"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${z.expected}، ولكن تم إدخال ${U}`;return`مدخلات غير مقبولة: يفترض إدخال ${A}، ولكن تم إدخال ${U}`}case"invalid_value":if(z.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${m(z.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return` أكبر من اللازم: يفترض أن تكون ${z.origin??"القيمة"} ${A} ${z.maximum.toString()} ${J.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${z.origin??"القيمة"} ${A} ${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`أصغر من اللازم: يفترض لـ ${z.origin} أن يكون ${A} ${z.minimum.toString()} ${J.unit}`;return`أصغر من اللازم: يفترض لـ ${z.origin} أن يكون ${A} ${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${z.prefix}"`;if(A.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${A.suffix}"`;if(A.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${A.includes}"`;if(A.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${A.pattern}`;return`${b[A.format]??z.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${z.divisor}`;case"unrecognized_keys":return`معرف${z.keys.length>1?"ات":""} غريب${z.keys.length>1?"ة":""}: ${R(z.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${z.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${z.origin}`;default:return"مدخل غير مقبول"}}};function O3(){return{localeError:cV()}}var rV=()=>{let _={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 $(z){return _[z]??null}let b={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"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Yanlış dəyər: gözlənilən instanceof ${z.expected}, daxil olan ${U}`;return`Yanlış dəyər: gözlənilən ${A}, daxil olan ${U}`}case"invalid_value":if(z.values.length===1)return`Yanlış dəyər: gözlənilən ${m(z.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Çox böyük: gözlənilən ${z.origin??"dəyər"} ${A}${z.maximum.toString()} ${J.unit??"element"}`;return`Çox böyük: gözlənilən ${z.origin??"dəyər"} ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Çox kiçik: gözlənilən ${z.origin} ${A}${z.minimum.toString()} ${J.unit}`;return`Çox kiçik: gözlənilən ${z.origin} ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Yanlış mətn: "${A.prefix}" ilə başlamalıdır`;if(A.format==="ends_with")return`Yanlış mətn: "${A.suffix}" ilə bitməlidir`;if(A.format==="includes")return`Yanlış mətn: "${A.includes}" daxil olmalıdır`;if(A.format==="regex")return`Yanlış mətn: ${A.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${b[A.format]??z.format}`}case"not_multiple_of":return`Yanlış ədəd: ${z.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${z.keys.length>1?"lar":""}: ${R(z.keys,", ")}`;case"invalid_key":return`${z.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${z.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function P3(){return{localeError:rV()}}function _Y(_,$,b,Z){let z=Math.abs(_),A=z%10,J=z%100;if(J>=11&&J<=19)return Z;if(A===1)return $;if(A>=2&&A<=4)return b;return Z}var nV=()=>{let _={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 $(z){return _[z]??null}let b={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:"увод"},Z={nan:"NaN",number:"лік",array:"масіў"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Няправільны ўвод: чакаўся instanceof ${z.expected}, атрымана ${U}`;return`Няправільны ўвод: чакаўся ${A}, атрымана ${U}`}case"invalid_value":if(z.values.length===1)return`Няправільны ўвод: чакалася ${m(z.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J){let U=Number(z.maximum),G=_Y(U,J.unit.one,J.unit.few,J.unit.many);return`Занадта вялікі: чакалася, што ${z.origin??"значэнне"} павінна ${J.verb} ${A}${z.maximum.toString()} ${G}`}return`Занадта вялікі: чакалася, што ${z.origin??"значэнне"} павінна быць ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J){let U=Number(z.minimum),G=_Y(U,J.unit.one,J.unit.few,J.unit.many);return`Занадта малы: чакалася, што ${z.origin} павінна ${J.verb} ${A}${z.minimum.toString()} ${G}`}return`Занадта малы: чакалася, што ${z.origin} павінна быць ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${A.prefix}"`;if(A.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${A.suffix}"`;if(A.format==="includes")return`Няправільны радок: павінен змяшчаць "${A.includes}"`;if(A.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${A.pattern}`;return`Няправільны ${b[A.format]??z.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${z.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${z.keys.length>1?"ключы":"ключ"}: ${R(z.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${z.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${z.origin}`;default:return"Няправільны ўвод"}}};function j3(){return{localeError:nV()}}var lV=()=>{let _={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function $(z){return _[z]??null}let b={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:"вход"},Z={nan:"NaN",number:"число",array:"масив"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Невалиден вход: очакван instanceof ${z.expected}, получен ${U}`;return`Невалиден вход: очакван ${A}, получен ${U}`}case"invalid_value":if(z.values.length===1)return`Невалиден вход: очакван ${m(z.values[0])}`;return`Невалидна опция: очаквано едно от ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Твърде голямо: очаква се ${z.origin??"стойност"} да съдържа ${A}${z.maximum.toString()} ${J.unit??"елемента"}`;return`Твърде голямо: очаква се ${z.origin??"стойност"} да бъде ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Твърде малко: очаква се ${z.origin} да съдържа ${A}${z.minimum.toString()} ${J.unit}`;return`Твърде малко: очаква се ${z.origin} да бъде ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Невалиден низ: трябва да започва с "${A.prefix}"`;if(A.format==="ends_with")return`Невалиден низ: трябва да завършва с "${A.suffix}"`;if(A.format==="includes")return`Невалиден низ: трябва да включва "${A.includes}"`;if(A.format==="regex")return`Невалиден низ: трябва да съвпада с ${A.pattern}`;let J="Невалиден";if(A.format==="emoji")J="Невалидно";if(A.format==="datetime")J="Невалидно";if(A.format==="date")J="Невалидна";if(A.format==="time")J="Невалидно";if(A.format==="duration")J="Невалидна";return`${J} ${b[A.format]??z.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${z.divisor}`;case"unrecognized_keys":return`Неразпознат${z.keys.length>1?"и":""} ключ${z.keys.length>1?"ове":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${z.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${z.origin}`;default:return"Невалиден вход"}}};function S3(){return{localeError:lV()}}var pV=()=>{let _={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Tipus invàlid: s'esperava instanceof ${z.expected}, s'ha rebut ${U}`;return`Tipus invàlid: s'esperava ${A}, s'ha rebut ${U}`}case"invalid_value":if(z.values.length===1)return`Valor invàlid: s'esperava ${m(z.values[0])}`;return`Opció invàlida: s'esperava una de ${R(z.values," o ")}`;case"too_big":{let A=z.inclusive?"com a màxim":"menys de",J=$(z.origin);if(J)return`Massa gran: s'esperava que ${z.origin??"el valor"} contingués ${A} ${z.maximum.toString()} ${J.unit??"elements"}`;return`Massa gran: s'esperava que ${z.origin??"el valor"} fos ${A} ${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?"com a mínim":"més de",J=$(z.origin);if(J)return`Massa petit: s'esperava que ${z.origin} contingués ${A} ${z.minimum.toString()} ${J.unit}`;return`Massa petit: s'esperava que ${z.origin} fos ${A} ${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Format invàlid: ha de començar amb "${A.prefix}"`;if(A.format==="ends_with")return`Format invàlid: ha d'acabar amb "${A.suffix}"`;if(A.format==="includes")return`Format invàlid: ha d'incloure "${A.includes}"`;if(A.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${A.pattern}`;return`Format invàlid per a ${b[A.format]??z.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${z.divisor}`;case"unrecognized_keys":return`Clau${z.keys.length>1?"s":""} no reconeguda${z.keys.length>1?"s":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${z.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${z.origin}`;default:return"Entrada invàlida"}}};function R3(){return{localeError:pV()}}var dV=()=>{let _={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 $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Neplatný vstup: očekáváno instanceof ${z.expected}, obdrženo ${U}`;return`Neplatný vstup: očekáváno ${A}, obdrženo ${U}`}case"invalid_value":if(z.values.length===1)return`Neplatný vstup: očekáváno ${m(z.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Hodnota je příliš velká: ${z.origin??"hodnota"} musí mít ${A}${z.maximum.toString()} ${J.unit??"prvků"}`;return`Hodnota je příliš velká: ${z.origin??"hodnota"} musí být ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Hodnota je příliš malá: ${z.origin??"hodnota"} musí mít ${A}${z.minimum.toString()} ${J.unit??"prvků"}`;return`Hodnota je příliš malá: ${z.origin??"hodnota"} musí být ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Neplatný řetězec: musí začínat na "${A.prefix}"`;if(A.format==="ends_with")return`Neplatný řetězec: musí končit na "${A.suffix}"`;if(A.format==="includes")return`Neplatný řetězec: musí obsahovat "${A.includes}"`;if(A.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${A.pattern}`;return`Neplatný formát ${b[A.format]??z.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${z.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${R(z.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${z.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${z.origin}`;default:return"Neplatný vstup"}}};function L3(){return{localeError:dV()}}var iV=()=>{let _={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function $(z){return _[z]??null}let b={regex:"input",email:"e-mailadresse",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 klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},Z={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Ugyldigt input: forventede instanceof ${z.expected}, fik ${U}`;return`Ugyldigt input: forventede ${A}, fik ${U}`}case"invalid_value":if(z.values.length===1)return`Ugyldig værdi: forventede ${m(z.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin),U=Z[z.origin]??z.origin;if(J)return`For stor: forventede ${U??"value"} ${J.verb} ${A} ${z.maximum.toString()} ${J.unit??"elementer"}`;return`For stor: forventede ${U??"value"} havde ${A} ${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin),U=Z[z.origin]??z.origin;if(J)return`For lille: forventede ${U} ${J.verb} ${A} ${z.minimum.toString()} ${J.unit}`;return`For lille: forventede ${U} havde ${A} ${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Ugyldig streng: skal starte med "${A.prefix}"`;if(A.format==="ends_with")return`Ugyldig streng: skal ende med "${A.suffix}"`;if(A.format==="includes")return`Ugyldig streng: skal indeholde "${A.includes}"`;if(A.format==="regex")return`Ugyldig streng: skal matche mønsteret ${A.pattern}`;return`Ugyldig ${b[A.format]??z.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${z.divisor}`;case"unrecognized_keys":return`${z.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${R(z.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${z.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${z.origin}`;default:return"Ugyldigt input"}}};function T3(){return{localeError:iV()}}var oV=()=>{let _={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 $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"Zahl",array:"Array"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Ungültige Eingabe: erwartet instanceof ${z.expected}, erhalten ${U}`;return`Ungültige Eingabe: erwartet ${A}, erhalten ${U}`}case"invalid_value":if(z.values.length===1)return`Ungültige Eingabe: erwartet ${m(z.values[0])}`;return`Ungültige Option: erwartet eine von ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Zu groß: erwartet, dass ${z.origin??"Wert"} ${A}${z.maximum.toString()} ${J.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${z.origin??"Wert"} ${A}${z.maximum.toString()} ist`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Zu klein: erwartet, dass ${z.origin} ${A}${z.minimum.toString()} ${J.unit} hat`;return`Zu klein: erwartet, dass ${z.origin} ${A}${z.minimum.toString()} ist`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Ungültiger String: muss mit "${A.prefix}" beginnen`;if(A.format==="ends_with")return`Ungültiger String: muss mit "${A.suffix}" enden`;if(A.format==="includes")return`Ungültiger String: muss "${A.includes}" enthalten`;if(A.format==="regex")return`Ungültiger String: muss dem Muster ${A.pattern} entsprechen`;return`Ungültig: ${b[A.format]??z.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${z.divisor} sein`;case"unrecognized_keys":return`${z.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${R(z.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${z.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${z.origin}`;default:return"Ungültige Eingabe"}}};function y3(){return{localeError:oV()}}var aV=()=>{let _={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function $(z){return _[z]??null}let b={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;return`Invalid input: expected ${A}, received ${U}`}case"invalid_value":if(z.values.length===1)return`Invalid input: expected ${m(z.values[0])}`;return`Invalid option: expected one of ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Too big: expected ${z.origin??"value"} to have ${A}${z.maximum.toString()} ${J.unit??"elements"}`;return`Too big: expected ${z.origin??"value"} to be ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Too small: expected ${z.origin} to have ${A}${z.minimum.toString()} ${J.unit}`;return`Too small: expected ${z.origin} to be ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Invalid string: must start with "${A.prefix}"`;if(A.format==="ends_with")return`Invalid string: must end with "${A.suffix}"`;if(A.format==="includes")return`Invalid string: must include "${A.includes}"`;if(A.format==="regex")return`Invalid string: must match pattern ${A.pattern}`;return`Invalid ${b[A.format]??z.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${z.divisor}`;case"unrecognized_keys":return`Unrecognized key${z.keys.length>1?"s":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Invalid key in ${z.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${z.origin}`;default:return"Invalid input"}}};function O$(){return{localeError:aV()}}var eV=()=>{let _={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Nevalida enigo: atendiĝis instanceof ${z.expected}, riceviĝis ${U}`;return`Nevalida enigo: atendiĝis ${A}, riceviĝis ${U}`}case"invalid_value":if(z.values.length===1)return`Nevalida enigo: atendiĝis ${m(z.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Tro granda: atendiĝis ke ${z.origin??"valoro"} havu ${A}${z.maximum.toString()} ${J.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${z.origin??"valoro"} havu ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Tro malgranda: atendiĝis ke ${z.origin} havu ${A}${z.minimum.toString()} ${J.unit}`;return`Tro malgranda: atendiĝis ke ${z.origin} estu ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${A.prefix}"`;if(A.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${A.suffix}"`;if(A.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${A.includes}"`;if(A.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${A.pattern}`;return`Nevalida ${b[A.format]??z.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${z.divisor}`;case"unrecognized_keys":return`Nekonata${z.keys.length>1?"j":""} ŝlosilo${z.keys.length>1?"j":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${z.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${z.origin}`;default:return"Nevalida enigo"}}};function C3(){return{localeError:eV()}}var tV=()=>{let _={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Entrada inválida: se esperaba instanceof ${z.expected}, recibido ${U}`;return`Entrada inválida: se esperaba ${A}, recibido ${U}`}case"invalid_value":if(z.values.length===1)return`Entrada inválida: se esperaba ${m(z.values[0])}`;return`Opción inválida: se esperaba una de ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin),U=Z[z.origin]??z.origin;if(J)return`Demasiado grande: se esperaba que ${U??"valor"} tuviera ${A}${z.maximum.toString()} ${J.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${U??"valor"} fuera ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin),U=Z[z.origin]??z.origin;if(J)return`Demasiado pequeño: se esperaba que ${U} tuviera ${A}${z.minimum.toString()} ${J.unit}`;return`Demasiado pequeño: se esperaba que ${U} fuera ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Cadena inválida: debe comenzar con "${A.prefix}"`;if(A.format==="ends_with")return`Cadena inválida: debe terminar en "${A.suffix}"`;if(A.format==="includes")return`Cadena inválida: debe incluir "${A.includes}"`;if(A.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${A.pattern}`;return`Inválido ${b[A.format]??z.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${z.divisor}`;case"unrecognized_keys":return`Llave${z.keys.length>1?"s":""} desconocida${z.keys.length>1?"s":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Llave inválida en ${Z[z.origin]??z.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${Z[z.origin]??z.origin}`;default:return"Entrada inválida"}}};function f3(){return{localeError:tV()}}var sV=()=>{let _={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function $(z){return _[z]??null}let b={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:"ورودی"},Z={nan:"NaN",number:"عدد",array:"آرایه"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`ورودی نامعتبر: می‌بایست instanceof ${z.expected} می‌بود، ${U} دریافت شد`;return`ورودی نامعتبر: می‌بایست ${A} می‌بود، ${U} دریافت شد`}case"invalid_value":if(z.values.length===1)return`ورودی نامعتبر: می‌بایست ${m(z.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${R(z.values,"|")} می‌بود`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`خیلی بزرگ: ${z.origin??"مقدار"} باید ${A}${z.maximum.toString()} ${J.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${z.origin??"مقدار"} باید ${A}${z.maximum.toString()} باشد`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`خیلی کوچک: ${z.origin} باید ${A}${z.minimum.toString()} ${J.unit} باشد`;return`خیلی کوچک: ${z.origin} باید ${A}${z.minimum.toString()} باشد`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`رشته نامعتبر: باید با "${A.prefix}" شروع شود`;if(A.format==="ends_with")return`رشته نامعتبر: باید با "${A.suffix}" تمام شود`;if(A.format==="includes")return`رشته نامعتبر: باید شامل "${A.includes}" باشد`;if(A.format==="regex")return`رشته نامعتبر: باید با الگوی ${A.pattern} مطابقت داشته باشد`;return`${b[A.format]??z.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${z.divisor} باشد`;case"unrecognized_keys":return`کلید${z.keys.length>1?"های":""} ناشناس: ${R(z.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${z.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${z.origin}`;default:return"ورودی نامعتبر"}}};function m3(){return{localeError:sV()}}var _D=()=>{let _={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 $(z){return _[z]??null}let b={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"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Virheellinen tyyppi: odotettiin instanceof ${z.expected}, oli ${U}`;return`Virheellinen tyyppi: odotettiin ${A}, oli ${U}`}case"invalid_value":if(z.values.length===1)return`Virheellinen syöte: täytyy olla ${m(z.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Liian suuri: ${J.subject} täytyy olla ${A}${z.maximum.toString()} ${J.unit}`.trim();return`Liian suuri: arvon täytyy olla ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Liian pieni: ${J.subject} täytyy olla ${A}${z.minimum.toString()} ${J.unit}`.trim();return`Liian pieni: arvon täytyy olla ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${A.prefix}"`;if(A.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${A.suffix}"`;if(A.format==="includes")return`Virheellinen syöte: täytyy sisältää "${A.includes}"`;if(A.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${A.pattern}`;return`Virheellinen ${b[A.format]??z.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${z.divisor} monikerta`;case"unrecognized_keys":return`${z.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${R(z.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 u3(){return{localeError:_D()}}var $D=()=>{let _={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"nombre",array:"tableau"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Entrée invalide : instanceof ${z.expected} attendu, ${U} reçu`;return`Entrée invalide : ${A} attendu, ${U} reçu`}case"invalid_value":if(z.values.length===1)return`Entrée invalide : ${m(z.values[0])} attendu`;return`Option invalide : une valeur parmi ${R(z.values,"|")} attendue`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Trop grand : ${z.origin??"valeur"} doit ${J.verb} ${A}${z.maximum.toString()} ${J.unit??"élément(s)"}`;return`Trop grand : ${z.origin??"valeur"} doit être ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Trop petit : ${z.origin} doit ${J.verb} ${A}${z.minimum.toString()} ${J.unit}`;return`Trop petit : ${z.origin} doit être ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Chaîne invalide : doit commencer par "${A.prefix}"`;if(A.format==="ends_with")return`Chaîne invalide : doit se terminer par "${A.suffix}"`;if(A.format==="includes")return`Chaîne invalide : doit inclure "${A.includes}"`;if(A.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${A.pattern}`;return`${b[A.format]??z.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${z.divisor}`;case"unrecognized_keys":return`Clé${z.keys.length>1?"s":""} non reconnue${z.keys.length>1?"s":""} : ${R(z.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${z.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${z.origin}`;default:return"Entrée invalide"}}};function h3(){return{localeError:$D()}}var zD=()=>{let _={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Entrée invalide : attendu instanceof ${z.expected}, reçu ${U}`;return`Entrée invalide : attendu ${A}, reçu ${U}`}case"invalid_value":if(z.values.length===1)return`Entrée invalide : attendu ${m(z.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"≤":"<",J=$(z.origin);if(J)return`Trop grand : attendu que ${z.origin??"la valeur"} ait ${A}${z.maximum.toString()} ${J.unit}`;return`Trop grand : attendu que ${z.origin??"la valeur"} soit ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?"≥":">",J=$(z.origin);if(J)return`Trop petit : attendu que ${z.origin} ait ${A}${z.minimum.toString()} ${J.unit}`;return`Trop petit : attendu que ${z.origin} soit ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Chaîne invalide : doit commencer par "${A.prefix}"`;if(A.format==="ends_with")return`Chaîne invalide : doit se terminer par "${A.suffix}"`;if(A.format==="includes")return`Chaîne invalide : doit inclure "${A.includes}"`;if(A.format==="regex")return`Chaîne invalide : doit correspondre au motif ${A.pattern}`;return`${b[A.format]??z.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${z.divisor}`;case"unrecognized_keys":return`Clé${z.keys.length>1?"s":""} non reconnue${z.keys.length>1?"s":""} : ${R(z.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${z.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${z.origin}`;default:return"Entrée invalide"}}};function c3(){return{localeError:zD()}}var bD=()=>{let _={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},$={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},b=(Y)=>Y?_[Y]:void 0,Z=(Y)=>{let X=b(Y);if(X)return X.label;return Y??_.unknown.label},z=(Y)=>`ה${Z(Y)}`,A=(Y)=>{return(b(Y)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},J=(Y)=>{if(!Y)return null;return $[Y]??null},U={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},G={nan:"NaN"};return(Y)=>{switch(Y.code){case"invalid_type":{let X=Y.expected,Q=G[X??""]??Z(X),K=h(Y.input),v=G[K]??_[K]?.label??K;if(/^[A-Z]/.test(Y.expected))return`קלט לא תקין: צריך להיות instanceof ${Y.expected}, התקבל ${v}`;return`קלט לא תקין: צריך להיות ${Q}, התקבל ${v}`}case"invalid_value":{if(Y.values.length===1)return`ערך לא תקין: הערך חייב להיות ${m(Y.values[0])}`;let X=Y.values.map((v)=>m(v));if(Y.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${X[0]} או ${X[1]}`;let Q=X[X.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${X.slice(0,-1).join(", ")} או ${Q}`}case"too_big":{let X=J(Y.origin),Q=z(Y.origin??"value");if(Y.origin==="string")return`${X?.longLabel??"ארוך"} מדי: ${Q} צריכה להכיל ${Y.maximum.toString()} ${X?.unit??""} ${Y.inclusive?"או פחות":"לכל היותר"}`.trim();if(Y.origin==="number"){let V=Y.inclusive?`קטן או שווה ל-${Y.maximum}`:`קטן מ-${Y.maximum}`;return`גדול מדי: ${Q} צריך להיות ${V}`}if(Y.origin==="array"||Y.origin==="set"){let V=Y.origin==="set"?"צריכה":"צריך",w=Y.inclusive?`${Y.maximum} ${X?.unit??""} או פחות`:`פחות מ-${Y.maximum} ${X?.unit??""}`;return`גדול מדי: ${Q} ${V} להכיל ${w}`.trim()}let K=Y.inclusive?"<=":"<",v=A(Y.origin??"value");if(X?.unit)return`${X.longLabel} מדי: ${Q} ${v} ${K}${Y.maximum.toString()} ${X.unit}`;return`${X?.longLabel??"גדול"} מדי: ${Q} ${v} ${K}${Y.maximum.toString()}`}case"too_small":{let X=J(Y.origin),Q=z(Y.origin??"value");if(Y.origin==="string")return`${X?.shortLabel??"קצר"} מדי: ${Q} צריכה להכיל ${Y.minimum.toString()} ${X?.unit??""} ${Y.inclusive?"או יותר":"לפחות"}`.trim();if(Y.origin==="number"){let V=Y.inclusive?`גדול או שווה ל-${Y.minimum}`:`גדול מ-${Y.minimum}`;return`קטן מדי: ${Q} צריך להיות ${V}`}if(Y.origin==="array"||Y.origin==="set"){let V=Y.origin==="set"?"צריכה":"צריך";if(Y.minimum===1&&Y.inclusive){let P=Y.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${Q} ${V} להכיל ${P}`}let w=Y.inclusive?`${Y.minimum} ${X?.unit??""} או יותר`:`יותר מ-${Y.minimum} ${X?.unit??""}`;return`קטן מדי: ${Q} ${V} להכיל ${w}`.trim()}let K=Y.inclusive?">=":">",v=A(Y.origin??"value");if(X?.unit)return`${X.shortLabel} מדי: ${Q} ${v} ${K}${Y.minimum.toString()} ${X.unit}`;return`${X?.shortLabel??"קטן"} מדי: ${Q} ${v} ${K}${Y.minimum.toString()}`}case"invalid_format":{let X=Y;if(X.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${X.prefix}"`;if(X.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${X.suffix}"`;if(X.format==="includes")return`המחרוזת חייבת לכלול "${X.includes}"`;if(X.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${X.pattern}`;let Q=U[X.format],K=Q?.label??X.format,V=(Q?.gender??"m")==="f"?"תקינה":"תקין";return`${K} לא ${V}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${Y.divisor}`;case"unrecognized_keys":return`מפתח${Y.keys.length>1?"ות":""} לא מזוה${Y.keys.length>1?"ים":"ה"}: ${R(Y.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${z(Y.origin??"array")}`;default:return"קלט לא תקין"}}};function r3(){return{localeError:bD()}}var ZD=()=>{let _={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"szám",array:"tömb"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Érvénytelen bemenet: a várt érték instanceof ${z.expected}, a kapott érték ${U}`;return`Érvénytelen bemenet: a várt érték ${A}, a kapott érték ${U}`}case"invalid_value":if(z.values.length===1)return`Érvénytelen bemenet: a várt érték ${m(z.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Túl nagy: ${z.origin??"érték"} mérete túl nagy ${A}${z.maximum.toString()} ${J.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${z.origin??"érték"} túl nagy: ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Túl kicsi: a bemeneti érték ${z.origin} mérete túl kicsi ${A}${z.minimum.toString()} ${J.unit}`;return`Túl kicsi: a bemeneti érték ${z.origin} túl kicsi ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Érvénytelen string: "${A.prefix}" értékkel kell kezdődnie`;if(A.format==="ends_with")return`Érvénytelen string: "${A.suffix}" értékkel kell végződnie`;if(A.format==="includes")return`Érvénytelen string: "${A.includes}" értéket kell tartalmaznia`;if(A.format==="regex")return`Érvénytelen string: ${A.pattern} mintának kell megfelelnie`;return`Érvénytelen ${b[A.format]??z.format}`}case"not_multiple_of":return`Érvénytelen szám: ${z.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${z.keys.length>1?"s":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${z.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${z.origin}`;default:return"Érvénytelen bemenet"}}};function n3(){return{localeError:ZD()}}function $Y(_,$,b){return Math.abs(_)===1?$:b}function H9(_){if(!_)return"";let $=["ա","ե","ը","ի","ո","ու","օ"],b=_[_.length-1];return _+($.includes(b)?"ն":"ը")}var AD=()=>{let _={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function $(z){return _[z]??null}let b={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:"մուտք"},Z={nan:"NaN",number:"թիվ",array:"զանգված"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${z.expected}, ստացվել է ${U}`;return`Սխալ մուտքագրում․ սպասվում էր ${A}, ստացվել է ${U}`}case"invalid_value":if(z.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${m(z.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J){let U=Number(z.maximum),G=$Y(U,J.unit.one,J.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${H9(z.origin??"արժեք")} կունենա ${A}${z.maximum.toString()} ${G}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${H9(z.origin??"արժեք")} լինի ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J){let U=Number(z.minimum),G=$Y(U,J.unit.one,J.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${H9(z.origin)} կունենա ${A}${z.minimum.toString()} ${G}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${H9(z.origin)} լինի ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${A.prefix}"-ով`;if(A.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${A.suffix}"-ով`;if(A.format==="includes")return`Սխալ տող․ պետք է պարունակի "${A.includes}"`;if(A.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${A.pattern} ձևաչափին`;return`Սխալ ${b[A.format]??z.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${z.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${z.keys.length>1?"ներ":""}. ${R(z.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${H9(z.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${H9(z.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function l3(){return{localeError:AD()}}var JD=()=>{let _={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Input tidak valid: diharapkan instanceof ${z.expected}, diterima ${U}`;return`Input tidak valid: diharapkan ${A}, diterima ${U}`}case"invalid_value":if(z.values.length===1)return`Input tidak valid: diharapkan ${m(z.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Terlalu besar: diharapkan ${z.origin??"value"} memiliki ${A}${z.maximum.toString()} ${J.unit??"elemen"}`;return`Terlalu besar: diharapkan ${z.origin??"value"} menjadi ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Terlalu kecil: diharapkan ${z.origin} memiliki ${A}${z.minimum.toString()} ${J.unit}`;return`Terlalu kecil: diharapkan ${z.origin} menjadi ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`String tidak valid: harus dimulai dengan "${A.prefix}"`;if(A.format==="ends_with")return`String tidak valid: harus berakhir dengan "${A.suffix}"`;if(A.format==="includes")return`String tidak valid: harus menyertakan "${A.includes}"`;if(A.format==="regex")return`String tidak valid: harus sesuai pola ${A.pattern}`;return`${b[A.format]??z.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${z.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${z.keys.length>1?"s":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${z.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${z.origin}`;default:return"Input tidak valid"}}};function p3(){return{localeError:JD()}}var UD=()=>{let _={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function $(z){return _[z]??null}let b={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},Z={nan:"NaN",number:"númer",array:"fylki"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Rangt gildi: Þú slóst inn ${U} þar sem á að vera instanceof ${z.expected}`;return`Rangt gildi: Þú slóst inn ${U} þar sem á að vera ${A}`}case"invalid_value":if(z.values.length===1)return`Rangt gildi: gert ráð fyrir ${m(z.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Of stórt: gert er ráð fyrir að ${z.origin??"gildi"} hafi ${A}${z.maximum.toString()} ${J.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${z.origin??"gildi"} sé ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Of lítið: gert er ráð fyrir að ${z.origin} hafi ${A}${z.minimum.toString()} ${J.unit}`;return`Of lítið: gert er ráð fyrir að ${z.origin} sé ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Ógildur strengur: verður að byrja á "${A.prefix}"`;if(A.format==="ends_with")return`Ógildur strengur: verður að enda á "${A.suffix}"`;if(A.format==="includes")return`Ógildur strengur: verður að innihalda "${A.includes}"`;if(A.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${A.pattern}`;return`Rangt ${b[A.format]??z.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${z.divisor}`;case"unrecognized_keys":return`Óþekkt ${z.keys.length>1?"ir lyklar":"ur lykill"}: ${R(z.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${z.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${z.origin}`;default:return"Rangt gildi"}}};function d3(){return{localeError:UD()}}var GD=()=>{let _={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"numero",array:"vettore"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Input non valido: atteso instanceof ${z.expected}, ricevuto ${U}`;return`Input non valido: atteso ${A}, ricevuto ${U}`}case"invalid_value":if(z.values.length===1)return`Input non valido: atteso ${m(z.values[0])}`;return`Opzione non valida: atteso uno tra ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Troppo grande: ${z.origin??"valore"} deve avere ${A}${z.maximum.toString()} ${J.unit??"elementi"}`;return`Troppo grande: ${z.origin??"valore"} deve essere ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Troppo piccolo: ${z.origin} deve avere ${A}${z.minimum.toString()} ${J.unit}`;return`Troppo piccolo: ${z.origin} deve essere ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Stringa non valida: deve iniziare con "${A.prefix}"`;if(A.format==="ends_with")return`Stringa non valida: deve terminare con "${A.suffix}"`;if(A.format==="includes")return`Stringa non valida: deve includere "${A.includes}"`;if(A.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${A.pattern}`;return`Invalid ${b[A.format]??z.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${z.divisor}`;case"unrecognized_keys":return`Chiav${z.keys.length>1?"i":"e"} non riconosciut${z.keys.length>1?"e":"a"}: ${R(z.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${z.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${z.origin}`;default:return"Input non valido"}}};function i3(){return{localeError:GD()}}var YD=()=>{let _={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function $(z){return _[z]??null}let b={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:"入力値"},Z={nan:"NaN",number:"数値",array:"配列"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`無効な入力: instanceof ${z.expected}が期待されましたが、${U}が入力されました`;return`無効な入力: ${A}が期待されましたが、${U}が入力されました`}case"invalid_value":if(z.values.length===1)return`無効な入力: ${m(z.values[0])}が期待されました`;return`無効な選択: ${R(z.values,"、")}のいずれかである必要があります`;case"too_big":{let A=z.inclusive?"以下である":"より小さい",J=$(z.origin);if(J)return`大きすぎる値: ${z.origin??"値"}は${z.maximum.toString()}${J.unit??"要素"}${A}必要があります`;return`大きすぎる値: ${z.origin??"値"}は${z.maximum.toString()}${A}必要があります`}case"too_small":{let A=z.inclusive?"以上である":"より大きい",J=$(z.origin);if(J)return`小さすぎる値: ${z.origin}は${z.minimum.toString()}${J.unit}${A}必要があります`;return`小さすぎる値: ${z.origin}は${z.minimum.toString()}${A}必要があります`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`無効な文字列: "${A.prefix}"で始まる必要があります`;if(A.format==="ends_with")return`無効な文字列: "${A.suffix}"で終わる必要があります`;if(A.format==="includes")return`無効な文字列: "${A.includes}"を含む必要があります`;if(A.format==="regex")return`無効な文字列: パターン${A.pattern}に一致する必要があります`;return`無効な${b[A.format]??z.format}`}case"not_multiple_of":return`無効な数値: ${z.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${z.keys.length>1?"群":""}: ${R(z.keys,"、")}`;case"invalid_key":return`${z.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${z.origin}内の無効な値`;default:return"無効な入力"}}};function o3(){return{localeError:YD()}}var XD=()=>{let _={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function $(z){return _[z]??null}let b={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-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},Z={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${z.expected}, მიღებული ${U}`;return`არასწორი შეყვანა: მოსალოდნელი ${A}, მიღებული ${U}`}case"invalid_value":if(z.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${m(z.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${R(z.values,"|")}-დან`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`ზედმეტად დიდი: მოსალოდნელი ${z.origin??"მნიშვნელობა"} ${J.verb} ${A}${z.maximum.toString()} ${J.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${z.origin??"მნიშვნელობა"} იყოს ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`ზედმეტად პატარა: მოსალოდნელი ${z.origin} ${J.verb} ${A}${z.minimum.toString()} ${J.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${z.origin} იყოს ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${A.prefix}"-ით`;if(A.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${A.suffix}"-ით`;if(A.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${A.includes}"-ს`;if(A.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${A.pattern}`;return`არასწორი ${b[A.format]??z.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${z.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${z.keys.length>1?"ები":"ი"}: ${R(z.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${z.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${z.origin}-ში`;default:return"არასწორი შეყვანა"}}};function a3(){return{localeError:XD()}}var QD=()=>{let _={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function $(z){return _[z]??null}let b={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:"ទិន្នន័យបញ្ចូល"},Z={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${z.expected} ប៉ុន្តែទទួលបាន ${U}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${A} ប៉ុន្តែទទួលបាន ${U}`}case"invalid_value":if(z.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${m(z.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`ធំពេក៖ ត្រូវការ ${z.origin??"តម្លៃ"} ${A} ${z.maximum.toString()} ${J.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${z.origin??"តម្លៃ"} ${A} ${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`តូចពេក៖ ត្រូវការ ${z.origin} ${A} ${z.minimum.toString()} ${J.unit}`;return`តូចពេក៖ ត្រូវការ ${z.origin} ${A} ${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${A.prefix}"`;if(A.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${A.suffix}"`;if(A.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${A.includes}"`;if(A.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${A.pattern}`;return`មិនត្រឹមត្រូវ៖ ${b[A.format]??z.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${z.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${R(z.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${z.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${z.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function P$(){return{localeError:QD()}}function e3(){return P$()}var KD=()=>{let _={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function $(z){return _[z]??null}let b={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:"입력"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`잘못된 입력: 예상 타입은 instanceof ${z.expected}, 받은 타입은 ${U}입니다`;return`잘못된 입력: 예상 타입은 ${A}, 받은 타입은 ${U}입니다`}case"invalid_value":if(z.values.length===1)return`잘못된 입력: 값은 ${m(z.values[0])} 이어야 합니다`;return`잘못된 옵션: ${R(z.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let A=z.inclusive?"이하":"미만",J=A==="미만"?"이어야 합니다":"여야 합니다",U=$(z.origin),G=U?.unit??"요소";if(U)return`${z.origin??"값"}이 너무 큽니다: ${z.maximum.toString()}${G} ${A}${J}`;return`${z.origin??"값"}이 너무 큽니다: ${z.maximum.toString()} ${A}${J}`}case"too_small":{let A=z.inclusive?"이상":"초과",J=A==="이상"?"이어야 합니다":"여야 합니다",U=$(z.origin),G=U?.unit??"요소";if(U)return`${z.origin??"값"}이 너무 작습니다: ${z.minimum.toString()}${G} ${A}${J}`;return`${z.origin??"값"}이 너무 작습니다: ${z.minimum.toString()} ${A}${J}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`잘못된 문자열: "${A.prefix}"(으)로 시작해야 합니다`;if(A.format==="ends_with")return`잘못된 문자열: "${A.suffix}"(으)로 끝나야 합니다`;if(A.format==="includes")return`잘못된 문자열: "${A.includes}"을(를) 포함해야 합니다`;if(A.format==="regex")return`잘못된 문자열: 정규식 ${A.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${b[A.format]??z.format}`}case"not_multiple_of":return`잘못된 숫자: ${z.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${R(z.keys,", ")}`;case"invalid_key":return`잘못된 키: ${z.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${z.origin}`;default:return"잘못된 입력"}}};function t3(){return{localeError:KD()}}var j$=(_)=>{return _.charAt(0).toUpperCase()+_.slice(1)};function zY(_){let $=Math.abs(_),b=$%10,Z=$%100;if(Z>=11&&Z<=19||b===0)return"many";if(b===1)return"one";return"few"}var vD=()=>{let _={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function $(z,A,J,U){let G=_[z]??null;if(G===null)return G;return{unit:G.unit[A],verb:G.verb[U][J?"inclusive":"notInclusive"]}}let b={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},Z={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Gautas tipas ${U}, o tikėtasi - instanceof ${z.expected}`;return`Gautas tipas ${U}, o tikėtasi - ${A}`}case"invalid_value":if(z.values.length===1)return`Privalo būti ${m(z.values[0])}`;return`Privalo būti vienas iš ${R(z.values,"|")} pasirinkimų`;case"too_big":{let A=Z[z.origin]??z.origin,J=$(z.origin,zY(Number(z.maximum)),z.inclusive??!1,"smaller");if(J?.verb)return`${j$(A??z.origin??"reikšmė")} ${J.verb} ${z.maximum.toString()} ${J.unit??"elementų"}`;let U=z.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${j$(A??z.origin??"reikšmė")} turi būti ${U} ${z.maximum.toString()} ${J?.unit}`}case"too_small":{let A=Z[z.origin]??z.origin,J=$(z.origin,zY(Number(z.minimum)),z.inclusive??!1,"bigger");if(J?.verb)return`${j$(A??z.origin??"reikšmė")} ${J.verb} ${z.minimum.toString()} ${J.unit??"elementų"}`;let U=z.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${j$(A??z.origin??"reikšmė")} turi būti ${U} ${z.minimum.toString()} ${J?.unit}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Eilutė privalo prasidėti "${A.prefix}"`;if(A.format==="ends_with")return`Eilutė privalo pasibaigti "${A.suffix}"`;if(A.format==="includes")return`Eilutė privalo įtraukti "${A.includes}"`;if(A.format==="regex")return`Eilutė privalo atitikti ${A.pattern}`;return`Neteisingas ${b[A.format]??z.format}`}case"not_multiple_of":return`Skaičius privalo būti ${z.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${z.keys.length>1?"i":"as"} rakt${z.keys.length>1?"ai":"as"}: ${R(z.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let A=Z[z.origin]??z.origin;return`${j$(A??z.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function s3(){return{localeError:vD()}}var FD=()=>{let _={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function $(z){return _[z]??null}let b={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:"внес"},Z={nan:"NaN",number:"број",array:"низа"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Грешен внес: се очекува instanceof ${z.expected}, примено ${U}`;return`Грешен внес: се очекува ${A}, примено ${U}`}case"invalid_value":if(z.values.length===1)return`Invalid input: expected ${m(z.values[0])}`;return`Грешана опција: се очекува една ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Премногу голем: се очекува ${z.origin??"вредноста"} да има ${A}${z.maximum.toString()} ${J.unit??"елементи"}`;return`Премногу голем: се очекува ${z.origin??"вредноста"} да биде ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Премногу мал: се очекува ${z.origin} да има ${A}${z.minimum.toString()} ${J.unit}`;return`Премногу мал: се очекува ${z.origin} да биде ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Неважечка низа: мора да започнува со "${A.prefix}"`;if(A.format==="ends_with")return`Неважечка низа: мора да завршува со "${A.suffix}"`;if(A.format==="includes")return`Неважечка низа: мора да вклучува "${A.includes}"`;if(A.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${A.pattern}`;return`Invalid ${b[A.format]??z.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${z.divisor}`;case"unrecognized_keys":return`${z.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${R(z.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${z.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${z.origin}`;default:return"Грешен внес"}}};function _A(){return{localeError:FD()}}var HD=()=>{let _={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"nombor"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Input tidak sah: dijangka instanceof ${z.expected}, diterima ${U}`;return`Input tidak sah: dijangka ${A}, diterima ${U}`}case"invalid_value":if(z.values.length===1)return`Input tidak sah: dijangka ${m(z.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Terlalu besar: dijangka ${z.origin??"nilai"} ${J.verb} ${A}${z.maximum.toString()} ${J.unit??"elemen"}`;return`Terlalu besar: dijangka ${z.origin??"nilai"} adalah ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Terlalu kecil: dijangka ${z.origin} ${J.verb} ${A}${z.minimum.toString()} ${J.unit}`;return`Terlalu kecil: dijangka ${z.origin} adalah ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`String tidak sah: mesti bermula dengan "${A.prefix}"`;if(A.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${A.suffix}"`;if(A.format==="includes")return`String tidak sah: mesti mengandungi "${A.includes}"`;if(A.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${A.pattern}`;return`${b[A.format]??z.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${z.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${R(z.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${z.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${z.origin}`;default:return"Input tidak sah"}}};function $A(){return{localeError:HD()}}var qD=()=>{let _={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"getal"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Ongeldige invoer: verwacht instanceof ${z.expected}, ontving ${U}`;return`Ongeldige invoer: verwacht ${A}, ontving ${U}`}case"invalid_value":if(z.values.length===1)return`Ongeldige invoer: verwacht ${m(z.values[0])}`;return`Ongeldige optie: verwacht één van ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin),U=z.origin==="date"?"laat":z.origin==="string"?"lang":"groot";if(J)return`Te ${U}: verwacht dat ${z.origin??"waarde"} ${A}${z.maximum.toString()} ${J.unit??"elementen"} ${J.verb}`;return`Te ${U}: verwacht dat ${z.origin??"waarde"} ${A}${z.maximum.toString()} is`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin),U=z.origin==="date"?"vroeg":z.origin==="string"?"kort":"klein";if(J)return`Te ${U}: verwacht dat ${z.origin} ${A}${z.minimum.toString()} ${J.unit} ${J.verb}`;return`Te ${U}: verwacht dat ${z.origin} ${A}${z.minimum.toString()} is`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Ongeldige tekst: moet met "${A.prefix}" beginnen`;if(A.format==="ends_with")return`Ongeldige tekst: moet op "${A.suffix}" eindigen`;if(A.format==="includes")return`Ongeldige tekst: moet "${A.includes}" bevatten`;if(A.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${A.pattern}`;return`Ongeldig: ${b[A.format]??z.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${z.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${z.keys.length>1?"s":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${z.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${z.origin}`;default:return"Ongeldige invoer"}}};function zA(){return{localeError:qD()}}var VD=()=>{let _={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"tall",array:"liste"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Ugyldig input: forventet instanceof ${z.expected}, fikk ${U}`;return`Ugyldig input: forventet ${A}, fikk ${U}`}case"invalid_value":if(z.values.length===1)return`Ugyldig verdi: forventet ${m(z.values[0])}`;return`Ugyldig valg: forventet en av ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`For stor(t): forventet ${z.origin??"value"} til å ha ${A}${z.maximum.toString()} ${J.unit??"elementer"}`;return`For stor(t): forventet ${z.origin??"value"} til å ha ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`For lite(n): forventet ${z.origin} til å ha ${A}${z.minimum.toString()} ${J.unit}`;return`For lite(n): forventet ${z.origin} til å ha ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Ugyldig streng: må starte med "${A.prefix}"`;if(A.format==="ends_with")return`Ugyldig streng: må ende med "${A.suffix}"`;if(A.format==="includes")return`Ugyldig streng: må inneholde "${A.includes}"`;if(A.format==="regex")return`Ugyldig streng: må matche mønsteret ${A.pattern}`;return`Ugyldig ${b[A.format]??z.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${z.divisor}`;case"unrecognized_keys":return`${z.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${R(z.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${z.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${z.origin}`;default:return"Ugyldig input"}}};function bA(){return{localeError:VD()}}var DD=()=>{let _={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 $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Fâsit giren: umulan instanceof ${z.expected}, alınan ${U}`;return`Fâsit giren: umulan ${A}, alınan ${U}`}case"invalid_value":if(z.values.length===1)return`Fâsit giren: umulan ${m(z.values[0])}`;return`Fâsit tercih: mûteberler ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Fazla büyük: ${z.origin??"value"}, ${A}${z.maximum.toString()} ${J.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${z.origin??"value"}, ${A}${z.maximum.toString()} olmalıydı.`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Fazla küçük: ${z.origin}, ${A}${z.minimum.toString()} ${J.unit} sahip olmalıydı.`;return`Fazla küçük: ${z.origin}, ${A}${z.minimum.toString()} olmalıydı.`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Fâsit metin: "${A.prefix}" ile başlamalı.`;if(A.format==="ends_with")return`Fâsit metin: "${A.suffix}" ile bitmeli.`;if(A.format==="includes")return`Fâsit metin: "${A.includes}" ihtivâ etmeli.`;if(A.format==="regex")return`Fâsit metin: ${A.pattern} nakşına uymalı.`;return`Fâsit ${b[A.format]??z.format}`}case"not_multiple_of":return`Fâsit sayı: ${z.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${z.keys.length>1?"s":""}: ${R(z.keys,", ")}`;case"invalid_key":return`${z.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${z.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function ZA(){return{localeError:DD()}}var kD=()=>{let _={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function $(z){return _[z]??null}let b={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:"ورودي"},Z={nan:"NaN",number:"عدد",array:"ارې"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`ناسم ورودي: باید instanceof ${z.expected} وای, مګر ${U} ترلاسه شو`;return`ناسم ورودي: باید ${A} وای, مګر ${U} ترلاسه شو`}case"invalid_value":if(z.values.length===1)return`ناسم ورودي: باید ${m(z.values[0])} وای`;return`ناسم انتخاب: باید یو له ${R(z.values,"|")} څخه وای`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`ډیر لوی: ${z.origin??"ارزښت"} باید ${A}${z.maximum.toString()} ${J.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${z.origin??"ارزښت"} باید ${A}${z.maximum.toString()} وي`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`ډیر کوچنی: ${z.origin} باید ${A}${z.minimum.toString()} ${J.unit} ولري`;return`ډیر کوچنی: ${z.origin} باید ${A}${z.minimum.toString()} وي`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`ناسم متن: باید د "${A.prefix}" سره پیل شي`;if(A.format==="ends_with")return`ناسم متن: باید د "${A.suffix}" سره پای ته ورسيږي`;if(A.format==="includes")return`ناسم متن: باید "${A.includes}" ولري`;if(A.format==="regex")return`ناسم متن: باید د ${A.pattern} سره مطابقت ولري`;return`${b[A.format]??z.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${z.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${z.keys.length>1?"کلیډونه":"کلیډ"}: ${R(z.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${z.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${z.origin} کې`;default:return"ناسمه ورودي"}}};function AA(){return{localeError:kD()}}var WD=()=>{let _={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 $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"liczba",array:"tablica"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${z.expected}, otrzymano ${U}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${A}, otrzymano ${U}`}case"invalid_value":if(z.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${m(z.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Za duża wartość: oczekiwano, że ${z.origin??"wartość"} będzie mieć ${A}${z.maximum.toString()} ${J.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${z.origin??"wartość"} będzie wynosić ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Za mała wartość: oczekiwano, że ${z.origin??"wartość"} będzie mieć ${A}${z.minimum.toString()} ${J.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${z.origin??"wartość"} będzie wynosić ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${A.prefix}"`;if(A.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${A.suffix}"`;if(A.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${A.includes}"`;if(A.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${A.pattern}`;return`Nieprawidłow(y/a/e) ${b[A.format]??z.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${z.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${z.keys.length>1?"s":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${z.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${z.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function JA(){return{localeError:WD()}}var gD=()=>{let _={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"número",null:"nulo"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Tipo inválido: esperado instanceof ${z.expected}, recebido ${U}`;return`Tipo inválido: esperado ${A}, recebido ${U}`}case"invalid_value":if(z.values.length===1)return`Entrada inválida: esperado ${m(z.values[0])}`;return`Opção inválida: esperada uma das ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Muito grande: esperado que ${z.origin??"valor"} tivesse ${A}${z.maximum.toString()} ${J.unit??"elementos"}`;return`Muito grande: esperado que ${z.origin??"valor"} fosse ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Muito pequeno: esperado que ${z.origin} tivesse ${A}${z.minimum.toString()} ${J.unit}`;return`Muito pequeno: esperado que ${z.origin} fosse ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Texto inválido: deve começar com "${A.prefix}"`;if(A.format==="ends_with")return`Texto inválido: deve terminar com "${A.suffix}"`;if(A.format==="includes")return`Texto inválido: deve incluir "${A.includes}"`;if(A.format==="regex")return`Texto inválido: deve corresponder ao padrão ${A.pattern}`;return`${b[A.format]??z.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${z.divisor}`;case"unrecognized_keys":return`Chave${z.keys.length>1?"s":""} desconhecida${z.keys.length>1?"s":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Chave inválida em ${z.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${z.origin}`;default:return"Campo inválido"}}};function UA(){return{localeError:gD()}}function bY(_,$,b,Z){let z=Math.abs(_),A=z%10,J=z%100;if(J>=11&&J<=19)return Z;if(A===1)return $;if(A>=2&&A<=4)return b;return Z}var BD=()=>{let _={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 $(z){return _[z]??null}let b={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:"ввод"},Z={nan:"NaN",number:"число",array:"массив"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Неверный ввод: ожидалось instanceof ${z.expected}, получено ${U}`;return`Неверный ввод: ожидалось ${A}, получено ${U}`}case"invalid_value":if(z.values.length===1)return`Неверный ввод: ожидалось ${m(z.values[0])}`;return`Неверный вариант: ожидалось одно из ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J){let U=Number(z.maximum),G=bY(U,J.unit.one,J.unit.few,J.unit.many);return`Слишком большое значение: ожидалось, что ${z.origin??"значение"} будет иметь ${A}${z.maximum.toString()} ${G}`}return`Слишком большое значение: ожидалось, что ${z.origin??"значение"} будет ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J){let U=Number(z.minimum),G=bY(U,J.unit.one,J.unit.few,J.unit.many);return`Слишком маленькое значение: ожидалось, что ${z.origin} будет иметь ${A}${z.minimum.toString()} ${G}`}return`Слишком маленькое значение: ожидалось, что ${z.origin} будет ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Неверная строка: должна начинаться с "${A.prefix}"`;if(A.format==="ends_with")return`Неверная строка: должна заканчиваться на "${A.suffix}"`;if(A.format==="includes")return`Неверная строка: должна содержать "${A.includes}"`;if(A.format==="regex")return`Неверная строка: должна соответствовать шаблону ${A.pattern}`;return`Неверный ${b[A.format]??z.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${z.divisor}`;case"unrecognized_keys":return`Нераспознанн${z.keys.length>1?"ые":"ый"} ключ${z.keys.length>1?"и":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${z.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${z.origin}`;default:return"Неверные входные данные"}}};function GA(){return{localeError:BD()}}var wD=()=>{let _={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"število",array:"tabela"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Neveljaven vnos: pričakovano instanceof ${z.expected}, prejeto ${U}`;return`Neveljaven vnos: pričakovano ${A}, prejeto ${U}`}case"invalid_value":if(z.values.length===1)return`Neveljaven vnos: pričakovano ${m(z.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Preveliko: pričakovano, da bo ${z.origin??"vrednost"} imelo ${A}${z.maximum.toString()} ${J.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${z.origin??"vrednost"} ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Premajhno: pričakovano, da bo ${z.origin} imelo ${A}${z.minimum.toString()} ${J.unit}`;return`Premajhno: pričakovano, da bo ${z.origin} ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Neveljaven niz: mora se začeti z "${A.prefix}"`;if(A.format==="ends_with")return`Neveljaven niz: mora se končati z "${A.suffix}"`;if(A.format==="includes")return`Neveljaven niz: mora vsebovati "${A.includes}"`;if(A.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${A.pattern}`;return`Neveljaven ${b[A.format]??z.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${z.divisor}`;case"unrecognized_keys":return`Neprepoznan${z.keys.length>1?"i ključi":" ključ"}: ${R(z.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${z.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${z.origin}`;default:return"Neveljaven vnos"}}};function YA(){return{localeError:wD()}}var xD=()=>{let _={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 $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"antal",array:"lista"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Ogiltig inmatning: förväntat instanceof ${z.expected}, fick ${U}`;return`Ogiltig inmatning: förväntat ${A}, fick ${U}`}case"invalid_value":if(z.values.length===1)return`Ogiltig inmatning: förväntat ${m(z.values[0])}`;return`Ogiltigt val: förväntade en av ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`För stor(t): förväntade ${z.origin??"värdet"} att ha ${A}${z.maximum.toString()} ${J.unit??"element"}`;return`För stor(t): förväntat ${z.origin??"värdet"} att ha ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`För lite(t): förväntade ${z.origin??"värdet"} att ha ${A}${z.minimum.toString()} ${J.unit}`;return`För lite(t): förväntade ${z.origin??"värdet"} att ha ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Ogiltig sträng: måste börja med "${A.prefix}"`;if(A.format==="ends_with")return`Ogiltig sträng: måste sluta med "${A.suffix}"`;if(A.format==="includes")return`Ogiltig sträng: måste innehålla "${A.includes}"`;if(A.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${A.pattern}"`;return`Ogiltig(t) ${b[A.format]??z.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${z.divisor}`;case"unrecognized_keys":return`${z.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${R(z.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${z.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${z.origin??"värdet"}`;default:return"Ogiltig input"}}};function XA(){return{localeError:xD()}}var ND=()=>{let _={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${z.expected}, பெறப்பட்டது ${U}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${A}, பெறப்பட்டது ${U}`}case"invalid_value":if(z.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${m(z.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${R(z.values,"|")} இல் ஒன்று`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${z.origin??"மதிப்பு"} ${A}${z.maximum.toString()} ${J.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${z.origin??"மதிப்பு"} ${A}${z.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${z.origin} ${A}${z.minimum.toString()} ${J.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${z.origin} ${A}${z.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`தவறான சரம்: "${A.prefix}" இல் தொடங்க வேண்டும்`;if(A.format==="ends_with")return`தவறான சரம்: "${A.suffix}" இல் முடிவடைய வேண்டும்`;if(A.format==="includes")return`தவறான சரம்: "${A.includes}" ஐ உள்ளடக்க வேண்டும்`;if(A.format==="regex")return`தவறான சரம்: ${A.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${b[A.format]??z.format}`}case"not_multiple_of":return`தவறான எண்: ${z.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${z.keys.length>1?"கள்":""}: ${R(z.keys,", ")}`;case"invalid_key":return`${z.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${z.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function QA(){return{localeError:ND()}}var ID=()=>{let _={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function $(z){return _[z]??null}let b={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:"ข้อมูลที่ป้อน"},Z={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${z.expected} แต่ได้รับ ${U}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${A} แต่ได้รับ ${U}`}case"invalid_value":if(z.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${m(z.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"ไม่เกิน":"น้อยกว่า",J=$(z.origin);if(J)return`เกินกำหนด: ${z.origin??"ค่า"} ควรมี${A} ${z.maximum.toString()} ${J.unit??"รายการ"}`;return`เกินกำหนด: ${z.origin??"ค่า"} ควรมี${A} ${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?"อย่างน้อย":"มากกว่า",J=$(z.origin);if(J)return`น้อยกว่ากำหนด: ${z.origin} ควรมี${A} ${z.minimum.toString()} ${J.unit}`;return`น้อยกว่ากำหนด: ${z.origin} ควรมี${A} ${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${A.prefix}"`;if(A.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${A.suffix}"`;if(A.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${A.includes}" อยู่ในข้อความ`;if(A.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${A.pattern}`;return`รูปแบบไม่ถูกต้อง: ${b[A.format]??z.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${z.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${R(z.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${z.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${z.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function KA(){return{localeError:ID()}}var MD=()=>{let _={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Geçersiz değer: beklenen instanceof ${z.expected}, alınan ${U}`;return`Geçersiz değer: beklenen ${A}, alınan ${U}`}case"invalid_value":if(z.values.length===1)return`Geçersiz değer: beklenen ${m(z.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Çok büyük: beklenen ${z.origin??"değer"} ${A}${z.maximum.toString()} ${J.unit??"öğe"}`;return`Çok büyük: beklenen ${z.origin??"değer"} ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Çok küçük: beklenen ${z.origin} ${A}${z.minimum.toString()} ${J.unit}`;return`Çok küçük: beklenen ${z.origin} ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Geçersiz metin: "${A.prefix}" ile başlamalı`;if(A.format==="ends_with")return`Geçersiz metin: "${A.suffix}" ile bitmeli`;if(A.format==="includes")return`Geçersiz metin: "${A.includes}" içermeli`;if(A.format==="regex")return`Geçersiz metin: ${A.pattern} desenine uymalı`;return`Geçersiz ${b[A.format]??z.format}`}case"not_multiple_of":return`Geçersiz sayı: ${z.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${z.keys.length>1?"lar":""}: ${R(z.keys,", ")}`;case"invalid_key":return`${z.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${z.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function vA(){return{localeError:MD()}}var ED=()=>{let _={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function $(z){return _[z]??null}let b={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:"вхідні дані"},Z={nan:"NaN",number:"число",array:"масив"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Неправильні вхідні дані: очікується instanceof ${z.expected}, отримано ${U}`;return`Неправильні вхідні дані: очікується ${A}, отримано ${U}`}case"invalid_value":if(z.values.length===1)return`Неправильні вхідні дані: очікується ${m(z.values[0])}`;return`Неправильна опція: очікується одне з ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Занадто велике: очікується, що ${z.origin??"значення"} ${J.verb} ${A}${z.maximum.toString()} ${J.unit??"елементів"}`;return`Занадто велике: очікується, що ${z.origin??"значення"} буде ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Занадто мале: очікується, що ${z.origin} ${J.verb} ${A}${z.minimum.toString()} ${J.unit}`;return`Занадто мале: очікується, що ${z.origin} буде ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Неправильний рядок: повинен починатися з "${A.prefix}"`;if(A.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${A.suffix}"`;if(A.format==="includes")return`Неправильний рядок: повинен містити "${A.includes}"`;if(A.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${A.pattern}`;return`Неправильний ${b[A.format]??z.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${z.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${z.keys.length>1?"і":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${z.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${z.origin}`;default:return"Неправильні вхідні дані"}}};function S$(){return{localeError:ED()}}function FA(){return S$()}var OD=()=>{let _={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function $(z){return _[z]??null}let b={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:"ان پٹ"},Z={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`غلط ان پٹ: instanceof ${z.expected} متوقع تھا، ${U} موصول ہوا`;return`غلط ان پٹ: ${A} متوقع تھا، ${U} موصول ہوا`}case"invalid_value":if(z.values.length===1)return`غلط ان پٹ: ${m(z.values[0])} متوقع تھا`;return`غلط آپشن: ${R(z.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`بہت بڑا: ${z.origin??"ویلیو"} کے ${A}${z.maximum.toString()} ${J.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${z.origin??"ویلیو"} کا ${A}${z.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`بہت چھوٹا: ${z.origin} کے ${A}${z.minimum.toString()} ${J.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${z.origin} کا ${A}${z.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`غلط سٹرنگ: "${A.prefix}" سے شروع ہونا چاہیے`;if(A.format==="ends_with")return`غلط سٹرنگ: "${A.suffix}" پر ختم ہونا چاہیے`;if(A.format==="includes")return`غلط سٹرنگ: "${A.includes}" شامل ہونا چاہیے`;if(A.format==="regex")return`غلط سٹرنگ: پیٹرن ${A.pattern} سے میچ ہونا چاہیے`;return`غلط ${b[A.format]??z.format}`}case"not_multiple_of":return`غلط نمبر: ${z.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${z.keys.length>1?"ز":""}: ${R(z.keys,"، ")}`;case"invalid_key":return`${z.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${z.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function HA(){return{localeError:OD()}}var PD=()=>{let _={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function $(z){return _[z]??null}let b={regex:"kirish",email:"elektron pochta manzili",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 sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},Z={nan:"NaN",number:"raqam",array:"massiv"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${z.expected}, qabul qilingan ${U}`;return`Noto‘g‘ri kirish: kutilgan ${A}, qabul qilingan ${U}`}case"invalid_value":if(z.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${m(z.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Juda katta: kutilgan ${z.origin??"qiymat"} ${A}${z.maximum.toString()} ${J.unit} ${J.verb}`;return`Juda katta: kutilgan ${z.origin??"qiymat"} ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Juda kichik: kutilgan ${z.origin} ${A}${z.minimum.toString()} ${J.unit} ${J.verb}`;return`Juda kichik: kutilgan ${z.origin} ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Noto‘g‘ri satr: "${A.prefix}" bilan boshlanishi kerak`;if(A.format==="ends_with")return`Noto‘g‘ri satr: "${A.suffix}" bilan tugashi kerak`;if(A.format==="includes")return`Noto‘g‘ri satr: "${A.includes}" ni o‘z ichiga olishi kerak`;if(A.format==="regex")return`Noto‘g‘ri satr: ${A.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${b[A.format]??z.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${z.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${z.keys.length>1?"lar":""}: ${R(z.keys,", ")}`;case"invalid_key":return`${z.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${z.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function qA(){return{localeError:PD()}}var jD=()=>{let _={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 $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"số",array:"mảng"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${z.expected}, nhận được ${U}`;return`Đầu vào không hợp lệ: mong đợi ${A}, nhận được ${U}`}case"invalid_value":if(z.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${m(z.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Quá lớn: mong đợi ${z.origin??"giá trị"} ${J.verb} ${A}${z.maximum.toString()} ${J.unit??"phần tử"}`;return`Quá lớn: mong đợi ${z.origin??"giá trị"} ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Quá nhỏ: mong đợi ${z.origin} ${J.verb} ${A}${z.minimum.toString()} ${J.unit}`;return`Quá nhỏ: mong đợi ${z.origin} ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${A.prefix}"`;if(A.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${A.suffix}"`;if(A.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${A.includes}"`;if(A.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${A.pattern}`;return`${b[A.format]??z.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 ${z.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${R(z.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${z.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 ${z.origin}`;default:return"Đầu vào không hợp lệ"}}};function VA(){return{localeError:jD()}}var SD=()=>{let _={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function $(z){return _[z]??null}let b={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:"输入"},Z={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`无效输入:期望 instanceof ${z.expected},实际接收 ${U}`;return`无效输入:期望 ${A},实际接收 ${U}`}case"invalid_value":if(z.values.length===1)return`无效输入:期望 ${m(z.values[0])}`;return`无效选项:期望以下之一 ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`数值过大:期望 ${z.origin??"值"} ${A}${z.maximum.toString()} ${J.unit??"个元素"}`;return`数值过大:期望 ${z.origin??"值"} ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`数值过小:期望 ${z.origin} ${A}${z.minimum.toString()} ${J.unit}`;return`数值过小:期望 ${z.origin} ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`无效字符串:必须以 "${A.prefix}" 开头`;if(A.format==="ends_with")return`无效字符串:必须以 "${A.suffix}" 结尾`;if(A.format==="includes")return`无效字符串:必须包含 "${A.includes}"`;if(A.format==="regex")return`无效字符串:必须满足正则表达式 ${A.pattern}`;return`无效${b[A.format]??z.format}`}case"not_multiple_of":return`无效数字:必须是 ${z.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${R(z.keys,", ")}`;case"invalid_key":return`${z.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${z.origin} 中包含无效值(value)`;default:return"无效输入"}}};function DA(){return{localeError:SD()}}var RD=()=>{let _={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function $(z){return _[z]??null}let b={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:"輸入"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`無效的輸入值:預期為 instanceof ${z.expected},但收到 ${U}`;return`無效的輸入值:預期為 ${A},但收到 ${U}`}case"invalid_value":if(z.values.length===1)return`無效的輸入值:預期為 ${m(z.values[0])}`;return`無效的選項:預期為以下其中之一 ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`數值過大:預期 ${z.origin??"值"} 應為 ${A}${z.maximum.toString()} ${J.unit??"個元素"}`;return`數值過大:預期 ${z.origin??"值"} 應為 ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`數值過小:預期 ${z.origin} 應為 ${A}${z.minimum.toString()} ${J.unit}`;return`數值過小:預期 ${z.origin} 應為 ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`無效的字串:必須以 "${A.prefix}" 開頭`;if(A.format==="ends_with")return`無效的字串:必須以 "${A.suffix}" 結尾`;if(A.format==="includes")return`無效的字串:必須包含 "${A.includes}"`;if(A.format==="regex")return`無效的字串:必須符合格式 ${A.pattern}`;return`無效的 ${b[A.format]??z.format}`}case"not_multiple_of":return`無效的數字:必須為 ${z.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${z.keys.length>1?"們":""}:${R(z.keys,"、")}`;case"invalid_key":return`${z.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${z.origin} 中有無效的值`;default:return"無效的輸入值"}}};function kA(){return{localeError:RD()}}var LD=()=>{let _={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function $(z){return _[z]??null}let b={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",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:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},Z={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=h(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${z.expected}, àmọ̀ a rí ${U}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${A}, àmọ̀ a rí ${U}`}case"invalid_value":if(z.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${m(z.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${z.origin??"iye"} ${J.verb} ${A}${z.maximum} ${J.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${A}${z.maximum}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Kéré ju: a ní láti jẹ́ pé ${z.origin} ${J.verb} ${A}${z.minimum} ${J.unit}`;return`Kéré ju: a ní láti jẹ́ ${A}${z.minimum}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${A.prefix}"`;if(A.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${A.suffix}"`;if(A.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${A.includes}"`;if(A.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${A.pattern}`;return`Aṣìṣe: ${b[A.format]??z.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${z.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${R(z.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${z.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${z.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function WA(){return{localeError:LD()}}var ZY,gA=Symbol("ZodOutput"),BA=Symbol("ZodInput");class wA{constructor(){this._map=new WeakMap,this._idmap=new Map}add(_,...$){let b=$[0];if(this._map.set(_,b),b&&typeof b==="object"&&"id"in b)this._idmap.set(b.id,_);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(_){let $=this._map.get(_);if($&&typeof $==="object"&&"id"in $)this._idmap.delete($.id);return this._map.delete(_),this}get(_){let $=_._zod.parent;if($){let b={...this.get($)??{}};delete b.id;let Z={...b,...this._map.get(_)};return Object.keys(Z).length?Z:void 0}return this._map.get(_)}has(_){return this._map.has(_)}}function X1(){return new wA}(ZY=globalThis).__zod_globalRegistry??(ZY.__zod_globalRegistry=X1());var E0=globalThis.__zod_globalRegistry;function xA(_,$){return new _({type:"string",...r($)})}function NA(_,$){return new _({type:"string",coerce:!0,...r($)})}function Q1(_,$){return new _({type:"string",format:"email",check:"string_format",abort:!1,...r($)})}function L$(_,$){return new _({type:"string",format:"guid",check:"string_format",abort:!1,...r($)})}function K1(_,$){return new _({type:"string",format:"uuid",check:"string_format",abort:!1,...r($)})}function v1(_,$){return new _({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...r($)})}function F1(_,$){return new _({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...r($)})}function H1(_,$){return new _({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...r($)})}function T$(_,$){return new _({type:"string",format:"url",check:"string_format",abort:!1,...r($)})}function q1(_,$){return new _({type:"string",format:"emoji",check:"string_format",abort:!1,...r($)})}function V1(_,$){return new _({type:"string",format:"nanoid",check:"string_format",abort:!1,...r($)})}function D1(_,$){return new _({type:"string",format:"cuid",check:"string_format",abort:!1,...r($)})}function k1(_,$){return new _({type:"string",format:"cuid2",check:"string_format",abort:!1,...r($)})}function W1(_,$){return new _({type:"string",format:"ulid",check:"string_format",abort:!1,...r($)})}function g1(_,$){return new _({type:"string",format:"xid",check:"string_format",abort:!1,...r($)})}function B1(_,$){return new _({type:"string",format:"ksuid",check:"string_format",abort:!1,...r($)})}function w1(_,$){return new _({type:"string",format:"ipv4",check:"string_format",abort:!1,...r($)})}function x1(_,$){return new _({type:"string",format:"ipv6",check:"string_format",abort:!1,...r($)})}function IA(_,$){return new _({type:"string",format:"mac",check:"string_format",abort:!1,...r($)})}function N1(_,$){return new _({type:"string",format:"cidrv4",check:"string_format",abort:!1,...r($)})}function I1(_,$){return new _({type:"string",format:"cidrv6",check:"string_format",abort:!1,...r($)})}function M1(_,$){return new _({type:"string",format:"base64",check:"string_format",abort:!1,...r($)})}function E1(_,$){return new _({type:"string",format:"base64url",check:"string_format",abort:!1,...r($)})}function O1(_,$){return new _({type:"string",format:"e164",check:"string_format",abort:!1,...r($)})}function P1(_,$){return new _({type:"string",format:"jwt",check:"string_format",abort:!1,...r($)})}var MA={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function EA(_,$){return new _({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...r($)})}function OA(_,$){return new _({type:"string",format:"date",check:"string_format",...r($)})}function PA(_,$){return new _({type:"string",format:"time",check:"string_format",precision:null,...r($)})}function jA(_,$){return new _({type:"string",format:"duration",check:"string_format",...r($)})}function SA(_,$){return new _({type:"number",checks:[],...r($)})}function RA(_,$){return new _({type:"number",coerce:!0,checks:[],...r($)})}function LA(_,$){return new _({type:"number",check:"number_format",abort:!1,format:"safeint",...r($)})}function TA(_,$){return new _({type:"number",check:"number_format",abort:!1,format:"float32",...r($)})}function yA(_,$){return new _({type:"number",check:"number_format",abort:!1,format:"float64",...r($)})}function CA(_,$){return new _({type:"number",check:"number_format",abort:!1,format:"int32",...r($)})}function fA(_,$){return new _({type:"number",check:"number_format",abort:!1,format:"uint32",...r($)})}function mA(_,$){return new _({type:"boolean",...r($)})}function uA(_,$){return new _({type:"boolean",coerce:!0,...r($)})}function hA(_,$){return new _({type:"bigint",...r($)})}function cA(_,$){return new _({type:"bigint",coerce:!0,...r($)})}function rA(_,$){return new _({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...r($)})}function nA(_,$){return new _({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...r($)})}function lA(_,$){return new _({type:"symbol",...r($)})}function pA(_,$){return new _({type:"undefined",...r($)})}function dA(_,$){return new _({type:"null",...r($)})}function iA(_){return new _({type:"any"})}function oA(_){return new _({type:"unknown"})}function aA(_,$){return new _({type:"never",...r($)})}function eA(_,$){return new _({type:"void",...r($)})}function tA(_,$){return new _({type:"date",...r($)})}function sA(_,$){return new _({type:"date",coerce:!0,...r($)})}function _8(_,$){return new _({type:"nan",...r($)})}function j_(_,$){return new t2({check:"less_than",...r($),value:_,inclusive:!1})}function $_(_,$){return new t2({check:"less_than",...r($),value:_,inclusive:!0})}function S_(_,$){return new s2({check:"greater_than",...r($),value:_,inclusive:!1})}function C0(_,$){return new s2({check:"greater_than",...r($),value:_,inclusive:!0})}function j1(_){return S_(0,_)}function S1(_){return j_(0,_)}function R1(_){return $_(0,_)}function L1(_){return C0(0,_)}function F4(_,$){return new _Z({check:"multiple_of",...r($),value:_})}function H4(_,$){return new bZ({check:"max_size",...r($),maximum:_})}function R_(_,$){return new ZZ({check:"min_size",...r($),minimum:_})}function f4(_,$){return new AZ({check:"size_equals",...r($),size:_})}function m4(_,$){return new JZ({check:"max_length",...r($),maximum:_})}function o_(_,$){return new UZ({check:"min_length",...r($),minimum:_})}function u4(_,$){return new GZ({check:"length_equals",...r($),length:_})}function q9(_,$){return new YZ({check:"string_format",format:"regex",...r($),pattern:_})}function V9(_){return new XZ({check:"string_format",format:"lowercase",...r(_)})}function D9(_){return new QZ({check:"string_format",format:"uppercase",...r(_)})}function k9(_,$){return new KZ({check:"string_format",format:"includes",...r($),includes:_})}function W9(_,$){return new vZ({check:"string_format",format:"starts_with",...r($),prefix:_})}function g9(_,$){return new FZ({check:"string_format",format:"ends_with",...r($),suffix:_})}function T1(_,$,b){return new HZ({check:"property",property:_,schema:$,...r(b)})}function B9(_,$){return new qZ({check:"mime_type",mime:_,...r($)})}function W_(_){return new VZ({check:"overwrite",tx:_})}function w9(_){return W_(($)=>$.normalize(_))}function x9(){return W_((_)=>_.trim())}function N9(){return W_((_)=>_.toLowerCase())}function I9(){return W_((_)=>_.toUpperCase())}function M9(){return W_((_)=>Hb(_))}function $8(_,$,b){return new _({type:"array",element:$,...r(b)})}function yD(_,$,b){return new _({type:"union",options:$,...r(b)})}function CD(_,$,b){return new _({type:"union",options:$,inclusive:!1,...r(b)})}function fD(_,$,b,Z){return new _({type:"union",options:b,discriminator:$,...r(Z)})}function mD(_,$,b){return new _({type:"intersection",left:$,right:b})}function uD(_,$,b,Z){let z=b instanceof i;return new _({type:"tuple",items:$,rest:z?b:null,...r(z?Z:b)})}function hD(_,$,b,Z){return new _({type:"record",keyType:$,valueType:b,...r(Z)})}function cD(_,$,b,Z){return new _({type:"map",keyType:$,valueType:b,...r(Z)})}function rD(_,$,b){return new _({type:"set",valueType:$,...r(b)})}function nD(_,$,b){let Z=Array.isArray($)?Object.fromEntries($.map((z)=>[z,z])):$;return new _({type:"enum",entries:Z,...r(b)})}function lD(_,$,b){return new _({type:"enum",entries:$,...r(b)})}function pD(_,$,b){return new _({type:"literal",values:Array.isArray($)?$:[$],...r(b)})}function z8(_,$){return new _({type:"file",...r($)})}function dD(_,$){return new _({type:"transform",transform:$})}function iD(_,$){return new _({type:"optional",innerType:$})}function oD(_,$){return new _({type:"nullable",innerType:$})}function aD(_,$,b){return new _({type:"default",innerType:$,get defaultValue(){return typeof b==="function"?b():Vb(b)}})}function eD(_,$,b){return new _({type:"nonoptional",innerType:$,...r(b)})}function tD(_,$){return new _({type:"success",innerType:$})}function sD(_,$,b){return new _({type:"catch",innerType:$,catchValue:typeof b==="function"?b:()=>b})}function _k(_,$,b){return new _({type:"pipe",in:$,out:b})}function $k(_,$){return new _({type:"readonly",innerType:$})}function zk(_,$,b){return new _({type:"template_literal",parts:$,...r(b)})}function bk(_,$){return new _({type:"lazy",getter:$})}function Zk(_,$){return new _({type:"promise",innerType:$})}function b8(_,$,b){let Z=r(b);return Z.abort??(Z.abort=!0),new _({type:"custom",check:"custom",fn:$,...Z})}function Z8(_,$,b){return new _({type:"custom",check:"custom",fn:$,...r(b)})}function A8(_){let $=AY((b)=>{return b.addIssue=(Z)=>{if(typeof Z==="string")b.issues.push(Y9(Z,b.value,$._zod.def));else{let z=Z;if(z.fatal)z.continue=!1;z.code??(z.code="custom"),z.input??(z.input=b.value),z.inst??(z.inst=$),z.continue??(z.continue=!$._zod.def.abort),b.issues.push(Y9(z))}},_(b.value,b)});return $}function AY(_,$){let b=new K0({check:"custom",...r($)});return b._zod.check=_,b}function J8(_){let $=new K0({check:"describe"});return $._zod.onattach=[(b)=>{let Z=E0.get(b)??{};E0.add(b,{...Z,description:_})}],$._zod.check=()=>{},$}function U8(_){let $=new K0({check:"meta"});return $._zod.onattach=[(b)=>{let Z=E0.get(b)??{};E0.add(b,{...Z,..._})}],$._zod.check=()=>{},$}function G8(_,$){let b=r($),Z=b.truthy??["true","1","yes","on","y","enabled"],z=b.falsy??["false","0","no","off","n","disabled"];if(b.case!=="sensitive")Z=Z.map((v)=>typeof v==="string"?v.toLowerCase():v),z=z.map((v)=>typeof v==="string"?v.toLowerCase():v);let A=new Set(Z),J=new Set(z),U=_.Codec??E$,G=_.Boolean??I$,X=new(_.String??C4)({type:"string",error:b.error}),Q=new G({type:"boolean",error:b.error}),K=new U({type:"pipe",in:X,out:Q,transform:(v,V)=>{let w=v;if(b.case!=="sensitive")w=w.toLowerCase();if(A.has(w))return!0;else if(J.has(w))return!1;else return V.issues.push({code:"invalid_value",expected:"stringbool",values:[...A,...J],input:V.value,inst:K,continue:!1}),{}},reverseTransform:(v,V)=>{if(v===!0)return Z[0]||"true";else return z[0]||"false"},error:b.error});return K}function E9(_,$,b,Z={}){let z=r(Z),A={...r(Z),check:"string_format",type:"string",format:$,fn:typeof b==="function"?b:(U)=>b.test(U),...z};if(b instanceof RegExp)A.pattern=b;return new _(A)}function q4(_){let $=_?.target??"draft-2020-12";if($==="draft-4")$="draft-04";if($==="draft-7")$="draft-07";return{processors:_.processors??{},metadataRegistry:_?.metadata??E0,target:$,unrepresentable:_?.unrepresentable??"throw",override:_?.override??(()=>{}),io:_?.io??"output",counter:0,seen:new Map,cycles:_?.cycles??"ref",reused:_?.reused??"inline",external:_?.external??void 0}}function A0(_,$,b={path:[],schemaPath:[]}){var Z;let z=_._zod.def,A=$.seen.get(_);if(A){if(A.count++,b.schemaPath.includes(_))A.cycle=b.path;return A.schema}let J={schema:{},count:1,cycle:void 0,path:b.path};$.seen.set(_,J);let U=_._zod.toJSONSchema?.();if(U)J.schema=U;else{let X={...b,schemaPath:[...b.schemaPath,_],path:b.path};if(_._zod.processJSONSchema)_._zod.processJSONSchema($,J.schema,X);else{let K=J.schema,v=$.processors[z.type];if(!v)throw Error(`[toJSONSchema]: Non-representable type encountered: ${z.type}`);v(_,$,K,X)}let Q=_._zod.parent;if(Q){if(!J.ref)J.ref=Q;A0(Q,$,X),$.seen.get(Q).isParent=!0}}let G=$.metadataRegistry.get(_);if(G)Object.assign(J.schema,G);if($.io==="input"&&f0(_))delete J.schema.examples,delete J.schema.default;if($.io==="input"&&J.schema._prefault)(Z=J.schema).default??(Z.default=J.schema._prefault);return delete J.schema._prefault,$.seen.get(_).schema}function V4(_,$){let b=_.seen.get($);if(!b)throw Error("Unprocessed schema. This is a bug in Zod.");let Z=new Map;for(let J of _.seen.entries()){let U=_.metadataRegistry.get(J[0])?.id;if(U){let G=Z.get(U);if(G&&G!==J[0])throw Error(`Duplicate schema id "${U}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);Z.set(U,J[0])}}let z=(J)=>{let U=_.target==="draft-2020-12"?"$defs":"definitions";if(_.external){let Q=_.external.registry.get(J[0])?.id,K=_.external.uri??((V)=>V);if(Q)return{ref:K(Q)};let v=J[1].defId??J[1].schema.id??`schema${_.counter++}`;return J[1].defId=v,{defId:v,ref:`${K("__shared")}#/${U}/${v}`}}if(J[1]===b)return{ref:"#"};let Y=`${"#"}/${U}/`,X=J[1].schema.id??`__schema${_.counter++}`;return{defId:X,ref:Y+X}},A=(J)=>{if(J[1].schema.$ref)return;let U=J[1],{ref:G,defId:Y}=z(J);if(U.def={...U.schema},Y)U.defId=Y;let X=U.schema;for(let Q in X)delete X[Q];X.$ref=G};if(_.cycles==="throw")for(let J of _.seen.entries()){let U=J[1];if(U.cycle)throw Error(`Cycle detected: #/${U.cycle?.join("/")}/<root>
87
+ `)}v.write("payload.value = newResult;"),v.write("return payload;");let B=v.compile();return(C,f)=>B(K,C,f)},A,J=y4,U=!K$.jitless,Y=U&&kb.value,X=$.catchall,Q;_._zod.parse=(K,v)=>{Q??(Q=Z.value);let D=K.value;if(!J(D))return K.issues.push({expected:"object",code:"invalid_type",input:D,inst:_}),K;if(U&&Y&&v?.async===!1&&v.jitless!==!0){if(!A)A=z($.shape);if(K=A(K,v),!X)return K;return zY([],D,K,v,Q,_)}return b(K,v)}});function rG(_,$,b,Z){for(let A of _)if(A.issues.length===0)return $.value=A.value,$;let z=_.filter((A)=>!V4(A));if(z.length===1)return $.value=z[0].value,z[0];return $.issues.push({code:"invalid_union",input:$.value,inst:b,errors:_.map((A)=>A.issues.map((J)=>n0(J,Z,V0())))}),$}var I$=I("$ZodUnion",(_,$)=>{i.init(_,$),t(_._zod,"optin",()=>$.options.some((z)=>z._zod.optin==="optional")?"optional":void 0),t(_._zod,"optout",()=>$.options.some((z)=>z._zod.optout==="optional")?"optional":void 0),t(_._zod,"values",()=>{if($.options.every((z)=>z._zod.values))return new Set($.options.flatMap((z)=>Array.from(z._zod.values)));return}),t(_._zod,"pattern",()=>{if($.options.every((z)=>z._zod.pattern)){let z=$.options.map((A)=>A._zod.pattern);return new RegExp(`^(${z.map((A)=>H$(A.source)).join("|")})$`)}return});let b=$.options.length===1,Z=$.options[0]._zod.run;_._zod.parse=(z,A)=>{if(b)return Z(z,A);let J=!1,U=[];for(let G of $.options){let Y=G._zod.run({value:z.value,issues:[]},A);if(Y instanceof Promise)U.push(Y),J=!0;else{if(Y.issues.length===0)return Y;U.push(Y)}}if(!J)return rG(U,z,_,A);return Promise.all(U).then((G)=>{return rG(G,z,_,A)})}});function nG(_,$,b,Z){let z=_.filter((A)=>A.issues.length===0);if(z.length===1)return $.value=z[0].value,$;if(z.length===0)$.issues.push({code:"invalid_union",input:$.value,inst:b,errors:_.map((A)=>A.issues.map((J)=>n0(J,Z,V0())))});else $.issues.push({code:"invalid_union",input:$.value,inst:b,errors:[],inclusive:!1});return $}var G3=I("$ZodXor",(_,$)=>{I$.init(_,$),$.inclusive=!1;let b=$.options.length===1,Z=$.options[0]._zod.run;_._zod.parse=(z,A)=>{if(b)return Z(z,A);let J=!1,U=[];for(let G of $.options){let Y=G._zod.run({value:z.value,issues:[]},A);if(Y instanceof Promise)U.push(Y),J=!0;else U.push(Y)}if(!J)return nG(U,z,_,A);return Promise.all(U).then((G)=>{return nG(G,z,_,A)})}}),Y3=I("$ZodDiscriminatedUnion",(_,$)=>{$.inclusive=!1,I$.init(_,$);let b=_._zod.parse;t(_._zod,"propValues",()=>{let z={};for(let A of $.options){let J=A._zod.propValues;if(!J||Object.keys(J).length===0)throw Error(`Invalid discriminated union option at index "${$.options.indexOf(A)}"`);for(let[U,G]of Object.entries(J)){if(!z[U])z[U]=new Set;for(let Y of G)z[U].add(Y)}}return z});let Z=G9(()=>{let z=$.options,A=new Map;for(let J of z){let U=J._zod.propValues?.[$.discriminator];if(!U||U.size===0)throw Error(`Invalid discriminated union option at index "${$.options.indexOf(J)}"`);for(let G of U){if(A.has(G))throw Error(`Duplicate discriminator value "${String(G)}"`);A.set(G,J)}}return A});_._zod.parse=(z,A)=>{let J=z.value;if(!y4(J))return z.issues.push({code:"invalid_type",expected:"object",input:J,inst:_}),z;let U=Z.value.get(J?.[$.discriminator]);if(U)return U._zod.run(z,A);if($.unionFallback)return b(z,A);return z.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:$.discriminator,input:J,path:[$.discriminator],inst:_}),z}}),X3=I("$ZodIntersection",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{let z=b.value,A=$.left._zod.run({value:z,issues:[]},Z),J=$.right._zod.run({value:z,issues:[]},Z);if(A instanceof Promise||J instanceof Promise)return Promise.all([A,J]).then(([G,Y])=>{return lG(b,G,Y)});return lG(b,A,J)}});function BZ(_,$){if(_===$)return{valid:!0,data:_};if(_ instanceof Date&&$ instanceof Date&&+_===+$)return{valid:!0,data:_};if(D4(_)&&D4($)){let b=Object.keys($),Z=Object.keys(_).filter((A)=>b.indexOf(A)!==-1),z={..._,...$};for(let A of Z){let J=BZ(_[A],$[A]);if(!J.valid)return{valid:!1,mergeErrorPath:[A,...J.mergeErrorPath]};z[A]=J.data}return{valid:!0,data:z}}if(Array.isArray(_)&&Array.isArray($)){if(_.length!==$.length)return{valid:!1,mergeErrorPath:[]};let b=[];for(let Z=0;Z<_.length;Z++){let z=_[Z],A=$[Z],J=BZ(z,A);if(!J.valid)return{valid:!1,mergeErrorPath:[Z,...J.mergeErrorPath]};b.push(J.data)}return{valid:!0,data:b}}return{valid:!1,mergeErrorPath:[]}}function lG(_,$,b){let Z=new Map,z;for(let U of $.issues)if(U.code==="unrecognized_keys"){z??(z=U);for(let G of U.keys){if(!Z.has(G))Z.set(G,{});Z.get(G).l=!0}}else _.issues.push(U);for(let U of b.issues)if(U.code==="unrecognized_keys")for(let G of U.keys){if(!Z.has(G))Z.set(G,{});Z.get(G).r=!0}else _.issues.push(U);let A=[...Z].filter(([,U])=>U.l&&U.r).map(([U])=>U);if(A.length&&z)_.issues.push({...z,keys:A});if(V4(_))return _;let J=BZ($.value,b.value);if(!J.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(J.mergeErrorPath)}`);return _.value=J.data,_}var U1=I("$ZodTuple",(_,$)=>{i.init(_,$);let b=$.items;_._zod.parse=(Z,z)=>{let A=Z.value;if(!Array.isArray(A))return Z.issues.push({input:A,inst:_,expected:"tuple",code:"invalid_type"}),Z;Z.value=[];let J=[],U=[...b].reverse().findIndex((X)=>X._zod.optin!=="optional"),G=U===-1?0:b.length-U;if(!$.rest){let X=A.length>b.length,Q=A.length<G-1;if(X||Q)return Z.issues.push({...X?{code:"too_big",maximum:b.length,inclusive:!0}:{code:"too_small",minimum:b.length},input:A,inst:_,origin:"array"}),Z}let Y=-1;for(let X of b){if(Y++,Y>=A.length){if(Y>=G)continue}let Q=X._zod.run({value:A[Y],issues:[]},z);if(Q instanceof Promise)J.push(Q.then((K)=>_1(K,Z,Y)));else _1(Q,Z,Y)}if($.rest){let X=A.slice(b.length);for(let Q of X){Y++;let K=$.rest._zod.run({value:Q,issues:[]},z);if(K instanceof Promise)J.push(K.then((v)=>_1(v,Z,Y)));else _1(K,Z,Y)}}if(J.length)return Promise.all(J).then(()=>Z);return Z}});function _1(_,$,b){if(_.issues.length)$.issues.push(...$_(b,_.issues));$.value[b]=_.value}var Q3=I("$ZodRecord",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{let z=b.value;if(!D4(z))return b.issues.push({expected:"record",code:"invalid_type",input:z,inst:_}),b;let A=[],J=$.keyType._zod.values;if(J){b.value={};let U=new Set;for(let Y of J)if(typeof Y==="string"||typeof Y==="number"||typeof Y==="symbol"){U.add(typeof Y==="number"?Y.toString():Y);let X=$.valueType._zod.run({value:z[Y],issues:[]},Z);if(X instanceof Promise)A.push(X.then((Q)=>{if(Q.issues.length)b.issues.push(...$_(Y,Q.issues));b.value[Y]=Q.value}));else{if(X.issues.length)b.issues.push(...$_(Y,X.issues));b.value[Y]=X.value}}let G;for(let Y in z)if(!U.has(Y))G=G??[],G.push(Y);if(G&&G.length>0)b.issues.push({code:"unrecognized_keys",input:z,inst:_,keys:G})}else{b.value={};for(let U of Reflect.ownKeys(z)){if(U==="__proto__")continue;let G=$.keyType._zod.run({value:U,issues:[]},Z);if(G instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof U==="string"&&w$.test(U)&&G.issues.length){let Q=$.keyType._zod.run({value:Number(U),issues:[]},Z);if(Q instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(Q.issues.length===0)G=Q}if(G.issues.length){if($.mode==="loose")b.value[U]=z[U];else b.issues.push({code:"invalid_key",origin:"record",issues:G.issues.map((Q)=>n0(Q,Z,V0())),input:U,path:[U],inst:_});continue}let X=$.valueType._zod.run({value:z[U],issues:[]},Z);if(X instanceof Promise)A.push(X.then((Q)=>{if(Q.issues.length)b.issues.push(...$_(U,Q.issues));b.value[G.value]=Q.value}));else{if(X.issues.length)b.issues.push(...$_(U,X.issues));b.value[G.value]=X.value}}}if(A.length)return Promise.all(A).then(()=>b);return b}}),K3=I("$ZodMap",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{let z=b.value;if(!(z instanceof Map))return b.issues.push({expected:"map",code:"invalid_type",input:z,inst:_}),b;let A=[];b.value=new Map;for(let[J,U]of z){let G=$.keyType._zod.run({value:J,issues:[]},Z),Y=$.valueType._zod.run({value:U,issues:[]},Z);if(G instanceof Promise||Y instanceof Promise)A.push(Promise.all([G,Y]).then(([X,Q])=>{pG(X,Q,b,J,z,_,Z)}));else pG(G,Y,b,J,z,_,Z)}if(A.length)return Promise.all(A).then(()=>b);return b}});function pG(_,$,b,Z,z,A,J){if(_.issues.length)if(q$.has(typeof Z))b.issues.push(...$_(Z,_.issues));else b.issues.push({code:"invalid_key",origin:"map",input:z,inst:A,issues:_.issues.map((U)=>n0(U,J,V0()))});if($.issues.length)if(q$.has(typeof Z))b.issues.push(...$_(Z,$.issues));else b.issues.push({origin:"map",code:"invalid_element",input:z,inst:A,key:Z,issues:$.issues.map((U)=>n0(U,J,V0()))});b.value.set(_.value,$.value)}var F3=I("$ZodSet",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{let z=b.value;if(!(z instanceof Set))return b.issues.push({input:z,inst:_,expected:"set",code:"invalid_type"}),b;let A=[];b.value=new Set;for(let J of z){let U=$.valueType._zod.run({value:J,issues:[]},Z);if(U instanceof Promise)A.push(U.then((G)=>dG(G,b)));else dG(U,b)}if(A.length)return Promise.all(A).then(()=>b);return b}});function dG(_,$){if(_.issues.length)$.issues.push(..._.issues);$.value.add(_.value)}var v3=I("$ZodEnum",(_,$)=>{i.init(_,$);let b=v$($.entries),Z=new Set(b);_._zod.values=Z,_._zod.pattern=new RegExp(`^(${b.filter((z)=>q$.has(typeof z)).map((z)=>typeof z==="string"?Q_(z):z.toString()).join("|")})$`),_._zod.parse=(z,A)=>{let J=z.value;if(Z.has(J))return z;return z.issues.push({code:"invalid_value",values:b,input:J,inst:_}),z}}),H3=I("$ZodLiteral",(_,$)=>{if(i.init(_,$),$.values.length===0)throw Error("Cannot create literal schema with no valid values");let b=new Set($.values);_._zod.values=b,_._zod.pattern=new RegExp(`^(${$.values.map((Z)=>typeof Z==="string"?Q_(Z):Z?Q_(Z.toString()):String(Z)).join("|")})$`),_._zod.parse=(Z,z)=>{let A=Z.value;if(b.has(A))return Z;return Z.issues.push({code:"invalid_value",values:$.values,input:A,inst:_}),Z}}),q3=I("$ZodFile",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{let z=b.value;if(z instanceof File)return b;return b.issues.push({expected:"file",code:"invalid_type",input:z,inst:_}),b}}),D3=I("$ZodTransform",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{if(Z.direction==="backward")throw new T4(_.constructor.name);let z=$.transform(b.value,b);if(Z.async)return(z instanceof Promise?z:Promise.resolve(z)).then((J)=>{return b.value=J,b});if(z instanceof Promise)throw new j_;return b.value=z,b}});function iG(_,$){if(_.issues.length&&$===void 0)return{issues:[],value:void 0};return _}var G1=I("$ZodOptional",(_,$)=>{i.init(_,$),_._zod.optin="optional",_._zod.optout="optional",t(_._zod,"values",()=>{return $.innerType._zod.values?new Set([...$.innerType._zod.values,void 0]):void 0}),t(_._zod,"pattern",()=>{let b=$.innerType._zod.pattern;return b?new RegExp(`^(${H$(b.source)})?$`):void 0}),_._zod.parse=(b,Z)=>{if($.innerType._zod.optin==="optional"){let z=$.innerType._zod.run(b,Z);if(z instanceof Promise)return z.then((A)=>iG(A,b.value));return iG(z,b.value)}if(b.value===void 0)return b;return $.innerType._zod.run(b,Z)}}),V3=I("$ZodExactOptional",(_,$)=>{G1.init(_,$),t(_._zod,"values",()=>$.innerType._zod.values),t(_._zod,"pattern",()=>$.innerType._zod.pattern),_._zod.parse=(b,Z)=>{return $.innerType._zod.run(b,Z)}}),g3=I("$ZodNullable",(_,$)=>{i.init(_,$),t(_._zod,"optin",()=>$.innerType._zod.optin),t(_._zod,"optout",()=>$.innerType._zod.optout),t(_._zod,"pattern",()=>{let b=$.innerType._zod.pattern;return b?new RegExp(`^(${H$(b.source)}|null)$`):void 0}),t(_._zod,"values",()=>{return $.innerType._zod.values?new Set([...$.innerType._zod.values,null]):void 0}),_._zod.parse=(b,Z)=>{if(b.value===null)return b;return $.innerType._zod.run(b,Z)}}),k3=I("$ZodDefault",(_,$)=>{i.init(_,$),_._zod.optin="optional",t(_._zod,"values",()=>$.innerType._zod.values),_._zod.parse=(b,Z)=>{if(Z.direction==="backward")return $.innerType._zod.run(b,Z);if(b.value===void 0)return b.value=$.defaultValue,b;let z=$.innerType._zod.run(b,Z);if(z instanceof Promise)return z.then((A)=>oG(A,$));return oG(z,$)}});function oG(_,$){if(_.value===void 0)_.value=$.defaultValue;return _}var W3=I("$ZodPrefault",(_,$)=>{i.init(_,$),_._zod.optin="optional",t(_._zod,"values",()=>$.innerType._zod.values),_._zod.parse=(b,Z)=>{if(Z.direction==="backward")return $.innerType._zod.run(b,Z);if(b.value===void 0)b.value=$.defaultValue;return $.innerType._zod.run(b,Z)}}),w3=I("$ZodNonOptional",(_,$)=>{i.init(_,$),t(_._zod,"values",()=>{let b=$.innerType._zod.values;return b?new Set([...b].filter((Z)=>Z!==void 0)):void 0}),_._zod.parse=(b,Z)=>{let z=$.innerType._zod.run(b,Z);if(z instanceof Promise)return z.then((A)=>aG(A,_));return aG(z,_)}});function aG(_,$){if(!_.issues.length&&_.value===void 0)_.issues.push({code:"invalid_type",expected:"nonoptional",input:_.value,inst:$});return _}var B3=I("$ZodSuccess",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{if(Z.direction==="backward")throw new T4("ZodSuccess");let z=$.innerType._zod.run(b,Z);if(z instanceof Promise)return z.then((A)=>{return b.value=A.issues.length===0,b});return b.value=z.issues.length===0,b}}),x3=I("$ZodCatch",(_,$)=>{i.init(_,$),t(_._zod,"optin",()=>$.innerType._zod.optin),t(_._zod,"optout",()=>$.innerType._zod.optout),t(_._zod,"values",()=>$.innerType._zod.values),_._zod.parse=(b,Z)=>{if(Z.direction==="backward")return $.innerType._zod.run(b,Z);let z=$.innerType._zod.run(b,Z);if(z instanceof Promise)return z.then((A)=>{if(b.value=A.value,A.issues.length)b.value=$.catchValue({...b,error:{issues:A.issues.map((J)=>n0(J,Z,V0()))},input:b.value}),b.issues=[];return b});if(b.value=z.value,z.issues.length)b.value=$.catchValue({...b,error:{issues:z.issues.map((A)=>n0(A,Z,V0()))},input:b.value}),b.issues=[];return b}}),N3=I("$ZodNaN",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{if(typeof b.value!=="number"||!Number.isNaN(b.value))return b.issues.push({input:b.value,inst:_,expected:"nan",code:"invalid_type"}),b;return b}}),I3=I("$ZodPipe",(_,$)=>{i.init(_,$),t(_._zod,"values",()=>$.in._zod.values),t(_._zod,"optin",()=>$.in._zod.optin),t(_._zod,"optout",()=>$.out._zod.optout),t(_._zod,"propValues",()=>$.in._zod.propValues),_._zod.parse=(b,Z)=>{if(Z.direction==="backward"){let A=$.out._zod.run(b,Z);if(A instanceof Promise)return A.then((J)=>$1(J,$.in,Z));return $1(A,$.in,Z)}let z=$.in._zod.run(b,Z);if(z instanceof Promise)return z.then((A)=>$1(A,$.out,Z));return $1(z,$.out,Z)}});function $1(_,$,b){if(_.issues.length)return _.aborted=!0,_;return $._zod.run({value:_.value,issues:_.issues},b)}var M$=I("$ZodCodec",(_,$)=>{i.init(_,$),t(_._zod,"values",()=>$.in._zod.values),t(_._zod,"optin",()=>$.in._zod.optin),t(_._zod,"optout",()=>$.out._zod.optout),t(_._zod,"propValues",()=>$.in._zod.propValues),_._zod.parse=(b,Z)=>{if((Z.direction||"forward")==="forward"){let A=$.in._zod.run(b,Z);if(A instanceof Promise)return A.then((J)=>z1(J,$,Z));return z1(A,$,Z)}else{let A=$.out._zod.run(b,Z);if(A instanceof Promise)return A.then((J)=>z1(J,$,Z));return z1(A,$,Z)}}});function z1(_,$,b){if(_.issues.length)return _.aborted=!0,_;if((b.direction||"forward")==="forward"){let z=$.transform(_.value,_);if(z instanceof Promise)return z.then((A)=>b1(_,A,$.out,b));return b1(_,z,$.out,b)}else{let z=$.reverseTransform(_.value,_);if(z instanceof Promise)return z.then((A)=>b1(_,A,$.in,b));return b1(_,z,$.in,b)}}function b1(_,$,b,Z){if(_.issues.length)return _.aborted=!0,_;return b._zod.run({value:$,issues:_.issues},Z)}var M3=I("$ZodReadonly",(_,$)=>{i.init(_,$),t(_._zod,"propValues",()=>$.innerType._zod.propValues),t(_._zod,"values",()=>$.innerType._zod.values),t(_._zod,"optin",()=>$.innerType?._zod?.optin),t(_._zod,"optout",()=>$.innerType?._zod?.optout),_._zod.parse=(b,Z)=>{if(Z.direction==="backward")return $.innerType._zod.run(b,Z);let z=$.innerType._zod.run(b,Z);if(z instanceof Promise)return z.then(eG);return eG(z)}});function eG(_){return _.value=Object.freeze(_.value),_}var E3=I("$ZodTemplateLiteral",(_,$)=>{i.init(_,$);let b=[];for(let Z of $.parts)if(typeof Z==="object"&&Z!==null){if(!Z._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...Z._zod.traits].shift()}`);let z=Z._zod.pattern instanceof RegExp?Z._zod.pattern.source:Z._zod.pattern;if(!z)throw Error(`Invalid template literal part: ${Z._zod.traits}`);let A=z.startsWith("^")?1:0,J=z.endsWith("$")?z.length-1:z.length;b.push(z.slice(A,J))}else if(Z===null||wb.has(typeof Z))b.push(Q_(`${Z}`));else throw Error(`Invalid template literal part: ${Z}`);_._zod.pattern=new RegExp(`^${b.join("")}$`),_._zod.parse=(Z,z)=>{if(typeof Z.value!=="string")return Z.issues.push({input:Z.value,inst:_,expected:"string",code:"invalid_type"}),Z;if(_._zod.pattern.lastIndex=0,!_._zod.pattern.test(Z.value))return Z.issues.push({input:Z.value,inst:_,code:"invalid_format",format:$.format??"template_literal",pattern:_._zod.pattern.source}),Z;return Z}}),O3=I("$ZodFunction",(_,$)=>{return i.init(_,$),_._def=$,_._zod.def=$,_.implement=(b)=>{if(typeof b!=="function")throw Error("implement() must be called with a function");return function(...Z){let z=_._def.input?u2(_._def.input,Z):Z,A=Reflect.apply(b,this,z);if(_._def.output)return u2(_._def.output,A);return A}},_.implementAsync=(b)=>{if(typeof b!=="function")throw Error("implementAsync() must be called with a function");return async function(...Z){let z=_._def.input?await c2(_._def.input,Z):Z,A=await Reflect.apply(b,this,z);if(_._def.output)return await c2(_._def.output,A);return A}},_._zod.parse=(b,Z)=>{if(typeof b.value!=="function")return b.issues.push({code:"invalid_type",expected:"function",input:b.value,inst:_}),b;if(_._def.output&&_._def.output._zod.def.type==="promise")b.value=_.implementAsync(b.value);else b.value=_.implement(b.value);return b},_.input=(...b)=>{let Z=_.constructor;if(Array.isArray(b[0]))return new Z({type:"function",input:new U1({type:"tuple",items:b[0],rest:b[1]}),output:_._def.output});return new Z({type:"function",input:b[0],output:_._def.output})},_.output=(b)=>{return new _.constructor({type:"function",input:_._def.input,output:b})},_}),P3=I("$ZodPromise",(_,$)=>{i.init(_,$),_._zod.parse=(b,Z)=>{return Promise.resolve(b.value).then((z)=>$.innerType._zod.run({value:z,issues:[]},Z))}}),j3=I("$ZodLazy",(_,$)=>{i.init(_,$),t(_._zod,"innerType",()=>$.getter()),t(_._zod,"pattern",()=>_._zod.innerType?._zod?.pattern),t(_._zod,"propValues",()=>_._zod.innerType?._zod?.propValues),t(_._zod,"optin",()=>_._zod.innerType?._zod?.optin??void 0),t(_._zod,"optout",()=>_._zod.innerType?._zod?.optout??void 0),_._zod.parse=(b,Z)=>{return _._zod.innerType._zod.run(b,Z)}}),S3=I("$ZodCustom",(_,$)=>{K0.init(_,$),i.init(_,$),_._zod.parse=(b,Z)=>{return b},_._zod.check=(b)=>{let Z=b.value,z=$.fn(Z);if(z instanceof Promise)return z.then((A)=>tG(A,b,Z,_));tG(z,b,Z,_);return}});function tG(_,$,b,Z){if(!_){let z={code:"custom",input:b,inst:Z,path:[...Z._zod.def.path??[]],continue:!Z._zod.def.abort};if(Z._zod.def.params)z.params=Z._zod.def.params;$.issues.push(Y9(z))}}var S$={};i_(S$,{zhTW:()=>BA,zhCN:()=>wA,yo:()=>xA,vi:()=>WA,uz:()=>kA,ur:()=>gA,uk:()=>j$,ua:()=>VA,tr:()=>DA,th:()=>qA,ta:()=>HA,sv:()=>vA,sl:()=>FA,ru:()=>KA,pt:()=>QA,ps:()=>YA,pl:()=>XA,ota:()=>GA,no:()=>UA,nl:()=>JA,ms:()=>AA,mk:()=>ZA,lt:()=>bA,ko:()=>zA,km:()=>O$,kh:()=>$A,ka:()=>_A,ja:()=>s3,it:()=>t3,is:()=>e3,id:()=>a3,hy:()=>o3,hu:()=>i3,he:()=>d3,frCA:()=>p3,fr:()=>l3,fi:()=>n3,fa:()=>r3,es:()=>h3,eo:()=>c3,en:()=>E$,de:()=>u3,da:()=>m3,cs:()=>f3,ca:()=>C3,bg:()=>y3,be:()=>T3,az:()=>L3,ar:()=>R3});var iD=()=>{let _={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function $(z){return _[z]??null}let b={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:"مدخل"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${z.expected}، ولكن تم إدخال ${U}`;return`مدخلات غير مقبولة: يفترض إدخال ${A}، ولكن تم إدخال ${U}`}case"invalid_value":if(z.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${m(z.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return` أكبر من اللازم: يفترض أن تكون ${z.origin??"القيمة"} ${A} ${z.maximum.toString()} ${J.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${z.origin??"القيمة"} ${A} ${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`أصغر من اللازم: يفترض لـ ${z.origin} أن يكون ${A} ${z.minimum.toString()} ${J.unit}`;return`أصغر من اللازم: يفترض لـ ${z.origin} أن يكون ${A} ${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${z.prefix}"`;if(A.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${A.suffix}"`;if(A.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${A.includes}"`;if(A.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${A.pattern}`;return`${b[A.format]??z.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${z.divisor}`;case"unrecognized_keys":return`معرف${z.keys.length>1?"ات":""} غريب${z.keys.length>1?"ة":""}: ${R(z.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${z.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${z.origin}`;default:return"مدخل غير مقبول"}}};function R3(){return{localeError:iD()}}var oD=()=>{let _={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 $(z){return _[z]??null}let b={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"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Yanlış dəyər: gözlənilən instanceof ${z.expected}, daxil olan ${U}`;return`Yanlış dəyər: gözlənilən ${A}, daxil olan ${U}`}case"invalid_value":if(z.values.length===1)return`Yanlış dəyər: gözlənilən ${m(z.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Çox böyük: gözlənilən ${z.origin??"dəyər"} ${A}${z.maximum.toString()} ${J.unit??"element"}`;return`Çox böyük: gözlənilən ${z.origin??"dəyər"} ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Çox kiçik: gözlənilən ${z.origin} ${A}${z.minimum.toString()} ${J.unit}`;return`Çox kiçik: gözlənilən ${z.origin} ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Yanlış mətn: "${A.prefix}" ilə başlamalıdır`;if(A.format==="ends_with")return`Yanlış mətn: "${A.suffix}" ilə bitməlidir`;if(A.format==="includes")return`Yanlış mətn: "${A.includes}" daxil olmalıdır`;if(A.format==="regex")return`Yanlış mətn: ${A.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${b[A.format]??z.format}`}case"not_multiple_of":return`Yanlış ədəd: ${z.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${z.keys.length>1?"lar":""}: ${R(z.keys,", ")}`;case"invalid_key":return`${z.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${z.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function L3(){return{localeError:oD()}}function ZY(_,$,b,Z){let z=Math.abs(_),A=z%10,J=z%100;if(J>=11&&J<=19)return Z;if(A===1)return $;if(A>=2&&A<=4)return b;return Z}var aD=()=>{let _={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 $(z){return _[z]??null}let b={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:"увод"},Z={nan:"NaN",number:"лік",array:"масіў"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Няправільны ўвод: чакаўся instanceof ${z.expected}, атрымана ${U}`;return`Няправільны ўвод: чакаўся ${A}, атрымана ${U}`}case"invalid_value":if(z.values.length===1)return`Няправільны ўвод: чакалася ${m(z.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J){let U=Number(z.maximum),G=ZY(U,J.unit.one,J.unit.few,J.unit.many);return`Занадта вялікі: чакалася, што ${z.origin??"значэнне"} павінна ${J.verb} ${A}${z.maximum.toString()} ${G}`}return`Занадта вялікі: чакалася, што ${z.origin??"значэнне"} павінна быць ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J){let U=Number(z.minimum),G=ZY(U,J.unit.one,J.unit.few,J.unit.many);return`Занадта малы: чакалася, што ${z.origin} павінна ${J.verb} ${A}${z.minimum.toString()} ${G}`}return`Занадта малы: чакалася, што ${z.origin} павінна быць ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${A.prefix}"`;if(A.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${A.suffix}"`;if(A.format==="includes")return`Няправільны радок: павінен змяшчаць "${A.includes}"`;if(A.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${A.pattern}`;return`Няправільны ${b[A.format]??z.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${z.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${z.keys.length>1?"ключы":"ключ"}: ${R(z.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${z.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${z.origin}`;default:return"Няправільны ўвод"}}};function T3(){return{localeError:aD()}}var eD=()=>{let _={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function $(z){return _[z]??null}let b={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:"вход"},Z={nan:"NaN",number:"число",array:"масив"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Невалиден вход: очакван instanceof ${z.expected}, получен ${U}`;return`Невалиден вход: очакван ${A}, получен ${U}`}case"invalid_value":if(z.values.length===1)return`Невалиден вход: очакван ${m(z.values[0])}`;return`Невалидна опция: очаквано едно от ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Твърде голямо: очаква се ${z.origin??"стойност"} да съдържа ${A}${z.maximum.toString()} ${J.unit??"елемента"}`;return`Твърде голямо: очаква се ${z.origin??"стойност"} да бъде ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Твърде малко: очаква се ${z.origin} да съдържа ${A}${z.minimum.toString()} ${J.unit}`;return`Твърде малко: очаква се ${z.origin} да бъде ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Невалиден низ: трябва да започва с "${A.prefix}"`;if(A.format==="ends_with")return`Невалиден низ: трябва да завършва с "${A.suffix}"`;if(A.format==="includes")return`Невалиден низ: трябва да включва "${A.includes}"`;if(A.format==="regex")return`Невалиден низ: трябва да съвпада с ${A.pattern}`;let J="Невалиден";if(A.format==="emoji")J="Невалидно";if(A.format==="datetime")J="Невалидно";if(A.format==="date")J="Невалидна";if(A.format==="time")J="Невалидно";if(A.format==="duration")J="Невалидна";return`${J} ${b[A.format]??z.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${z.divisor}`;case"unrecognized_keys":return`Неразпознат${z.keys.length>1?"и":""} ключ${z.keys.length>1?"ове":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${z.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${z.origin}`;default:return"Невалиден вход"}}};function y3(){return{localeError:eD()}}var tD=()=>{let _={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Tipus invàlid: s'esperava instanceof ${z.expected}, s'ha rebut ${U}`;return`Tipus invàlid: s'esperava ${A}, s'ha rebut ${U}`}case"invalid_value":if(z.values.length===1)return`Valor invàlid: s'esperava ${m(z.values[0])}`;return`Opció invàlida: s'esperava una de ${R(z.values," o ")}`;case"too_big":{let A=z.inclusive?"com a màxim":"menys de",J=$(z.origin);if(J)return`Massa gran: s'esperava que ${z.origin??"el valor"} contingués ${A} ${z.maximum.toString()} ${J.unit??"elements"}`;return`Massa gran: s'esperava que ${z.origin??"el valor"} fos ${A} ${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?"com a mínim":"més de",J=$(z.origin);if(J)return`Massa petit: s'esperava que ${z.origin} contingués ${A} ${z.minimum.toString()} ${J.unit}`;return`Massa petit: s'esperava que ${z.origin} fos ${A} ${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Format invàlid: ha de començar amb "${A.prefix}"`;if(A.format==="ends_with")return`Format invàlid: ha d'acabar amb "${A.suffix}"`;if(A.format==="includes")return`Format invàlid: ha d'incloure "${A.includes}"`;if(A.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${A.pattern}`;return`Format invàlid per a ${b[A.format]??z.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${z.divisor}`;case"unrecognized_keys":return`Clau${z.keys.length>1?"s":""} no reconeguda${z.keys.length>1?"s":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${z.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${z.origin}`;default:return"Entrada invàlida"}}};function C3(){return{localeError:tD()}}var sD=()=>{let _={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 $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Neplatný vstup: očekáváno instanceof ${z.expected}, obdrženo ${U}`;return`Neplatný vstup: očekáváno ${A}, obdrženo ${U}`}case"invalid_value":if(z.values.length===1)return`Neplatný vstup: očekáváno ${m(z.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Hodnota je příliš velká: ${z.origin??"hodnota"} musí mít ${A}${z.maximum.toString()} ${J.unit??"prvků"}`;return`Hodnota je příliš velká: ${z.origin??"hodnota"} musí být ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Hodnota je příliš malá: ${z.origin??"hodnota"} musí mít ${A}${z.minimum.toString()} ${J.unit??"prvků"}`;return`Hodnota je příliš malá: ${z.origin??"hodnota"} musí být ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Neplatný řetězec: musí začínat na "${A.prefix}"`;if(A.format==="ends_with")return`Neplatný řetězec: musí končit na "${A.suffix}"`;if(A.format==="includes")return`Neplatný řetězec: musí obsahovat "${A.includes}"`;if(A.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${A.pattern}`;return`Neplatný formát ${b[A.format]??z.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${z.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${R(z.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${z.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${z.origin}`;default:return"Neplatný vstup"}}};function f3(){return{localeError:sD()}}var _V=()=>{let _={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function $(z){return _[z]??null}let b={regex:"input",email:"e-mailadresse",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 klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},Z={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Ugyldigt input: forventede instanceof ${z.expected}, fik ${U}`;return`Ugyldigt input: forventede ${A}, fik ${U}`}case"invalid_value":if(z.values.length===1)return`Ugyldig værdi: forventede ${m(z.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin),U=Z[z.origin]??z.origin;if(J)return`For stor: forventede ${U??"value"} ${J.verb} ${A} ${z.maximum.toString()} ${J.unit??"elementer"}`;return`For stor: forventede ${U??"value"} havde ${A} ${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin),U=Z[z.origin]??z.origin;if(J)return`For lille: forventede ${U} ${J.verb} ${A} ${z.minimum.toString()} ${J.unit}`;return`For lille: forventede ${U} havde ${A} ${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Ugyldig streng: skal starte med "${A.prefix}"`;if(A.format==="ends_with")return`Ugyldig streng: skal ende med "${A.suffix}"`;if(A.format==="includes")return`Ugyldig streng: skal indeholde "${A.includes}"`;if(A.format==="regex")return`Ugyldig streng: skal matche mønsteret ${A.pattern}`;return`Ugyldig ${b[A.format]??z.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${z.divisor}`;case"unrecognized_keys":return`${z.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${R(z.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${z.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${z.origin}`;default:return"Ugyldigt input"}}};function m3(){return{localeError:_V()}}var $V=()=>{let _={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 $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"Zahl",array:"Array"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Ungültige Eingabe: erwartet instanceof ${z.expected}, erhalten ${U}`;return`Ungültige Eingabe: erwartet ${A}, erhalten ${U}`}case"invalid_value":if(z.values.length===1)return`Ungültige Eingabe: erwartet ${m(z.values[0])}`;return`Ungültige Option: erwartet eine von ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Zu groß: erwartet, dass ${z.origin??"Wert"} ${A}${z.maximum.toString()} ${J.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${z.origin??"Wert"} ${A}${z.maximum.toString()} ist`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Zu klein: erwartet, dass ${z.origin} ${A}${z.minimum.toString()} ${J.unit} hat`;return`Zu klein: erwartet, dass ${z.origin} ${A}${z.minimum.toString()} ist`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Ungültiger String: muss mit "${A.prefix}" beginnen`;if(A.format==="ends_with")return`Ungültiger String: muss mit "${A.suffix}" enden`;if(A.format==="includes")return`Ungültiger String: muss "${A.includes}" enthalten`;if(A.format==="regex")return`Ungültiger String: muss dem Muster ${A.pattern} entsprechen`;return`Ungültig: ${b[A.format]??z.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${z.divisor} sein`;case"unrecognized_keys":return`${z.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${R(z.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${z.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${z.origin}`;default:return"Ungültige Eingabe"}}};function u3(){return{localeError:$V()}}var zV=()=>{let _={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function $(z){return _[z]??null}let b={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;return`Invalid input: expected ${A}, received ${U}`}case"invalid_value":if(z.values.length===1)return`Invalid input: expected ${m(z.values[0])}`;return`Invalid option: expected one of ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Too big: expected ${z.origin??"value"} to have ${A}${z.maximum.toString()} ${J.unit??"elements"}`;return`Too big: expected ${z.origin??"value"} to be ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Too small: expected ${z.origin} to have ${A}${z.minimum.toString()} ${J.unit}`;return`Too small: expected ${z.origin} to be ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Invalid string: must start with "${A.prefix}"`;if(A.format==="ends_with")return`Invalid string: must end with "${A.suffix}"`;if(A.format==="includes")return`Invalid string: must include "${A.includes}"`;if(A.format==="regex")return`Invalid string: must match pattern ${A.pattern}`;return`Invalid ${b[A.format]??z.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${z.divisor}`;case"unrecognized_keys":return`Unrecognized key${z.keys.length>1?"s":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Invalid key in ${z.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${z.origin}`;default:return"Invalid input"}}};function E$(){return{localeError:zV()}}var bV=()=>{let _={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Nevalida enigo: atendiĝis instanceof ${z.expected}, riceviĝis ${U}`;return`Nevalida enigo: atendiĝis ${A}, riceviĝis ${U}`}case"invalid_value":if(z.values.length===1)return`Nevalida enigo: atendiĝis ${m(z.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Tro granda: atendiĝis ke ${z.origin??"valoro"} havu ${A}${z.maximum.toString()} ${J.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${z.origin??"valoro"} havu ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Tro malgranda: atendiĝis ke ${z.origin} havu ${A}${z.minimum.toString()} ${J.unit}`;return`Tro malgranda: atendiĝis ke ${z.origin} estu ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${A.prefix}"`;if(A.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${A.suffix}"`;if(A.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${A.includes}"`;if(A.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${A.pattern}`;return`Nevalida ${b[A.format]??z.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${z.divisor}`;case"unrecognized_keys":return`Nekonata${z.keys.length>1?"j":""} ŝlosilo${z.keys.length>1?"j":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${z.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${z.origin}`;default:return"Nevalida enigo"}}};function c3(){return{localeError:bV()}}var ZV=()=>{let _={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Entrada inválida: se esperaba instanceof ${z.expected}, recibido ${U}`;return`Entrada inválida: se esperaba ${A}, recibido ${U}`}case"invalid_value":if(z.values.length===1)return`Entrada inválida: se esperaba ${m(z.values[0])}`;return`Opción inválida: se esperaba una de ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin),U=Z[z.origin]??z.origin;if(J)return`Demasiado grande: se esperaba que ${U??"valor"} tuviera ${A}${z.maximum.toString()} ${J.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${U??"valor"} fuera ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin),U=Z[z.origin]??z.origin;if(J)return`Demasiado pequeño: se esperaba que ${U} tuviera ${A}${z.minimum.toString()} ${J.unit}`;return`Demasiado pequeño: se esperaba que ${U} fuera ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Cadena inválida: debe comenzar con "${A.prefix}"`;if(A.format==="ends_with")return`Cadena inválida: debe terminar en "${A.suffix}"`;if(A.format==="includes")return`Cadena inválida: debe incluir "${A.includes}"`;if(A.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${A.pattern}`;return`Inválido ${b[A.format]??z.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${z.divisor}`;case"unrecognized_keys":return`Llave${z.keys.length>1?"s":""} desconocida${z.keys.length>1?"s":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Llave inválida en ${Z[z.origin]??z.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${Z[z.origin]??z.origin}`;default:return"Entrada inválida"}}};function h3(){return{localeError:ZV()}}var AV=()=>{let _={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function $(z){return _[z]??null}let b={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:"ورودی"},Z={nan:"NaN",number:"عدد",array:"آرایه"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`ورودی نامعتبر: می‌بایست instanceof ${z.expected} می‌بود، ${U} دریافت شد`;return`ورودی نامعتبر: می‌بایست ${A} می‌بود، ${U} دریافت شد`}case"invalid_value":if(z.values.length===1)return`ورودی نامعتبر: می‌بایست ${m(z.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${R(z.values,"|")} می‌بود`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`خیلی بزرگ: ${z.origin??"مقدار"} باید ${A}${z.maximum.toString()} ${J.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${z.origin??"مقدار"} باید ${A}${z.maximum.toString()} باشد`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`خیلی کوچک: ${z.origin} باید ${A}${z.minimum.toString()} ${J.unit} باشد`;return`خیلی کوچک: ${z.origin} باید ${A}${z.minimum.toString()} باشد`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`رشته نامعتبر: باید با "${A.prefix}" شروع شود`;if(A.format==="ends_with")return`رشته نامعتبر: باید با "${A.suffix}" تمام شود`;if(A.format==="includes")return`رشته نامعتبر: باید شامل "${A.includes}" باشد`;if(A.format==="regex")return`رشته نامعتبر: باید با الگوی ${A.pattern} مطابقت داشته باشد`;return`${b[A.format]??z.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${z.divisor} باشد`;case"unrecognized_keys":return`کلید${z.keys.length>1?"های":""} ناشناس: ${R(z.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${z.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${z.origin}`;default:return"ورودی نامعتبر"}}};function r3(){return{localeError:AV()}}var JV=()=>{let _={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 $(z){return _[z]??null}let b={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"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Virheellinen tyyppi: odotettiin instanceof ${z.expected}, oli ${U}`;return`Virheellinen tyyppi: odotettiin ${A}, oli ${U}`}case"invalid_value":if(z.values.length===1)return`Virheellinen syöte: täytyy olla ${m(z.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Liian suuri: ${J.subject} täytyy olla ${A}${z.maximum.toString()} ${J.unit}`.trim();return`Liian suuri: arvon täytyy olla ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Liian pieni: ${J.subject} täytyy olla ${A}${z.minimum.toString()} ${J.unit}`.trim();return`Liian pieni: arvon täytyy olla ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${A.prefix}"`;if(A.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${A.suffix}"`;if(A.format==="includes")return`Virheellinen syöte: täytyy sisältää "${A.includes}"`;if(A.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${A.pattern}`;return`Virheellinen ${b[A.format]??z.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${z.divisor} monikerta`;case"unrecognized_keys":return`${z.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${R(z.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 n3(){return{localeError:JV()}}var UV=()=>{let _={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"nombre",array:"tableau"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Entrée invalide : instanceof ${z.expected} attendu, ${U} reçu`;return`Entrée invalide : ${A} attendu, ${U} reçu`}case"invalid_value":if(z.values.length===1)return`Entrée invalide : ${m(z.values[0])} attendu`;return`Option invalide : une valeur parmi ${R(z.values,"|")} attendue`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Trop grand : ${z.origin??"valeur"} doit ${J.verb} ${A}${z.maximum.toString()} ${J.unit??"élément(s)"}`;return`Trop grand : ${z.origin??"valeur"} doit être ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Trop petit : ${z.origin} doit ${J.verb} ${A}${z.minimum.toString()} ${J.unit}`;return`Trop petit : ${z.origin} doit être ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Chaîne invalide : doit commencer par "${A.prefix}"`;if(A.format==="ends_with")return`Chaîne invalide : doit se terminer par "${A.suffix}"`;if(A.format==="includes")return`Chaîne invalide : doit inclure "${A.includes}"`;if(A.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${A.pattern}`;return`${b[A.format]??z.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${z.divisor}`;case"unrecognized_keys":return`Clé${z.keys.length>1?"s":""} non reconnue${z.keys.length>1?"s":""} : ${R(z.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${z.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${z.origin}`;default:return"Entrée invalide"}}};function l3(){return{localeError:UV()}}var GV=()=>{let _={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Entrée invalide : attendu instanceof ${z.expected}, reçu ${U}`;return`Entrée invalide : attendu ${A}, reçu ${U}`}case"invalid_value":if(z.values.length===1)return`Entrée invalide : attendu ${m(z.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"≤":"<",J=$(z.origin);if(J)return`Trop grand : attendu que ${z.origin??"la valeur"} ait ${A}${z.maximum.toString()} ${J.unit}`;return`Trop grand : attendu que ${z.origin??"la valeur"} soit ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?"≥":">",J=$(z.origin);if(J)return`Trop petit : attendu que ${z.origin} ait ${A}${z.minimum.toString()} ${J.unit}`;return`Trop petit : attendu que ${z.origin} soit ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Chaîne invalide : doit commencer par "${A.prefix}"`;if(A.format==="ends_with")return`Chaîne invalide : doit se terminer par "${A.suffix}"`;if(A.format==="includes")return`Chaîne invalide : doit inclure "${A.includes}"`;if(A.format==="regex")return`Chaîne invalide : doit correspondre au motif ${A.pattern}`;return`${b[A.format]??z.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${z.divisor}`;case"unrecognized_keys":return`Clé${z.keys.length>1?"s":""} non reconnue${z.keys.length>1?"s":""} : ${R(z.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${z.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${z.origin}`;default:return"Entrée invalide"}}};function p3(){return{localeError:GV()}}var YV=()=>{let _={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},$={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},b=(Y)=>Y?_[Y]:void 0,Z=(Y)=>{let X=b(Y);if(X)return X.label;return Y??_.unknown.label},z=(Y)=>`ה${Z(Y)}`,A=(Y)=>{return(b(Y)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},J=(Y)=>{if(!Y)return null;return $[Y]??null},U={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},G={nan:"NaN"};return(Y)=>{switch(Y.code){case"invalid_type":{let X=Y.expected,Q=G[X??""]??Z(X),K=c(Y.input),v=G[K]??_[K]?.label??K;if(/^[A-Z]/.test(Y.expected))return`קלט לא תקין: צריך להיות instanceof ${Y.expected}, התקבל ${v}`;return`קלט לא תקין: צריך להיות ${Q}, התקבל ${v}`}case"invalid_value":{if(Y.values.length===1)return`ערך לא תקין: הערך חייב להיות ${m(Y.values[0])}`;let X=Y.values.map((v)=>m(v));if(Y.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${X[0]} או ${X[1]}`;let Q=X[X.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${X.slice(0,-1).join(", ")} או ${Q}`}case"too_big":{let X=J(Y.origin),Q=z(Y.origin??"value");if(Y.origin==="string")return`${X?.longLabel??"ארוך"} מדי: ${Q} צריכה להכיל ${Y.maximum.toString()} ${X?.unit??""} ${Y.inclusive?"או פחות":"לכל היותר"}`.trim();if(Y.origin==="number"){let D=Y.inclusive?`קטן או שווה ל-${Y.maximum}`:`קטן מ-${Y.maximum}`;return`גדול מדי: ${Q} צריך להיות ${D}`}if(Y.origin==="array"||Y.origin==="set"){let D=Y.origin==="set"?"צריכה":"צריך",w=Y.inclusive?`${Y.maximum} ${X?.unit??""} או פחות`:`פחות מ-${Y.maximum} ${X?.unit??""}`;return`גדול מדי: ${Q} ${D} להכיל ${w}`.trim()}let K=Y.inclusive?"<=":"<",v=A(Y.origin??"value");if(X?.unit)return`${X.longLabel} מדי: ${Q} ${v} ${K}${Y.maximum.toString()} ${X.unit}`;return`${X?.longLabel??"גדול"} מדי: ${Q} ${v} ${K}${Y.maximum.toString()}`}case"too_small":{let X=J(Y.origin),Q=z(Y.origin??"value");if(Y.origin==="string")return`${X?.shortLabel??"קצר"} מדי: ${Q} צריכה להכיל ${Y.minimum.toString()} ${X?.unit??""} ${Y.inclusive?"או יותר":"לפחות"}`.trim();if(Y.origin==="number"){let D=Y.inclusive?`גדול או שווה ל-${Y.minimum}`:`גדול מ-${Y.minimum}`;return`קטן מדי: ${Q} צריך להיות ${D}`}if(Y.origin==="array"||Y.origin==="set"){let D=Y.origin==="set"?"צריכה":"צריך";if(Y.minimum===1&&Y.inclusive){let P=Y.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${Q} ${D} להכיל ${P}`}let w=Y.inclusive?`${Y.minimum} ${X?.unit??""} או יותר`:`יותר מ-${Y.minimum} ${X?.unit??""}`;return`קטן מדי: ${Q} ${D} להכיל ${w}`.trim()}let K=Y.inclusive?">=":">",v=A(Y.origin??"value");if(X?.unit)return`${X.shortLabel} מדי: ${Q} ${v} ${K}${Y.minimum.toString()} ${X.unit}`;return`${X?.shortLabel??"קטן"} מדי: ${Q} ${v} ${K}${Y.minimum.toString()}`}case"invalid_format":{let X=Y;if(X.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${X.prefix}"`;if(X.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${X.suffix}"`;if(X.format==="includes")return`המחרוזת חייבת לכלול "${X.includes}"`;if(X.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${X.pattern}`;let Q=U[X.format],K=Q?.label??X.format,D=(Q?.gender??"m")==="f"?"תקינה":"תקין";return`${K} לא ${D}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${Y.divisor}`;case"unrecognized_keys":return`מפתח${Y.keys.length>1?"ות":""} לא מזוה${Y.keys.length>1?"ים":"ה"}: ${R(Y.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${z(Y.origin??"array")}`;default:return"קלט לא תקין"}}};function d3(){return{localeError:YV()}}var XV=()=>{let _={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"szám",array:"tömb"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Érvénytelen bemenet: a várt érték instanceof ${z.expected}, a kapott érték ${U}`;return`Érvénytelen bemenet: a várt érték ${A}, a kapott érték ${U}`}case"invalid_value":if(z.values.length===1)return`Érvénytelen bemenet: a várt érték ${m(z.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Túl nagy: ${z.origin??"érték"} mérete túl nagy ${A}${z.maximum.toString()} ${J.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${z.origin??"érték"} túl nagy: ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Túl kicsi: a bemeneti érték ${z.origin} mérete túl kicsi ${A}${z.minimum.toString()} ${J.unit}`;return`Túl kicsi: a bemeneti érték ${z.origin} túl kicsi ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Érvénytelen string: "${A.prefix}" értékkel kell kezdődnie`;if(A.format==="ends_with")return`Érvénytelen string: "${A.suffix}" értékkel kell végződnie`;if(A.format==="includes")return`Érvénytelen string: "${A.includes}" értéket kell tartalmaznia`;if(A.format==="regex")return`Érvénytelen string: ${A.pattern} mintának kell megfelelnie`;return`Érvénytelen ${b[A.format]??z.format}`}case"not_multiple_of":return`Érvénytelen szám: ${z.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${z.keys.length>1?"s":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${z.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${z.origin}`;default:return"Érvénytelen bemenet"}}};function i3(){return{localeError:XV()}}function AY(_,$,b){return Math.abs(_)===1?$:b}function H9(_){if(!_)return"";let $=["ա","ե","ը","ի","ո","ու","օ"],b=_[_.length-1];return _+($.includes(b)?"ն":"ը")}var QV=()=>{let _={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function $(z){return _[z]??null}let b={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:"մուտք"},Z={nan:"NaN",number:"թիվ",array:"զանգված"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${z.expected}, ստացվել է ${U}`;return`Սխալ մուտքագրում․ սպասվում էր ${A}, ստացվել է ${U}`}case"invalid_value":if(z.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${m(z.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J){let U=Number(z.maximum),G=AY(U,J.unit.one,J.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${H9(z.origin??"արժեք")} կունենա ${A}${z.maximum.toString()} ${G}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${H9(z.origin??"արժեք")} լինի ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J){let U=Number(z.minimum),G=AY(U,J.unit.one,J.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${H9(z.origin)} կունենա ${A}${z.minimum.toString()} ${G}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${H9(z.origin)} լինի ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${A.prefix}"-ով`;if(A.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${A.suffix}"-ով`;if(A.format==="includes")return`Սխալ տող․ պետք է պարունակի "${A.includes}"`;if(A.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${A.pattern} ձևաչափին`;return`Սխալ ${b[A.format]??z.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${z.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${z.keys.length>1?"ներ":""}. ${R(z.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${H9(z.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${H9(z.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function o3(){return{localeError:QV()}}var KV=()=>{let _={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Input tidak valid: diharapkan instanceof ${z.expected}, diterima ${U}`;return`Input tidak valid: diharapkan ${A}, diterima ${U}`}case"invalid_value":if(z.values.length===1)return`Input tidak valid: diharapkan ${m(z.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Terlalu besar: diharapkan ${z.origin??"value"} memiliki ${A}${z.maximum.toString()} ${J.unit??"elemen"}`;return`Terlalu besar: diharapkan ${z.origin??"value"} menjadi ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Terlalu kecil: diharapkan ${z.origin} memiliki ${A}${z.minimum.toString()} ${J.unit}`;return`Terlalu kecil: diharapkan ${z.origin} menjadi ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`String tidak valid: harus dimulai dengan "${A.prefix}"`;if(A.format==="ends_with")return`String tidak valid: harus berakhir dengan "${A.suffix}"`;if(A.format==="includes")return`String tidak valid: harus menyertakan "${A.includes}"`;if(A.format==="regex")return`String tidak valid: harus sesuai pola ${A.pattern}`;return`${b[A.format]??z.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${z.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${z.keys.length>1?"s":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${z.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${z.origin}`;default:return"Input tidak valid"}}};function a3(){return{localeError:KV()}}var FV=()=>{let _={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function $(z){return _[z]??null}let b={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},Z={nan:"NaN",number:"númer",array:"fylki"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Rangt gildi: Þú slóst inn ${U} þar sem á að vera instanceof ${z.expected}`;return`Rangt gildi: Þú slóst inn ${U} þar sem á að vera ${A}`}case"invalid_value":if(z.values.length===1)return`Rangt gildi: gert ráð fyrir ${m(z.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Of stórt: gert er ráð fyrir að ${z.origin??"gildi"} hafi ${A}${z.maximum.toString()} ${J.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${z.origin??"gildi"} sé ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Of lítið: gert er ráð fyrir að ${z.origin} hafi ${A}${z.minimum.toString()} ${J.unit}`;return`Of lítið: gert er ráð fyrir að ${z.origin} sé ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Ógildur strengur: verður að byrja á "${A.prefix}"`;if(A.format==="ends_with")return`Ógildur strengur: verður að enda á "${A.suffix}"`;if(A.format==="includes")return`Ógildur strengur: verður að innihalda "${A.includes}"`;if(A.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${A.pattern}`;return`Rangt ${b[A.format]??z.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${z.divisor}`;case"unrecognized_keys":return`Óþekkt ${z.keys.length>1?"ir lyklar":"ur lykill"}: ${R(z.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${z.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${z.origin}`;default:return"Rangt gildi"}}};function e3(){return{localeError:FV()}}var vV=()=>{let _={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"numero",array:"vettore"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Input non valido: atteso instanceof ${z.expected}, ricevuto ${U}`;return`Input non valido: atteso ${A}, ricevuto ${U}`}case"invalid_value":if(z.values.length===1)return`Input non valido: atteso ${m(z.values[0])}`;return`Opzione non valida: atteso uno tra ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Troppo grande: ${z.origin??"valore"} deve avere ${A}${z.maximum.toString()} ${J.unit??"elementi"}`;return`Troppo grande: ${z.origin??"valore"} deve essere ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Troppo piccolo: ${z.origin} deve avere ${A}${z.minimum.toString()} ${J.unit}`;return`Troppo piccolo: ${z.origin} deve essere ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Stringa non valida: deve iniziare con "${A.prefix}"`;if(A.format==="ends_with")return`Stringa non valida: deve terminare con "${A.suffix}"`;if(A.format==="includes")return`Stringa non valida: deve includere "${A.includes}"`;if(A.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${A.pattern}`;return`Invalid ${b[A.format]??z.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${z.divisor}`;case"unrecognized_keys":return`Chiav${z.keys.length>1?"i":"e"} non riconosciut${z.keys.length>1?"e":"a"}: ${R(z.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${z.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${z.origin}`;default:return"Input non valido"}}};function t3(){return{localeError:vV()}}var HV=()=>{let _={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function $(z){return _[z]??null}let b={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:"入力値"},Z={nan:"NaN",number:"数値",array:"配列"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`無効な入力: instanceof ${z.expected}が期待されましたが、${U}が入力されました`;return`無効な入力: ${A}が期待されましたが、${U}が入力されました`}case"invalid_value":if(z.values.length===1)return`無効な入力: ${m(z.values[0])}が期待されました`;return`無効な選択: ${R(z.values,"、")}のいずれかである必要があります`;case"too_big":{let A=z.inclusive?"以下である":"より小さい",J=$(z.origin);if(J)return`大きすぎる値: ${z.origin??"値"}は${z.maximum.toString()}${J.unit??"要素"}${A}必要があります`;return`大きすぎる値: ${z.origin??"値"}は${z.maximum.toString()}${A}必要があります`}case"too_small":{let A=z.inclusive?"以上である":"より大きい",J=$(z.origin);if(J)return`小さすぎる値: ${z.origin}は${z.minimum.toString()}${J.unit}${A}必要があります`;return`小さすぎる値: ${z.origin}は${z.minimum.toString()}${A}必要があります`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`無効な文字列: "${A.prefix}"で始まる必要があります`;if(A.format==="ends_with")return`無効な文字列: "${A.suffix}"で終わる必要があります`;if(A.format==="includes")return`無効な文字列: "${A.includes}"を含む必要があります`;if(A.format==="regex")return`無効な文字列: パターン${A.pattern}に一致する必要があります`;return`無効な${b[A.format]??z.format}`}case"not_multiple_of":return`無効な数値: ${z.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${z.keys.length>1?"群":""}: ${R(z.keys,"、")}`;case"invalid_key":return`${z.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${z.origin}内の無効な値`;default:return"無効な入力"}}};function s3(){return{localeError:HV()}}var qV=()=>{let _={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function $(z){return _[z]??null}let b={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-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},Z={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${z.expected}, მიღებული ${U}`;return`არასწორი შეყვანა: მოსალოდნელი ${A}, მიღებული ${U}`}case"invalid_value":if(z.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${m(z.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${R(z.values,"|")}-დან`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`ზედმეტად დიდი: მოსალოდნელი ${z.origin??"მნიშვნელობა"} ${J.verb} ${A}${z.maximum.toString()} ${J.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${z.origin??"მნიშვნელობა"} იყოს ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`ზედმეტად პატარა: მოსალოდნელი ${z.origin} ${J.verb} ${A}${z.minimum.toString()} ${J.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${z.origin} იყოს ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${A.prefix}"-ით`;if(A.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${A.suffix}"-ით`;if(A.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${A.includes}"-ს`;if(A.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${A.pattern}`;return`არასწორი ${b[A.format]??z.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${z.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${z.keys.length>1?"ები":"ი"}: ${R(z.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${z.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${z.origin}-ში`;default:return"არასწორი შეყვანა"}}};function _A(){return{localeError:qV()}}var DV=()=>{let _={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function $(z){return _[z]??null}let b={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:"ទិន្នន័យបញ្ចូល"},Z={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${z.expected} ប៉ុន្តែទទួលបាន ${U}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${A} ប៉ុន្តែទទួលបាន ${U}`}case"invalid_value":if(z.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${m(z.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`ធំពេក៖ ត្រូវការ ${z.origin??"តម្លៃ"} ${A} ${z.maximum.toString()} ${J.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${z.origin??"តម្លៃ"} ${A} ${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`តូចពេក៖ ត្រូវការ ${z.origin} ${A} ${z.minimum.toString()} ${J.unit}`;return`តូចពេក៖ ត្រូវការ ${z.origin} ${A} ${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${A.prefix}"`;if(A.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${A.suffix}"`;if(A.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${A.includes}"`;if(A.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${A.pattern}`;return`មិនត្រឹមត្រូវ៖ ${b[A.format]??z.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${z.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${R(z.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${z.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${z.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function O$(){return{localeError:DV()}}function $A(){return O$()}var VV=()=>{let _={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function $(z){return _[z]??null}let b={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:"입력"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`잘못된 입력: 예상 타입은 instanceof ${z.expected}, 받은 타입은 ${U}입니다`;return`잘못된 입력: 예상 타입은 ${A}, 받은 타입은 ${U}입니다`}case"invalid_value":if(z.values.length===1)return`잘못된 입력: 값은 ${m(z.values[0])} 이어야 합니다`;return`잘못된 옵션: ${R(z.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let A=z.inclusive?"이하":"미만",J=A==="미만"?"이어야 합니다":"여야 합니다",U=$(z.origin),G=U?.unit??"요소";if(U)return`${z.origin??"값"}이 너무 큽니다: ${z.maximum.toString()}${G} ${A}${J}`;return`${z.origin??"값"}이 너무 큽니다: ${z.maximum.toString()} ${A}${J}`}case"too_small":{let A=z.inclusive?"이상":"초과",J=A==="이상"?"이어야 합니다":"여야 합니다",U=$(z.origin),G=U?.unit??"요소";if(U)return`${z.origin??"값"}이 너무 작습니다: ${z.minimum.toString()}${G} ${A}${J}`;return`${z.origin??"값"}이 너무 작습니다: ${z.minimum.toString()} ${A}${J}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`잘못된 문자열: "${A.prefix}"(으)로 시작해야 합니다`;if(A.format==="ends_with")return`잘못된 문자열: "${A.suffix}"(으)로 끝나야 합니다`;if(A.format==="includes")return`잘못된 문자열: "${A.includes}"을(를) 포함해야 합니다`;if(A.format==="regex")return`잘못된 문자열: 정규식 ${A.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${b[A.format]??z.format}`}case"not_multiple_of":return`잘못된 숫자: ${z.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${R(z.keys,", ")}`;case"invalid_key":return`잘못된 키: ${z.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${z.origin}`;default:return"잘못된 입력"}}};function zA(){return{localeError:VV()}}var P$=(_)=>{return _.charAt(0).toUpperCase()+_.slice(1)};function JY(_){let $=Math.abs(_),b=$%10,Z=$%100;if(Z>=11&&Z<=19||b===0)return"many";if(b===1)return"one";return"few"}var gV=()=>{let _={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function $(z,A,J,U){let G=_[z]??null;if(G===null)return G;return{unit:G.unit[A],verb:G.verb[U][J?"inclusive":"notInclusive"]}}let b={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},Z={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Gautas tipas ${U}, o tikėtasi - instanceof ${z.expected}`;return`Gautas tipas ${U}, o tikėtasi - ${A}`}case"invalid_value":if(z.values.length===1)return`Privalo būti ${m(z.values[0])}`;return`Privalo būti vienas iš ${R(z.values,"|")} pasirinkimų`;case"too_big":{let A=Z[z.origin]??z.origin,J=$(z.origin,JY(Number(z.maximum)),z.inclusive??!1,"smaller");if(J?.verb)return`${P$(A??z.origin??"reikšmė")} ${J.verb} ${z.maximum.toString()} ${J.unit??"elementų"}`;let U=z.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${P$(A??z.origin??"reikšmė")} turi būti ${U} ${z.maximum.toString()} ${J?.unit}`}case"too_small":{let A=Z[z.origin]??z.origin,J=$(z.origin,JY(Number(z.minimum)),z.inclusive??!1,"bigger");if(J?.verb)return`${P$(A??z.origin??"reikšmė")} ${J.verb} ${z.minimum.toString()} ${J.unit??"elementų"}`;let U=z.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${P$(A??z.origin??"reikšmė")} turi būti ${U} ${z.minimum.toString()} ${J?.unit}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Eilutė privalo prasidėti "${A.prefix}"`;if(A.format==="ends_with")return`Eilutė privalo pasibaigti "${A.suffix}"`;if(A.format==="includes")return`Eilutė privalo įtraukti "${A.includes}"`;if(A.format==="regex")return`Eilutė privalo atitikti ${A.pattern}`;return`Neteisingas ${b[A.format]??z.format}`}case"not_multiple_of":return`Skaičius privalo būti ${z.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${z.keys.length>1?"i":"as"} rakt${z.keys.length>1?"ai":"as"}: ${R(z.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let A=Z[z.origin]??z.origin;return`${P$(A??z.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function bA(){return{localeError:gV()}}var kV=()=>{let _={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function $(z){return _[z]??null}let b={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:"внес"},Z={nan:"NaN",number:"број",array:"низа"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Грешен внес: се очекува instanceof ${z.expected}, примено ${U}`;return`Грешен внес: се очекува ${A}, примено ${U}`}case"invalid_value":if(z.values.length===1)return`Invalid input: expected ${m(z.values[0])}`;return`Грешана опција: се очекува една ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Премногу голем: се очекува ${z.origin??"вредноста"} да има ${A}${z.maximum.toString()} ${J.unit??"елементи"}`;return`Премногу голем: се очекува ${z.origin??"вредноста"} да биде ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Премногу мал: се очекува ${z.origin} да има ${A}${z.minimum.toString()} ${J.unit}`;return`Премногу мал: се очекува ${z.origin} да биде ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Неважечка низа: мора да започнува со "${A.prefix}"`;if(A.format==="ends_with")return`Неважечка низа: мора да завршува со "${A.suffix}"`;if(A.format==="includes")return`Неважечка низа: мора да вклучува "${A.includes}"`;if(A.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${A.pattern}`;return`Invalid ${b[A.format]??z.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${z.divisor}`;case"unrecognized_keys":return`${z.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${R(z.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${z.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${z.origin}`;default:return"Грешен внес"}}};function ZA(){return{localeError:kV()}}var WV=()=>{let _={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"nombor"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Input tidak sah: dijangka instanceof ${z.expected}, diterima ${U}`;return`Input tidak sah: dijangka ${A}, diterima ${U}`}case"invalid_value":if(z.values.length===1)return`Input tidak sah: dijangka ${m(z.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Terlalu besar: dijangka ${z.origin??"nilai"} ${J.verb} ${A}${z.maximum.toString()} ${J.unit??"elemen"}`;return`Terlalu besar: dijangka ${z.origin??"nilai"} adalah ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Terlalu kecil: dijangka ${z.origin} ${J.verb} ${A}${z.minimum.toString()} ${J.unit}`;return`Terlalu kecil: dijangka ${z.origin} adalah ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`String tidak sah: mesti bermula dengan "${A.prefix}"`;if(A.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${A.suffix}"`;if(A.format==="includes")return`String tidak sah: mesti mengandungi "${A.includes}"`;if(A.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${A.pattern}`;return`${b[A.format]??z.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${z.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${R(z.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${z.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${z.origin}`;default:return"Input tidak sah"}}};function AA(){return{localeError:WV()}}var wV=()=>{let _={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"getal"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Ongeldige invoer: verwacht instanceof ${z.expected}, ontving ${U}`;return`Ongeldige invoer: verwacht ${A}, ontving ${U}`}case"invalid_value":if(z.values.length===1)return`Ongeldige invoer: verwacht ${m(z.values[0])}`;return`Ongeldige optie: verwacht één van ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin),U=z.origin==="date"?"laat":z.origin==="string"?"lang":"groot";if(J)return`Te ${U}: verwacht dat ${z.origin??"waarde"} ${A}${z.maximum.toString()} ${J.unit??"elementen"} ${J.verb}`;return`Te ${U}: verwacht dat ${z.origin??"waarde"} ${A}${z.maximum.toString()} is`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin),U=z.origin==="date"?"vroeg":z.origin==="string"?"kort":"klein";if(J)return`Te ${U}: verwacht dat ${z.origin} ${A}${z.minimum.toString()} ${J.unit} ${J.verb}`;return`Te ${U}: verwacht dat ${z.origin} ${A}${z.minimum.toString()} is`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Ongeldige tekst: moet met "${A.prefix}" beginnen`;if(A.format==="ends_with")return`Ongeldige tekst: moet op "${A.suffix}" eindigen`;if(A.format==="includes")return`Ongeldige tekst: moet "${A.includes}" bevatten`;if(A.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${A.pattern}`;return`Ongeldig: ${b[A.format]??z.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${z.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${z.keys.length>1?"s":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${z.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${z.origin}`;default:return"Ongeldige invoer"}}};function JA(){return{localeError:wV()}}var BV=()=>{let _={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"tall",array:"liste"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Ugyldig input: forventet instanceof ${z.expected}, fikk ${U}`;return`Ugyldig input: forventet ${A}, fikk ${U}`}case"invalid_value":if(z.values.length===1)return`Ugyldig verdi: forventet ${m(z.values[0])}`;return`Ugyldig valg: forventet en av ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`For stor(t): forventet ${z.origin??"value"} til å ha ${A}${z.maximum.toString()} ${J.unit??"elementer"}`;return`For stor(t): forventet ${z.origin??"value"} til å ha ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`For lite(n): forventet ${z.origin} til å ha ${A}${z.minimum.toString()} ${J.unit}`;return`For lite(n): forventet ${z.origin} til å ha ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Ugyldig streng: må starte med "${A.prefix}"`;if(A.format==="ends_with")return`Ugyldig streng: må ende med "${A.suffix}"`;if(A.format==="includes")return`Ugyldig streng: må inneholde "${A.includes}"`;if(A.format==="regex")return`Ugyldig streng: må matche mønsteret ${A.pattern}`;return`Ugyldig ${b[A.format]??z.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${z.divisor}`;case"unrecognized_keys":return`${z.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${R(z.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${z.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${z.origin}`;default:return"Ugyldig input"}}};function UA(){return{localeError:BV()}}var xV=()=>{let _={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 $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Fâsit giren: umulan instanceof ${z.expected}, alınan ${U}`;return`Fâsit giren: umulan ${A}, alınan ${U}`}case"invalid_value":if(z.values.length===1)return`Fâsit giren: umulan ${m(z.values[0])}`;return`Fâsit tercih: mûteberler ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Fazla büyük: ${z.origin??"value"}, ${A}${z.maximum.toString()} ${J.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${z.origin??"value"}, ${A}${z.maximum.toString()} olmalıydı.`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Fazla küçük: ${z.origin}, ${A}${z.minimum.toString()} ${J.unit} sahip olmalıydı.`;return`Fazla küçük: ${z.origin}, ${A}${z.minimum.toString()} olmalıydı.`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Fâsit metin: "${A.prefix}" ile başlamalı.`;if(A.format==="ends_with")return`Fâsit metin: "${A.suffix}" ile bitmeli.`;if(A.format==="includes")return`Fâsit metin: "${A.includes}" ihtivâ etmeli.`;if(A.format==="regex")return`Fâsit metin: ${A.pattern} nakşına uymalı.`;return`Fâsit ${b[A.format]??z.format}`}case"not_multiple_of":return`Fâsit sayı: ${z.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${z.keys.length>1?"s":""}: ${R(z.keys,", ")}`;case"invalid_key":return`${z.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${z.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function GA(){return{localeError:xV()}}var NV=()=>{let _={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function $(z){return _[z]??null}let b={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:"ورودي"},Z={nan:"NaN",number:"عدد",array:"ارې"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`ناسم ورودي: باید instanceof ${z.expected} وای, مګر ${U} ترلاسه شو`;return`ناسم ورودي: باید ${A} وای, مګر ${U} ترلاسه شو`}case"invalid_value":if(z.values.length===1)return`ناسم ورودي: باید ${m(z.values[0])} وای`;return`ناسم انتخاب: باید یو له ${R(z.values,"|")} څخه وای`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`ډیر لوی: ${z.origin??"ارزښت"} باید ${A}${z.maximum.toString()} ${J.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${z.origin??"ارزښت"} باید ${A}${z.maximum.toString()} وي`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`ډیر کوچنی: ${z.origin} باید ${A}${z.minimum.toString()} ${J.unit} ولري`;return`ډیر کوچنی: ${z.origin} باید ${A}${z.minimum.toString()} وي`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`ناسم متن: باید د "${A.prefix}" سره پیل شي`;if(A.format==="ends_with")return`ناسم متن: باید د "${A.suffix}" سره پای ته ورسيږي`;if(A.format==="includes")return`ناسم متن: باید "${A.includes}" ولري`;if(A.format==="regex")return`ناسم متن: باید د ${A.pattern} سره مطابقت ولري`;return`${b[A.format]??z.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${z.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${z.keys.length>1?"کلیډونه":"کلیډ"}: ${R(z.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${z.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${z.origin} کې`;default:return"ناسمه ورودي"}}};function YA(){return{localeError:NV()}}var IV=()=>{let _={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 $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"liczba",array:"tablica"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${z.expected}, otrzymano ${U}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${A}, otrzymano ${U}`}case"invalid_value":if(z.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${m(z.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Za duża wartość: oczekiwano, że ${z.origin??"wartość"} będzie mieć ${A}${z.maximum.toString()} ${J.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${z.origin??"wartość"} będzie wynosić ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Za mała wartość: oczekiwano, że ${z.origin??"wartość"} będzie mieć ${A}${z.minimum.toString()} ${J.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${z.origin??"wartość"} będzie wynosić ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${A.prefix}"`;if(A.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${A.suffix}"`;if(A.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${A.includes}"`;if(A.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${A.pattern}`;return`Nieprawidłow(y/a/e) ${b[A.format]??z.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${z.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${z.keys.length>1?"s":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${z.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${z.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function XA(){return{localeError:IV()}}var MV=()=>{let _={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"número",null:"nulo"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Tipo inválido: esperado instanceof ${z.expected}, recebido ${U}`;return`Tipo inválido: esperado ${A}, recebido ${U}`}case"invalid_value":if(z.values.length===1)return`Entrada inválida: esperado ${m(z.values[0])}`;return`Opção inválida: esperada uma das ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Muito grande: esperado que ${z.origin??"valor"} tivesse ${A}${z.maximum.toString()} ${J.unit??"elementos"}`;return`Muito grande: esperado que ${z.origin??"valor"} fosse ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Muito pequeno: esperado que ${z.origin} tivesse ${A}${z.minimum.toString()} ${J.unit}`;return`Muito pequeno: esperado que ${z.origin} fosse ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Texto inválido: deve começar com "${A.prefix}"`;if(A.format==="ends_with")return`Texto inválido: deve terminar com "${A.suffix}"`;if(A.format==="includes")return`Texto inválido: deve incluir "${A.includes}"`;if(A.format==="regex")return`Texto inválido: deve corresponder ao padrão ${A.pattern}`;return`${b[A.format]??z.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${z.divisor}`;case"unrecognized_keys":return`Chave${z.keys.length>1?"s":""} desconhecida${z.keys.length>1?"s":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Chave inválida em ${z.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${z.origin}`;default:return"Campo inválido"}}};function QA(){return{localeError:MV()}}function UY(_,$,b,Z){let z=Math.abs(_),A=z%10,J=z%100;if(J>=11&&J<=19)return Z;if(A===1)return $;if(A>=2&&A<=4)return b;return Z}var EV=()=>{let _={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 $(z){return _[z]??null}let b={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:"ввод"},Z={nan:"NaN",number:"число",array:"массив"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Неверный ввод: ожидалось instanceof ${z.expected}, получено ${U}`;return`Неверный ввод: ожидалось ${A}, получено ${U}`}case"invalid_value":if(z.values.length===1)return`Неверный ввод: ожидалось ${m(z.values[0])}`;return`Неверный вариант: ожидалось одно из ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J){let U=Number(z.maximum),G=UY(U,J.unit.one,J.unit.few,J.unit.many);return`Слишком большое значение: ожидалось, что ${z.origin??"значение"} будет иметь ${A}${z.maximum.toString()} ${G}`}return`Слишком большое значение: ожидалось, что ${z.origin??"значение"} будет ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J){let U=Number(z.minimum),G=UY(U,J.unit.one,J.unit.few,J.unit.many);return`Слишком маленькое значение: ожидалось, что ${z.origin} будет иметь ${A}${z.minimum.toString()} ${G}`}return`Слишком маленькое значение: ожидалось, что ${z.origin} будет ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Неверная строка: должна начинаться с "${A.prefix}"`;if(A.format==="ends_with")return`Неверная строка: должна заканчиваться на "${A.suffix}"`;if(A.format==="includes")return`Неверная строка: должна содержать "${A.includes}"`;if(A.format==="regex")return`Неверная строка: должна соответствовать шаблону ${A.pattern}`;return`Неверный ${b[A.format]??z.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${z.divisor}`;case"unrecognized_keys":return`Нераспознанн${z.keys.length>1?"ые":"ый"} ключ${z.keys.length>1?"и":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${z.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${z.origin}`;default:return"Неверные входные данные"}}};function KA(){return{localeError:EV()}}var OV=()=>{let _={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"število",array:"tabela"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Neveljaven vnos: pričakovano instanceof ${z.expected}, prejeto ${U}`;return`Neveljaven vnos: pričakovano ${A}, prejeto ${U}`}case"invalid_value":if(z.values.length===1)return`Neveljaven vnos: pričakovano ${m(z.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Preveliko: pričakovano, da bo ${z.origin??"vrednost"} imelo ${A}${z.maximum.toString()} ${J.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${z.origin??"vrednost"} ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Premajhno: pričakovano, da bo ${z.origin} imelo ${A}${z.minimum.toString()} ${J.unit}`;return`Premajhno: pričakovano, da bo ${z.origin} ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Neveljaven niz: mora se začeti z "${A.prefix}"`;if(A.format==="ends_with")return`Neveljaven niz: mora se končati z "${A.suffix}"`;if(A.format==="includes")return`Neveljaven niz: mora vsebovati "${A.includes}"`;if(A.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${A.pattern}`;return`Neveljaven ${b[A.format]??z.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${z.divisor}`;case"unrecognized_keys":return`Neprepoznan${z.keys.length>1?"i ključi":" ključ"}: ${R(z.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${z.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${z.origin}`;default:return"Neveljaven vnos"}}};function FA(){return{localeError:OV()}}var PV=()=>{let _={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 $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"antal",array:"lista"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Ogiltig inmatning: förväntat instanceof ${z.expected}, fick ${U}`;return`Ogiltig inmatning: förväntat ${A}, fick ${U}`}case"invalid_value":if(z.values.length===1)return`Ogiltig inmatning: förväntat ${m(z.values[0])}`;return`Ogiltigt val: förväntade en av ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`För stor(t): förväntade ${z.origin??"värdet"} att ha ${A}${z.maximum.toString()} ${J.unit??"element"}`;return`För stor(t): förväntat ${z.origin??"värdet"} att ha ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`För lite(t): förväntade ${z.origin??"värdet"} att ha ${A}${z.minimum.toString()} ${J.unit}`;return`För lite(t): förväntade ${z.origin??"värdet"} att ha ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Ogiltig sträng: måste börja med "${A.prefix}"`;if(A.format==="ends_with")return`Ogiltig sträng: måste sluta med "${A.suffix}"`;if(A.format==="includes")return`Ogiltig sträng: måste innehålla "${A.includes}"`;if(A.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${A.pattern}"`;return`Ogiltig(t) ${b[A.format]??z.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${z.divisor}`;case"unrecognized_keys":return`${z.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${R(z.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${z.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${z.origin??"värdet"}`;default:return"Ogiltig input"}}};function vA(){return{localeError:PV()}}var jV=()=>{let _={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${z.expected}, பெறப்பட்டது ${U}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${A}, பெறப்பட்டது ${U}`}case"invalid_value":if(z.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${m(z.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${R(z.values,"|")} இல் ஒன்று`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${z.origin??"மதிப்பு"} ${A}${z.maximum.toString()} ${J.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${z.origin??"மதிப்பு"} ${A}${z.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${z.origin} ${A}${z.minimum.toString()} ${J.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${z.origin} ${A}${z.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`தவறான சரம்: "${A.prefix}" இல் தொடங்க வேண்டும்`;if(A.format==="ends_with")return`தவறான சரம்: "${A.suffix}" இல் முடிவடைய வேண்டும்`;if(A.format==="includes")return`தவறான சரம்: "${A.includes}" ஐ உள்ளடக்க வேண்டும்`;if(A.format==="regex")return`தவறான சரம்: ${A.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${b[A.format]??z.format}`}case"not_multiple_of":return`தவறான எண்: ${z.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${z.keys.length>1?"கள்":""}: ${R(z.keys,", ")}`;case"invalid_key":return`${z.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${z.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function HA(){return{localeError:jV()}}var SV=()=>{let _={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function $(z){return _[z]??null}let b={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:"ข้อมูลที่ป้อน"},Z={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${z.expected} แต่ได้รับ ${U}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${A} แต่ได้รับ ${U}`}case"invalid_value":if(z.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${m(z.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"ไม่เกิน":"น้อยกว่า",J=$(z.origin);if(J)return`เกินกำหนด: ${z.origin??"ค่า"} ควรมี${A} ${z.maximum.toString()} ${J.unit??"รายการ"}`;return`เกินกำหนด: ${z.origin??"ค่า"} ควรมี${A} ${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?"อย่างน้อย":"มากกว่า",J=$(z.origin);if(J)return`น้อยกว่ากำหนด: ${z.origin} ควรมี${A} ${z.minimum.toString()} ${J.unit}`;return`น้อยกว่ากำหนด: ${z.origin} ควรมี${A} ${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${A.prefix}"`;if(A.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${A.suffix}"`;if(A.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${A.includes}" อยู่ในข้อความ`;if(A.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${A.pattern}`;return`รูปแบบไม่ถูกต้อง: ${b[A.format]??z.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${z.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${R(z.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${z.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${z.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function qA(){return{localeError:SV()}}var RV=()=>{let _={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function $(z){return _[z]??null}let b={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"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Geçersiz değer: beklenen instanceof ${z.expected}, alınan ${U}`;return`Geçersiz değer: beklenen ${A}, alınan ${U}`}case"invalid_value":if(z.values.length===1)return`Geçersiz değer: beklenen ${m(z.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Çok büyük: beklenen ${z.origin??"değer"} ${A}${z.maximum.toString()} ${J.unit??"öğe"}`;return`Çok büyük: beklenen ${z.origin??"değer"} ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Çok küçük: beklenen ${z.origin} ${A}${z.minimum.toString()} ${J.unit}`;return`Çok küçük: beklenen ${z.origin} ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Geçersiz metin: "${A.prefix}" ile başlamalı`;if(A.format==="ends_with")return`Geçersiz metin: "${A.suffix}" ile bitmeli`;if(A.format==="includes")return`Geçersiz metin: "${A.includes}" içermeli`;if(A.format==="regex")return`Geçersiz metin: ${A.pattern} desenine uymalı`;return`Geçersiz ${b[A.format]??z.format}`}case"not_multiple_of":return`Geçersiz sayı: ${z.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${z.keys.length>1?"lar":""}: ${R(z.keys,", ")}`;case"invalid_key":return`${z.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${z.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function DA(){return{localeError:RV()}}var LV=()=>{let _={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function $(z){return _[z]??null}let b={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:"вхідні дані"},Z={nan:"NaN",number:"число",array:"масив"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Неправильні вхідні дані: очікується instanceof ${z.expected}, отримано ${U}`;return`Неправильні вхідні дані: очікується ${A}, отримано ${U}`}case"invalid_value":if(z.values.length===1)return`Неправильні вхідні дані: очікується ${m(z.values[0])}`;return`Неправильна опція: очікується одне з ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Занадто велике: очікується, що ${z.origin??"значення"} ${J.verb} ${A}${z.maximum.toString()} ${J.unit??"елементів"}`;return`Занадто велике: очікується, що ${z.origin??"значення"} буде ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Занадто мале: очікується, що ${z.origin} ${J.verb} ${A}${z.minimum.toString()} ${J.unit}`;return`Занадто мале: очікується, що ${z.origin} буде ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Неправильний рядок: повинен починатися з "${A.prefix}"`;if(A.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${A.suffix}"`;if(A.format==="includes")return`Неправильний рядок: повинен містити "${A.includes}"`;if(A.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${A.pattern}`;return`Неправильний ${b[A.format]??z.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${z.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${z.keys.length>1?"і":""}: ${R(z.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${z.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${z.origin}`;default:return"Неправильні вхідні дані"}}};function j$(){return{localeError:LV()}}function VA(){return j$()}var TV=()=>{let _={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function $(z){return _[z]??null}let b={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:"ان پٹ"},Z={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`غلط ان پٹ: instanceof ${z.expected} متوقع تھا، ${U} موصول ہوا`;return`غلط ان پٹ: ${A} متوقع تھا، ${U} موصول ہوا`}case"invalid_value":if(z.values.length===1)return`غلط ان پٹ: ${m(z.values[0])} متوقع تھا`;return`غلط آپشن: ${R(z.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`بہت بڑا: ${z.origin??"ویلیو"} کے ${A}${z.maximum.toString()} ${J.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${z.origin??"ویلیو"} کا ${A}${z.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`بہت چھوٹا: ${z.origin} کے ${A}${z.minimum.toString()} ${J.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${z.origin} کا ${A}${z.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`غلط سٹرنگ: "${A.prefix}" سے شروع ہونا چاہیے`;if(A.format==="ends_with")return`غلط سٹرنگ: "${A.suffix}" پر ختم ہونا چاہیے`;if(A.format==="includes")return`غلط سٹرنگ: "${A.includes}" شامل ہونا چاہیے`;if(A.format==="regex")return`غلط سٹرنگ: پیٹرن ${A.pattern} سے میچ ہونا چاہیے`;return`غلط ${b[A.format]??z.format}`}case"not_multiple_of":return`غلط نمبر: ${z.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${z.keys.length>1?"ز":""}: ${R(z.keys,"، ")}`;case"invalid_key":return`${z.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${z.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function gA(){return{localeError:TV()}}var yV=()=>{let _={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function $(z){return _[z]??null}let b={regex:"kirish",email:"elektron pochta manzili",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 sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},Z={nan:"NaN",number:"raqam",array:"massiv"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${z.expected}, qabul qilingan ${U}`;return`Noto‘g‘ri kirish: kutilgan ${A}, qabul qilingan ${U}`}case"invalid_value":if(z.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${m(z.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Juda katta: kutilgan ${z.origin??"qiymat"} ${A}${z.maximum.toString()} ${J.unit} ${J.verb}`;return`Juda katta: kutilgan ${z.origin??"qiymat"} ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Juda kichik: kutilgan ${z.origin} ${A}${z.minimum.toString()} ${J.unit} ${J.verb}`;return`Juda kichik: kutilgan ${z.origin} ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Noto‘g‘ri satr: "${A.prefix}" bilan boshlanishi kerak`;if(A.format==="ends_with")return`Noto‘g‘ri satr: "${A.suffix}" bilan tugashi kerak`;if(A.format==="includes")return`Noto‘g‘ri satr: "${A.includes}" ni o‘z ichiga olishi kerak`;if(A.format==="regex")return`Noto‘g‘ri satr: ${A.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${b[A.format]??z.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${z.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${z.keys.length>1?"lar":""}: ${R(z.keys,", ")}`;case"invalid_key":return`${z.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${z.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function kA(){return{localeError:yV()}}var CV=()=>{let _={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 $(z){return _[z]??null}let b={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"},Z={nan:"NaN",number:"số",array:"mảng"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${z.expected}, nhận được ${U}`;return`Đầu vào không hợp lệ: mong đợi ${A}, nhận được ${U}`}case"invalid_value":if(z.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${m(z.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Quá lớn: mong đợi ${z.origin??"giá trị"} ${J.verb} ${A}${z.maximum.toString()} ${J.unit??"phần tử"}`;return`Quá lớn: mong đợi ${z.origin??"giá trị"} ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Quá nhỏ: mong đợi ${z.origin} ${J.verb} ${A}${z.minimum.toString()} ${J.unit}`;return`Quá nhỏ: mong đợi ${z.origin} ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${A.prefix}"`;if(A.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${A.suffix}"`;if(A.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${A.includes}"`;if(A.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${A.pattern}`;return`${b[A.format]??z.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 ${z.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${R(z.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${z.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 ${z.origin}`;default:return"Đầu vào không hợp lệ"}}};function WA(){return{localeError:CV()}}var fV=()=>{let _={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function $(z){return _[z]??null}let b={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:"输入"},Z={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`无效输入:期望 instanceof ${z.expected},实际接收 ${U}`;return`无效输入:期望 ${A},实际接收 ${U}`}case"invalid_value":if(z.values.length===1)return`无效输入:期望 ${m(z.values[0])}`;return`无效选项:期望以下之一 ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`数值过大:期望 ${z.origin??"值"} ${A}${z.maximum.toString()} ${J.unit??"个元素"}`;return`数值过大:期望 ${z.origin??"值"} ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`数值过小:期望 ${z.origin} ${A}${z.minimum.toString()} ${J.unit}`;return`数值过小:期望 ${z.origin} ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`无效字符串:必须以 "${A.prefix}" 开头`;if(A.format==="ends_with")return`无效字符串:必须以 "${A.suffix}" 结尾`;if(A.format==="includes")return`无效字符串:必须包含 "${A.includes}"`;if(A.format==="regex")return`无效字符串:必须满足正则表达式 ${A.pattern}`;return`无效${b[A.format]??z.format}`}case"not_multiple_of":return`无效数字:必须是 ${z.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${R(z.keys,", ")}`;case"invalid_key":return`${z.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${z.origin} 中包含无效值(value)`;default:return"无效输入"}}};function wA(){return{localeError:fV()}}var mV=()=>{let _={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function $(z){return _[z]??null}let b={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:"輸入"},Z={nan:"NaN"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`無效的輸入值:預期為 instanceof ${z.expected},但收到 ${U}`;return`無效的輸入值:預期為 ${A},但收到 ${U}`}case"invalid_value":if(z.values.length===1)return`無效的輸入值:預期為 ${m(z.values[0])}`;return`無效的選項:預期為以下其中之一 ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`數值過大:預期 ${z.origin??"值"} 應為 ${A}${z.maximum.toString()} ${J.unit??"個元素"}`;return`數值過大:預期 ${z.origin??"值"} 應為 ${A}${z.maximum.toString()}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`數值過小:預期 ${z.origin} 應為 ${A}${z.minimum.toString()} ${J.unit}`;return`數值過小:預期 ${z.origin} 應為 ${A}${z.minimum.toString()}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`無效的字串:必須以 "${A.prefix}" 開頭`;if(A.format==="ends_with")return`無效的字串:必須以 "${A.suffix}" 結尾`;if(A.format==="includes")return`無效的字串:必須包含 "${A.includes}"`;if(A.format==="regex")return`無效的字串:必須符合格式 ${A.pattern}`;return`無效的 ${b[A.format]??z.format}`}case"not_multiple_of":return`無效的數字:必須為 ${z.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${z.keys.length>1?"們":""}:${R(z.keys,"、")}`;case"invalid_key":return`${z.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${z.origin} 中有無效的值`;default:return"無效的輸入值"}}};function BA(){return{localeError:mV()}}var uV=()=>{let _={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function $(z){return _[z]??null}let b={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",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:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},Z={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(z)=>{switch(z.code){case"invalid_type":{let A=Z[z.expected]??z.expected,J=c(z.input),U=Z[J]??J;if(/^[A-Z]/.test(z.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${z.expected}, àmọ̀ a rí ${U}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${A}, àmọ̀ a rí ${U}`}case"invalid_value":if(z.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${m(z.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${R(z.values,"|")}`;case"too_big":{let A=z.inclusive?"<=":"<",J=$(z.origin);if(J)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${z.origin??"iye"} ${J.verb} ${A}${z.maximum} ${J.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${A}${z.maximum}`}case"too_small":{let A=z.inclusive?">=":">",J=$(z.origin);if(J)return`Kéré ju: a ní láti jẹ́ pé ${z.origin} ${J.verb} ${A}${z.minimum} ${J.unit}`;return`Kéré ju: a ní láti jẹ́ ${A}${z.minimum}`}case"invalid_format":{let A=z;if(A.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${A.prefix}"`;if(A.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${A.suffix}"`;if(A.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${A.includes}"`;if(A.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${A.pattern}`;return`Aṣìṣe: ${b[A.format]??z.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${z.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${R(z.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${z.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${z.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function xA(){return{localeError:uV()}}var GY,NA=Symbol("ZodOutput"),IA=Symbol("ZodInput");class MA{constructor(){this._map=new WeakMap,this._idmap=new Map}add(_,...$){let b=$[0];if(this._map.set(_,b),b&&typeof b==="object"&&"id"in b)this._idmap.set(b.id,_);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(_){let $=this._map.get(_);if($&&typeof $==="object"&&"id"in $)this._idmap.delete($.id);return this._map.delete(_),this}get(_){let $=_._zod.parent;if($){let b={...this.get($)??{}};delete b.id;let Z={...b,...this._map.get(_)};return Object.keys(Z).length?Z:void 0}return this._map.get(_)}has(_){return this._map.has(_)}}function Y1(){return new MA}(GY=globalThis).__zod_globalRegistry??(GY.__zod_globalRegistry=Y1());var E0=globalThis.__zod_globalRegistry;function EA(_,$){return new _({type:"string",...r($)})}function OA(_,$){return new _({type:"string",coerce:!0,...r($)})}function X1(_,$){return new _({type:"string",format:"email",check:"string_format",abort:!1,...r($)})}function R$(_,$){return new _({type:"string",format:"guid",check:"string_format",abort:!1,...r($)})}function Q1(_,$){return new _({type:"string",format:"uuid",check:"string_format",abort:!1,...r($)})}function K1(_,$){return new _({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...r($)})}function F1(_,$){return new _({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...r($)})}function v1(_,$){return new _({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...r($)})}function L$(_,$){return new _({type:"string",format:"url",check:"string_format",abort:!1,...r($)})}function H1(_,$){return new _({type:"string",format:"emoji",check:"string_format",abort:!1,...r($)})}function q1(_,$){return new _({type:"string",format:"nanoid",check:"string_format",abort:!1,...r($)})}function D1(_,$){return new _({type:"string",format:"cuid",check:"string_format",abort:!1,...r($)})}function V1(_,$){return new _({type:"string",format:"cuid2",check:"string_format",abort:!1,...r($)})}function g1(_,$){return new _({type:"string",format:"ulid",check:"string_format",abort:!1,...r($)})}function k1(_,$){return new _({type:"string",format:"xid",check:"string_format",abort:!1,...r($)})}function W1(_,$){return new _({type:"string",format:"ksuid",check:"string_format",abort:!1,...r($)})}function w1(_,$){return new _({type:"string",format:"ipv4",check:"string_format",abort:!1,...r($)})}function B1(_,$){return new _({type:"string",format:"ipv6",check:"string_format",abort:!1,...r($)})}function PA(_,$){return new _({type:"string",format:"mac",check:"string_format",abort:!1,...r($)})}function x1(_,$){return new _({type:"string",format:"cidrv4",check:"string_format",abort:!1,...r($)})}function N1(_,$){return new _({type:"string",format:"cidrv6",check:"string_format",abort:!1,...r($)})}function I1(_,$){return new _({type:"string",format:"base64",check:"string_format",abort:!1,...r($)})}function M1(_,$){return new _({type:"string",format:"base64url",check:"string_format",abort:!1,...r($)})}function E1(_,$){return new _({type:"string",format:"e164",check:"string_format",abort:!1,...r($)})}function O1(_,$){return new _({type:"string",format:"jwt",check:"string_format",abort:!1,...r($)})}var jA={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function SA(_,$){return new _({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...r($)})}function RA(_,$){return new _({type:"string",format:"date",check:"string_format",...r($)})}function LA(_,$){return new _({type:"string",format:"time",check:"string_format",precision:null,...r($)})}function TA(_,$){return new _({type:"string",format:"duration",check:"string_format",...r($)})}function yA(_,$){return new _({type:"number",checks:[],...r($)})}function CA(_,$){return new _({type:"number",coerce:!0,checks:[],...r($)})}function fA(_,$){return new _({type:"number",check:"number_format",abort:!1,format:"safeint",...r($)})}function mA(_,$){return new _({type:"number",check:"number_format",abort:!1,format:"float32",...r($)})}function uA(_,$){return new _({type:"number",check:"number_format",abort:!1,format:"float64",...r($)})}function cA(_,$){return new _({type:"number",check:"number_format",abort:!1,format:"int32",...r($)})}function hA(_,$){return new _({type:"number",check:"number_format",abort:!1,format:"uint32",...r($)})}function rA(_,$){return new _({type:"boolean",...r($)})}function nA(_,$){return new _({type:"boolean",coerce:!0,...r($)})}function lA(_,$){return new _({type:"bigint",...r($)})}function pA(_,$){return new _({type:"bigint",coerce:!0,...r($)})}function dA(_,$){return new _({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...r($)})}function iA(_,$){return new _({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...r($)})}function oA(_,$){return new _({type:"symbol",...r($)})}function aA(_,$){return new _({type:"undefined",...r($)})}function eA(_,$){return new _({type:"null",...r($)})}function tA(_){return new _({type:"any"})}function sA(_){return new _({type:"unknown"})}function _8(_,$){return new _({type:"never",...r($)})}function $8(_,$){return new _({type:"void",...r($)})}function z8(_,$){return new _({type:"date",...r($)})}function b8(_,$){return new _({type:"date",coerce:!0,...r($)})}function Z8(_,$){return new _({type:"nan",...r($)})}function S_(_,$){return new e2({check:"less_than",...r($),value:_,inclusive:!1})}function z_(_,$){return new e2({check:"less_than",...r($),value:_,inclusive:!0})}function R_(_,$){return new t2({check:"greater_than",...r($),value:_,inclusive:!1})}function C0(_,$){return new t2({check:"greater_than",...r($),value:_,inclusive:!0})}function P1(_){return R_(0,_)}function j1(_){return S_(0,_)}function S1(_){return z_(0,_)}function R1(_){return C0(0,_)}function g4(_,$){return new ZZ({check:"multiple_of",...r($),value:_})}function k4(_,$){return new UZ({check:"max_size",...r($),maximum:_})}function L_(_,$){return new GZ({check:"min_size",...r($),minimum:_})}function m4(_,$){return new YZ({check:"size_equals",...r($),size:_})}function u4(_,$){return new XZ({check:"max_length",...r($),maximum:_})}function _4(_,$){return new QZ({check:"min_length",...r($),minimum:_})}function c4(_,$){return new KZ({check:"length_equals",...r($),length:_})}function q9(_,$){return new FZ({check:"string_format",format:"regex",...r($),pattern:_})}function D9(_){return new vZ({check:"string_format",format:"lowercase",...r(_)})}function V9(_){return new HZ({check:"string_format",format:"uppercase",...r(_)})}function g9(_,$){return new qZ({check:"string_format",format:"includes",...r($),includes:_})}function k9(_,$){return new DZ({check:"string_format",format:"starts_with",...r($),prefix:_})}function W9(_,$){return new VZ({check:"string_format",format:"ends_with",...r($),suffix:_})}function L1(_,$,b){return new gZ({check:"property",property:_,schema:$,...r(b)})}function w9(_,$){return new kZ({check:"mime_type",mime:_,...r($)})}function W_(_){return new WZ({check:"overwrite",tx:_})}function B9(_){return W_(($)=>$.normalize(_))}function x9(){return W_((_)=>_.trim())}function N9(){return W_((_)=>_.toLowerCase())}function I9(){return W_((_)=>_.toUpperCase())}function M9(){return W_((_)=>gb(_))}function A8(_,$,b){return new _({type:"array",element:$,...r(b)})}function hV(_,$,b){return new _({type:"union",options:$,...r(b)})}function rV(_,$,b){return new _({type:"union",options:$,inclusive:!1,...r(b)})}function nV(_,$,b,Z){return new _({type:"union",options:b,discriminator:$,...r(Z)})}function lV(_,$,b){return new _({type:"intersection",left:$,right:b})}function pV(_,$,b,Z){let z=b instanceof i;return new _({type:"tuple",items:$,rest:z?b:null,...r(z?Z:b)})}function dV(_,$,b,Z){return new _({type:"record",keyType:$,valueType:b,...r(Z)})}function iV(_,$,b,Z){return new _({type:"map",keyType:$,valueType:b,...r(Z)})}function oV(_,$,b){return new _({type:"set",valueType:$,...r(b)})}function aV(_,$,b){let Z=Array.isArray($)?Object.fromEntries($.map((z)=>[z,z])):$;return new _({type:"enum",entries:Z,...r(b)})}function eV(_,$,b){return new _({type:"enum",entries:$,...r(b)})}function tV(_,$,b){return new _({type:"literal",values:Array.isArray($)?$:[$],...r(b)})}function J8(_,$){return new _({type:"file",...r($)})}function sV(_,$){return new _({type:"transform",transform:$})}function _g(_,$){return new _({type:"optional",innerType:$})}function $g(_,$){return new _({type:"nullable",innerType:$})}function zg(_,$,b){return new _({type:"default",innerType:$,get defaultValue(){return typeof b==="function"?b():Wb(b)}})}function bg(_,$,b){return new _({type:"nonoptional",innerType:$,...r(b)})}function Zg(_,$){return new _({type:"success",innerType:$})}function Ag(_,$,b){return new _({type:"catch",innerType:$,catchValue:typeof b==="function"?b:()=>b})}function Jg(_,$,b){return new _({type:"pipe",in:$,out:b})}function Ug(_,$){return new _({type:"readonly",innerType:$})}function Gg(_,$,b){return new _({type:"template_literal",parts:$,...r(b)})}function Yg(_,$){return new _({type:"lazy",getter:$})}function Xg(_,$){return new _({type:"promise",innerType:$})}function U8(_,$,b){let Z=r(b);return Z.abort??(Z.abort=!0),new _({type:"custom",check:"custom",fn:$,...Z})}function G8(_,$,b){return new _({type:"custom",check:"custom",fn:$,...r(b)})}function Y8(_){let $=YY((b)=>{return b.addIssue=(Z)=>{if(typeof Z==="string")b.issues.push(Y9(Z,b.value,$._zod.def));else{let z=Z;if(z.fatal)z.continue=!1;z.code??(z.code="custom"),z.input??(z.input=b.value),z.inst??(z.inst=$),z.continue??(z.continue=!$._zod.def.abort),b.issues.push(Y9(z))}},_(b.value,b)});return $}function YY(_,$){let b=new K0({check:"custom",...r($)});return b._zod.check=_,b}function X8(_){let $=new K0({check:"describe"});return $._zod.onattach=[(b)=>{let Z=E0.get(b)??{};E0.add(b,{...Z,description:_})}],$._zod.check=()=>{},$}function Q8(_){let $=new K0({check:"meta"});return $._zod.onattach=[(b)=>{let Z=E0.get(b)??{};E0.add(b,{...Z,..._})}],$._zod.check=()=>{},$}function K8(_,$){let b=r($),Z=b.truthy??["true","1","yes","on","y","enabled"],z=b.falsy??["false","0","no","off","n","disabled"];if(b.case!=="sensitive")Z=Z.map((v)=>typeof v==="string"?v.toLowerCase():v),z=z.map((v)=>typeof v==="string"?v.toLowerCase():v);let A=new Set(Z),J=new Set(z),U=_.Codec??M$,G=_.Boolean??N$,X=new(_.String??f4)({type:"string",error:b.error}),Q=new G({type:"boolean",error:b.error}),K=new U({type:"pipe",in:X,out:Q,transform:(v,D)=>{let w=v;if(b.case!=="sensitive")w=w.toLowerCase();if(A.has(w))return!0;else if(J.has(w))return!1;else return D.issues.push({code:"invalid_value",expected:"stringbool",values:[...A,...J],input:D.value,inst:K,continue:!1}),{}},reverseTransform:(v,D)=>{if(v===!0)return Z[0]||"true";else return z[0]||"false"},error:b.error});return K}function E9(_,$,b,Z={}){let z=r(Z),A={...r(Z),check:"string_format",type:"string",format:$,fn:typeof b==="function"?b:(U)=>b.test(U),...z};if(b instanceof RegExp)A.pattern=b;return new _(A)}function W4(_){let $=_?.target??"draft-2020-12";if($==="draft-4")$="draft-04";if($==="draft-7")$="draft-07";return{processors:_.processors??{},metadataRegistry:_?.metadata??E0,target:$,unrepresentable:_?.unrepresentable??"throw",override:_?.override??(()=>{}),io:_?.io??"output",counter:0,seen:new Map,cycles:_?.cycles??"ref",reused:_?.reused??"inline",external:_?.external??void 0}}function A0(_,$,b={path:[],schemaPath:[]}){var Z;let z=_._zod.def,A=$.seen.get(_);if(A){if(A.count++,b.schemaPath.includes(_))A.cycle=b.path;return A.schema}let J={schema:{},count:1,cycle:void 0,path:b.path};$.seen.set(_,J);let U=_._zod.toJSONSchema?.();if(U)J.schema=U;else{let X={...b,schemaPath:[...b.schemaPath,_],path:b.path};if(_._zod.processJSONSchema)_._zod.processJSONSchema($,J.schema,X);else{let K=J.schema,v=$.processors[z.type];if(!v)throw Error(`[toJSONSchema]: Non-representable type encountered: ${z.type}`);v(_,$,K,X)}let Q=_._zod.parent;if(Q){if(!J.ref)J.ref=Q;A0(Q,$,X),$.seen.get(Q).isParent=!0}}let G=$.metadataRegistry.get(_);if(G)Object.assign(J.schema,G);if($.io==="input"&&f0(_))delete J.schema.examples,delete J.schema.default;if($.io==="input"&&J.schema._prefault)(Z=J.schema).default??(Z.default=J.schema._prefault);return delete J.schema._prefault,$.seen.get(_).schema}function w4(_,$){let b=_.seen.get($);if(!b)throw Error("Unprocessed schema. This is a bug in Zod.");let Z=new Map;for(let J of _.seen.entries()){let U=_.metadataRegistry.get(J[0])?.id;if(U){let G=Z.get(U);if(G&&G!==J[0])throw Error(`Duplicate schema id "${U}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);Z.set(U,J[0])}}let z=(J)=>{let U=_.target==="draft-2020-12"?"$defs":"definitions";if(_.external){let Q=_.external.registry.get(J[0])?.id,K=_.external.uri??((D)=>D);if(Q)return{ref:K(Q)};let v=J[1].defId??J[1].schema.id??`schema${_.counter++}`;return J[1].defId=v,{defId:v,ref:`${K("__shared")}#/${U}/${v}`}}if(J[1]===b)return{ref:"#"};let Y=`${"#"}/${U}/`,X=J[1].schema.id??`__schema${_.counter++}`;return{defId:X,ref:Y+X}},A=(J)=>{if(J[1].schema.$ref)return;let U=J[1],{ref:G,defId:Y}=z(J);if(U.def={...U.schema},Y)U.defId=Y;let X=U.schema;for(let Q in X)delete X[Q];X.$ref=G};if(_.cycles==="throw")for(let J of _.seen.entries()){let U=J[1];if(U.cycle)throw Error(`Cycle detected: #/${U.cycle?.join("/")}/<root>
88
88
 
89
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let J of _.seen.entries()){let U=J[1];if($===J[0]){A(J);continue}if(_.external){let Y=_.external.registry.get(J[0])?.id;if($!==J[0]&&Y){A(J);continue}}if(_.metadataRegistry.get(J[0])?.id){A(J);continue}if(U.cycle){A(J);continue}if(U.count>1){if(_.reused==="ref"){A(J);continue}}}}function D4(_,$){let b=_.seen.get($);if(!b)throw Error("Unprocessed schema. This is a bug in Zod.");let Z=(J)=>{let U=_.seen.get(J);if(U.ref===null)return;let G=U.def??U.schema,Y={...G},X=U.ref;if(U.ref=null,X){Z(X);let K=_.seen.get(X),v=K.schema;if(v.$ref&&(_.target==="draft-07"||_.target==="draft-04"||_.target==="openapi-3.0"))G.allOf=G.allOf??[],G.allOf.push(v);else Object.assign(G,v);if(Object.assign(G,Y),J._zod.parent===X)for(let w in G){if(w==="$ref"||w==="allOf")continue;if(!(w in Y))delete G[w]}if(v.$ref&&K.def)for(let w in G){if(w==="$ref"||w==="allOf")continue;if(w in K.def&&JSON.stringify(G[w])===JSON.stringify(K.def[w]))delete G[w]}}let Q=J._zod.parent;if(Q&&Q!==X){Z(Q);let K=_.seen.get(Q);if(K?.schema.$ref){if(G.$ref=K.schema.$ref,K.def)for(let v in G){if(v==="$ref"||v==="allOf")continue;if(v in K.def&&JSON.stringify(G[v])===JSON.stringify(K.def[v]))delete G[v]}}}_.override({zodSchema:J,jsonSchema:G,path:U.path??[]})};for(let J of[..._.seen.entries()].reverse())Z(J[0]);let z={};if(_.target==="draft-2020-12")z.$schema="https://json-schema.org/draft/2020-12/schema";else if(_.target==="draft-07")z.$schema="http://json-schema.org/draft-07/schema#";else if(_.target==="draft-04")z.$schema="http://json-schema.org/draft-04/schema#";else if(_.target==="openapi-3.0");if(_.external?.uri){let J=_.external.registry.get($)?.id;if(!J)throw Error("Schema is missing an `id` property");z.$id=_.external.uri(J)}Object.assign(z,b.def??b.schema);let A=_.external?.defs??{};for(let J of _.seen.entries()){let U=J[1];if(U.def&&U.defId)A[U.defId]=U.def}if(_.external);else if(Object.keys(A).length>0)if(_.target==="draft-2020-12")z.$defs=A;else z.definitions=A;try{let J=JSON.parse(JSON.stringify(z));return Object.defineProperty(J,"~standard",{value:{...$["~standard"],jsonSchema:{input:O9($,"input",_.processors),output:O9($,"output",_.processors)}},enumerable:!1,writable:!1}),J}catch(J){throw Error("Error converting schema to JSON.")}}function f0(_,$){let b=$??{seen:new Set};if(b.seen.has(_))return!1;b.seen.add(_);let Z=_._zod.def;if(Z.type==="transform")return!0;if(Z.type==="array")return f0(Z.element,b);if(Z.type==="set")return f0(Z.valueType,b);if(Z.type==="lazy")return f0(Z.getter(),b);if(Z.type==="promise"||Z.type==="optional"||Z.type==="nonoptional"||Z.type==="nullable"||Z.type==="readonly"||Z.type==="default"||Z.type==="prefault")return f0(Z.innerType,b);if(Z.type==="intersection")return f0(Z.left,b)||f0(Z.right,b);if(Z.type==="record"||Z.type==="map")return f0(Z.keyType,b)||f0(Z.valueType,b);if(Z.type==="pipe")return f0(Z.in,b)||f0(Z.out,b);if(Z.type==="object"){for(let z in Z.shape)if(f0(Z.shape[z],b))return!0;return!1}if(Z.type==="union"){for(let z of Z.options)if(f0(z,b))return!0;return!1}if(Z.type==="tuple"){for(let z of Z.items)if(f0(z,b))return!0;if(Z.rest&&f0(Z.rest,b))return!0;return!1}return!1}var Y8=(_,$={})=>(b)=>{let Z=q4({...b,processors:$});return A0(_,Z),V4(Z,_),D4(Z,_)},O9=(_,$,b={})=>(Z)=>{let{libraryOptions:z,target:A}=Z??{},J=q4({...z??{},target:A,io:$,processors:b});return A0(_,J),V4(J,_),D4(J,_)};var Ak={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},X8=(_,$,b,Z)=>{let z=b;z.type="string";let{minimum:A,maximum:J,format:U,patterns:G,contentEncoding:Y}=_._zod.bag;if(typeof A==="number")z.minLength=A;if(typeof J==="number")z.maxLength=J;if(U){if(z.format=Ak[U]??U,z.format==="")delete z.format;if(U==="time")delete z.format}if(Y)z.contentEncoding=Y;if(G&&G.size>0){let X=[...G];if(X.length===1)z.pattern=X[0].source;else if(X.length>1)z.allOf=[...X.map((Q)=>({...$.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"?{type:"string"}:{},pattern:Q.source}))]}},Q8=(_,$,b,Z)=>{let z=b,{minimum:A,maximum:J,format:U,multipleOf:G,exclusiveMaximum:Y,exclusiveMinimum:X}=_._zod.bag;if(typeof U==="string"&&U.includes("int"))z.type="integer";else z.type="number";if(typeof X==="number")if($.target==="draft-04"||$.target==="openapi-3.0")z.minimum=X,z.exclusiveMinimum=!0;else z.exclusiveMinimum=X;if(typeof A==="number"){if(z.minimum=A,typeof X==="number"&&$.target!=="draft-04")if(X>=A)delete z.minimum;else delete z.exclusiveMinimum}if(typeof Y==="number")if($.target==="draft-04"||$.target==="openapi-3.0")z.maximum=Y,z.exclusiveMaximum=!0;else z.exclusiveMaximum=Y;if(typeof J==="number"){if(z.maximum=J,typeof Y==="number"&&$.target!=="draft-04")if(Y<=J)delete z.maximum;else delete z.exclusiveMaximum}if(typeof G==="number")z.multipleOf=G},K8=(_,$,b,Z)=>{b.type="boolean"},v8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},F8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},H8=(_,$,b,Z)=>{if($.target==="openapi-3.0")b.type="string",b.nullable=!0,b.enum=[null];else b.type="null"},q8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},V8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},D8=(_,$,b,Z)=>{b.not={}},k8=(_,$,b,Z)=>{},W8=(_,$,b,Z)=>{},g8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},B8=(_,$,b,Z)=>{let z=_._zod.def,A=H$(z.entries);if(A.every((J)=>typeof J==="number"))b.type="number";if(A.every((J)=>typeof J==="string"))b.type="string";b.enum=A},w8=(_,$,b,Z)=>{let z=_._zod.def,A=[];for(let J of z.values)if(J===void 0){if($.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof J==="bigint")if($.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else A.push(Number(J));else A.push(J);if(A.length===0);else if(A.length===1){let J=A[0];if(b.type=J===null?"null":typeof J,$.target==="draft-04"||$.target==="openapi-3.0")b.enum=[J];else b.const=J}else{if(A.every((J)=>typeof J==="number"))b.type="number";if(A.every((J)=>typeof J==="string"))b.type="string";if(A.every((J)=>typeof J==="boolean"))b.type="boolean";if(A.every((J)=>J===null))b.type="null";b.enum=A}},x8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},N8=(_,$,b,Z)=>{let z=b,A=_._zod.pattern;if(!A)throw Error("Pattern not found in template literal");z.type="string",z.pattern=A.source},I8=(_,$,b,Z)=>{let z=b,A={type:"string",format:"binary",contentEncoding:"binary"},{minimum:J,maximum:U,mime:G}=_._zod.bag;if(J!==void 0)A.minLength=J;if(U!==void 0)A.maxLength=U;if(G)if(G.length===1)A.contentMediaType=G[0],Object.assign(z,A);else Object.assign(z,A),z.anyOf=G.map((Y)=>({contentMediaType:Y}));else Object.assign(z,A)},M8=(_,$,b,Z)=>{b.type="boolean"},E8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},O8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},P8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},j8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},S8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},R8=(_,$,b,Z)=>{let z=b,A=_._zod.def,{minimum:J,maximum:U}=_._zod.bag;if(typeof J==="number")z.minItems=J;if(typeof U==="number")z.maxItems=U;z.type="array",z.items=A0(A.element,$,{...Z,path:[...Z.path,"items"]})},L8=(_,$,b,Z)=>{let z=b,A=_._zod.def;z.type="object",z.properties={};let J=A.shape;for(let Y in J)z.properties[Y]=A0(J[Y],$,{...Z,path:[...Z.path,"properties",Y]});let U=new Set(Object.keys(J)),G=new Set([...U].filter((Y)=>{let X=A.shape[Y]._zod;if($.io==="input")return X.optin===void 0;else return X.optout===void 0}));if(G.size>0)z.required=Array.from(G);if(A.catchall?._zod.def.type==="never")z.additionalProperties=!1;else if(!A.catchall){if($.io==="output")z.additionalProperties=!1}else if(A.catchall)z.additionalProperties=A0(A.catchall,$,{...Z,path:[...Z.path,"additionalProperties"]})},C1=(_,$,b,Z)=>{let z=_._zod.def,A=z.inclusive===!1,J=z.options.map((U,G)=>A0(U,$,{...Z,path:[...Z.path,A?"oneOf":"anyOf",G]}));if(A)b.oneOf=J;else b.anyOf=J},T8=(_,$,b,Z)=>{let z=_._zod.def,A=A0(z.left,$,{...Z,path:[...Z.path,"allOf",0]}),J=A0(z.right,$,{...Z,path:[...Z.path,"allOf",1]}),U=(Y)=>("allOf"in Y)&&Object.keys(Y).length===1,G=[...U(A)?A.allOf:[A],...U(J)?J.allOf:[J]];b.allOf=G},y8=(_,$,b,Z)=>{let z=b,A=_._zod.def;z.type="array";let J=$.target==="draft-2020-12"?"prefixItems":"items",U=$.target==="draft-2020-12"?"items":$.target==="openapi-3.0"?"items":"additionalItems",G=A.items.map((K,v)=>A0(K,$,{...Z,path:[...Z.path,J,v]})),Y=A.rest?A0(A.rest,$,{...Z,path:[...Z.path,U,...$.target==="openapi-3.0"?[A.items.length]:[]]}):null;if($.target==="draft-2020-12"){if(z.prefixItems=G,Y)z.items=Y}else if($.target==="openapi-3.0"){if(z.items={anyOf:G},Y)z.items.anyOf.push(Y);if(z.minItems=G.length,!Y)z.maxItems=G.length}else if(z.items=G,Y)z.additionalItems=Y;let{minimum:X,maximum:Q}=_._zod.bag;if(typeof X==="number")z.minItems=X;if(typeof Q==="number")z.maxItems=Q},C8=(_,$,b,Z)=>{let z=b,A=_._zod.def;z.type="object";let J=A.keyType,G=J._zod.bag?.patterns;if(A.mode==="loose"&&G&&G.size>0){let X=A0(A.valueType,$,{...Z,path:[...Z.path,"patternProperties","*"]});z.patternProperties={};for(let Q of G)z.patternProperties[Q.source]=X}else{if($.target==="draft-07"||$.target==="draft-2020-12")z.propertyNames=A0(A.keyType,$,{...Z,path:[...Z.path,"propertyNames"]});z.additionalProperties=A0(A.valueType,$,{...Z,path:[...Z.path,"additionalProperties"]})}let Y=J._zod.values;if(Y){let X=[...Y].filter((Q)=>typeof Q==="string"||typeof Q==="number");if(X.length>0)z.required=X}},f8=(_,$,b,Z)=>{let z=_._zod.def,A=A0(z.innerType,$,Z),J=$.seen.get(_);if($.target==="openapi-3.0")J.ref=z.innerType,b.nullable=!0;else b.anyOf=[A,{type:"null"}]},m8=(_,$,b,Z)=>{let z=_._zod.def;A0(z.innerType,$,Z);let A=$.seen.get(_);A.ref=z.innerType},u8=(_,$,b,Z)=>{let z=_._zod.def;A0(z.innerType,$,Z);let A=$.seen.get(_);A.ref=z.innerType,b.default=JSON.parse(JSON.stringify(z.defaultValue))},h8=(_,$,b,Z)=>{let z=_._zod.def;A0(z.innerType,$,Z);let A=$.seen.get(_);if(A.ref=z.innerType,$.io==="input")b._prefault=JSON.parse(JSON.stringify(z.defaultValue))},c8=(_,$,b,Z)=>{let z=_._zod.def;A0(z.innerType,$,Z);let A=$.seen.get(_);A.ref=z.innerType;let J;try{J=z.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}b.default=J},r8=(_,$,b,Z)=>{let z=_._zod.def,A=$.io==="input"?z.in._zod.def.type==="transform"?z.out:z.in:z.out;A0(A,$,Z);let J=$.seen.get(_);J.ref=A},n8=(_,$,b,Z)=>{let z=_._zod.def;A0(z.innerType,$,Z);let A=$.seen.get(_);A.ref=z.innerType,b.readOnly=!0},l8=(_,$,b,Z)=>{let z=_._zod.def;A0(z.innerType,$,Z);let A=$.seen.get(_);A.ref=z.innerType},f1=(_,$,b,Z)=>{let z=_._zod.def;A0(z.innerType,$,Z);let A=$.seen.get(_);A.ref=z.innerType},p8=(_,$,b,Z)=>{let z=_._zod.innerType;A0(z,$,Z);let A=$.seen.get(_);A.ref=z},y1={string:X8,number:Q8,boolean:K8,bigint:v8,symbol:F8,null:H8,undefined:q8,void:V8,never:D8,any:k8,unknown:W8,date:g8,enum:B8,literal:w8,nan:x8,template_literal:N8,file:I8,success:M8,custom:E8,function:O8,transform:P8,map:j8,set:S8,array:R8,object:L8,union:C1,intersection:T8,tuple:y8,record:C8,nullable:f8,nonoptional:m8,default:u8,prefault:h8,catch:c8,pipe:r8,readonly:n8,promise:l8,optional:f1,lazy:p8};function m1(_,$){if("_idmap"in _){let Z=_,z=q4({...$,processors:y1}),A={};for(let G of Z._idmap.entries()){let[Y,X]=G;A0(X,z)}let J={},U={registry:Z,uri:$?.uri,defs:A};z.external=U;for(let G of Z._idmap.entries()){let[Y,X]=G;V4(z,X),J[Y]=D4(z,X)}if(Object.keys(A).length>0){let G=z.target==="draft-2020-12"?"$defs":"definitions";J.__shared={[G]:A}}return{schemas:J}}let b=q4({...$,processors:y1});return A0(_,b),V4(b,_),D4(b,_)}class d8{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(_){this.ctx.counter=_}get seen(){return this.ctx.seen}constructor(_){let $=_?.target??"draft-2020-12";if($==="draft-4")$="draft-04";if($==="draft-7")$="draft-07";this.ctx=q4({processors:y1,target:$,..._?.metadata&&{metadata:_.metadata},..._?.unrepresentable&&{unrepresentable:_.unrepresentable},..._?.override&&{override:_.override},..._?.io&&{io:_.io}})}process(_,$={path:[],schemaPath:[]}){return A0(_,this.ctx,$)}emit(_,$){if($){if($.cycles)this.ctx.cycles=$.cycles;if($.reused)this.ctx.reused=$.reused;if($.external)this.ctx.external=$.external}V4(this.ctx,_);let b=D4(this.ctx,_),{"~standard":Z,...z}=b;return z}}var JY={};var y$={};r_(y$,{xor:()=>tY,xid:()=>gY,void:()=>pY,uuidv7:()=>vY,uuidv6:()=>KY,uuidv4:()=>QY,uuid:()=>XY,url:()=>FY,unknown:()=>h4,union:()=>K6,undefined:()=>nY,ulid:()=>WY,uint64:()=>cY,uint32:()=>mY,tuple:()=>M5,transform:()=>F6,templateLiteral:()=>QX,symbol:()=>rY,superRefine:()=>_J,success:()=>GX,stringbool:()=>kX,stringFormat:()=>SY,string:()=>l1,strictObject:()=>aY,set:()=>bX,refine:()=>s5,record:()=>E5,readonly:()=>d5,promise:()=>KX,preprocess:()=>gX,prefault:()=>u5,pipe:()=>u$,partialRecord:()=>_X,optional:()=>f$,object:()=>oY,number:()=>Q5,nullish:()=>UX,nullable:()=>m$,null:()=>q5,nonoptional:()=>h5,never:()=>Q6,nativeEnum:()=>ZX,nanoid:()=>VY,nan:()=>YX,meta:()=>VX,map:()=>zX,mac:()=>xY,looseRecord:()=>$X,looseObject:()=>eY,literal:()=>AX,lazy:()=>a5,ksuid:()=>BY,keyof:()=>iY,jwt:()=>jY,json:()=>WX,ipv6:()=>NY,ipv4:()=>wY,intersection:()=>N5,int64:()=>hY,int32:()=>fY,int:()=>p1,instanceof:()=>DX,httpUrl:()=>HY,hostname:()=>RY,hex:()=>LY,hash:()=>TY,guid:()=>YY,function:()=>vX,float64:()=>CY,float32:()=>yY,file:()=>JX,exactOptional:()=>T5,enum:()=>v6,emoji:()=>qY,email:()=>GY,e164:()=>PY,discriminatedUnion:()=>sY,describe:()=>qX,date:()=>dY,custom:()=>HX,cuid2:()=>kY,cuid:()=>DY,codec:()=>XX,cidrv6:()=>MY,cidrv4:()=>IY,check:()=>FX,catch:()=>n5,boolean:()=>K5,bigint:()=>uY,base64url:()=>OY,base64:()=>EY,array:()=>r$,any:()=>lY,_function:()=>vX,_default:()=>f5,_ZodString:()=>d1,ZodXor:()=>B5,ZodXID:()=>_6,ZodVoid:()=>W5,ZodUnknown:()=>D5,ZodUnion:()=>l$,ZodUndefined:()=>F5,ZodUUID:()=>L_,ZodURL:()=>h$,ZodULID:()=>s1,ZodType:()=>e,ZodTuple:()=>I5,ZodTransform:()=>R5,ZodTemplateLiteral:()=>i5,ZodSymbol:()=>v5,ZodSuccess:()=>c5,ZodStringFormat:()=>Q0,ZodString:()=>S9,ZodSet:()=>P5,ZodRecord:()=>p$,ZodReadonly:()=>p5,ZodPromise:()=>e5,ZodPrefault:()=>m5,ZodPipe:()=>V6,ZodOptional:()=>H6,ZodObject:()=>n$,ZodNumberFormat:()=>c4,ZodNumber:()=>L9,ZodNullable:()=>y5,ZodNull:()=>H5,ZodNonOptional:()=>q6,ZodNever:()=>k5,ZodNanoID:()=>a1,ZodNaN:()=>l5,ZodMap:()=>O5,ZodMAC:()=>X5,ZodLiteral:()=>j5,ZodLazy:()=>o5,ZodKSUID:()=>$6,ZodJWT:()=>Y6,ZodIntersection:()=>x5,ZodIPv6:()=>b6,ZodIPv4:()=>z6,ZodGUID:()=>C$,ZodFunction:()=>t5,ZodFile:()=>S5,ZodExactOptional:()=>L5,ZodEnum:()=>j9,ZodEmoji:()=>o1,ZodEmail:()=>i1,ZodE164:()=>G6,ZodDiscriminatedUnion:()=>w5,ZodDefault:()=>C5,ZodDate:()=>c$,ZodCustomStringFormat:()=>R9,ZodCustom:()=>d$,ZodCodec:()=>D6,ZodCatch:()=>r5,ZodCUID2:()=>t1,ZodCUID:()=>e1,ZodCIDRv6:()=>A6,ZodCIDRv4:()=>Z6,ZodBoolean:()=>T9,ZodBigIntFormat:()=>X6,ZodBigInt:()=>y9,ZodBase64URL:()=>U6,ZodBase64:()=>J6,ZodArray:()=>g5,ZodAny:()=>V5});var u1={};r_(u1,{uppercase:()=>D9,trim:()=>x9,toUpperCase:()=>I9,toLowerCase:()=>N9,startsWith:()=>W9,slugify:()=>M9,size:()=>f4,regex:()=>q9,property:()=>T1,positive:()=>j1,overwrite:()=>W_,normalize:()=>w9,nonpositive:()=>R1,nonnegative:()=>L1,negative:()=>S1,multipleOf:()=>F4,minSize:()=>R_,minLength:()=>o_,mime:()=>B9,maxSize:()=>H4,maxLength:()=>m4,lte:()=>$_,lt:()=>j_,lowercase:()=>V9,length:()=>u4,includes:()=>k9,gte:()=>C0,gt:()=>S_,endsWith:()=>g9});var P9={};r_(P9,{time:()=>a8,duration:()=>e8,datetime:()=>i8,date:()=>o8,ZodISOTime:()=>r1,ZodISODuration:()=>n1,ZodISODateTime:()=>h1,ZodISODate:()=>c1});var h1=I("ZodISODateTime",(_,$)=>{jZ.init(_,$),Q0.init(_,$)});function i8(_){return EA(h1,_)}var c1=I("ZodISODate",(_,$)=>{SZ.init(_,$),Q0.init(_,$)});function o8(_){return OA(c1,_)}var r1=I("ZodISOTime",(_,$)=>{RZ.init(_,$),Q0.init(_,$)});function a8(_){return PA(r1,_)}var n1=I("ZodISODuration",(_,$)=>{LZ.init(_,$),Q0.init(_,$)});function e8(_){return jA(n1,_)}var UY=(_,$)=>{W$.init(_,$),_.name="ZodError",Object.defineProperties(_,{format:{value:(b)=>B$(_,b)},flatten:{value:(b)=>g$(_,b)},addIssue:{value:(b)=>{_.issues.push(b),_.message=JSON.stringify(_.issues,U9,2)}},addIssues:{value:(b)=>{_.issues.push(...b),_.message=JSON.stringify(_.issues,U9,2)}},isEmpty:{get(){return _.issues.length===0}}})},Uk=I("ZodError",UY),l0=I("ZodError",UY,{Parent:Error});var t8=X9(l0),s8=Q9(l0),_5=K9(l0),$5=v9(l0),z5=r2(l0),b5=n2(l0),Z5=l2(l0),A5=p2(l0),J5=d2(l0),U5=i2(l0),G5=o2(l0),Y5=a2(l0);var e=I("ZodType",(_,$)=>{return i.init(_,$),Object.assign(_["~standard"],{jsonSchema:{input:O9(_,"input"),output:O9(_,"output")}}),_.toJSONSchema=Y8(_,{}),_.def=$,_.type=$.type,Object.defineProperty(_,"_def",{value:$}),_.check=(...b)=>{return _.clone(c.mergeDefs($,{checks:[...$.checks??[],...b.map((Z)=>typeof Z==="function"?{_zod:{check:Z,def:{check:"custom"},onattach:[]}}:Z)]}),{parent:!0})},_.with=_.check,_.clone=(b,Z)=>y0(_,b,Z),_.brand=()=>_,_.register=(b,Z)=>{return b.add(_,Z),_},_.parse=(b,Z)=>t8(_,b,Z,{callee:_.parse}),_.safeParse=(b,Z)=>_5(_,b,Z),_.parseAsync=async(b,Z)=>s8(_,b,Z,{callee:_.parseAsync}),_.safeParseAsync=async(b,Z)=>$5(_,b,Z),_.spa=_.safeParseAsync,_.encode=(b,Z)=>z5(_,b,Z),_.decode=(b,Z)=>b5(_,b,Z),_.encodeAsync=async(b,Z)=>Z5(_,b,Z),_.decodeAsync=async(b,Z)=>A5(_,b,Z),_.safeEncode=(b,Z)=>J5(_,b,Z),_.safeDecode=(b,Z)=>U5(_,b,Z),_.safeEncodeAsync=async(b,Z)=>G5(_,b,Z),_.safeDecodeAsync=async(b,Z)=>Y5(_,b,Z),_.refine=(b,Z)=>_.check(s5(b,Z)),_.superRefine=(b)=>_.check(_J(b)),_.overwrite=(b)=>_.check(W_(b)),_.optional=()=>f$(_),_.exactOptional=()=>T5(_),_.nullable=()=>m$(_),_.nullish=()=>f$(m$(_)),_.nonoptional=(b)=>h5(_,b),_.array=()=>r$(_),_.or=(b)=>K6([_,b]),_.and=(b)=>N5(_,b),_.transform=(b)=>u$(_,F6(b)),_.default=(b)=>f5(_,b),_.prefault=(b)=>u5(_,b),_.catch=(b)=>n5(_,b),_.pipe=(b)=>u$(_,b),_.readonly=()=>d5(_),_.describe=(b)=>{let Z=_.clone();return E0.add(Z,{description:b}),Z},Object.defineProperty(_,"description",{get(){return E0.get(_)?.description},configurable:!0}),_.meta=(...b)=>{if(b.length===0)return E0.get(_);let Z=_.clone();return E0.add(Z,b[0]),Z},_.isOptional=()=>_.safeParse(void 0).success,_.isNullable=()=>_.safeParse(null).success,_.apply=(b)=>b(_),_}),d1=I("_ZodString",(_,$)=>{C4.init(_,$),e.init(_,$),_._zod.processJSONSchema=(Z,z,A)=>X8(_,Z,z,A);let b=_._zod.bag;_.format=b.format??null,_.minLength=b.minimum??null,_.maxLength=b.maximum??null,_.regex=(...Z)=>_.check(q9(...Z)),_.includes=(...Z)=>_.check(k9(...Z)),_.startsWith=(...Z)=>_.check(W9(...Z)),_.endsWith=(...Z)=>_.check(g9(...Z)),_.min=(...Z)=>_.check(o_(...Z)),_.max=(...Z)=>_.check(m4(...Z)),_.length=(...Z)=>_.check(u4(...Z)),_.nonempty=(...Z)=>_.check(o_(1,...Z)),_.lowercase=(Z)=>_.check(V9(Z)),_.uppercase=(Z)=>_.check(D9(Z)),_.trim=()=>_.check(x9()),_.normalize=(...Z)=>_.check(w9(...Z)),_.toLowerCase=()=>_.check(N9()),_.toUpperCase=()=>_.check(I9()),_.slugify=()=>_.check(M9())}),S9=I("ZodString",(_,$)=>{C4.init(_,$),d1.init(_,$),_.email=(b)=>_.check(Q1(i1,b)),_.url=(b)=>_.check(T$(h$,b)),_.jwt=(b)=>_.check(P1(Y6,b)),_.emoji=(b)=>_.check(q1(o1,b)),_.guid=(b)=>_.check(L$(C$,b)),_.uuid=(b)=>_.check(K1(L_,b)),_.uuidv4=(b)=>_.check(v1(L_,b)),_.uuidv6=(b)=>_.check(F1(L_,b)),_.uuidv7=(b)=>_.check(H1(L_,b)),_.nanoid=(b)=>_.check(V1(a1,b)),_.guid=(b)=>_.check(L$(C$,b)),_.cuid=(b)=>_.check(D1(e1,b)),_.cuid2=(b)=>_.check(k1(t1,b)),_.ulid=(b)=>_.check(W1(s1,b)),_.base64=(b)=>_.check(M1(J6,b)),_.base64url=(b)=>_.check(E1(U6,b)),_.xid=(b)=>_.check(g1(_6,b)),_.ksuid=(b)=>_.check(B1($6,b)),_.ipv4=(b)=>_.check(w1(z6,b)),_.ipv6=(b)=>_.check(x1(b6,b)),_.cidrv4=(b)=>_.check(N1(Z6,b)),_.cidrv6=(b)=>_.check(I1(A6,b)),_.e164=(b)=>_.check(O1(G6,b)),_.datetime=(b)=>_.check(i8(b)),_.date=(b)=>_.check(o8(b)),_.time=(b)=>_.check(a8(b)),_.duration=(b)=>_.check(e8(b))});function l1(_){return xA(S9,_)}var Q0=I("ZodStringFormat",(_,$)=>{X0.init(_,$),d1.init(_,$)}),i1=I("ZodEmail",(_,$)=>{BZ.init(_,$),Q0.init(_,$)});function GY(_){return Q1(i1,_)}var C$=I("ZodGUID",(_,$)=>{WZ.init(_,$),Q0.init(_,$)});function YY(_){return L$(C$,_)}var L_=I("ZodUUID",(_,$)=>{gZ.init(_,$),Q0.init(_,$)});function XY(_){return K1(L_,_)}function QY(_){return v1(L_,_)}function KY(_){return F1(L_,_)}function vY(_){return H1(L_,_)}var h$=I("ZodURL",(_,$)=>{wZ.init(_,$),Q0.init(_,$)});function FY(_){return T$(h$,_)}function HY(_){return T$(h$,{protocol:/^https?$/,hostname:K_.domain,...c.normalizeParams(_)})}var o1=I("ZodEmoji",(_,$)=>{xZ.init(_,$),Q0.init(_,$)});function qY(_){return q1(o1,_)}var a1=I("ZodNanoID",(_,$)=>{NZ.init(_,$),Q0.init(_,$)});function VY(_){return V1(a1,_)}var e1=I("ZodCUID",(_,$)=>{IZ.init(_,$),Q0.init(_,$)});function DY(_){return D1(e1,_)}var t1=I("ZodCUID2",(_,$)=>{MZ.init(_,$),Q0.init(_,$)});function kY(_){return k1(t1,_)}var s1=I("ZodULID",(_,$)=>{EZ.init(_,$),Q0.init(_,$)});function WY(_){return W1(s1,_)}var _6=I("ZodXID",(_,$)=>{OZ.init(_,$),Q0.init(_,$)});function gY(_){return g1(_6,_)}var $6=I("ZodKSUID",(_,$)=>{PZ.init(_,$),Q0.init(_,$)});function BY(_){return B1($6,_)}var z6=I("ZodIPv4",(_,$)=>{TZ.init(_,$),Q0.init(_,$)});function wY(_){return w1(z6,_)}var X5=I("ZodMAC",(_,$)=>{CZ.init(_,$),Q0.init(_,$)});function xY(_){return IA(X5,_)}var b6=I("ZodIPv6",(_,$)=>{yZ.init(_,$),Q0.init(_,$)});function NY(_){return x1(b6,_)}var Z6=I("ZodCIDRv4",(_,$)=>{fZ.init(_,$),Q0.init(_,$)});function IY(_){return N1(Z6,_)}var A6=I("ZodCIDRv6",(_,$)=>{mZ.init(_,$),Q0.init(_,$)});function MY(_){return I1(A6,_)}var J6=I("ZodBase64",(_,$)=>{hZ.init(_,$),Q0.init(_,$)});function EY(_){return M1(J6,_)}var U6=I("ZodBase64URL",(_,$)=>{cZ.init(_,$),Q0.init(_,$)});function OY(_){return E1(U6,_)}var G6=I("ZodE164",(_,$)=>{rZ.init(_,$),Q0.init(_,$)});function PY(_){return O1(G6,_)}var Y6=I("ZodJWT",(_,$)=>{nZ.init(_,$),Q0.init(_,$)});function jY(_){return P1(Y6,_)}var R9=I("ZodCustomStringFormat",(_,$)=>{lZ.init(_,$),Q0.init(_,$)});function SY(_,$,b={}){return E9(R9,_,$,b)}function RY(_){return E9(R9,"hostname",K_.hostname,_)}function LY(_){return E9(R9,"hex",K_.hex,_)}function TY(_,$){let b=$?.enc??"hex",Z=`${_}_${b}`,z=K_[Z];if(!z)throw Error(`Unrecognized hash format: ${Z}`);return E9(R9,Z,z,$)}var L9=I("ZodNumber",(_,$)=>{J1.init(_,$),e.init(_,$),_._zod.processJSONSchema=(Z,z,A)=>Q8(_,Z,z,A),_.gt=(Z,z)=>_.check(S_(Z,z)),_.gte=(Z,z)=>_.check(C0(Z,z)),_.min=(Z,z)=>_.check(C0(Z,z)),_.lt=(Z,z)=>_.check(j_(Z,z)),_.lte=(Z,z)=>_.check($_(Z,z)),_.max=(Z,z)=>_.check($_(Z,z)),_.int=(Z)=>_.check(p1(Z)),_.safe=(Z)=>_.check(p1(Z)),_.positive=(Z)=>_.check(S_(0,Z)),_.nonnegative=(Z)=>_.check(C0(0,Z)),_.negative=(Z)=>_.check(j_(0,Z)),_.nonpositive=(Z)=>_.check($_(0,Z)),_.multipleOf=(Z,z)=>_.check(F4(Z,z)),_.step=(Z,z)=>_.check(F4(Z,z)),_.finite=()=>_;let b=_._zod.bag;_.minValue=Math.max(b.minimum??Number.NEGATIVE_INFINITY,b.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,_.maxValue=Math.min(b.maximum??Number.POSITIVE_INFINITY,b.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,_.isInt=(b.format??"").includes("int")||Number.isSafeInteger(b.multipleOf??0.5),_.isFinite=!0,_.format=b.format??null});function Q5(_){return SA(L9,_)}var c4=I("ZodNumberFormat",(_,$)=>{pZ.init(_,$),L9.init(_,$)});function p1(_){return LA(c4,_)}function yY(_){return TA(c4,_)}function CY(_){return yA(c4,_)}function fY(_){return CA(c4,_)}function mY(_){return fA(c4,_)}var T9=I("ZodBoolean",(_,$)=>{I$.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>K8(_,b,Z,z)});function K5(_){return mA(T9,_)}var y9=I("ZodBigInt",(_,$)=>{U1.init(_,$),e.init(_,$),_._zod.processJSONSchema=(Z,z,A)=>v8(_,Z,z,A),_.gte=(Z,z)=>_.check(C0(Z,z)),_.min=(Z,z)=>_.check(C0(Z,z)),_.gt=(Z,z)=>_.check(S_(Z,z)),_.gte=(Z,z)=>_.check(C0(Z,z)),_.min=(Z,z)=>_.check(C0(Z,z)),_.lt=(Z,z)=>_.check(j_(Z,z)),_.lte=(Z,z)=>_.check($_(Z,z)),_.max=(Z,z)=>_.check($_(Z,z)),_.positive=(Z)=>_.check(S_(BigInt(0),Z)),_.negative=(Z)=>_.check(j_(BigInt(0),Z)),_.nonpositive=(Z)=>_.check($_(BigInt(0),Z)),_.nonnegative=(Z)=>_.check(C0(BigInt(0),Z)),_.multipleOf=(Z,z)=>_.check(F4(Z,z));let b=_._zod.bag;_.minValue=b.minimum??null,_.maxValue=b.maximum??null,_.format=b.format??null});function uY(_){return hA(y9,_)}var X6=I("ZodBigIntFormat",(_,$)=>{dZ.init(_,$),y9.init(_,$)});function hY(_){return rA(X6,_)}function cY(_){return nA(X6,_)}var v5=I("ZodSymbol",(_,$)=>{iZ.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>F8(_,b,Z,z)});function rY(_){return lA(v5,_)}var F5=I("ZodUndefined",(_,$)=>{oZ.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>q8(_,b,Z,z)});function nY(_){return pA(F5,_)}var H5=I("ZodNull",(_,$)=>{aZ.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>H8(_,b,Z,z)});function q5(_){return dA(H5,_)}var V5=I("ZodAny",(_,$)=>{eZ.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>k8(_,b,Z,z)});function lY(){return iA(V5)}var D5=I("ZodUnknown",(_,$)=>{tZ.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>W8(_,b,Z,z)});function h4(){return oA(D5)}var k5=I("ZodNever",(_,$)=>{sZ.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>D8(_,b,Z,z)});function Q6(_){return aA(k5,_)}var W5=I("ZodVoid",(_,$)=>{_3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>V8(_,b,Z,z)});function pY(_){return eA(W5,_)}var c$=I("ZodDate",(_,$)=>{$3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(Z,z,A)=>g8(_,Z,z,A),_.min=(Z,z)=>_.check(C0(Z,z)),_.max=(Z,z)=>_.check($_(Z,z));let b=_._zod.bag;_.minDate=b.minimum?new Date(b.minimum):null,_.maxDate=b.maximum?new Date(b.maximum):null});function dY(_){return tA(c$,_)}var g5=I("ZodArray",(_,$)=>{z3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>R8(_,b,Z,z),_.element=$.element,_.min=(b,Z)=>_.check(o_(b,Z)),_.nonempty=(b)=>_.check(o_(1,b)),_.max=(b,Z)=>_.check(m4(b,Z)),_.length=(b,Z)=>_.check(u4(b,Z)),_.unwrap=()=>_.element});function r$(_,$){return $8(g5,_,$)}function iY(_){let $=_._zod.def.shape;return v6(Object.keys($))}var n$=I("ZodObject",(_,$)=>{b3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>L8(_,b,Z,z),c.defineLazy(_,"shape",()=>{return $.shape}),_.keyof=()=>v6(Object.keys(_._zod.def.shape)),_.catchall=(b)=>_.clone({..._._zod.def,catchall:b}),_.passthrough=()=>_.clone({..._._zod.def,catchall:h4()}),_.loose=()=>_.clone({..._._zod.def,catchall:h4()}),_.strict=()=>_.clone({..._._zod.def,catchall:Q6()}),_.strip=()=>_.clone({..._._zod.def,catchall:void 0}),_.extend=(b)=>{return c.extend(_,b)},_.safeExtend=(b)=>{return c.safeExtend(_,b)},_.merge=(b)=>c.merge(_,b),_.pick=(b)=>c.pick(_,b),_.omit=(b)=>c.omit(_,b),_.partial=(...b)=>c.partial(H6,_,b[0]),_.required=(...b)=>c.required(q6,_,b[0])});function oY(_,$){let b={type:"object",shape:_??{},...c.normalizeParams($)};return new n$(b)}function aY(_,$){return new n$({type:"object",shape:_,catchall:Q6(),...c.normalizeParams($)})}function eY(_,$){return new n$({type:"object",shape:_,catchall:h4(),...c.normalizeParams($)})}var l$=I("ZodUnion",(_,$)=>{M$.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>C1(_,b,Z,z),_.options=$.options});function K6(_,$){return new l$({type:"union",options:_,...c.normalizeParams($)})}var B5=I("ZodXor",(_,$)=>{l$.init(_,$),Z3.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>C1(_,b,Z,z),_.options=$.options});function tY(_,$){return new B5({type:"union",options:_,inclusive:!1,...c.normalizeParams($)})}var w5=I("ZodDiscriminatedUnion",(_,$)=>{l$.init(_,$),A3.init(_,$)});function sY(_,$,b){return new w5({type:"union",options:$,discriminator:_,...c.normalizeParams(b)})}var x5=I("ZodIntersection",(_,$)=>{J3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>T8(_,b,Z,z)});function N5(_,$){return new x5({type:"intersection",left:_,right:$})}var I5=I("ZodTuple",(_,$)=>{G1.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>y8(_,b,Z,z),_.rest=(b)=>_.clone({..._._zod.def,rest:b})});function M5(_,$,b){let Z=$ instanceof i,z=Z?b:$;return new I5({type:"tuple",items:_,rest:Z?$:null,...c.normalizeParams(z)})}var p$=I("ZodRecord",(_,$)=>{U3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>C8(_,b,Z,z),_.keyType=$.keyType,_.valueType=$.valueType});function E5(_,$,b){return new p$({type:"record",keyType:_,valueType:$,...c.normalizeParams(b)})}function _X(_,$,b){let Z=y0(_);return Z._zod.values=void 0,new p$({type:"record",keyType:Z,valueType:$,...c.normalizeParams(b)})}function $X(_,$,b){return new p$({type:"record",keyType:_,valueType:$,mode:"loose",...c.normalizeParams(b)})}var O5=I("ZodMap",(_,$)=>{G3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>j8(_,b,Z,z),_.keyType=$.keyType,_.valueType=$.valueType,_.min=(...b)=>_.check(R_(...b)),_.nonempty=(b)=>_.check(R_(1,b)),_.max=(...b)=>_.check(H4(...b)),_.size=(...b)=>_.check(f4(...b))});function zX(_,$,b){return new O5({type:"map",keyType:_,valueType:$,...c.normalizeParams(b)})}var P5=I("ZodSet",(_,$)=>{Y3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>S8(_,b,Z,z),_.min=(...b)=>_.check(R_(...b)),_.nonempty=(b)=>_.check(R_(1,b)),_.max=(...b)=>_.check(H4(...b)),_.size=(...b)=>_.check(f4(...b))});function bX(_,$){return new P5({type:"set",valueType:_,...c.normalizeParams($)})}var j9=I("ZodEnum",(_,$)=>{X3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(Z,z,A)=>B8(_,Z,z,A),_.enum=$.entries,_.options=Object.values($.entries);let b=new Set(Object.keys($.entries));_.extract=(Z,z)=>{let A={};for(let J of Z)if(b.has(J))A[J]=$.entries[J];else throw Error(`Key ${J} not found in enum`);return new j9({...$,checks:[],...c.normalizeParams(z),entries:A})},_.exclude=(Z,z)=>{let A={...$.entries};for(let J of Z)if(b.has(J))delete A[J];else throw Error(`Key ${J} not found in enum`);return new j9({...$,checks:[],...c.normalizeParams(z),entries:A})}});function v6(_,$){let b=Array.isArray(_)?Object.fromEntries(_.map((Z)=>[Z,Z])):_;return new j9({type:"enum",entries:b,...c.normalizeParams($)})}function ZX(_,$){return new j9({type:"enum",entries:_,...c.normalizeParams($)})}var j5=I("ZodLiteral",(_,$)=>{Q3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>w8(_,b,Z,z),_.values=new Set($.values),Object.defineProperty(_,"value",{get(){if($.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return $.values[0]}})});function AX(_,$){return new j5({type:"literal",values:Array.isArray(_)?_:[_],...c.normalizeParams($)})}var S5=I("ZodFile",(_,$)=>{K3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>I8(_,b,Z,z),_.min=(b,Z)=>_.check(R_(b,Z)),_.max=(b,Z)=>_.check(H4(b,Z)),_.mime=(b,Z)=>_.check(B9(Array.isArray(b)?b:[b],Z))});function JX(_){return z8(S5,_)}var R5=I("ZodTransform",(_,$)=>{v3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>P8(_,b,Z,z),_._zod.parse=(b,Z)=>{if(Z.direction==="backward")throw new L4(_.constructor.name);b.addIssue=(A)=>{if(typeof A==="string")b.issues.push(c.issue(A,b.value,$));else{let J=A;if(J.fatal)J.continue=!1;J.code??(J.code="custom"),J.input??(J.input=b.value),J.inst??(J.inst=_),b.issues.push(c.issue(J))}};let z=$.transform(b.value,b);if(z instanceof Promise)return z.then((A)=>{return b.value=A,b});return b.value=z,b}});function F6(_){return new R5({type:"transform",transform:_})}var H6=I("ZodOptional",(_,$)=>{Y1.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>f1(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType});function f$(_){return new H6({type:"optional",innerType:_})}var L5=I("ZodExactOptional",(_,$)=>{F3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>f1(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType});function T5(_){return new L5({type:"optional",innerType:_})}var y5=I("ZodNullable",(_,$)=>{H3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>f8(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType});function m$(_){return new y5({type:"nullable",innerType:_})}function UX(_){return f$(m$(_))}var C5=I("ZodDefault",(_,$)=>{q3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>u8(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType,_.removeDefault=_.unwrap});function f5(_,$){return new C5({type:"default",innerType:_,get defaultValue(){return typeof $==="function"?$():c.shallowClone($)}})}var m5=I("ZodPrefault",(_,$)=>{V3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>h8(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType});function u5(_,$){return new m5({type:"prefault",innerType:_,get defaultValue(){return typeof $==="function"?$():c.shallowClone($)}})}var q6=I("ZodNonOptional",(_,$)=>{D3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>m8(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType});function h5(_,$){return new q6({type:"nonoptional",innerType:_,...c.normalizeParams($)})}var c5=I("ZodSuccess",(_,$)=>{k3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>M8(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType});function GX(_){return new c5({type:"success",innerType:_})}var r5=I("ZodCatch",(_,$)=>{W3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>c8(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType,_.removeCatch=_.unwrap});function n5(_,$){return new r5({type:"catch",innerType:_,catchValue:typeof $==="function"?$:()=>$})}var l5=I("ZodNaN",(_,$)=>{g3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>x8(_,b,Z,z)});function YX(_){return _8(l5,_)}var V6=I("ZodPipe",(_,$)=>{B3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>r8(_,b,Z,z),_.in=$.in,_.out=$.out});function u$(_,$){return new V6({type:"pipe",in:_,out:$})}var D6=I("ZodCodec",(_,$)=>{V6.init(_,$),E$.init(_,$)});function XX(_,$,b){return new D6({type:"pipe",in:_,out:$,transform:b.decode,reverseTransform:b.encode})}var p5=I("ZodReadonly",(_,$)=>{w3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>n8(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType});function d5(_){return new p5({type:"readonly",innerType:_})}var i5=I("ZodTemplateLiteral",(_,$)=>{x3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>N8(_,b,Z,z)});function QX(_,$){return new i5({type:"template_literal",parts:_,...c.normalizeParams($)})}var o5=I("ZodLazy",(_,$)=>{M3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>p8(_,b,Z,z),_.unwrap=()=>_._zod.def.getter()});function a5(_){return new o5({type:"lazy",getter:_})}var e5=I("ZodPromise",(_,$)=>{I3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>l8(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType});function KX(_){return new e5({type:"promise",innerType:_})}var t5=I("ZodFunction",(_,$)=>{N3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>O8(_,b,Z,z)});function vX(_){return new t5({type:"function",input:Array.isArray(_?.input)?M5(_?.input):_?.input??r$(h4()),output:_?.output??h4()})}var d$=I("ZodCustom",(_,$)=>{E3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>E8(_,b,Z,z)});function FX(_){let $=new K0({check:"custom"});return $._zod.check=_,$}function HX(_,$){return b8(d$,_??(()=>!0),$)}function s5(_,$={}){return Z8(d$,_,$)}function _J(_){return A8(_)}var qX=J8,VX=U8;function DX(_,$={}){let b=new d$({type:"custom",check:"custom",fn:(Z)=>Z instanceof _,abort:!0,...c.normalizeParams($)});return b._zod.bag.Class=_,b._zod.check=(Z)=>{if(!(Z.value instanceof _))Z.issues.push({code:"invalid_type",expected:_.name,input:Z.value,inst:b,path:[...b._zod.def.path??[]]})},b}var kX=(..._)=>G8({Codec:D6,Boolean:T9,String:S9},..._);function WX(_){let $=a5(()=>{return K6([l1(_),Q5(),K5(),q5(),r$($),E5(l1(),$)])});return $}function gX(_,$){return u$(F6(_),$)}var Yk={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 Xk(_){D0({customError:_})}function Qk(){return D0().customError}var $J;(function(_){})($J||($J={}));var n={...y$,...u1,iso:P9},Kk=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function vk(_,$){let b=_.$schema;if(b==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(b==="http://json-schema.org/draft-07/schema#")return"draft-7";if(b==="http://json-schema.org/draft-04/schema#")return"draft-4";return $??"draft-2020-12"}function Fk(_,$){if(!_.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let b=_.slice(1).split("/").filter(Boolean);if(b.length===0)return $.rootSchema;let Z=$.version==="draft-2020-12"?"$defs":"definitions";if(b[0]===Z){let z=b[1];if(!z||!$.defs[z])throw Error(`Reference not found: ${_}`);return $.defs[z]}throw Error(`Reference not found: ${_}`)}function BX(_,$){if(_.not!==void 0){if(typeof _.not==="object"&&Object.keys(_.not).length===0)return n.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(_.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(_.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(_.if!==void 0||_.then!==void 0||_.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(_.dependentSchemas!==void 0||_.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(_.$ref){let z=_.$ref;if($.refs.has(z))return $.refs.get(z);if($.processing.has(z))return n.lazy(()=>{if(!$.refs.has(z))throw Error(`Circular reference not resolved: ${z}`);return $.refs.get(z)});$.processing.add(z);let A=Fk(z,$),J=j0(A,$);return $.refs.set(z,J),$.processing.delete(z),J}if(_.enum!==void 0){let z=_.enum;if($.version==="openapi-3.0"&&_.nullable===!0&&z.length===1&&z[0]===null)return n.null();if(z.length===0)return n.never();if(z.length===1)return n.literal(z[0]);if(z.every((J)=>typeof J==="string"))return n.enum(z);let A=z.map((J)=>n.literal(J));if(A.length<2)return A[0];return n.union([A[0],A[1],...A.slice(2)])}if(_.const!==void 0)return n.literal(_.const);let b=_.type;if(Array.isArray(b)){let z=b.map((A)=>{let J={..._,type:A};return BX(J,$)});if(z.length===0)return n.never();if(z.length===1)return z[0];return n.union(z)}if(!b)return n.any();let Z;switch(b){case"string":{let z=n.string();if(_.format){let A=_.format;if(A==="email")z=z.check(n.email());else if(A==="uri"||A==="uri-reference")z=z.check(n.url());else if(A==="uuid"||A==="guid")z=z.check(n.uuid());else if(A==="date-time")z=z.check(n.iso.datetime());else if(A==="date")z=z.check(n.iso.date());else if(A==="time")z=z.check(n.iso.time());else if(A==="duration")z=z.check(n.iso.duration());else if(A==="ipv4")z=z.check(n.ipv4());else if(A==="ipv6")z=z.check(n.ipv6());else if(A==="mac")z=z.check(n.mac());else if(A==="cidr")z=z.check(n.cidrv4());else if(A==="cidr-v6")z=z.check(n.cidrv6());else if(A==="base64")z=z.check(n.base64());else if(A==="base64url")z=z.check(n.base64url());else if(A==="e164")z=z.check(n.e164());else if(A==="jwt")z=z.check(n.jwt());else if(A==="emoji")z=z.check(n.emoji());else if(A==="nanoid")z=z.check(n.nanoid());else if(A==="cuid")z=z.check(n.cuid());else if(A==="cuid2")z=z.check(n.cuid2());else if(A==="ulid")z=z.check(n.ulid());else if(A==="xid")z=z.check(n.xid());else if(A==="ksuid")z=z.check(n.ksuid())}if(typeof _.minLength==="number")z=z.min(_.minLength);if(typeof _.maxLength==="number")z=z.max(_.maxLength);if(_.pattern)z=z.regex(new RegExp(_.pattern));Z=z;break}case"number":case"integer":{let z=b==="integer"?n.number().int():n.number();if(typeof _.minimum==="number")z=z.min(_.minimum);if(typeof _.maximum==="number")z=z.max(_.maximum);if(typeof _.exclusiveMinimum==="number")z=z.gt(_.exclusiveMinimum);else if(_.exclusiveMinimum===!0&&typeof _.minimum==="number")z=z.gt(_.minimum);if(typeof _.exclusiveMaximum==="number")z=z.lt(_.exclusiveMaximum);else if(_.exclusiveMaximum===!0&&typeof _.maximum==="number")z=z.lt(_.maximum);if(typeof _.multipleOf==="number")z=z.multipleOf(_.multipleOf);Z=z;break}case"boolean":{Z=n.boolean();break}case"null":{Z=n.null();break}case"object":{let z={},A=_.properties||{},J=new Set(_.required||[]);for(let[G,Y]of Object.entries(A)){let X=j0(Y,$);z[G]=J.has(G)?X:X.optional()}if(_.propertyNames){let G=j0(_.propertyNames,$),Y=_.additionalProperties&&typeof _.additionalProperties==="object"?j0(_.additionalProperties,$):n.any();if(Object.keys(z).length===0){Z=n.record(G,Y);break}let X=n.object(z).passthrough(),Q=n.looseRecord(G,Y);Z=n.intersection(X,Q);break}if(_.patternProperties){let G=_.patternProperties,Y=Object.keys(G),X=[];for(let K of Y){let v=j0(G[K],$),V=n.string().regex(new RegExp(K));X.push(n.looseRecord(V,v))}let Q=[];if(Object.keys(z).length>0)Q.push(n.object(z).passthrough());if(Q.push(...X),Q.length===0)Z=n.object({}).passthrough();else if(Q.length===1)Z=Q[0];else{let K=n.intersection(Q[0],Q[1]);for(let v=2;v<Q.length;v++)K=n.intersection(K,Q[v]);Z=K}break}let U=n.object(z);if(_.additionalProperties===!1)Z=U.strict();else if(typeof _.additionalProperties==="object")Z=U.catchall(j0(_.additionalProperties,$));else Z=U.passthrough();break}case"array":{let{prefixItems:z,items:A}=_;if(z&&Array.isArray(z)){let J=z.map((G)=>j0(G,$)),U=A&&typeof A==="object"&&!Array.isArray(A)?j0(A,$):void 0;if(U)Z=n.tuple(J).rest(U);else Z=n.tuple(J);if(typeof _.minItems==="number")Z=Z.check(n.minLength(_.minItems));if(typeof _.maxItems==="number")Z=Z.check(n.maxLength(_.maxItems))}else if(Array.isArray(A)){let J=A.map((G)=>j0(G,$)),U=_.additionalItems&&typeof _.additionalItems==="object"?j0(_.additionalItems,$):void 0;if(U)Z=n.tuple(J).rest(U);else Z=n.tuple(J);if(typeof _.minItems==="number")Z=Z.check(n.minLength(_.minItems));if(typeof _.maxItems==="number")Z=Z.check(n.maxLength(_.maxItems))}else if(A!==void 0){let J=j0(A,$),U=n.array(J);if(typeof _.minItems==="number")U=U.min(_.minItems);if(typeof _.maxItems==="number")U=U.max(_.maxItems);Z=U}else Z=n.array(n.any());break}default:throw Error(`Unsupported type: ${b}`)}if(_.description)Z=Z.describe(_.description);if(_.default!==void 0)Z=Z.default(_.default);return Z}function j0(_,$){if(typeof _==="boolean")return _?n.any():n.never();let b=BX(_,$),Z=_.type||_.enum!==void 0||_.const!==void 0;if(_.anyOf&&Array.isArray(_.anyOf)){let U=_.anyOf.map((Y)=>j0(Y,$)),G=n.union(U);b=Z?n.intersection(b,G):G}if(_.oneOf&&Array.isArray(_.oneOf)){let U=_.oneOf.map((Y)=>j0(Y,$)),G=n.xor(U);b=Z?n.intersection(b,G):G}if(_.allOf&&Array.isArray(_.allOf))if(_.allOf.length===0)b=Z?b:n.any();else{let U=Z?b:j0(_.allOf[0],$),G=Z?0:1;for(let Y=G;Y<_.allOf.length;Y++)U=n.intersection(U,j0(_.allOf[Y],$));b=U}if(_.nullable===!0&&$.version==="openapi-3.0")b=n.nullable(b);if(_.readOnly===!0)b=n.readonly(b);let z={},A=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let U of A)if(U in _)z[U]=_[U];let J=["contentEncoding","contentMediaType","contentSchema"];for(let U of J)if(U in _)z[U]=_[U];for(let U of Object.keys(_))if(!Kk.has(U))z[U]=_[U];if(Object.keys(z).length>0)$.registry.add(b,z);return b}function wX(_,$){if(typeof _==="boolean")return _?n.any():n.never();let b=vk(_,$?.defaultTarget),Z=_.$defs||_.definitions||{},z={version:b,defs:Z,refs:new Map,processing:new Set,rootSchema:_,registry:$?.registry??E0};return j0(_,z)}var zJ={};r_(zJ,{string:()=>Hk,number:()=>qk,date:()=>kk,boolean:()=>Vk,bigint:()=>Dk});function Hk(_){return NA(S9,_)}function qk(_){return RA(L9,_)}function Vk(_){return uA(T9,_)}function Dk(_){return cA(y9,_)}function kk(_){return sA(c$,_)}D0(O$());var xX=M.object({sha256:M.string(),mediaType:M.string()}),Wk=M.object({type:M.literal("user"),text:M.string(),images:M.array(xX).optional(),id:M.string().optional(),timestamp:M.string().optional()}),gk=M.object({type:M.literal("compaction-summary"),text:M.string(),id:M.string().optional(),timestamp:M.string().optional()}),Bk=M.object({type:M.literal("command"),name:M.string(),args:M.string().optional(),output:M.string().optional(),id:M.string().optional(),timestamp:M.string().optional()}),wk=M.object({type:M.literal("agent"),text:M.string(),id:M.string().optional(),timestamp:M.string().optional(),model:M.string().optional()}),xk=M.object({type:M.literal("thinking"),text:M.string(),id:M.string().optional(),timestamp:M.string().optional(),model:M.string().optional()}),NX=M.object({type:M.literal("tool-call"),toolName:M.string().nullable(),input:M.unknown().optional(),output:M.unknown().optional(),images:M.array(xX).optional(),error:M.string().optional(),isError:M.union([M.boolean(),M.string()]).optional(),id:M.string().optional(),timestamp:M.string().optional(),model:M.string().optional()}),s=M.discriminatedUnion("type",[Wk,gk,Bk,wk,xk,NX]),ZJ=M.object({inputTokens:M.number(),cachedInputTokens:M.number(),outputTokens:M.number(),reasoningOutputTokens:M.number(),totalTokens:M.number()}),T_=NX,Nk=T_.extend({toolName:M.literal("Write"),input:M.object({file_path:M.string(),content:M.string().optional()}).passthrough().optional(),output:M.object({type:M.string().optional()}).passthrough().optional()}),Ik=T_.extend({toolName:M.literal("Read"),input:M.object({file_path:M.string()}).passthrough().optional(),output:M.union([M.string(),M.object({type:M.string().optional(),file:M.object({content:M.string().optional(),numLines:M.number().optional(),startLine:M.number().optional(),totalLines:M.number().optional()}).passthrough().optional()}).passthrough()]).optional()}),Mk=T_.extend({toolName:M.literal("Edit"),input:M.object({file_path:M.string(),diff:M.string().optional()}).passthrough().optional(),output:M.union([M.string(),M.object({userModified:M.boolean().optional()}).passthrough()]).optional()}),IX=M.object({filenames:M.array(M.string()),durationMs:M.number().optional(),truncated:M.boolean().optional()}).passthrough(),Ek=T_.extend({toolName:M.literal("Glob"),input:M.object({pattern:M.string().optional()}).passthrough().optional(),output:IX.optional()}),Ok=T_.extend({toolName:M.literal("Grep"),input:M.unknown().optional(),output:IX.extend({mode:M.string().optional(),numMatches:M.number().optional()}).passthrough().optional()}),Pk=T_.extend({toolName:M.literal("Bash"),input:M.object({command:M.string(),description:M.string().optional()}).passthrough().optional(),output:M.union([M.string(),M.object({stdout:M.string().optional(),stderr:M.string().optional(),interrupted:M.boolean().optional(),isImage:M.boolean().optional()}).passthrough()]).optional()}),jk=T_.extend({toolName:M.literal("BashOutput"),input:M.object({bash_id:M.string().optional()}).passthrough().optional(),output:M.object({command:M.string().optional(),exitCode:M.number().optional(),shellId:M.string().optional(),status:M.string().optional(),stderr:M.string().optional(),stdout:M.string().optional(),timestamp:M.string().optional()}).passthrough().optional()}),Sk=T_.extend({toolName:M.literal("Task"),input:M.unknown().optional(),output:M.object({status:M.string().optional(),totalDurationMs:M.number().optional(),totalToolUseCount:M.number().optional(),content:M.array(M.object({type:M.string().optional(),text:M.string().optional()}).passthrough()).optional(),usage:ZJ.optional()}).passthrough().optional()}),bJ=M.object({content:M.string(),status:M.string().optional()}).passthrough(),Rk=T_.extend({toolName:M.literal("TodoWrite"),input:M.object({todos:M.array(bJ).optional()}).passthrough().optional(),output:M.object({oldTodos:M.array(bJ).optional(),newTodos:M.array(bJ).optional()}).passthrough().optional()}),Lk=[Nk,Ik,Mk,Ek,Ok,Pk,jk,Sk,Rk],Tk=T_,k6=M.union([...Lk,Tk]),e_=M.object({model:M.string(),usage:ZJ}),m0=M.object({relativeCwd:M.string().nullable(),branch:M.string().nullable(),repo:M.string().nullable()}).strict().nullable(),y_=M.object({v:M.literal(1),id:M.string(),source:M.enum(["claude-code","cline","codex","opencode","pi","unknown"]),timestamp:M.coerce.date(),preview:M.string().nullable(),summary:M.string().nullable().default(null),model:M.string().nullable(),clientVersion:M.string().nullable(),blendedTokens:M.number(),costUsd:M.number(),messageCount:M.number(),toolCount:M.number(),userMessageCount:M.number(),filesChanged:M.number(),linesAdded:M.number().default(0),linesRemoved:M.number().default(0),linesModified:M.number().default(0),tokenUsage:ZJ,modelUsage:M.array(e_),git:m0,cwd:M.string().nullable(),messages:M.array(s)});import{appendFileSync as hk,mkdirSync as ck}from"fs";import{dirname as rk}from"path";import{existsSync as yk,readFileSync as Ck}from"fs";import{homedir as fk}from"os";import{dirname as MX,resolve as AJ}from"path";function mk(){let $=process.env.VI_CLI_PATH;if($?.startsWith("bun "))$=$.slice(4);let b=$?MX($):process.cwd(),Z=10,z=0;while(z<Z){let A=AJ(b,"package.json");if(yk(A))try{if(JSON.parse(Ck(A,"utf-8")).workspaces)return b}catch{}let J=MX(b);if(J===b)break;b=J,z++}return null}function uk(){let _=mk();return _?AJ(_,"logs"):null}function EX(){let _=uk();return _?AJ(_,"dev.log"):null}function z_(_){let $=fk();if(_.startsWith($))return _.replace($,"~");let b=/^(\/Users\/[^/]+|\/home\/[^/]+)/;return _.replace(b,"~")}function i$(_){if(_==="."||_===null)return"";return _}function S0(_,$){if(!$)return _;let b=$.endsWith("/")?$:`${$}/`,Z=b.slice(0,-1),z=(J)=>typeof J==="object"&&J!==null&&!Array.isArray(J),A=(J)=>{if(typeof J==="string"){if(J.includes(b))return J.replaceAll(b,"./");if(J.includes(Z))return J.replaceAll(Z,".");return J}if(Array.isArray(J))return J.map(A);if(z(J)){let U={};for(let[G,Y]of Object.entries(J))U[G]=A(Y);return U}return J};return A(_)}var OX=!1;function nk(_){if(_===void 0||_===null)return _;if(process.env.DEBUG_PAYLOADS!=="true"){if(!OX)return OX=!0,"[payload logging disabled - set DEBUG_PAYLOADS=true to enable]";return}if(typeof _==="object"){let b=JSON.stringify(_),Z=Math.round(b.length/1024),z=b.includes('"isImage":true')||b.includes('"isImage": true')||b.length>1e4&&/[A-Za-z0-9+/]{100,}/.test(b);if(z||b.length>1e4)return`[payload: ${Z}KB${z?", contains binary data":""}]`}return _}class PX{component;logToFile;logFilePath;disableConsole;constructor(_){this.component=_.component,this.disableConsole=_.disableConsole??!1;let $=typeof process<"u"&&!!process.versions?.node;if(this.logToFile=_.logToFile??($&&!1),$&&this.logToFile){let b=EX(),Z=_.logFilePath??b;if(Z)this.logFilePath=Z;else this.logToFile=!1,this.logFilePath=""}else this.logFilePath="",this.logToFile=!1;if(process.env.DEBUG)console.log(`[${this.component}] Logger config:`,{logToFile:this.logToFile,logFilePath:this.logFilePath,cwd:process.cwd(),NODE_ENV:"production"});if(this.logToFile)try{let b=rk(this.logFilePath);ck(b,{recursive:!0})}catch(b){if(process.env.DEBUG)console.error(`[${this.component}] Failed to create logs directory:`,b)}}log(_,$,b){let Z=new Date,A=`[${`${String(Z.getMonth()+1).padStart(2,"0")}-${String(Z.getDate()).padStart(2,"0")} ${String(Z.getHours()).padStart(2,"0")}:${String(Z.getMinutes()).padStart(2,"0")}:${String(Z.getSeconds()).padStart(2,"0")}`}] [${this.component}] [${_}] ${$}`,J=_==="ERROR"?console.error:_==="WARN"?console.warn:console.log,U=nk(b);if(!this.disableConsole){if(J(A),U!==void 0){let G=typeof U==="object"?JSON.stringify(U,null,2):String(U);J(` ${G}`)}}if(this.logToFile)try{let G=A+`
89
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let J of _.seen.entries()){let U=J[1];if($===J[0]){A(J);continue}if(_.external){let Y=_.external.registry.get(J[0])?.id;if($!==J[0]&&Y){A(J);continue}}if(_.metadataRegistry.get(J[0])?.id){A(J);continue}if(U.cycle){A(J);continue}if(U.count>1){if(_.reused==="ref"){A(J);continue}}}}function B4(_,$){let b=_.seen.get($);if(!b)throw Error("Unprocessed schema. This is a bug in Zod.");let Z=(J)=>{let U=_.seen.get(J);if(U.ref===null)return;let G=U.def??U.schema,Y={...G},X=U.ref;if(U.ref=null,X){Z(X);let K=_.seen.get(X),v=K.schema;if(v.$ref&&(_.target==="draft-07"||_.target==="draft-04"||_.target==="openapi-3.0"))G.allOf=G.allOf??[],G.allOf.push(v);else Object.assign(G,v);if(Object.assign(G,Y),J._zod.parent===X)for(let w in G){if(w==="$ref"||w==="allOf")continue;if(!(w in Y))delete G[w]}if(v.$ref&&K.def)for(let w in G){if(w==="$ref"||w==="allOf")continue;if(w in K.def&&JSON.stringify(G[w])===JSON.stringify(K.def[w]))delete G[w]}}let Q=J._zod.parent;if(Q&&Q!==X){Z(Q);let K=_.seen.get(Q);if(K?.schema.$ref){if(G.$ref=K.schema.$ref,K.def)for(let v in G){if(v==="$ref"||v==="allOf")continue;if(v in K.def&&JSON.stringify(G[v])===JSON.stringify(K.def[v]))delete G[v]}}}_.override({zodSchema:J,jsonSchema:G,path:U.path??[]})};for(let J of[..._.seen.entries()].reverse())Z(J[0]);let z={};if(_.target==="draft-2020-12")z.$schema="https://json-schema.org/draft/2020-12/schema";else if(_.target==="draft-07")z.$schema="http://json-schema.org/draft-07/schema#";else if(_.target==="draft-04")z.$schema="http://json-schema.org/draft-04/schema#";else if(_.target==="openapi-3.0");if(_.external?.uri){let J=_.external.registry.get($)?.id;if(!J)throw Error("Schema is missing an `id` property");z.$id=_.external.uri(J)}Object.assign(z,b.def??b.schema);let A=_.external?.defs??{};for(let J of _.seen.entries()){let U=J[1];if(U.def&&U.defId)A[U.defId]=U.def}if(_.external);else if(Object.keys(A).length>0)if(_.target==="draft-2020-12")z.$defs=A;else z.definitions=A;try{let J=JSON.parse(JSON.stringify(z));return Object.defineProperty(J,"~standard",{value:{...$["~standard"],jsonSchema:{input:O9($,"input",_.processors),output:O9($,"output",_.processors)}},enumerable:!1,writable:!1}),J}catch(J){throw Error("Error converting schema to JSON.")}}function f0(_,$){let b=$??{seen:new Set};if(b.seen.has(_))return!1;b.seen.add(_);let Z=_._zod.def;if(Z.type==="transform")return!0;if(Z.type==="array")return f0(Z.element,b);if(Z.type==="set")return f0(Z.valueType,b);if(Z.type==="lazy")return f0(Z.getter(),b);if(Z.type==="promise"||Z.type==="optional"||Z.type==="nonoptional"||Z.type==="nullable"||Z.type==="readonly"||Z.type==="default"||Z.type==="prefault")return f0(Z.innerType,b);if(Z.type==="intersection")return f0(Z.left,b)||f0(Z.right,b);if(Z.type==="record"||Z.type==="map")return f0(Z.keyType,b)||f0(Z.valueType,b);if(Z.type==="pipe")return f0(Z.in,b)||f0(Z.out,b);if(Z.type==="object"){for(let z in Z.shape)if(f0(Z.shape[z],b))return!0;return!1}if(Z.type==="union"){for(let z of Z.options)if(f0(z,b))return!0;return!1}if(Z.type==="tuple"){for(let z of Z.items)if(f0(z,b))return!0;if(Z.rest&&f0(Z.rest,b))return!0;return!1}return!1}var F8=(_,$={})=>(b)=>{let Z=W4({...b,processors:$});return A0(_,Z),w4(Z,_),B4(Z,_)},O9=(_,$,b={})=>(Z)=>{let{libraryOptions:z,target:A}=Z??{},J=W4({...z??{},target:A,io:$,processors:b});return A0(_,J),w4(J,_),B4(J,_)};var Qg={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},v8=(_,$,b,Z)=>{let z=b;z.type="string";let{minimum:A,maximum:J,format:U,patterns:G,contentEncoding:Y}=_._zod.bag;if(typeof A==="number")z.minLength=A;if(typeof J==="number")z.maxLength=J;if(U){if(z.format=Qg[U]??U,z.format==="")delete z.format;if(U==="time")delete z.format}if(Y)z.contentEncoding=Y;if(G&&G.size>0){let X=[...G];if(X.length===1)z.pattern=X[0].source;else if(X.length>1)z.allOf=[...X.map((Q)=>({...$.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"?{type:"string"}:{},pattern:Q.source}))]}},H8=(_,$,b,Z)=>{let z=b,{minimum:A,maximum:J,format:U,multipleOf:G,exclusiveMaximum:Y,exclusiveMinimum:X}=_._zod.bag;if(typeof U==="string"&&U.includes("int"))z.type="integer";else z.type="number";if(typeof X==="number")if($.target==="draft-04"||$.target==="openapi-3.0")z.minimum=X,z.exclusiveMinimum=!0;else z.exclusiveMinimum=X;if(typeof A==="number"){if(z.minimum=A,typeof X==="number"&&$.target!=="draft-04")if(X>=A)delete z.minimum;else delete z.exclusiveMinimum}if(typeof Y==="number")if($.target==="draft-04"||$.target==="openapi-3.0")z.maximum=Y,z.exclusiveMaximum=!0;else z.exclusiveMaximum=Y;if(typeof J==="number"){if(z.maximum=J,typeof Y==="number"&&$.target!=="draft-04")if(Y<=J)delete z.maximum;else delete z.exclusiveMaximum}if(typeof G==="number")z.multipleOf=G},q8=(_,$,b,Z)=>{b.type="boolean"},D8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},V8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},g8=(_,$,b,Z)=>{if($.target==="openapi-3.0")b.type="string",b.nullable=!0,b.enum=[null];else b.type="null"},k8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},W8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},w8=(_,$,b,Z)=>{b.not={}},B8=(_,$,b,Z)=>{},x8=(_,$,b,Z)=>{},N8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},I8=(_,$,b,Z)=>{let z=_._zod.def,A=v$(z.entries);if(A.every((J)=>typeof J==="number"))b.type="number";if(A.every((J)=>typeof J==="string"))b.type="string";b.enum=A},M8=(_,$,b,Z)=>{let z=_._zod.def,A=[];for(let J of z.values)if(J===void 0){if($.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof J==="bigint")if($.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else A.push(Number(J));else A.push(J);if(A.length===0);else if(A.length===1){let J=A[0];if(b.type=J===null?"null":typeof J,$.target==="draft-04"||$.target==="openapi-3.0")b.enum=[J];else b.const=J}else{if(A.every((J)=>typeof J==="number"))b.type="number";if(A.every((J)=>typeof J==="string"))b.type="string";if(A.every((J)=>typeof J==="boolean"))b.type="boolean";if(A.every((J)=>J===null))b.type="null";b.enum=A}},E8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},O8=(_,$,b,Z)=>{let z=b,A=_._zod.pattern;if(!A)throw Error("Pattern not found in template literal");z.type="string",z.pattern=A.source},P8=(_,$,b,Z)=>{let z=b,A={type:"string",format:"binary",contentEncoding:"binary"},{minimum:J,maximum:U,mime:G}=_._zod.bag;if(J!==void 0)A.minLength=J;if(U!==void 0)A.maxLength=U;if(G)if(G.length===1)A.contentMediaType=G[0],Object.assign(z,A);else Object.assign(z,A),z.anyOf=G.map((Y)=>({contentMediaType:Y}));else Object.assign(z,A)},j8=(_,$,b,Z)=>{b.type="boolean"},S8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},R8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},L8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},T8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},y8=(_,$,b,Z)=>{if($.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},C8=(_,$,b,Z)=>{let z=b,A=_._zod.def,{minimum:J,maximum:U}=_._zod.bag;if(typeof J==="number")z.minItems=J;if(typeof U==="number")z.maxItems=U;z.type="array",z.items=A0(A.element,$,{...Z,path:[...Z.path,"items"]})},f8=(_,$,b,Z)=>{let z=b,A=_._zod.def;z.type="object",z.properties={};let J=A.shape;for(let Y in J)z.properties[Y]=A0(J[Y],$,{...Z,path:[...Z.path,"properties",Y]});let U=new Set(Object.keys(J)),G=new Set([...U].filter((Y)=>{let X=A.shape[Y]._zod;if($.io==="input")return X.optin===void 0;else return X.optout===void 0}));if(G.size>0)z.required=Array.from(G);if(A.catchall?._zod.def.type==="never")z.additionalProperties=!1;else if(!A.catchall){if($.io==="output")z.additionalProperties=!1}else if(A.catchall)z.additionalProperties=A0(A.catchall,$,{...Z,path:[...Z.path,"additionalProperties"]})},y1=(_,$,b,Z)=>{let z=_._zod.def,A=z.inclusive===!1,J=z.options.map((U,G)=>A0(U,$,{...Z,path:[...Z.path,A?"oneOf":"anyOf",G]}));if(A)b.oneOf=J;else b.anyOf=J},m8=(_,$,b,Z)=>{let z=_._zod.def,A=A0(z.left,$,{...Z,path:[...Z.path,"allOf",0]}),J=A0(z.right,$,{...Z,path:[...Z.path,"allOf",1]}),U=(Y)=>("allOf"in Y)&&Object.keys(Y).length===1,G=[...U(A)?A.allOf:[A],...U(J)?J.allOf:[J]];b.allOf=G},u8=(_,$,b,Z)=>{let z=b,A=_._zod.def;z.type="array";let J=$.target==="draft-2020-12"?"prefixItems":"items",U=$.target==="draft-2020-12"?"items":$.target==="openapi-3.0"?"items":"additionalItems",G=A.items.map((K,v)=>A0(K,$,{...Z,path:[...Z.path,J,v]})),Y=A.rest?A0(A.rest,$,{...Z,path:[...Z.path,U,...$.target==="openapi-3.0"?[A.items.length]:[]]}):null;if($.target==="draft-2020-12"){if(z.prefixItems=G,Y)z.items=Y}else if($.target==="openapi-3.0"){if(z.items={anyOf:G},Y)z.items.anyOf.push(Y);if(z.minItems=G.length,!Y)z.maxItems=G.length}else if(z.items=G,Y)z.additionalItems=Y;let{minimum:X,maximum:Q}=_._zod.bag;if(typeof X==="number")z.minItems=X;if(typeof Q==="number")z.maxItems=Q},c8=(_,$,b,Z)=>{let z=b,A=_._zod.def;z.type="object";let J=A.keyType,G=J._zod.bag?.patterns;if(A.mode==="loose"&&G&&G.size>0){let X=A0(A.valueType,$,{...Z,path:[...Z.path,"patternProperties","*"]});z.patternProperties={};for(let Q of G)z.patternProperties[Q.source]=X}else{if($.target==="draft-07"||$.target==="draft-2020-12")z.propertyNames=A0(A.keyType,$,{...Z,path:[...Z.path,"propertyNames"]});z.additionalProperties=A0(A.valueType,$,{...Z,path:[...Z.path,"additionalProperties"]})}let Y=J._zod.values;if(Y){let X=[...Y].filter((Q)=>typeof Q==="string"||typeof Q==="number");if(X.length>0)z.required=X}},h8=(_,$,b,Z)=>{let z=_._zod.def,A=A0(z.innerType,$,Z),J=$.seen.get(_);if($.target==="openapi-3.0")J.ref=z.innerType,b.nullable=!0;else b.anyOf=[A,{type:"null"}]},r8=(_,$,b,Z)=>{let z=_._zod.def;A0(z.innerType,$,Z);let A=$.seen.get(_);A.ref=z.innerType},n8=(_,$,b,Z)=>{let z=_._zod.def;A0(z.innerType,$,Z);let A=$.seen.get(_);A.ref=z.innerType,b.default=JSON.parse(JSON.stringify(z.defaultValue))},l8=(_,$,b,Z)=>{let z=_._zod.def;A0(z.innerType,$,Z);let A=$.seen.get(_);if(A.ref=z.innerType,$.io==="input")b._prefault=JSON.parse(JSON.stringify(z.defaultValue))},p8=(_,$,b,Z)=>{let z=_._zod.def;A0(z.innerType,$,Z);let A=$.seen.get(_);A.ref=z.innerType;let J;try{J=z.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}b.default=J},d8=(_,$,b,Z)=>{let z=_._zod.def,A=$.io==="input"?z.in._zod.def.type==="transform"?z.out:z.in:z.out;A0(A,$,Z);let J=$.seen.get(_);J.ref=A},i8=(_,$,b,Z)=>{let z=_._zod.def;A0(z.innerType,$,Z);let A=$.seen.get(_);A.ref=z.innerType,b.readOnly=!0},o8=(_,$,b,Z)=>{let z=_._zod.def;A0(z.innerType,$,Z);let A=$.seen.get(_);A.ref=z.innerType},C1=(_,$,b,Z)=>{let z=_._zod.def;A0(z.innerType,$,Z);let A=$.seen.get(_);A.ref=z.innerType},a8=(_,$,b,Z)=>{let z=_._zod.innerType;A0(z,$,Z);let A=$.seen.get(_);A.ref=z},T1={string:v8,number:H8,boolean:q8,bigint:D8,symbol:V8,null:g8,undefined:k8,void:W8,never:w8,any:B8,unknown:x8,date:N8,enum:I8,literal:M8,nan:E8,template_literal:O8,file:P8,success:j8,custom:S8,function:R8,transform:L8,map:T8,set:y8,array:C8,object:f8,union:y1,intersection:m8,tuple:u8,record:c8,nullable:h8,nonoptional:r8,default:n8,prefault:l8,catch:p8,pipe:d8,readonly:i8,promise:o8,optional:C1,lazy:a8};function f1(_,$){if("_idmap"in _){let Z=_,z=W4({...$,processors:T1}),A={};for(let G of Z._idmap.entries()){let[Y,X]=G;A0(X,z)}let J={},U={registry:Z,uri:$?.uri,defs:A};z.external=U;for(let G of Z._idmap.entries()){let[Y,X]=G;w4(z,X),J[Y]=B4(z,X)}if(Object.keys(A).length>0){let G=z.target==="draft-2020-12"?"$defs":"definitions";J.__shared={[G]:A}}return{schemas:J}}let b=W4({...$,processors:T1});return A0(_,b),w4(b,_),B4(b,_)}class e8{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(_){this.ctx.counter=_}get seen(){return this.ctx.seen}constructor(_){let $=_?.target??"draft-2020-12";if($==="draft-4")$="draft-04";if($==="draft-7")$="draft-07";this.ctx=W4({processors:T1,target:$,..._?.metadata&&{metadata:_.metadata},..._?.unrepresentable&&{unrepresentable:_.unrepresentable},..._?.override&&{override:_.override},..._?.io&&{io:_.io}})}process(_,$={path:[],schemaPath:[]}){return A0(_,this.ctx,$)}emit(_,$){if($){if($.cycles)this.ctx.cycles=$.cycles;if($.reused)this.ctx.reused=$.reused;if($.external)this.ctx.external=$.external}w4(this.ctx,_);let b=B4(this.ctx,_),{"~standard":Z,...z}=b;return z}}var XY={};var T$={};i_(T$,{xor:()=>zX,xid:()=>NY,void:()=>aY,uuidv7:()=>DY,uuidv6:()=>qY,uuidv4:()=>HY,uuid:()=>vY,url:()=>VY,unknown:()=>h4,union:()=>Q6,undefined:()=>iY,ulid:()=>xY,uint64:()=>pY,uint32:()=>rY,tuple:()=>j5,transform:()=>F6,templateLiteral:()=>HX,symbol:()=>dY,superRefine:()=>ZJ,success:()=>KX,stringbool:()=>BX,stringFormat:()=>yY,string:()=>n1,strictObject:()=>_X,set:()=>UX,refine:()=>bJ,record:()=>S5,readonly:()=>e5,promise:()=>qX,preprocess:()=>NX,prefault:()=>n5,pipe:()=>m$,partialRecord:()=>ZX,optional:()=>C$,object:()=>sY,number:()=>H5,nullish:()=>QX,nullable:()=>f$,null:()=>k5,nonoptional:()=>l5,never:()=>X6,nativeEnum:()=>GX,nanoid:()=>WY,nan:()=>FX,meta:()=>WX,map:()=>JX,mac:()=>EY,looseRecord:()=>AX,looseObject:()=>$X,literal:()=>YX,lazy:()=>_J,ksuid:()=>IY,keyof:()=>tY,jwt:()=>TY,json:()=>xX,ipv6:()=>OY,ipv4:()=>MY,intersection:()=>O5,int64:()=>lY,int32:()=>hY,int:()=>l1,instanceof:()=>wX,httpUrl:()=>gY,hostname:()=>CY,hex:()=>fY,hash:()=>mY,guid:()=>FY,function:()=>DX,float64:()=>cY,float32:()=>uY,file:()=>XX,exactOptional:()=>m5,enum:()=>K6,emoji:()=>kY,email:()=>KY,e164:()=>LY,discriminatedUnion:()=>bX,describe:()=>kX,date:()=>eY,custom:()=>gX,cuid2:()=>BY,cuid:()=>wY,codec:()=>vX,cidrv6:()=>jY,cidrv4:()=>PY,check:()=>VX,catch:()=>i5,boolean:()=>q5,bigint:()=>nY,base64url:()=>RY,base64:()=>SY,array:()=>h$,any:()=>oY,_function:()=>DX,_default:()=>h5,_ZodString:()=>p1,ZodXor:()=>I5,ZodXID:()=>s1,ZodVoid:()=>x5,ZodUnknown:()=>w5,ZodUnion:()=>n$,ZodUndefined:()=>V5,ZodUUID:()=>T_,ZodURL:()=>u$,ZodULID:()=>t1,ZodType:()=>e,ZodTuple:()=>P5,ZodTransform:()=>C5,ZodTemplateLiteral:()=>t5,ZodSymbol:()=>D5,ZodSuccess:()=>p5,ZodStringFormat:()=>Q0,ZodString:()=>S9,ZodSet:()=>L5,ZodRecord:()=>l$,ZodReadonly:()=>a5,ZodPromise:()=>$J,ZodPrefault:()=>r5,ZodPipe:()=>q6,ZodOptional:()=>v6,ZodObject:()=>r$,ZodNumberFormat:()=>r4,ZodNumber:()=>L9,ZodNullable:()=>u5,ZodNull:()=>g5,ZodNonOptional:()=>H6,ZodNever:()=>B5,ZodNanoID:()=>o1,ZodNaN:()=>o5,ZodMap:()=>R5,ZodMAC:()=>v5,ZodLiteral:()=>T5,ZodLazy:()=>s5,ZodKSUID:()=>_6,ZodJWT:()=>G6,ZodIntersection:()=>E5,ZodIPv6:()=>z6,ZodIPv4:()=>$6,ZodGUID:()=>y$,ZodFunction:()=>zJ,ZodFile:()=>y5,ZodExactOptional:()=>f5,ZodEnum:()=>j9,ZodEmoji:()=>i1,ZodEmail:()=>d1,ZodE164:()=>U6,ZodDiscriminatedUnion:()=>M5,ZodDefault:()=>c5,ZodDate:()=>c$,ZodCustomStringFormat:()=>R9,ZodCustom:()=>p$,ZodCodec:()=>D6,ZodCatch:()=>d5,ZodCUID2:()=>e1,ZodCUID:()=>a1,ZodCIDRv6:()=>Z6,ZodCIDRv4:()=>b6,ZodBoolean:()=>T9,ZodBigIntFormat:()=>Y6,ZodBigInt:()=>y9,ZodBase64URL:()=>J6,ZodBase64:()=>A6,ZodArray:()=>N5,ZodAny:()=>W5});var m1={};i_(m1,{uppercase:()=>V9,trim:()=>x9,toUpperCase:()=>I9,toLowerCase:()=>N9,startsWith:()=>k9,slugify:()=>M9,size:()=>m4,regex:()=>q9,property:()=>L1,positive:()=>P1,overwrite:()=>W_,normalize:()=>B9,nonpositive:()=>S1,nonnegative:()=>R1,negative:()=>j1,multipleOf:()=>g4,minSize:()=>L_,minLength:()=>_4,mime:()=>w9,maxSize:()=>k4,maxLength:()=>u4,lte:()=>z_,lt:()=>S_,lowercase:()=>D9,length:()=>c4,includes:()=>g9,gte:()=>C0,gt:()=>R_,endsWith:()=>W9});var P9={};i_(P9,{time:()=>_5,duration:()=>$5,datetime:()=>t8,date:()=>s8,ZodISOTime:()=>h1,ZodISODuration:()=>r1,ZodISODateTime:()=>u1,ZodISODate:()=>c1});var u1=I("ZodISODateTime",(_,$)=>{TZ.init(_,$),Q0.init(_,$)});function t8(_){return SA(u1,_)}var c1=I("ZodISODate",(_,$)=>{yZ.init(_,$),Q0.init(_,$)});function s8(_){return RA(c1,_)}var h1=I("ZodISOTime",(_,$)=>{CZ.init(_,$),Q0.init(_,$)});function _5(_){return LA(h1,_)}var r1=I("ZodISODuration",(_,$)=>{fZ.init(_,$),Q0.init(_,$)});function $5(_){return TA(r1,_)}var QY=(_,$)=>{g$.init(_,$),_.name="ZodError",Object.defineProperties(_,{format:{value:(b)=>W$(_,b)},flatten:{value:(b)=>k$(_,b)},addIssue:{value:(b)=>{_.issues.push(b),_.message=JSON.stringify(_.issues,U9,2)}},addIssues:{value:(b)=>{_.issues.push(...b),_.message=JSON.stringify(_.issues,U9,2)}},isEmpty:{get(){return _.issues.length===0}}})},Fg=I("ZodError",QY),p0=I("ZodError",QY,{Parent:Error});var z5=X9(p0),b5=Q9(p0),Z5=K9(p0),A5=F9(p0),J5=h2(p0),U5=r2(p0),G5=n2(p0),Y5=l2(p0),X5=p2(p0),Q5=d2(p0),K5=i2(p0),F5=o2(p0);var e=I("ZodType",(_,$)=>{return i.init(_,$),Object.assign(_["~standard"],{jsonSchema:{input:O9(_,"input"),output:O9(_,"output")}}),_.toJSONSchema=F8(_,{}),_.def=$,_.type=$.type,Object.defineProperty(_,"_def",{value:$}),_.check=(...b)=>{return _.clone(h.mergeDefs($,{checks:[...$.checks??[],...b.map((Z)=>typeof Z==="function"?{_zod:{check:Z,def:{check:"custom"},onattach:[]}}:Z)]}),{parent:!0})},_.with=_.check,_.clone=(b,Z)=>y0(_,b,Z),_.brand=()=>_,_.register=(b,Z)=>{return b.add(_,Z),_},_.parse=(b,Z)=>z5(_,b,Z,{callee:_.parse}),_.safeParse=(b,Z)=>Z5(_,b,Z),_.parseAsync=async(b,Z)=>b5(_,b,Z,{callee:_.parseAsync}),_.safeParseAsync=async(b,Z)=>A5(_,b,Z),_.spa=_.safeParseAsync,_.encode=(b,Z)=>J5(_,b,Z),_.decode=(b,Z)=>U5(_,b,Z),_.encodeAsync=async(b,Z)=>G5(_,b,Z),_.decodeAsync=async(b,Z)=>Y5(_,b,Z),_.safeEncode=(b,Z)=>X5(_,b,Z),_.safeDecode=(b,Z)=>Q5(_,b,Z),_.safeEncodeAsync=async(b,Z)=>K5(_,b,Z),_.safeDecodeAsync=async(b,Z)=>F5(_,b,Z),_.refine=(b,Z)=>_.check(bJ(b,Z)),_.superRefine=(b)=>_.check(ZJ(b)),_.overwrite=(b)=>_.check(W_(b)),_.optional=()=>C$(_),_.exactOptional=()=>m5(_),_.nullable=()=>f$(_),_.nullish=()=>C$(f$(_)),_.nonoptional=(b)=>l5(_,b),_.array=()=>h$(_),_.or=(b)=>Q6([_,b]),_.and=(b)=>O5(_,b),_.transform=(b)=>m$(_,F6(b)),_.default=(b)=>h5(_,b),_.prefault=(b)=>n5(_,b),_.catch=(b)=>i5(_,b),_.pipe=(b)=>m$(_,b),_.readonly=()=>e5(_),_.describe=(b)=>{let Z=_.clone();return E0.add(Z,{description:b}),Z},Object.defineProperty(_,"description",{get(){return E0.get(_)?.description},configurable:!0}),_.meta=(...b)=>{if(b.length===0)return E0.get(_);let Z=_.clone();return E0.add(Z,b[0]),Z},_.isOptional=()=>_.safeParse(void 0).success,_.isNullable=()=>_.safeParse(null).success,_.apply=(b)=>b(_),_}),p1=I("_ZodString",(_,$)=>{f4.init(_,$),e.init(_,$),_._zod.processJSONSchema=(Z,z,A)=>v8(_,Z,z,A);let b=_._zod.bag;_.format=b.format??null,_.minLength=b.minimum??null,_.maxLength=b.maximum??null,_.regex=(...Z)=>_.check(q9(...Z)),_.includes=(...Z)=>_.check(g9(...Z)),_.startsWith=(...Z)=>_.check(k9(...Z)),_.endsWith=(...Z)=>_.check(W9(...Z)),_.min=(...Z)=>_.check(_4(...Z)),_.max=(...Z)=>_.check(u4(...Z)),_.length=(...Z)=>_.check(c4(...Z)),_.nonempty=(...Z)=>_.check(_4(1,...Z)),_.lowercase=(Z)=>_.check(D9(Z)),_.uppercase=(Z)=>_.check(V9(Z)),_.trim=()=>_.check(x9()),_.normalize=(...Z)=>_.check(B9(...Z)),_.toLowerCase=()=>_.check(N9()),_.toUpperCase=()=>_.check(I9()),_.slugify=()=>_.check(M9())}),S9=I("ZodString",(_,$)=>{f4.init(_,$),p1.init(_,$),_.email=(b)=>_.check(X1(d1,b)),_.url=(b)=>_.check(L$(u$,b)),_.jwt=(b)=>_.check(O1(G6,b)),_.emoji=(b)=>_.check(H1(i1,b)),_.guid=(b)=>_.check(R$(y$,b)),_.uuid=(b)=>_.check(Q1(T_,b)),_.uuidv4=(b)=>_.check(K1(T_,b)),_.uuidv6=(b)=>_.check(F1(T_,b)),_.uuidv7=(b)=>_.check(v1(T_,b)),_.nanoid=(b)=>_.check(q1(o1,b)),_.guid=(b)=>_.check(R$(y$,b)),_.cuid=(b)=>_.check(D1(a1,b)),_.cuid2=(b)=>_.check(V1(e1,b)),_.ulid=(b)=>_.check(g1(t1,b)),_.base64=(b)=>_.check(I1(A6,b)),_.base64url=(b)=>_.check(M1(J6,b)),_.xid=(b)=>_.check(k1(s1,b)),_.ksuid=(b)=>_.check(W1(_6,b)),_.ipv4=(b)=>_.check(w1($6,b)),_.ipv6=(b)=>_.check(B1(z6,b)),_.cidrv4=(b)=>_.check(x1(b6,b)),_.cidrv6=(b)=>_.check(N1(Z6,b)),_.e164=(b)=>_.check(E1(U6,b)),_.datetime=(b)=>_.check(t8(b)),_.date=(b)=>_.check(s8(b)),_.time=(b)=>_.check(_5(b)),_.duration=(b)=>_.check($5(b))});function n1(_){return EA(S9,_)}var Q0=I("ZodStringFormat",(_,$)=>{X0.init(_,$),p1.init(_,$)}),d1=I("ZodEmail",(_,$)=>{IZ.init(_,$),Q0.init(_,$)});function KY(_){return X1(d1,_)}var y$=I("ZodGUID",(_,$)=>{xZ.init(_,$),Q0.init(_,$)});function FY(_){return R$(y$,_)}var T_=I("ZodUUID",(_,$)=>{NZ.init(_,$),Q0.init(_,$)});function vY(_){return Q1(T_,_)}function HY(_){return K1(T_,_)}function qY(_){return F1(T_,_)}function DY(_){return v1(T_,_)}var u$=I("ZodURL",(_,$)=>{MZ.init(_,$),Q0.init(_,$)});function VY(_){return L$(u$,_)}function gY(_){return L$(u$,{protocol:/^https?$/,hostname:K_.domain,...h.normalizeParams(_)})}var i1=I("ZodEmoji",(_,$)=>{EZ.init(_,$),Q0.init(_,$)});function kY(_){return H1(i1,_)}var o1=I("ZodNanoID",(_,$)=>{OZ.init(_,$),Q0.init(_,$)});function WY(_){return q1(o1,_)}var a1=I("ZodCUID",(_,$)=>{PZ.init(_,$),Q0.init(_,$)});function wY(_){return D1(a1,_)}var e1=I("ZodCUID2",(_,$)=>{jZ.init(_,$),Q0.init(_,$)});function BY(_){return V1(e1,_)}var t1=I("ZodULID",(_,$)=>{SZ.init(_,$),Q0.init(_,$)});function xY(_){return g1(t1,_)}var s1=I("ZodXID",(_,$)=>{RZ.init(_,$),Q0.init(_,$)});function NY(_){return k1(s1,_)}var _6=I("ZodKSUID",(_,$)=>{LZ.init(_,$),Q0.init(_,$)});function IY(_){return W1(_6,_)}var $6=I("ZodIPv4",(_,$)=>{mZ.init(_,$),Q0.init(_,$)});function MY(_){return w1($6,_)}var v5=I("ZodMAC",(_,$)=>{cZ.init(_,$),Q0.init(_,$)});function EY(_){return PA(v5,_)}var z6=I("ZodIPv6",(_,$)=>{uZ.init(_,$),Q0.init(_,$)});function OY(_){return B1(z6,_)}var b6=I("ZodCIDRv4",(_,$)=>{hZ.init(_,$),Q0.init(_,$)});function PY(_){return x1(b6,_)}var Z6=I("ZodCIDRv6",(_,$)=>{rZ.init(_,$),Q0.init(_,$)});function jY(_){return N1(Z6,_)}var A6=I("ZodBase64",(_,$)=>{lZ.init(_,$),Q0.init(_,$)});function SY(_){return I1(A6,_)}var J6=I("ZodBase64URL",(_,$)=>{pZ.init(_,$),Q0.init(_,$)});function RY(_){return M1(J6,_)}var U6=I("ZodE164",(_,$)=>{dZ.init(_,$),Q0.init(_,$)});function LY(_){return E1(U6,_)}var G6=I("ZodJWT",(_,$)=>{iZ.init(_,$),Q0.init(_,$)});function TY(_){return O1(G6,_)}var R9=I("ZodCustomStringFormat",(_,$)=>{oZ.init(_,$),Q0.init(_,$)});function yY(_,$,b={}){return E9(R9,_,$,b)}function CY(_){return E9(R9,"hostname",K_.hostname,_)}function fY(_){return E9(R9,"hex",K_.hex,_)}function mY(_,$){let b=$?.enc??"hex",Z=`${_}_${b}`,z=K_[Z];if(!z)throw Error(`Unrecognized hash format: ${Z}`);return E9(R9,Z,z,$)}var L9=I("ZodNumber",(_,$)=>{A1.init(_,$),e.init(_,$),_._zod.processJSONSchema=(Z,z,A)=>H8(_,Z,z,A),_.gt=(Z,z)=>_.check(R_(Z,z)),_.gte=(Z,z)=>_.check(C0(Z,z)),_.min=(Z,z)=>_.check(C0(Z,z)),_.lt=(Z,z)=>_.check(S_(Z,z)),_.lte=(Z,z)=>_.check(z_(Z,z)),_.max=(Z,z)=>_.check(z_(Z,z)),_.int=(Z)=>_.check(l1(Z)),_.safe=(Z)=>_.check(l1(Z)),_.positive=(Z)=>_.check(R_(0,Z)),_.nonnegative=(Z)=>_.check(C0(0,Z)),_.negative=(Z)=>_.check(S_(0,Z)),_.nonpositive=(Z)=>_.check(z_(0,Z)),_.multipleOf=(Z,z)=>_.check(g4(Z,z)),_.step=(Z,z)=>_.check(g4(Z,z)),_.finite=()=>_;let b=_._zod.bag;_.minValue=Math.max(b.minimum??Number.NEGATIVE_INFINITY,b.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,_.maxValue=Math.min(b.maximum??Number.POSITIVE_INFINITY,b.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,_.isInt=(b.format??"").includes("int")||Number.isSafeInteger(b.multipleOf??0.5),_.isFinite=!0,_.format=b.format??null});function H5(_){return yA(L9,_)}var r4=I("ZodNumberFormat",(_,$)=>{aZ.init(_,$),L9.init(_,$)});function l1(_){return fA(r4,_)}function uY(_){return mA(r4,_)}function cY(_){return uA(r4,_)}function hY(_){return cA(r4,_)}function rY(_){return hA(r4,_)}var T9=I("ZodBoolean",(_,$)=>{N$.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>q8(_,b,Z,z)});function q5(_){return rA(T9,_)}var y9=I("ZodBigInt",(_,$)=>{J1.init(_,$),e.init(_,$),_._zod.processJSONSchema=(Z,z,A)=>D8(_,Z,z,A),_.gte=(Z,z)=>_.check(C0(Z,z)),_.min=(Z,z)=>_.check(C0(Z,z)),_.gt=(Z,z)=>_.check(R_(Z,z)),_.gte=(Z,z)=>_.check(C0(Z,z)),_.min=(Z,z)=>_.check(C0(Z,z)),_.lt=(Z,z)=>_.check(S_(Z,z)),_.lte=(Z,z)=>_.check(z_(Z,z)),_.max=(Z,z)=>_.check(z_(Z,z)),_.positive=(Z)=>_.check(R_(BigInt(0),Z)),_.negative=(Z)=>_.check(S_(BigInt(0),Z)),_.nonpositive=(Z)=>_.check(z_(BigInt(0),Z)),_.nonnegative=(Z)=>_.check(C0(BigInt(0),Z)),_.multipleOf=(Z,z)=>_.check(g4(Z,z));let b=_._zod.bag;_.minValue=b.minimum??null,_.maxValue=b.maximum??null,_.format=b.format??null});function nY(_){return lA(y9,_)}var Y6=I("ZodBigIntFormat",(_,$)=>{eZ.init(_,$),y9.init(_,$)});function lY(_){return dA(Y6,_)}function pY(_){return iA(Y6,_)}var D5=I("ZodSymbol",(_,$)=>{tZ.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>V8(_,b,Z,z)});function dY(_){return oA(D5,_)}var V5=I("ZodUndefined",(_,$)=>{sZ.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>k8(_,b,Z,z)});function iY(_){return aA(V5,_)}var g5=I("ZodNull",(_,$)=>{_3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>g8(_,b,Z,z)});function k5(_){return eA(g5,_)}var W5=I("ZodAny",(_,$)=>{$3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>B8(_,b,Z,z)});function oY(){return tA(W5)}var w5=I("ZodUnknown",(_,$)=>{z3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>x8(_,b,Z,z)});function h4(){return sA(w5)}var B5=I("ZodNever",(_,$)=>{b3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>w8(_,b,Z,z)});function X6(_){return _8(B5,_)}var x5=I("ZodVoid",(_,$)=>{Z3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>W8(_,b,Z,z)});function aY(_){return $8(x5,_)}var c$=I("ZodDate",(_,$)=>{A3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(Z,z,A)=>N8(_,Z,z,A),_.min=(Z,z)=>_.check(C0(Z,z)),_.max=(Z,z)=>_.check(z_(Z,z));let b=_._zod.bag;_.minDate=b.minimum?new Date(b.minimum):null,_.maxDate=b.maximum?new Date(b.maximum):null});function eY(_){return z8(c$,_)}var N5=I("ZodArray",(_,$)=>{J3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>C8(_,b,Z,z),_.element=$.element,_.min=(b,Z)=>_.check(_4(b,Z)),_.nonempty=(b)=>_.check(_4(1,b)),_.max=(b,Z)=>_.check(u4(b,Z)),_.length=(b,Z)=>_.check(c4(b,Z)),_.unwrap=()=>_.element});function h$(_,$){return A8(N5,_,$)}function tY(_){let $=_._zod.def.shape;return K6(Object.keys($))}var r$=I("ZodObject",(_,$)=>{U3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>f8(_,b,Z,z),h.defineLazy(_,"shape",()=>{return $.shape}),_.keyof=()=>K6(Object.keys(_._zod.def.shape)),_.catchall=(b)=>_.clone({..._._zod.def,catchall:b}),_.passthrough=()=>_.clone({..._._zod.def,catchall:h4()}),_.loose=()=>_.clone({..._._zod.def,catchall:h4()}),_.strict=()=>_.clone({..._._zod.def,catchall:X6()}),_.strip=()=>_.clone({..._._zod.def,catchall:void 0}),_.extend=(b)=>{return h.extend(_,b)},_.safeExtend=(b)=>{return h.safeExtend(_,b)},_.merge=(b)=>h.merge(_,b),_.pick=(b)=>h.pick(_,b),_.omit=(b)=>h.omit(_,b),_.partial=(...b)=>h.partial(v6,_,b[0]),_.required=(...b)=>h.required(H6,_,b[0])});function sY(_,$){let b={type:"object",shape:_??{},...h.normalizeParams($)};return new r$(b)}function _X(_,$){return new r$({type:"object",shape:_,catchall:X6(),...h.normalizeParams($)})}function $X(_,$){return new r$({type:"object",shape:_,catchall:h4(),...h.normalizeParams($)})}var n$=I("ZodUnion",(_,$)=>{I$.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>y1(_,b,Z,z),_.options=$.options});function Q6(_,$){return new n$({type:"union",options:_,...h.normalizeParams($)})}var I5=I("ZodXor",(_,$)=>{n$.init(_,$),G3.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>y1(_,b,Z,z),_.options=$.options});function zX(_,$){return new I5({type:"union",options:_,inclusive:!1,...h.normalizeParams($)})}var M5=I("ZodDiscriminatedUnion",(_,$)=>{n$.init(_,$),Y3.init(_,$)});function bX(_,$,b){return new M5({type:"union",options:$,discriminator:_,...h.normalizeParams(b)})}var E5=I("ZodIntersection",(_,$)=>{X3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>m8(_,b,Z,z)});function O5(_,$){return new E5({type:"intersection",left:_,right:$})}var P5=I("ZodTuple",(_,$)=>{U1.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>u8(_,b,Z,z),_.rest=(b)=>_.clone({..._._zod.def,rest:b})});function j5(_,$,b){let Z=$ instanceof i,z=Z?b:$;return new P5({type:"tuple",items:_,rest:Z?$:null,...h.normalizeParams(z)})}var l$=I("ZodRecord",(_,$)=>{Q3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>c8(_,b,Z,z),_.keyType=$.keyType,_.valueType=$.valueType});function S5(_,$,b){return new l$({type:"record",keyType:_,valueType:$,...h.normalizeParams(b)})}function ZX(_,$,b){let Z=y0(_);return Z._zod.values=void 0,new l$({type:"record",keyType:Z,valueType:$,...h.normalizeParams(b)})}function AX(_,$,b){return new l$({type:"record",keyType:_,valueType:$,mode:"loose",...h.normalizeParams(b)})}var R5=I("ZodMap",(_,$)=>{K3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>T8(_,b,Z,z),_.keyType=$.keyType,_.valueType=$.valueType,_.min=(...b)=>_.check(L_(...b)),_.nonempty=(b)=>_.check(L_(1,b)),_.max=(...b)=>_.check(k4(...b)),_.size=(...b)=>_.check(m4(...b))});function JX(_,$,b){return new R5({type:"map",keyType:_,valueType:$,...h.normalizeParams(b)})}var L5=I("ZodSet",(_,$)=>{F3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>y8(_,b,Z,z),_.min=(...b)=>_.check(L_(...b)),_.nonempty=(b)=>_.check(L_(1,b)),_.max=(...b)=>_.check(k4(...b)),_.size=(...b)=>_.check(m4(...b))});function UX(_,$){return new L5({type:"set",valueType:_,...h.normalizeParams($)})}var j9=I("ZodEnum",(_,$)=>{v3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(Z,z,A)=>I8(_,Z,z,A),_.enum=$.entries,_.options=Object.values($.entries);let b=new Set(Object.keys($.entries));_.extract=(Z,z)=>{let A={};for(let J of Z)if(b.has(J))A[J]=$.entries[J];else throw Error(`Key ${J} not found in enum`);return new j9({...$,checks:[],...h.normalizeParams(z),entries:A})},_.exclude=(Z,z)=>{let A={...$.entries};for(let J of Z)if(b.has(J))delete A[J];else throw Error(`Key ${J} not found in enum`);return new j9({...$,checks:[],...h.normalizeParams(z),entries:A})}});function K6(_,$){let b=Array.isArray(_)?Object.fromEntries(_.map((Z)=>[Z,Z])):_;return new j9({type:"enum",entries:b,...h.normalizeParams($)})}function GX(_,$){return new j9({type:"enum",entries:_,...h.normalizeParams($)})}var T5=I("ZodLiteral",(_,$)=>{H3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>M8(_,b,Z,z),_.values=new Set($.values),Object.defineProperty(_,"value",{get(){if($.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return $.values[0]}})});function YX(_,$){return new T5({type:"literal",values:Array.isArray(_)?_:[_],...h.normalizeParams($)})}var y5=I("ZodFile",(_,$)=>{q3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>P8(_,b,Z,z),_.min=(b,Z)=>_.check(L_(b,Z)),_.max=(b,Z)=>_.check(k4(b,Z)),_.mime=(b,Z)=>_.check(w9(Array.isArray(b)?b:[b],Z))});function XX(_){return J8(y5,_)}var C5=I("ZodTransform",(_,$)=>{D3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>L8(_,b,Z,z),_._zod.parse=(b,Z)=>{if(Z.direction==="backward")throw new T4(_.constructor.name);b.addIssue=(A)=>{if(typeof A==="string")b.issues.push(h.issue(A,b.value,$));else{let J=A;if(J.fatal)J.continue=!1;J.code??(J.code="custom"),J.input??(J.input=b.value),J.inst??(J.inst=_),b.issues.push(h.issue(J))}};let z=$.transform(b.value,b);if(z instanceof Promise)return z.then((A)=>{return b.value=A,b});return b.value=z,b}});function F6(_){return new C5({type:"transform",transform:_})}var v6=I("ZodOptional",(_,$)=>{G1.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>C1(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType});function C$(_){return new v6({type:"optional",innerType:_})}var f5=I("ZodExactOptional",(_,$)=>{V3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>C1(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType});function m5(_){return new f5({type:"optional",innerType:_})}var u5=I("ZodNullable",(_,$)=>{g3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>h8(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType});function f$(_){return new u5({type:"nullable",innerType:_})}function QX(_){return C$(f$(_))}var c5=I("ZodDefault",(_,$)=>{k3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>n8(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType,_.removeDefault=_.unwrap});function h5(_,$){return new c5({type:"default",innerType:_,get defaultValue(){return typeof $==="function"?$():h.shallowClone($)}})}var r5=I("ZodPrefault",(_,$)=>{W3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>l8(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType});function n5(_,$){return new r5({type:"prefault",innerType:_,get defaultValue(){return typeof $==="function"?$():h.shallowClone($)}})}var H6=I("ZodNonOptional",(_,$)=>{w3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>r8(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType});function l5(_,$){return new H6({type:"nonoptional",innerType:_,...h.normalizeParams($)})}var p5=I("ZodSuccess",(_,$)=>{B3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>j8(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType});function KX(_){return new p5({type:"success",innerType:_})}var d5=I("ZodCatch",(_,$)=>{x3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>p8(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType,_.removeCatch=_.unwrap});function i5(_,$){return new d5({type:"catch",innerType:_,catchValue:typeof $==="function"?$:()=>$})}var o5=I("ZodNaN",(_,$)=>{N3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>E8(_,b,Z,z)});function FX(_){return Z8(o5,_)}var q6=I("ZodPipe",(_,$)=>{I3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>d8(_,b,Z,z),_.in=$.in,_.out=$.out});function m$(_,$){return new q6({type:"pipe",in:_,out:$})}var D6=I("ZodCodec",(_,$)=>{q6.init(_,$),M$.init(_,$)});function vX(_,$,b){return new D6({type:"pipe",in:_,out:$,transform:b.decode,reverseTransform:b.encode})}var a5=I("ZodReadonly",(_,$)=>{M3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>i8(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType});function e5(_){return new a5({type:"readonly",innerType:_})}var t5=I("ZodTemplateLiteral",(_,$)=>{E3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>O8(_,b,Z,z)});function HX(_,$){return new t5({type:"template_literal",parts:_,...h.normalizeParams($)})}var s5=I("ZodLazy",(_,$)=>{j3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>a8(_,b,Z,z),_.unwrap=()=>_._zod.def.getter()});function _J(_){return new s5({type:"lazy",getter:_})}var $J=I("ZodPromise",(_,$)=>{P3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>o8(_,b,Z,z),_.unwrap=()=>_._zod.def.innerType});function qX(_){return new $J({type:"promise",innerType:_})}var zJ=I("ZodFunction",(_,$)=>{O3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>R8(_,b,Z,z)});function DX(_){return new zJ({type:"function",input:Array.isArray(_?.input)?j5(_?.input):_?.input??h$(h4()),output:_?.output??h4()})}var p$=I("ZodCustom",(_,$)=>{S3.init(_,$),e.init(_,$),_._zod.processJSONSchema=(b,Z,z)=>S8(_,b,Z,z)});function VX(_){let $=new K0({check:"custom"});return $._zod.check=_,$}function gX(_,$){return U8(p$,_??(()=>!0),$)}function bJ(_,$={}){return G8(p$,_,$)}function ZJ(_){return Y8(_)}var kX=X8,WX=Q8;function wX(_,$={}){let b=new p$({type:"custom",check:"custom",fn:(Z)=>Z instanceof _,abort:!0,...h.normalizeParams($)});return b._zod.bag.Class=_,b._zod.check=(Z)=>{if(!(Z.value instanceof _))Z.issues.push({code:"invalid_type",expected:_.name,input:Z.value,inst:b,path:[...b._zod.def.path??[]]})},b}var BX=(..._)=>K8({Codec:D6,Boolean:T9,String:S9},..._);function xX(_){let $=_J(()=>{return Q6([n1(_),H5(),q5(),k5(),h$($),S5(n1(),$)])});return $}function NX(_,$){return m$(F6(_),$)}var Hg={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 qg(_){V0({customError:_})}function Dg(){return V0().customError}var AJ;(function(_){})(AJ||(AJ={}));var n={...T$,...m1,iso:P9},Vg=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function gg(_,$){let b=_.$schema;if(b==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(b==="http://json-schema.org/draft-07/schema#")return"draft-7";if(b==="http://json-schema.org/draft-04/schema#")return"draft-4";return $??"draft-2020-12"}function kg(_,$){if(!_.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let b=_.slice(1).split("/").filter(Boolean);if(b.length===0)return $.rootSchema;let Z=$.version==="draft-2020-12"?"$defs":"definitions";if(b[0]===Z){let z=b[1];if(!z||!$.defs[z])throw Error(`Reference not found: ${_}`);return $.defs[z]}throw Error(`Reference not found: ${_}`)}function IX(_,$){if(_.not!==void 0){if(typeof _.not==="object"&&Object.keys(_.not).length===0)return n.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(_.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(_.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(_.if!==void 0||_.then!==void 0||_.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(_.dependentSchemas!==void 0||_.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(_.$ref){let z=_.$ref;if($.refs.has(z))return $.refs.get(z);if($.processing.has(z))return n.lazy(()=>{if(!$.refs.has(z))throw Error(`Circular reference not resolved: ${z}`);return $.refs.get(z)});$.processing.add(z);let A=kg(z,$),J=j0(A,$);return $.refs.set(z,J),$.processing.delete(z),J}if(_.enum!==void 0){let z=_.enum;if($.version==="openapi-3.0"&&_.nullable===!0&&z.length===1&&z[0]===null)return n.null();if(z.length===0)return n.never();if(z.length===1)return n.literal(z[0]);if(z.every((J)=>typeof J==="string"))return n.enum(z);let A=z.map((J)=>n.literal(J));if(A.length<2)return A[0];return n.union([A[0],A[1],...A.slice(2)])}if(_.const!==void 0)return n.literal(_.const);let b=_.type;if(Array.isArray(b)){let z=b.map((A)=>{let J={..._,type:A};return IX(J,$)});if(z.length===0)return n.never();if(z.length===1)return z[0];return n.union(z)}if(!b)return n.any();let Z;switch(b){case"string":{let z=n.string();if(_.format){let A=_.format;if(A==="email")z=z.check(n.email());else if(A==="uri"||A==="uri-reference")z=z.check(n.url());else if(A==="uuid"||A==="guid")z=z.check(n.uuid());else if(A==="date-time")z=z.check(n.iso.datetime());else if(A==="date")z=z.check(n.iso.date());else if(A==="time")z=z.check(n.iso.time());else if(A==="duration")z=z.check(n.iso.duration());else if(A==="ipv4")z=z.check(n.ipv4());else if(A==="ipv6")z=z.check(n.ipv6());else if(A==="mac")z=z.check(n.mac());else if(A==="cidr")z=z.check(n.cidrv4());else if(A==="cidr-v6")z=z.check(n.cidrv6());else if(A==="base64")z=z.check(n.base64());else if(A==="base64url")z=z.check(n.base64url());else if(A==="e164")z=z.check(n.e164());else if(A==="jwt")z=z.check(n.jwt());else if(A==="emoji")z=z.check(n.emoji());else if(A==="nanoid")z=z.check(n.nanoid());else if(A==="cuid")z=z.check(n.cuid());else if(A==="cuid2")z=z.check(n.cuid2());else if(A==="ulid")z=z.check(n.ulid());else if(A==="xid")z=z.check(n.xid());else if(A==="ksuid")z=z.check(n.ksuid())}if(typeof _.minLength==="number")z=z.min(_.minLength);if(typeof _.maxLength==="number")z=z.max(_.maxLength);if(_.pattern)z=z.regex(new RegExp(_.pattern));Z=z;break}case"number":case"integer":{let z=b==="integer"?n.number().int():n.number();if(typeof _.minimum==="number")z=z.min(_.minimum);if(typeof _.maximum==="number")z=z.max(_.maximum);if(typeof _.exclusiveMinimum==="number")z=z.gt(_.exclusiveMinimum);else if(_.exclusiveMinimum===!0&&typeof _.minimum==="number")z=z.gt(_.minimum);if(typeof _.exclusiveMaximum==="number")z=z.lt(_.exclusiveMaximum);else if(_.exclusiveMaximum===!0&&typeof _.maximum==="number")z=z.lt(_.maximum);if(typeof _.multipleOf==="number")z=z.multipleOf(_.multipleOf);Z=z;break}case"boolean":{Z=n.boolean();break}case"null":{Z=n.null();break}case"object":{let z={},A=_.properties||{},J=new Set(_.required||[]);for(let[G,Y]of Object.entries(A)){let X=j0(Y,$);z[G]=J.has(G)?X:X.optional()}if(_.propertyNames){let G=j0(_.propertyNames,$),Y=_.additionalProperties&&typeof _.additionalProperties==="object"?j0(_.additionalProperties,$):n.any();if(Object.keys(z).length===0){Z=n.record(G,Y);break}let X=n.object(z).passthrough(),Q=n.looseRecord(G,Y);Z=n.intersection(X,Q);break}if(_.patternProperties){let G=_.patternProperties,Y=Object.keys(G),X=[];for(let K of Y){let v=j0(G[K],$),D=n.string().regex(new RegExp(K));X.push(n.looseRecord(D,v))}let Q=[];if(Object.keys(z).length>0)Q.push(n.object(z).passthrough());if(Q.push(...X),Q.length===0)Z=n.object({}).passthrough();else if(Q.length===1)Z=Q[0];else{let K=n.intersection(Q[0],Q[1]);for(let v=2;v<Q.length;v++)K=n.intersection(K,Q[v]);Z=K}break}let U=n.object(z);if(_.additionalProperties===!1)Z=U.strict();else if(typeof _.additionalProperties==="object")Z=U.catchall(j0(_.additionalProperties,$));else Z=U.passthrough();break}case"array":{let{prefixItems:z,items:A}=_;if(z&&Array.isArray(z)){let J=z.map((G)=>j0(G,$)),U=A&&typeof A==="object"&&!Array.isArray(A)?j0(A,$):void 0;if(U)Z=n.tuple(J).rest(U);else Z=n.tuple(J);if(typeof _.minItems==="number")Z=Z.check(n.minLength(_.minItems));if(typeof _.maxItems==="number")Z=Z.check(n.maxLength(_.maxItems))}else if(Array.isArray(A)){let J=A.map((G)=>j0(G,$)),U=_.additionalItems&&typeof _.additionalItems==="object"?j0(_.additionalItems,$):void 0;if(U)Z=n.tuple(J).rest(U);else Z=n.tuple(J);if(typeof _.minItems==="number")Z=Z.check(n.minLength(_.minItems));if(typeof _.maxItems==="number")Z=Z.check(n.maxLength(_.maxItems))}else if(A!==void 0){let J=j0(A,$),U=n.array(J);if(typeof _.minItems==="number")U=U.min(_.minItems);if(typeof _.maxItems==="number")U=U.max(_.maxItems);Z=U}else Z=n.array(n.any());break}default:throw Error(`Unsupported type: ${b}`)}if(_.description)Z=Z.describe(_.description);if(_.default!==void 0)Z=Z.default(_.default);return Z}function j0(_,$){if(typeof _==="boolean")return _?n.any():n.never();let b=IX(_,$),Z=_.type||_.enum!==void 0||_.const!==void 0;if(_.anyOf&&Array.isArray(_.anyOf)){let U=_.anyOf.map((Y)=>j0(Y,$)),G=n.union(U);b=Z?n.intersection(b,G):G}if(_.oneOf&&Array.isArray(_.oneOf)){let U=_.oneOf.map((Y)=>j0(Y,$)),G=n.xor(U);b=Z?n.intersection(b,G):G}if(_.allOf&&Array.isArray(_.allOf))if(_.allOf.length===0)b=Z?b:n.any();else{let U=Z?b:j0(_.allOf[0],$),G=Z?0:1;for(let Y=G;Y<_.allOf.length;Y++)U=n.intersection(U,j0(_.allOf[Y],$));b=U}if(_.nullable===!0&&$.version==="openapi-3.0")b=n.nullable(b);if(_.readOnly===!0)b=n.readonly(b);let z={},A=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let U of A)if(U in _)z[U]=_[U];let J=["contentEncoding","contentMediaType","contentSchema"];for(let U of J)if(U in _)z[U]=_[U];for(let U of Object.keys(_))if(!Vg.has(U))z[U]=_[U];if(Object.keys(z).length>0)$.registry.add(b,z);return b}function MX(_,$){if(typeof _==="boolean")return _?n.any():n.never();let b=gg(_,$?.defaultTarget),Z=_.$defs||_.definitions||{},z={version:b,defs:Z,refs:new Map,processing:new Set,rootSchema:_,registry:$?.registry??E0};return j0(_,z)}var JJ={};i_(JJ,{string:()=>Wg,number:()=>wg,date:()=>Ng,boolean:()=>Bg,bigint:()=>xg});function Wg(_){return OA(S9,_)}function wg(_){return CA(L9,_)}function Bg(_){return nA(T9,_)}function xg(_){return pA(y9,_)}function Ng(_){return b8(c$,_)}V0(E$());var EX=M.object({sha256:M.string(),mediaType:M.string()}),Ig=M.object({type:M.literal("user"),text:M.string(),images:M.array(EX).optional(),id:M.string().optional(),timestamp:M.string().optional()}),Mg=M.object({type:M.literal("compaction-summary"),text:M.string(),id:M.string().optional(),timestamp:M.string().optional()}),Eg=M.object({type:M.literal("command"),name:M.string(),args:M.string().optional(),output:M.string().optional(),id:M.string().optional(),timestamp:M.string().optional()}),Og=M.object({type:M.literal("agent"),text:M.string(),id:M.string().optional(),timestamp:M.string().optional(),model:M.string().optional()}),Pg=M.object({type:M.literal("thinking"),text:M.string(),id:M.string().optional(),timestamp:M.string().optional(),model:M.string().optional()}),OX=M.object({type:M.literal("tool-call"),toolName:M.string().nullable(),input:M.unknown().optional(),output:M.unknown().optional(),images:M.array(EX).optional(),error:M.string().optional(),isError:M.union([M.boolean(),M.string()]).optional(),id:M.string().optional(),timestamp:M.string().optional(),model:M.string().optional()}),s=M.discriminatedUnion("type",[Ig,Mg,Eg,Og,Pg,OX]),GJ=M.object({inputTokens:M.number(),cachedInputTokens:M.number(),outputTokens:M.number(),reasoningOutputTokens:M.number(),totalTokens:M.number()}),y_=OX,jg=y_.extend({toolName:M.literal("Write"),input:M.object({file_path:M.string(),content:M.string().optional()}).passthrough().optional(),output:M.object({type:M.string().optional()}).passthrough().optional()}),Sg=y_.extend({toolName:M.literal("Read"),input:M.object({file_path:M.string()}).passthrough().optional(),output:M.union([M.string(),M.object({type:M.string().optional(),file:M.object({content:M.string().optional(),numLines:M.number().optional(),startLine:M.number().optional(),totalLines:M.number().optional()}).passthrough().optional()}).passthrough()]).optional()}),Rg=y_.extend({toolName:M.literal("Edit"),input:M.object({file_path:M.string(),diff:M.string().optional()}).passthrough().optional(),output:M.union([M.string(),M.object({userModified:M.boolean().optional()}).passthrough()]).optional()}),PX=M.object({filenames:M.array(M.string()),durationMs:M.number().optional(),truncated:M.boolean().optional()}).passthrough(),Lg=y_.extend({toolName:M.literal("Glob"),input:M.object({pattern:M.string().optional()}).passthrough().optional(),output:PX.optional()}),Tg=y_.extend({toolName:M.literal("Grep"),input:M.unknown().optional(),output:PX.extend({mode:M.string().optional(),numMatches:M.number().optional()}).passthrough().optional()}),yg=y_.extend({toolName:M.literal("Bash"),input:M.object({command:M.string(),description:M.string().optional()}).passthrough().optional(),output:M.union([M.string(),M.object({stdout:M.string().optional(),stderr:M.string().optional(),interrupted:M.boolean().optional(),isImage:M.boolean().optional()}).passthrough()]).optional()}),Cg=y_.extend({toolName:M.literal("BashOutput"),input:M.object({bash_id:M.string().optional()}).passthrough().optional(),output:M.object({command:M.string().optional(),exitCode:M.number().optional(),shellId:M.string().optional(),status:M.string().optional(),stderr:M.string().optional(),stdout:M.string().optional(),timestamp:M.string().optional()}).passthrough().optional()}),fg=y_.extend({toolName:M.literal("Task"),input:M.unknown().optional(),output:M.object({status:M.string().optional(),totalDurationMs:M.number().optional(),totalToolUseCount:M.number().optional(),content:M.array(M.object({type:M.string().optional(),text:M.string().optional()}).passthrough()).optional(),usage:GJ.optional()}).passthrough().optional()}),UJ=M.object({content:M.string(),status:M.string().optional()}).passthrough(),mg=y_.extend({toolName:M.literal("TodoWrite"),input:M.object({todos:M.array(UJ).optional()}).passthrough().optional(),output:M.object({oldTodos:M.array(UJ).optional(),newTodos:M.array(UJ).optional()}).passthrough().optional()}),ug=[jg,Sg,Rg,Lg,Tg,yg,Cg,fg,mg],cg=y_,V6=M.union([...ug,cg]),z4=M.object({model:M.string(),usage:GJ}),m0=M.object({relativeCwd:M.string().nullable(),branch:M.string().nullable(),repo:M.string().nullable()}).strict().nullable(),C_=M.object({v:M.literal(1),id:M.string(),source:M.enum(["claude-code","cline","codex","opencode","pi","unknown"]),timestamp:M.coerce.date(),preview:M.string().nullable(),summary:M.string().nullable().default(null),model:M.string().nullable(),clientVersion:M.string().nullable(),blendedTokens:M.number(),costUsd:M.number(),messageCount:M.number(),toolCount:M.number(),userMessageCount:M.number(),filesChanged:M.number(),linesAdded:M.number().default(0),linesRemoved:M.number().default(0),linesModified:M.number().default(0),tokenUsage:GJ,modelUsage:M.array(z4),git:m0,cwd:M.string().nullable(),messages:M.array(s)});import{appendFileSync as dg,mkdirSync as ig}from"fs";import{dirname as og}from"path";import{existsSync as hg,readFileSync as rg}from"fs";import{homedir as ng}from"os";import{dirname as jX,resolve as YJ}from"path";function lg(){let $=process.env.VI_CLI_PATH;if($?.startsWith("bun "))$=$.slice(4);let b=$?jX($):process.cwd(),Z=10,z=0;while(z<Z){let A=YJ(b,"package.json");if(hg(A))try{if(JSON.parse(rg(A,"utf-8")).workspaces)return b}catch{}let J=jX(b);if(J===b)break;b=J,z++}return null}function pg(){let _=lg();return _?YJ(_,"logs"):null}function SX(){let _=pg();return _?YJ(_,"dev.log"):null}function b_(_){let $=ng();if(_.startsWith($))return _.replace($,"~");let b=/^(\/Users\/[^/]+|\/home\/[^/]+)/;return _.replace(b,"~")}function d$(_){if(_==="."||_===null)return"";return _}function S0(_,$){if(!$)return _;let b=$.endsWith("/")?$:`${$}/`,Z=b.slice(0,-1),z=(J)=>typeof J==="object"&&J!==null&&!Array.isArray(J),A=(J)=>{if(typeof J==="string"){if(J.includes(b))return J.replaceAll(b,"./");if(J.includes(Z))return J.replaceAll(Z,".");return J}if(Array.isArray(J))return J.map(A);if(z(J)){let U={};for(let[G,Y]of Object.entries(J))U[G]=A(Y);return U}return J};return A(_)}var RX=!1;function ag(_){if(_===void 0||_===null)return _;if(process.env.DEBUG_PAYLOADS!=="true"){if(!RX)return RX=!0,"[payload logging disabled - set DEBUG_PAYLOADS=true to enable]";return}if(typeof _==="object"){let b=JSON.stringify(_),Z=Math.round(b.length/1024),z=b.includes('"isImage":true')||b.includes('"isImage": true')||b.length>1e4&&/[A-Za-z0-9+/]{100,}/.test(b);if(z||b.length>1e4)return`[payload: ${Z}KB${z?", contains binary data":""}]`}return _}class LX{component;logToFile;logFilePath;disableConsole;constructor(_){this.component=_.component,this.disableConsole=_.disableConsole??!1;let $=typeof process<"u"&&!!process.versions?.node;if(this.logToFile=_.logToFile??($&&!1),$&&this.logToFile){let b=SX(),Z=_.logFilePath??b;if(Z)this.logFilePath=Z;else this.logToFile=!1,this.logFilePath=""}else this.logFilePath="",this.logToFile=!1;if(process.env.DEBUG)console.log(`[${this.component}] Logger config:`,{logToFile:this.logToFile,logFilePath:this.logFilePath,cwd:process.cwd(),NODE_ENV:"production"});if(this.logToFile)try{let b=og(this.logFilePath);ig(b,{recursive:!0})}catch(b){if(process.env.DEBUG)console.error(`[${this.component}] Failed to create logs directory:`,b)}}log(_,$,b){let Z=new Date,A=`[${`${String(Z.getMonth()+1).padStart(2,"0")}-${String(Z.getDate()).padStart(2,"0")} ${String(Z.getHours()).padStart(2,"0")}:${String(Z.getMinutes()).padStart(2,"0")}:${String(Z.getSeconds()).padStart(2,"0")}`}] [${this.component}] [${_}] ${$}`,J=_==="ERROR"?console.error:_==="WARN"?console.warn:console.log,U=ag(b);if(!this.disableConsole){if(J(A),U!==void 0){let G=typeof U==="object"?JSON.stringify(U,null,2):String(U);J(` ${G}`)}}if(this.logToFile)try{let G=A+`
90
90
  `;if(U!==void 0){let Y=typeof U==="object"?JSON.stringify(U):String(U);G+=` ${Y}
91
- `}hk(this.logFilePath,G)}catch{}}debug(_,$){if(process.env.DEBUG)this.log("DEBUG",_,$)}info(_,$){this.log("INFO",_,$)}warn(_,$){this.log("WARN",_,$)}error(_,$){this.log("ERROR",_,$)}}function jX(_,$){return new PX({component:_,...$})}import{execSync as lk}from"child_process";import{resolve as pk}from"path";var dk="http://localhost:3000",ik=1e4;async function ok(_,$,b){try{return(await fetch(`${$}/api/blobs/${_}`,{method:"HEAD",headers:{...b&&{Authorization:`Bearer ${b}`}},signal:AbortSignal.timeout(5000)})).ok}catch{return!1}}async function ak(_,$,b){if(!_||_.length===0)return;let z=(await Promise.all(_.map(async(A)=>({blob:A,exists:await ok(A.sha256,$,b)})))).filter((A)=>!A.exists).map((A)=>A.blob);return z.length>0?z:void 0}async function JJ(_,$={}){let b=$.serverUrl??process.env.VI_SERVER_URL??dk,Z=$.authToken??null,z=$.timeoutMs??ik,A=await ak(_.blobs,b,Z),J=new FormData,U=`${_.unifiedTranscript.id||"transcript"}.jsonl`;if(_.id)J.set("id",_.id);if(J.set("sha256",_.sha256),J.set("unifiedTranscript",JSON.stringify(_.unifiedTranscript)),_.visibility)J.set("visibility",_.visibility);if(J.set("transcript",new Blob([_.rawTranscript],{type:"application/jsonl"}),U),A)for(let G of A){let Y=G.data.buffer.slice(G.data.byteOffset,G.data.byteOffset+G.data.byteLength);J.append(`blob:${G.sha256}`,new Blob([Y],{type:G.mediaType}),`${G.sha256}.blob`)}try{let G=await fetch(`${b}/api/ingest`,{method:"POST",headers:{...Z&&{Authorization:`Bearer ${Z}`}},body:J,signal:AbortSignal.timeout(z)});if(!G.ok)return console.error(`Upload failed: ${G.status} ${G.statusText}`),{success:!1};let Y=await G.json();if(ek(Y))return{success:!0,id:Y.id,transcriptId:Y.transcriptId};return console.error("Upload succeeded but response had unexpected shape:",Y),{success:!1}}catch(G){if(G instanceof Error)console.error("Upload error:",G.message);return{success:!1}}}function ek(_){if(typeof _!=="object"||_===null)return!1;let $=_;return typeof $.success==="boolean"&&($.success===!1||typeof $.id==="string"&&typeof $.transcriptId==="string")&&($.eventsReceived===void 0||typeof $.eventsReceived==="number")}function SX(_){let $=pk(_),b=z_($);try{let Z=lk("git remote get-url origin",{cwd:$,encoding:"utf8",timeout:2000,stdio:["pipe","pipe","ignore"]}).trim(),z=tk(Z),A=z.split("/").pop()||"unknown";return{repoId:z,repoName:A,cwd:b}}catch{return{repoId:null,repoName:$.split("/").pop()||"unknown",cwd:b}}}function tk(_){let $=/^(?<user>[^@]+)@(?<host>[^:]+):(?<path>.+)$/,b=_.match($);if(b?.groups)return`${b.groups.host}/${b.groups.path.replace(/\.git$/i,"")}`;try{let Z=new URL(_),z=Z.pathname.replace(/\.git$/i,"").replace(/^\//,"");return`${Z.host}/${z}`}catch{return _.replace(/\.git$/i,"")}}import sk from"node:crypto";import RX from"node:fs/promises";import _W from"node:path";var $W=200000,zW=["anthropic/","claude-3-5-","claude-3-","claude-","openai/","azure/","openrouter/openai/"],CX=new Set(["[request interrupted by user]","[request aborted by user]","[request cancelled by user]"]),bW=new Set(["/clear"]),ZW=/^<\/?(?:command|local)-[a-z-]+>/i,fX=/^[α-ωΑ-Ω]\s/i,AW=/<command-name>(.*?)<\/command-name>/s,JW=/<command-args>(.*?)<\/command-args>/s,UW=/^<local-command-stdout>(.*)<\/local-command-stdout>$/s,GW=/<system-reminder>[\s\S]*?<\/system-reminder>/g,mX=["npm ","npm:","npm error","node:","node.js","error:","fatal:","warning:","traceback (most recent call last):","usage:","hint:","note:","code:","requirestack"],YW=new RegExp("\\b("+["fix","please","should","update","change","add","remove","create","write","implement","refactor","investigate","explain","help","why","what","how","need","ensure","make","build","let's","optimize","review","check"].join("|")+")\\b","i"),XW=3;function t_(_){let $=0,b=0,Z=0,z=0,A=0,J=new Set;for(let U of _)if(U.type==="user")b++;else if(U.type==="tool-call"){if($++,U.isError||U.error)continue;let{toolName:G,input:Y,output:X}=U;if(Y&&typeof Y.file_path==="string"){if(G==="Edit"||G==="Write")J.add(Y.file_path)}if(G==="Write"&&Y&&typeof Y.content==="string"){let K=Y.content.split(`
92
- `).length;Z+=K}let Q=Y?.diff??X?.diff;if(G==="Edit"&&typeof Q==="string"){let K=0,v=0,V=Q.split(`
93
- `);for(let P of V)if(P.startsWith("+")&&!P.startsWith("+++"))K++;else if(P.startsWith("-")&&!P.startsWith("---"))v++;let w=Math.min(K,v);Z+=K-w,z+=v-w,A+=w}}return{toolCount:$,userMessageCount:b,filesChanged:J.size,linesAdded:Z,linesRemoved:z,linesModified:A}}function g6(_,$={}){let b=QW(_);if(b.records.size===0)return null;let Z=FW(b.records);if(Z.length===0)return null;let z=Z[Z.length-1],A=HW(Z),J=VW(A),U=DW(A),G=OW(J),Y=A.map((C)=>{let F=C.message?.usage;if(!F)return null;return{model:C.message?.model??null,usage:F}}).filter((C)=>C!==null),X=SW(Y,$.pricing),Q=kW(Z),K=Q.length>0?BW(Q[0]):null,v=lX(z.timestamp)??$.now??new Date,V=NW(Z),w=IW(U),P=GJ(Z),O=$.gitContext!==void 0?$.gitContext:xW(Z),B=P?z_(P):"",{messages:T,blobs:y}=mW(Z);if(T.length===0)return null;let u=t_(T),E={v:1,id:V??z.uuid,source:"claude-code",timestamp:v,preview:K,summary:null,model:w,clientVersion:$.clientVersion??wW(Z),blendedTokens:G,costUsd:X,messageCount:T.length,...u,tokenUsage:J,modelUsage:Array.from(U.entries()).map(([C,F])=>({model:hX(C),usage:F})),git:O,cwd:B,messages:T};return{transcript:y_.parse(E),blobs:y}}function QW(_){let $=new Map,b=new Map;for(let Z of _){let z=typeof Z.type==="string"?Z.type:"";if(z==="summary")continue;let A=typeof Z.uuid==="string"?Z.uuid:null;if(!A)continue;let J={uuid:A,type:z,timestamp:typeof Z.timestamp==="string"?Z.timestamp:void 0,parentUuid:typeof Z.parentUuid==="string"||Z.parentUuid===null?Z.parentUuid:void 0,logicalParentUuid:typeof Z.logicalParentUuid==="string"||Z.logicalParentUuid===null?Z.logicalParentUuid:void 0,isSidechain:Boolean(Z.isSidechain),isMeta:Boolean(Z.isMeta),isCompactSummary:Boolean(Z.isCompactSummary),sessionId:typeof Z.sessionId==="string"?Z.sessionId:void 0,cwd:typeof Z.cwd==="string"?Z.cwd:void 0,gitBranch:typeof Z.gitBranch==="string"?Z.gitBranch:void 0,costUSD:typeof Z.costUSD==="number"?Z.costUSD:void 0,message:KW(Z.message),raw:Z};if($.set(A,J),J.parentUuid){let U=b.get(J.parentUuid)??new Set;U.add(A),b.set(J.parentUuid,U)}}return{records:$,children:b}}function KW(_){if(!_||typeof _!=="object")return;let $=_,b=typeof $.id==="string"?$.id:void 0,Z=typeof $.role==="string"?$.role:void 0,z=$.content,A=typeof $.model==="string"?$.model:void 0,J=vW($.usage);return{id:b,role:Z,content:z,model:A,usage:J}}function vW(_){if(!_||typeof _!=="object")return null;let $=_,b={};if(typeof $.input_tokens==="number")b.input_tokens=$.input_tokens;if(typeof $.cache_creation_input_tokens==="number")b.cache_creation_input_tokens=$.cache_creation_input_tokens;if(typeof $.cache_read_input_tokens==="number")b.cache_read_input_tokens=$.cache_read_input_tokens;if(typeof $.output_tokens==="number")b.output_tokens=$.output_tokens;if(typeof $.reasoning_output_tokens==="number")b.reasoning_output_tokens=$.reasoning_output_tokens;return Object.keys(b).length>0?b:null}function FW(_){let $=[];for(let b of _.values()){if(b.isSidechain)continue;$.push(b)}return $.sort((b,Z)=>{let z=LX(b.timestamp)??0,A=LX(Z.timestamp)??0;if(z!==A)return z-A;return b.uuid.localeCompare(Z.uuid)}),$}function HW(_){let $=new Map;for(let b of _){if(b.type!=="assistant")continue;if(!b.message?.usage)continue;let z=qW(b);$.set(z,b)}return Array.from($.values())}function qW(_){let $=_.message,b=TX($?.id),Z=TX(_.raw.requestId);if(b&&Z)return`${b}:${Z}`;if(b)return b;if(Z)return Z;return _.uuid}function VW(_){let $={inputTokens:0,cachedInputTokens:0,outputTokens:0,reasoningOutputTokens:0,totalTokens:0};for(let b of _){let Z=b.message?.usage;if(!Z)continue;let z=p0(Z.input_tokens),A=p0(Z.cache_creation_input_tokens),J=p0(Z.cache_read_input_tokens),U=p0(Z.output_tokens),G=p0(Z.reasoning_output_tokens);$.inputTokens+=z+A+J,$.cachedInputTokens+=J,$.outputTokens+=U,$.reasoningOutputTokens+=G,$.totalTokens+=z+A+J+U+G}return $}function DW(_){let $=new Map;for(let b of _){let Z=b.message?.model,z=b.message?.usage;if(!Z||!z)continue;let A=$.get(Z)??{inputTokens:0,cachedInputTokens:0,outputTokens:0,reasoningOutputTokens:0,totalTokens:0},J=p0(z.input_tokens),U=p0(z.cache_creation_input_tokens),G=p0(z.cache_read_input_tokens),Y=p0(z.output_tokens),X=p0(z.reasoning_output_tokens);A.inputTokens+=J+U+G,A.cachedInputTokens+=G,A.outputTokens+=Y,A.reasoningOutputTokens+=X,A.totalTokens+=J+U+G+Y+X,$.set(Z,A)}return $}function kW(_){let $=[];for(let b of _){if(!WW(b))continue;$.push(b)}return $}function WW(_){if(_.type!=="user")return!1;if(_.isSidechain)return!1;if(_.isMeta)return!1;let $=_.raw;if($&&typeof $==="object"){if("toolUseResult"in $)return!1}let b=_.message?.content;if(Array.isArray(b)){if(b.some((A)=>gW(A)))return!1}let Z=cX(_);if(!Z)return!1;let z=Z.toLowerCase();if(CX.has(z))return!1;if(uX(Z))return!1;if(fX.test(Z))return!1;if(mX.some((A)=>z.startsWith(A))){if(!nX(Z))return!1}return!0}function gW(_){if(!_||typeof _!=="object")return!1;let $=_;if($.type==="tool_result")return!0;if(typeof $.tool_use_id==="string")return!0;return!1}function uX(_){return ZW.test(_)}function BW(_){let $=cX(_);if(!$)return null;return rX($)}function GJ(_){for(let $ of _)if($.cwd)return $.cwd;return}function wW(_){for(let $ of _){let b=$.raw.version;if(typeof b==="string"&&b.length>0)return b}return null}function xW(_){let $=GJ(_),b=_.find((A)=>A.gitBranch)?.gitBranch??null;if(!$)return m0.parse({relativeCwd:null,branch:b,repo:null});let Z=$.split(/[\\/]+/).filter(Boolean);if(Z.length===0)return m0.parse({relativeCwd:null,branch:b,repo:null});let z=Z.findIndex((A)=>{let J=A.toLowerCase();return J.includes("github")||J.includes("gitlab")||J.includes("bitbucket")});if(z>=0){let A=Z[z]?.toLowerCase()??"",J=A.includes("gitlab")?"gitlab.com":A.includes("bitbucket")?"bitbucket.org":"github.com",U=Z[z+1],G=Z[z+2]?.replace(/\.git$/i,"");if(U&&G){let Y=Z.slice(z+3),X=Y.length>0?Y.join("/"):".";return m0.parse({relativeCwd:i$(X),branch:b,repo:`${J}/${U}/${G}`})}}return m0.parse({relativeCwd:null,branch:b,repo:null})}async function g0(_,$){if(!_)return null;try{if(!(await RX.stat(_)).isDirectory())return m0.parse({relativeCwd:null,branch:$??null,repo:null})}catch{return m0.parse({relativeCwd:null,branch:$??null,repo:null})}let b=await vz(_);if(!b)return m0.parse({relativeCwd:null,branch:$??null,repo:null});let Z=_W.relative(b,_)||".",z=$??await j7(b),A=await Fz(b);return m0.parse({relativeCwd:i$(Z),branch:z,repo:A})}function NW(_){for(let $ of _){let b=typeof $.sessionId==="string"?$.sessionId.trim():"";if(b.length>0)return b}return null}function hX(_){if(_.includes("/"))return _;return`anthropic/${_}`}function IW(_){let $=null,b=-1;for(let[Z,z]of _){let A=z.totalTokens>0?z.totalTokens:z.inputTokens+z.outputTokens;if(A>b)b=A,$=Z}return $?hX($):null}function cX(_){return MW(_.message)[0]??null}function MW(_){if(!_)return[];let $=_.content;if(typeof $==="string"){let b=UJ($);return b?[b]:[]}if(Array.isArray($)){let b=[];for(let Z of $){if(typeof Z==="string"){let z=UJ(Z);if(z)b.push(z);continue}if(Z&&typeof Z==="object"){let z=Z,A=["content","text"];for(let J of A){let U=z[J];if(typeof U==="string"){let G=UJ(U);if(G)b.push(G)}}}}return b}return[]}function UJ(_,$=XW){let b=EW(_);if(b.length===0)return null;let z=b.slice(0,$).join(" "),A=rX(z);return A.length>0?A:null}function EW(_){let $=[];for(let b of _.split(/\r?\n/)){let Z=b.trim();if(!Z)continue;let z=Z.toLowerCase();if(CX.has(z))continue;if(uX(Z))continue;if(fX.test(Z))continue;if(mX.some((A)=>z.startsWith(A))){if(!nX(Z))continue}if(!/[a-z]/i.test(Z)&&!/\d/.test(Z))continue;$.push(Z)}return $}function rX(_){return _.replace(/\s+/g," ").trim()}function nX(_){let $=_.toLowerCase();if(YW.test($))return!0;if($.includes("?"))return!0;return["can you","can we","could you","could we","would you","would we","should we","should i","let's","let us"].some((Z)=>$.includes(Z))}function OW(_){return Math.max(0,_.inputTokens-_.cachedInputTokens)+_.outputTokens+_.reasoningOutputTokens}function lX(_){if(!_)return null;let $=new Date(_);return Number.isNaN($.getTime())?null:$}function LX(_){let $=lX(_);return $?$.getTime():null}function p0(_){return typeof _==="number"&&Number.isFinite(_)?_:0}function TX(_){if(typeof _!=="string")return;let $=_.trim();return $.length>0?$:void 0}function PW(_){return sk.createHash("sha256").update(_).digest("hex")}function W6(_,$){if(_===null||_===void 0)return _;if(Array.isArray(_))return _.map((b)=>W6(b,$));if(typeof _==="object"){let b=_;if(b.type==="image"&&b.source&&typeof b.source==="object"){let z=b.source;if(typeof z.data==="string"&&z.data.length>0){let A=z.data,J=typeof z.mediaType==="string"?z.mediaType:typeof z.media_type==="string"?z.media_type:"image/unknown",U=Buffer.from(A,"base64"),G=PW(U);if(!$.has(G))$.set(G,{data:U,mediaType:J});return{type:"image",source:{type:"sha256",mediaType:J,sha256:G}}}}let Z={};for(let[z,A]of Object.entries(b))Z[z]=W6(A,$);return Z}return _}function jW(_){let $=[];function b(Z){if(Z===null||Z===void 0)return;if(Array.isArray(Z)){for(let z of Z)b(z);return}if(typeof Z==="object"){let z=Z;if(z.type==="image"&&z.source&&typeof z.source==="object"){let A=z.source;if(A.type==="sha256"&&typeof A.sha256==="string"){$.push({sha256:A.sha256,mediaType:typeof A.mediaType==="string"?A.mediaType:"image/unknown"});return}}for(let A of Object.values(z))b(A)}}return b(_),$}function SW(_,$){if(!$||Object.keys($).length===0)return 0;let b=0;for(let Z of _){let z=Z.model;if(!z)continue;let A=RW(z,$);if(!A)continue;let J=LW({input_tokens:p0(Z.usage.input_tokens),output_tokens:p0(Z.usage.output_tokens),cache_creation_input_tokens:p0(Z.usage.cache_creation_input_tokens),cache_read_input_tokens:p0(Z.usage.cache_read_input_tokens)},A);b+=J}return b}function RW(_,$){let b=_.trim();if(!b)return null;let Z=new Set;Z.add(b);for(let A of zW)Z.add(`${A}${b}`);for(let A of Z){let J=$[A];if(J)return J}let z=b.toLowerCase();for(let[A,J]of Object.entries($)){let U=A.toLowerCase();if(U.includes(z)||z.includes(U))return J}return null}function LW(_,$){let b=(U,G,Y,X=$W)=>{if(U==null||U<=0)return 0;if(U>X&&Y!=null){let Q=Math.min(U,X),v=Math.max(0,U-X)*Y;if(G!=null)v+=Q*G;return v}if(G!=null)return U*G;return 0},Z=b(_.input_tokens,$.input_cost_per_token,$.input_cost_per_token_above_200k_tokens),z=b(_.output_tokens,$.output_cost_per_token,$.output_cost_per_token_above_200k_tokens),A=b(_.cache_creation_input_tokens,$.cache_creation_input_token_cost,$.cache_creation_input_token_cost_above_200k_tokens),J=b(_.cache_read_input_tokens,$.cache_read_input_token_cost,$.cache_read_input_token_cost_above_200k_tokens);return Z+z+A+J}function TW(_){let $=_.match(AW);if(!$)return null;let b=$[1].trim(),z=_.match(JW)?.[1]?.trim()||void 0;return{name:b,args:z||void 0}}function yW(_){let $=_.trim().match(UW);if(!$)return null;return $[1]}function CW(_){return _.replace(GW,"").trim()}function fW(_){return _.replace(/\x1B\[[0-9;]*m/g,"")}function mW(_){let $=[],b=new Map,Z=new Map,z=null,A=!1,J=new Map,U=new Set,G=GJ(_);for(let Y of _){if(Y.isMeta)continue;let X=hW(Y),Q=Y.type;if(Q==="user"){let{texts:K,images:v,toolResults:V}=uW(Y,b);for(let w of K){if(!w.trim())continue;let P=yW(w);if(P!==null){if(A){A=!1;continue}if(z){let y=fW(P).trim();$.push(s.parse({type:"command",name:z.name,args:z.args,output:y||void 0,id:z.id,timestamp:z.timestamp})),z=null}continue}let O=TW(w);if(O){if(bW.has(O.name)){A=!0;continue}if(z)$.push(s.parse({type:"command",name:z.name,args:z.args,id:z.id,timestamp:z.timestamp}));z={name:O.name,args:O.args,id:Y.uuid,timestamp:X.timestamp};continue}let B=CW(w);if(!B)continue;let T=Y.isCompactSummary?"compaction-summary":"user";if(T==="user"){let y=`${X.timestamp}:${B}`,u=J.get(y);if(u){if(!u.hasImages&&v.length>0){let F=$[u.index];F.images=v,u.hasImages=!0}continue}let E={type:T,text:B,id:Y.uuid,timestamp:X.timestamp};if(v.length>0)E.images=v;let C=$.length;$.push(s.parse(E)),J.set(y,{index:C,hasImages:v.length>0})}else{let y={type:T,text:B,id:Y.uuid,timestamp:X.timestamp};$.push(s.parse(y))}}for(let w of V){let P=w.callId?Z.get(w.callId):void 0;if(P){let O=$[P.index],B=W6(w.output,b);O.output=B;let T=jW(B);if(T.length>0)O.images=T;if(w.error)O.error=w.error;if(typeof w.isError<"u")O.isError=w.isError;let y=yX(O,G);$[P.index]=y}}continue}if(Q==="assistant"){let K=Y.message?.content;if(!Array.isArray(K))continue;for(let v of K){if(!v||typeof v!=="object")continue;let V=v;if(V.type==="thinking"&&typeof V.thinking==="string"){let w=`thinking:${X.id}:${X.timestamp}:${V.thinking}`;if(U.has(w))continue;U.add(w),$.push(s.parse({type:"thinking",text:V.thinking,...X}));continue}if(V.type==="text"&&typeof V.text==="string"){let w=`agent:${X.id}:${X.timestamp}:${V.text}`;if(U.has(w))continue;U.add(w),$.push(s.parse({type:"agent",text:V.text,...X}));continue}if(V.type==="tool_use"){let w=typeof V.id==="string"?V.id:"",P=typeof V.name==="string"?V.name:null,O=V.input??void 0,B={type:"tool-call",toolName:P,...X,input:O},T=s.parse(B),y=yX(T,G);if($.push(y),w)Z.set(w,{index:$.length-1,toolName:P});continue}if(V.type==="image")continue}}}if(z)$.push(s.parse({type:"command",name:z.name,args:z.args,id:z.id,timestamp:z.timestamp}));return{messages:$,blobs:b}}function uW(_,$){let b=_.message;if(!b)return{texts:[],images:[],toolResults:[]};let Z=b.content;if(typeof Z==="string")return Z?{texts:[Z],images:[],toolResults:[]}:{texts:[],images:[],toolResults:[]};if(!Array.isArray(Z))return{texts:[],images:[],toolResults:[]};let z=[],A=[],J=[];for(let U of Z){if(!U||typeof U!=="object")continue;if(typeof U==="string"){if(U)z.push(U);continue}let G=U,Y=typeof G.type==="string"?G.type:void 0;if(Y==="tool_result"){let X=G,Q=typeof X.tool_use_id==="string"?X.tool_use_id:void 0,K=X.content,v=_.raw.toolUseResult??_.raw.tool_use_result;if(v)K=v;let V=typeof X.error==="string"?X.error:void 0,w=X.is_error??X.isError,P=typeof w==="boolean"?w:typeof X.success==="boolean"?!X.success:void 0;J.push({callId:Q,output:K,error:V,isError:P});continue}if(Y==="text"&&typeof G.text==="string"){if(G.text)z.push(G.text);continue}if(Y==="image"){let X=W6(G,$);if(X&&typeof X==="object"&&X.type==="image"){let Q=X.source;if(Q?.type==="sha256"&&typeof Q.sha256==="string")A.push({sha256:Q.sha256,mediaType:typeof Q.mediaType==="string"?Q.mediaType:"image/unknown"})}continue}for(let X of["content","text"]){let Q=G[X];if(typeof Q==="string"&&Q)z.push(Q)}}return{texts:z,images:A,toolResults:J}}function hW(_){return{id:_.message?.id,timestamp:_.timestamp,model:_.message?.model}}function yX(_,$){if(!$)return _;let b=$.endsWith("/")?$:`${$}/`,Z=(E)=>{if(E.startsWith(b))return`./${E.slice(b.length)}`;return E},z=(E)=>typeof E==="object"&&E!==null&&!Array.isArray(E),A=(E)=>z(E)?{...E}:void 0,J=(E,C)=>{let F={...E};for(let H of C)delete F[H];return F},U=(E,C)=>{if(typeof E[C]==="string")E[C]=Z(E[C])},G=(E)=>typeof E==="number"&&Number.isFinite(E)?E:0,Y=(E)=>{if(!Array.isArray(E))return E;return E.map((C)=>{if(z(C)){let F={...C};return delete F.activeForm,F}return C})},{toolName:X,input:Q,output:K}=_,v=Q,V=K,w=!1,P=!1,O=_.isError;switch(X){case"Write":{let E=A(Q);if(E)U(E,"file_path"),v=E,w=!0;let C=A(K);if(C){let F={};if(C.type!==void 0)F.type=C.type;V=F,P=!0}break}case"Read":{let E=A(Q);if(E)U(E,"file_path"),v=E,w=!0;let C=A(K);if(C){let F={};if(typeof C.type==="string")F.type=C.type;if(C.file&&z(C.file)){let H=C.file,q={};if(typeof H.content==="string")q.content=H.content;if(typeof H.numLines==="number")q.numLines=H.numLines;if(typeof H.startLine==="number")q.startLine=H.startLine;if(typeof H.totalLines==="number")q.totalLines=H.totalLines;if(Object.keys(q).length>0)F.file=q}V=F,P=!0}break}case"Edit":{let E=A(Q),C=A(K),F,H;if(C&&Array.isArray(C.structuredPatch)){let q=[];for(let g of C.structuredPatch)if(z(g)){if(H===void 0&&typeof g.oldStart==="number")H=g.oldStart;if(Array.isArray(g.lines)){for(let D of g.lines)if(typeof D==="string")q.push(D)}}if(q.length>0)F=`${q.join(`
91
+ `}dg(this.logFilePath,G)}catch{}}debug(_,$){if(process.env.DEBUG)this.log("DEBUG",_,$)}info(_,$){this.log("INFO",_,$)}warn(_,$){this.log("WARN",_,$)}error(_,$){this.log("ERROR",_,$)}}function TX(_,$){return new LX({component:_,...$})}import{execSync as eg}from"child_process";import{resolve as tg}from"path";var sg="http://localhost:3000",_k=1e4;async function $k(_,$,b){try{return(await fetch(`${$}/api/blobs/${_}`,{method:"HEAD",headers:{...b&&{Authorization:`Bearer ${b}`}},signal:AbortSignal.timeout(5000)})).ok}catch{return!1}}async function zk(_,$,b){if(!_||_.length===0)return;let z=(await Promise.all(_.map(async(A)=>({blob:A,exists:await $k(A.sha256,$,b)})))).filter((A)=>!A.exists).map((A)=>A.blob);return z.length>0?z:void 0}async function XJ(_,$={}){let b=$.serverUrl??process.env.VI_SERVER_URL??sg,Z=$.authToken??null,z=$.timeoutMs??_k,A=await zk(_.blobs,b,Z),J=new FormData;if(_.id)J.set("id",_.id);if(J.set("sha256",_.sha256),J.set("unifiedTranscript",JSON.stringify(_.unifiedTranscript)),_.visibility)J.set("visibility",_.visibility);if(A)for(let U of A){let G=U.data.buffer.slice(U.data.byteOffset,U.data.byteOffset+U.data.byteLength);J.append(`blob:${U.sha256}`,new Blob([G],{type:U.mediaType}),`${U.sha256}.blob`)}try{let U=await fetch(`${b}/api/ingest`,{method:"POST",headers:{...Z&&{Authorization:`Bearer ${Z}`}},body:J,signal:AbortSignal.timeout(z)});if(!U.ok)return console.error(`Upload failed: ${U.status} ${U.statusText}`),{success:!1};let G=await U.json();if(bk(G))return{success:!0,id:G.id,transcriptId:G.transcriptId};return console.error("Upload succeeded but response had unexpected shape:",G),{success:!1}}catch(U){if(U instanceof Error)console.error("Upload error:",U.message);return{success:!1}}}function bk(_){if(typeof _!=="object"||_===null)return!1;let $=_;return typeof $.success==="boolean"&&($.success===!1||typeof $.id==="string"&&typeof $.transcriptId==="string")&&($.eventsReceived===void 0||typeof $.eventsReceived==="number")}function yX(_){let $=tg(_),b=b_($);try{let Z=eg("git remote get-url origin",{cwd:$,encoding:"utf8",timeout:2000,stdio:["pipe","pipe","ignore"]}).trim(),z=Zk(Z),A=z.split("/").pop()||"unknown";return{repoId:z,repoName:A,cwd:b}}catch{return{repoId:null,repoName:$.split("/").pop()||"unknown",cwd:b}}}function Zk(_){let $=/^(?<user>[^@]+)@(?<host>[^:]+):(?<path>.+)$/,b=_.match($);if(b?.groups)return`${b.groups.host}/${b.groups.path.replace(/\.git$/i,"")}`;try{let Z=new URL(_),z=Z.pathname.replace(/\.git$/i,"").replace(/^\//,"");return`${Z.host}/${z}`}catch{return _.replace(/\.git$/i,"")}}import Ak from"node:crypto";import CX from"node:fs/promises";import Jk from"node:path";var Uk=200000,Gk=["anthropic/","claude-3-5-","claude-3-","claude-","openai/","azure/","openrouter/openai/"],cX=new Set(["[request interrupted by user]","[request aborted by user]","[request cancelled by user]"]),Yk=new Set(["/clear"]),Xk=/^<\/?(?:command|local)-[a-z-]+>/i,hX=/^[α-ωΑ-Ω]\s/i,Qk=/<command-name>(.*?)<\/command-name>/s,Kk=/<command-args>(.*?)<\/command-args>/s,Fk=/^<local-command-stdout>(.*)<\/local-command-stdout>$/s,vk=/<system-reminder>[\s\S]*?<\/system-reminder>/g,rX=["npm ","npm:","npm error","node:","node.js","error:","fatal:","warning:","traceback (most recent call last):","usage:","hint:","note:","code:","requirestack"],Hk=new RegExp("\\b("+["fix","please","should","update","change","add","remove","create","write","implement","refactor","investigate","explain","help","why","what","how","need","ensure","make","build","let's","optimize","review","check"].join("|")+")\\b","i"),qk=3;function b4(_){let $=0,b=0,Z=0,z=0,A=0,J=new Set;for(let U of _)if(U.type==="user")b++;else if(U.type==="tool-call"){if($++,U.isError||U.error)continue;let{toolName:G,input:Y,output:X}=U;if(Y&&typeof Y.file_path==="string"){if(G==="Edit"||G==="Write")J.add(Y.file_path)}if(G==="Write"&&Y&&typeof Y.content==="string"){let K=Y.content.split(`
92
+ `).length;Z+=K}let Q=Y?.diff??X?.diff;if(G==="Edit"&&typeof Q==="string"){let K=0,v=0,D=Q.split(`
93
+ `);for(let P of D)if(P.startsWith("+")&&!P.startsWith("+++"))K++;else if(P.startsWith("-")&&!P.startsWith("---"))v++;let w=Math.min(K,v);Z+=K-w,z+=v-w,A+=w}}return{toolCount:$,userMessageCount:b,filesChanged:J.size,linesAdded:Z,linesRemoved:z,linesModified:A}}function k6(_,$={}){let b=Dk(_);if(b.records.size===0)return null;let Z=kk(b.records);if(Z.length===0)return null;let z=Z[Z.length-1],A=Wk(Z),J=Bk(A),U=xk(A),G=Tk(J),Y=A.map((T)=>{let F=T.message?.usage;if(!F)return null;return{model:T.message?.model??null,usage:F}}).filter((T)=>T!==null),X=fk(Y,$.pricing),Q=Nk(Z),K=Q.length>0?Ek(Q[0]):null,v=oX(z.timestamp)??$.now??new Date,D=jk(Z),w=Sk(U),P=KJ(Z),E=$.gitContext!==void 0?$.gitContext:Pk(Z),B=P?b_(P):"",{messages:C,blobs:f}=lk(Z);if(C.length===0)return null;let u=b4(C),O={v:1,id:D??z.uuid,source:"claude-code",timestamp:v,preview:K,summary:null,model:w,clientVersion:$.clientVersion??Ok(Z),blendedTokens:G,costUsd:X,messageCount:C.length,...u,tokenUsage:J,modelUsage:Array.from(U.entries()).map(([T,F])=>({model:lX(T),usage:F})),git:E,cwd:B,messages:C};return{transcript:C_.parse(O),blobs:f}}function Dk(_){let $=new Map,b=new Map;for(let Z of _){let z=typeof Z.type==="string"?Z.type:"";if(z==="summary")continue;let A=typeof Z.uuid==="string"?Z.uuid:null;if(!A)continue;let J={uuid:A,type:z,timestamp:typeof Z.timestamp==="string"?Z.timestamp:void 0,parentUuid:typeof Z.parentUuid==="string"||Z.parentUuid===null?Z.parentUuid:void 0,logicalParentUuid:typeof Z.logicalParentUuid==="string"||Z.logicalParentUuid===null?Z.logicalParentUuid:void 0,isSidechain:Boolean(Z.isSidechain),isMeta:Boolean(Z.isMeta),isCompactSummary:Boolean(Z.isCompactSummary),sessionId:typeof Z.sessionId==="string"?Z.sessionId:void 0,cwd:typeof Z.cwd==="string"?Z.cwd:void 0,gitBranch:typeof Z.gitBranch==="string"?Z.gitBranch:void 0,costUSD:typeof Z.costUSD==="number"?Z.costUSD:void 0,message:Vk(Z.message),raw:Z};if($.set(A,J),J.parentUuid){let U=b.get(J.parentUuid)??new Set;U.add(A),b.set(J.parentUuid,U)}}return{records:$,children:b}}function Vk(_){if(!_||typeof _!=="object")return;let $=_,b=typeof $.id==="string"?$.id:void 0,Z=typeof $.role==="string"?$.role:void 0,z=$.content,A=typeof $.model==="string"?$.model:void 0,J=gk($.usage);return{id:b,role:Z,content:z,model:A,usage:J}}function gk(_){if(!_||typeof _!=="object")return null;let $=_,b={};if(typeof $.input_tokens==="number")b.input_tokens=$.input_tokens;if(typeof $.cache_creation_input_tokens==="number")b.cache_creation_input_tokens=$.cache_creation_input_tokens;if(typeof $.cache_read_input_tokens==="number")b.cache_read_input_tokens=$.cache_read_input_tokens;if(typeof $.output_tokens==="number")b.output_tokens=$.output_tokens;if(typeof $.reasoning_output_tokens==="number")b.reasoning_output_tokens=$.reasoning_output_tokens;return Object.keys(b).length>0?b:null}function kk(_){let $=[];for(let b of _.values()){if(b.isSidechain)continue;$.push(b)}return $.sort((b,Z)=>{let z=fX(b.timestamp)??0,A=fX(Z.timestamp)??0;if(z!==A)return z-A;return b.uuid.localeCompare(Z.uuid)}),$}function Wk(_){let $=new Map;for(let b of _){if(b.type!=="assistant")continue;if(!b.message?.usage)continue;let z=wk(b);$.set(z,b)}return Array.from($.values())}function wk(_){let $=_.message,b=mX($?.id),Z=mX(_.raw.requestId);if(b&&Z)return`${b}:${Z}`;if(b)return b;if(Z)return Z;return _.uuid}function Bk(_){let $={inputTokens:0,cachedInputTokens:0,outputTokens:0,reasoningOutputTokens:0,totalTokens:0};for(let b of _){let Z=b.message?.usage;if(!Z)continue;let z=d0(Z.input_tokens),A=d0(Z.cache_creation_input_tokens),J=d0(Z.cache_read_input_tokens),U=d0(Z.output_tokens),G=d0(Z.reasoning_output_tokens);$.inputTokens+=z+A+J,$.cachedInputTokens+=J,$.outputTokens+=U,$.reasoningOutputTokens+=G,$.totalTokens+=z+A+J+U+G}return $}function xk(_){let $=new Map;for(let b of _){let Z=b.message?.model,z=b.message?.usage;if(!Z||!z)continue;let A=$.get(Z)??{inputTokens:0,cachedInputTokens:0,outputTokens:0,reasoningOutputTokens:0,totalTokens:0},J=d0(z.input_tokens),U=d0(z.cache_creation_input_tokens),G=d0(z.cache_read_input_tokens),Y=d0(z.output_tokens),X=d0(z.reasoning_output_tokens);A.inputTokens+=J+U+G,A.cachedInputTokens+=G,A.outputTokens+=Y,A.reasoningOutputTokens+=X,A.totalTokens+=J+U+G+Y+X,$.set(Z,A)}return $}function Nk(_){let $=[];for(let b of _){if(!Ik(b))continue;$.push(b)}return $}function Ik(_){if(_.type!=="user")return!1;if(_.isSidechain)return!1;if(_.isMeta)return!1;let $=_.raw;if($&&typeof $==="object"){if("toolUseResult"in $)return!1}let b=_.message?.content;if(Array.isArray(b)){if(b.some((A)=>Mk(A)))return!1}let Z=pX(_);if(!Z)return!1;let z=Z.toLowerCase();if(cX.has(z))return!1;if(nX(Z))return!1;if(hX.test(Z))return!1;if(rX.some((A)=>z.startsWith(A))){if(!iX(Z))return!1}return!0}function Mk(_){if(!_||typeof _!=="object")return!1;let $=_;if($.type==="tool_result")return!0;if(typeof $.tool_use_id==="string")return!0;return!1}function nX(_){return Xk.test(_)}function Ek(_){let $=pX(_);if(!$)return null;return dX($)}function KJ(_){for(let $ of _)if($.cwd)return $.cwd;return}function Ok(_){for(let $ of _){let b=$.raw.version;if(typeof b==="string"&&b.length>0)return b}return null}function Pk(_){let $=KJ(_),b=_.find((A)=>A.gitBranch)?.gitBranch??null;if(!$)return m0.parse({relativeCwd:null,branch:b,repo:null});let Z=$.split(/[\\/]+/).filter(Boolean);if(Z.length===0)return m0.parse({relativeCwd:null,branch:b,repo:null});let z=Z.findIndex((A)=>{let J=A.toLowerCase();return J.includes("github")||J.includes("gitlab")||J.includes("bitbucket")});if(z>=0){let A=Z[z]?.toLowerCase()??"",J=A.includes("gitlab")?"gitlab.com":A.includes("bitbucket")?"bitbucket.org":"github.com",U=Z[z+1],G=Z[z+2]?.replace(/\.git$/i,"");if(U&&G){let Y=Z.slice(z+3),X=Y.length>0?Y.join("/"):".";return m0.parse({relativeCwd:d$(X),branch:b,repo:`${J}/${U}/${G}`})}}return m0.parse({relativeCwd:null,branch:b,repo:null})}async function W0(_,$){if(!_)return null;try{if(!(await CX.stat(_)).isDirectory())return m0.parse({relativeCwd:null,branch:$??null,repo:null})}catch{return m0.parse({relativeCwd:null,branch:$??null,repo:null})}let b=await Dz(_);if(!b)return m0.parse({relativeCwd:null,branch:$??null,repo:null});let Z=Jk.relative(b,_)||".",z=$??await TU(b),A=await Vz(b);return m0.parse({relativeCwd:d$(Z),branch:z,repo:A})}function jk(_){for(let $ of _){let b=typeof $.sessionId==="string"?$.sessionId.trim():"";if(b.length>0)return b}return null}function lX(_){if(_.includes("/"))return _;return`anthropic/${_}`}function Sk(_){let $=null,b=-1;for(let[Z,z]of _){let A=z.totalTokens>0?z.totalTokens:z.inputTokens+z.outputTokens;if(A>b)b=A,$=Z}return $?lX($):null}function pX(_){return Rk(_.message)[0]??null}function Rk(_){if(!_)return[];let $=_.content;if(typeof $==="string"){let b=QJ($);return b?[b]:[]}if(Array.isArray($)){let b=[];for(let Z of $){if(typeof Z==="string"){let z=QJ(Z);if(z)b.push(z);continue}if(Z&&typeof Z==="object"){let z=Z,A=["content","text"];for(let J of A){let U=z[J];if(typeof U==="string"){let G=QJ(U);if(G)b.push(G)}}}}return b}return[]}function QJ(_,$=qk){let b=Lk(_);if(b.length===0)return null;let z=b.slice(0,$).join(" "),A=dX(z);return A.length>0?A:null}function Lk(_){let $=[];for(let b of _.split(/\r?\n/)){let Z=b.trim();if(!Z)continue;let z=Z.toLowerCase();if(cX.has(z))continue;if(nX(Z))continue;if(hX.test(Z))continue;if(rX.some((A)=>z.startsWith(A))){if(!iX(Z))continue}if(!/[a-z]/i.test(Z)&&!/\d/.test(Z))continue;$.push(Z)}return $}function dX(_){return _.replace(/\s+/g," ").trim()}function iX(_){let $=_.toLowerCase();if(Hk.test($))return!0;if($.includes("?"))return!0;return["can you","can we","could you","could we","would you","would we","should we","should i","let's","let us"].some((Z)=>$.includes(Z))}function Tk(_){return Math.max(0,_.inputTokens-_.cachedInputTokens)+_.outputTokens+_.reasoningOutputTokens}function oX(_){if(!_)return null;let $=new Date(_);return Number.isNaN($.getTime())?null:$}function fX(_){let $=oX(_);return $?$.getTime():null}function d0(_){return typeof _==="number"&&Number.isFinite(_)?_:0}function mX(_){if(typeof _!=="string")return;let $=_.trim();return $.length>0?$:void 0}function yk(_){return Ak.createHash("sha256").update(_).digest("hex")}function g6(_,$){if(_===null||_===void 0)return _;if(Array.isArray(_))return _.map((b)=>g6(b,$));if(typeof _==="object"){let b=_;if(b.type==="image"&&b.source&&typeof b.source==="object"){let z=b.source;if(typeof z.data==="string"&&z.data.length>0){let A=z.data,J=typeof z.mediaType==="string"?z.mediaType:typeof z.media_type==="string"?z.media_type:"image/unknown",U=Buffer.from(A,"base64"),G=yk(U);if(!$.has(G))$.set(G,{data:U,mediaType:J});return{type:"image",source:{type:"sha256",mediaType:J,sha256:G}}}}let Z={};for(let[z,A]of Object.entries(b))Z[z]=g6(A,$);return Z}return _}function Ck(_){let $=[];function b(Z){if(Z===null||Z===void 0)return;if(Array.isArray(Z)){for(let z of Z)b(z);return}if(typeof Z==="object"){let z=Z;if(z.type==="image"&&z.source&&typeof z.source==="object"){let A=z.source;if(A.type==="sha256"&&typeof A.sha256==="string"){$.push({sha256:A.sha256,mediaType:typeof A.mediaType==="string"?A.mediaType:"image/unknown"});return}}for(let A of Object.values(z))b(A)}}return b(_),$}function fk(_,$){if(!$||Object.keys($).length===0)return 0;let b=0;for(let Z of _){let z=Z.model;if(!z)continue;let A=mk(z,$);if(!A)continue;let J=uk({input_tokens:d0(Z.usage.input_tokens),output_tokens:d0(Z.usage.output_tokens),cache_creation_input_tokens:d0(Z.usage.cache_creation_input_tokens),cache_read_input_tokens:d0(Z.usage.cache_read_input_tokens)},A);b+=J}return b}function mk(_,$){let b=_.trim();if(!b)return null;let Z=new Set;Z.add(b);for(let A of Gk)Z.add(`${A}${b}`);for(let A of Z){let J=$[A];if(J)return J}let z=b.toLowerCase();for(let[A,J]of Object.entries($)){let U=A.toLowerCase();if(U.includes(z)||z.includes(U))return J}return null}function uk(_,$){let b=(U,G,Y,X=Uk)=>{if(U==null||U<=0)return 0;if(U>X&&Y!=null){let Q=Math.min(U,X),v=Math.max(0,U-X)*Y;if(G!=null)v+=Q*G;return v}if(G!=null)return U*G;return 0},Z=b(_.input_tokens,$.input_cost_per_token,$.input_cost_per_token_above_200k_tokens),z=b(_.output_tokens,$.output_cost_per_token,$.output_cost_per_token_above_200k_tokens),A=b(_.cache_creation_input_tokens,$.cache_creation_input_token_cost,$.cache_creation_input_token_cost_above_200k_tokens),J=b(_.cache_read_input_tokens,$.cache_read_input_token_cost,$.cache_read_input_token_cost_above_200k_tokens);return Z+z+A+J}function ck(_){let $=_.match(Qk);if(!$)return null;let b=$[1].trim(),z=_.match(Kk)?.[1]?.trim()||void 0;return{name:b,args:z||void 0}}function hk(_){let $=_.trim().match(Fk);if(!$)return null;return $[1]}function rk(_){return _.replace(vk,"").trim()}function nk(_){return _.replace(/\x1B\[[0-9;]*m/g,"")}function lk(_){let $=[],b=new Map,Z=new Map,z=null,A=!1,J=new Map,U=new Set,G=KJ(_);for(let Y of _){if(Y.isMeta)continue;let X=dk(Y),Q=Y.type;if(Q==="user"){let{texts:K,images:v,toolResults:D}=pk(Y,b);for(let w of K){if(!w.trim())continue;let P=hk(w);if(P!==null){if(A){A=!1;continue}if(z){let f=nk(P).trim();$.push(s.parse({type:"command",name:z.name,args:z.args,output:f||void 0,id:z.id,timestamp:z.timestamp})),z=null}continue}let E=ck(w);if(E){if(Yk.has(E.name)){A=!0;continue}if(z)$.push(s.parse({type:"command",name:z.name,args:z.args,id:z.id,timestamp:z.timestamp}));z={name:E.name,args:E.args,id:Y.uuid,timestamp:X.timestamp};continue}let B=rk(w);if(!B)continue;let C=Y.isCompactSummary?"compaction-summary":"user";if(C==="user"){let f=`${X.timestamp}:${B}`,u=J.get(f);if(u){if(!u.hasImages&&v.length>0){let F=$[u.index];F.images=v,u.hasImages=!0}continue}let O={type:C,text:B,id:Y.uuid,timestamp:X.timestamp};if(v.length>0)O.images=v;let T=$.length;$.push(s.parse(O)),J.set(f,{index:T,hasImages:v.length>0})}else{let f={type:C,text:B,id:Y.uuid,timestamp:X.timestamp};$.push(s.parse(f))}}for(let w of D){let P=w.callId?Z.get(w.callId):void 0;if(P){let E=$[P.index],B=g6(w.output,b);E.output=B;let C=Ck(B);if(C.length>0)E.images=C;if(w.error)E.error=w.error;if(typeof w.isError<"u")E.isError=w.isError;let f=uX(E,G);$[P.index]=f}}continue}if(Q==="assistant"){let K=Y.message?.content;if(!Array.isArray(K))continue;for(let v of K){if(!v||typeof v!=="object")continue;let D=v;if(D.type==="thinking"&&typeof D.thinking==="string"){let w=`thinking:${X.id}:${X.timestamp}:${D.thinking}`;if(U.has(w))continue;U.add(w),$.push(s.parse({type:"thinking",text:D.thinking,...X}));continue}if(D.type==="text"&&typeof D.text==="string"){let w=`agent:${X.id}:${X.timestamp}:${D.text}`;if(U.has(w))continue;U.add(w),$.push(s.parse({type:"agent",text:D.text,...X}));continue}if(D.type==="tool_use"){let w=typeof D.id==="string"?D.id:"",P=typeof D.name==="string"?D.name:null,E=D.input??void 0,B={type:"tool-call",toolName:P,...X,input:E},C=s.parse(B),f=uX(C,G);if($.push(f),w)Z.set(w,{index:$.length-1,toolName:P});continue}if(D.type==="image")continue}}}if(z)$.push(s.parse({type:"command",name:z.name,args:z.args,id:z.id,timestamp:z.timestamp}));return{messages:$,blobs:b}}function pk(_,$){let b=_.message;if(!b)return{texts:[],images:[],toolResults:[]};let Z=b.content;if(typeof Z==="string")return Z?{texts:[Z],images:[],toolResults:[]}:{texts:[],images:[],toolResults:[]};if(!Array.isArray(Z))return{texts:[],images:[],toolResults:[]};let z=[],A=[],J=[];for(let U of Z){if(!U||typeof U!=="object")continue;if(typeof U==="string"){if(U)z.push(U);continue}let G=U,Y=typeof G.type==="string"?G.type:void 0;if(Y==="tool_result"){let X=G,Q=typeof X.tool_use_id==="string"?X.tool_use_id:void 0,K=X.content,v=_.raw.toolUseResult??_.raw.tool_use_result;if(v)K=v;let D=typeof X.error==="string"?X.error:void 0,w=X.is_error??X.isError,P=typeof w==="boolean"?w:typeof X.success==="boolean"?!X.success:void 0;J.push({callId:Q,output:K,error:D,isError:P});continue}if(Y==="text"&&typeof G.text==="string"){if(G.text)z.push(G.text);continue}if(Y==="image"){let X=g6(G,$);if(X&&typeof X==="object"&&X.type==="image"){let Q=X.source;if(Q?.type==="sha256"&&typeof Q.sha256==="string")A.push({sha256:Q.sha256,mediaType:typeof Q.mediaType==="string"?Q.mediaType:"image/unknown"})}continue}for(let X of["content","text"]){let Q=G[X];if(typeof Q==="string"&&Q)z.push(Q)}}return{texts:z,images:A,toolResults:J}}function dk(_){return{id:_.message?.id,timestamp:_.timestamp,model:_.message?.model}}function uX(_,$){if(!$)return _;let b=$.endsWith("/")?$:`${$}/`,Z=(O)=>{if(O.startsWith(b))return`./${O.slice(b.length)}`;return O},z=(O)=>typeof O==="object"&&O!==null&&!Array.isArray(O),A=(O)=>z(O)?{...O}:void 0,J=(O,T)=>{let F={...O};for(let H of T)delete F[H];return F},U=(O,T)=>{if(typeof O[T]==="string")O[T]=Z(O[T])},G=(O)=>typeof O==="number"&&Number.isFinite(O)?O:0,Y=(O)=>{if(!Array.isArray(O))return O;return O.map((T)=>{if(z(T)){let F={...T};return delete F.activeForm,F}return T})},{toolName:X,input:Q,output:K}=_,v=Q,D=K,w=!1,P=!1,E=_.isError;switch(X){case"Write":{let O=A(Q);if(O)U(O,"file_path"),v=O,w=!0;let T=A(K);if(T){let F={};if(T.type!==void 0)F.type=T.type;D=F,P=!0}break}case"Read":{let O=A(Q);if(O)U(O,"file_path"),v=O,w=!0;let T=A(K);if(T){let F={};if(typeof T.type==="string")F.type=T.type;if(T.file&&z(T.file)){let H=T.file,q={};if(typeof H.content==="string")q.content=H.content;if(typeof H.numLines==="number")q.numLines=H.numLines;if(typeof H.startLine==="number")q.startLine=H.startLine;if(typeof H.totalLines==="number")q.totalLines=H.totalLines;if(Object.keys(q).length>0)F.file=q}D=F,P=!0}break}case"Edit":{let O=A(Q),T=A(K),F,H;if(T&&Array.isArray(T.structuredPatch)){let q=[];for(let W of T.structuredPatch)if(z(W)){if(H===void 0&&typeof W.oldStart==="number")H=W.oldStart;if(Array.isArray(W.lines)){for(let V of W.lines)if(typeof V==="string")q.push(V)}}if(q.length>0)F=`${q.join(`
94
94
  `)}
95
- `}if(H===void 0&&typeof K==="string"){let q=K.match(/^\s*(\d+)[→\t]/m);if(q)H=parseInt(q[1],10)}if(E){U(E,"file_path");let q=typeof E.old_string==="string"?E.old_string:typeof E.oldString==="string"?E.oldString:void 0,g=typeof E.new_string==="string"?E.new_string:typeof E.newString==="string"?E.newString:void 0,D=O===!0||O==="true"||typeof K==="string"&&!K.includes("has been updated")||C&&typeof C.type==="string"&&C.type==="error";if(!F&&!D&&q!==void 0&&g!==void 0){let W=q.split(`
96
- `),N=g.split(`
97
- `),k=[];for(let x of W)k.push(`-${x}`);for(let x of N)k.push(`+${x}`);F=`${k.join(`
95
+ `}if(H===void 0&&typeof K==="string"){let q=K.match(/^\s*(\d+)[→\t]/m);if(q)H=parseInt(q[1],10)}if(O){U(O,"file_path");let q=typeof O.old_string==="string"?O.old_string:typeof O.oldString==="string"?O.oldString:void 0,W=typeof O.new_string==="string"?O.new_string:typeof O.newString==="string"?O.newString:void 0,V=E===!0||E==="true"||typeof K==="string"&&!K.includes("has been updated")||T&&typeof T.type==="string"&&T.type==="error";if(!F&&!V&&q!==void 0&&W!==void 0){let k=q.split(`
96
+ `),N=W.split(`
97
+ `),g=[];for(let x of k)g.push(`-${x}`);for(let x of N)g.push(`+${x}`);F=`${g.join(`
98
98
  `)}
99
- `}if(delete E.old_string,delete E.new_string,delete E.oldString,delete E.newString,F)E.diff=F;if(H!==void 0&&H>0)E.lineOffset=H;v=E,w=!0}if(C){let q=J(C,["filePath","newString","oldString","originalFile","structuredPatch","replaceAll"]);V=Object.keys(q).length>0?q:void 0,P=!0}break}case"Glob":case"Grep":{let E=A(K);if(E&&Array.isArray(E.filenames))E.filenames=E.filenames.map((C)=>typeof C==="string"?Z(C):C),delete E.numFiles,V=E,P=!0;break}case"Bash":{let E=A(Q);if(E&&typeof E.command==="string"){let F=E.command.match(/^(?:bash|zsh)\s+-lc\s+['"](.*)['"]$/s);if(F)E.command=F[1];v=E,w=!0}let C=A(K);if(C)delete C.stdoutLines,delete C.stderrLines,V=C,P=!0;break}case"Task":{let E=A(Q);if(E)v=E,w=!0;let C=A(K);if(C){let F={};for(let[H,q]of Object.entries(C)){if(H==="usage"&&z(q)){let g=q,D=G(g.input_tokens??g.inputTokens),W=G(g.cached_input_tokens??g.cachedInputTokens)+G(g.cache_creation_input_tokens??g.cacheCreationInputTokens)+G(g.cache_read_input_tokens??g.cacheReadInputTokens),N=G(g.output_tokens??g.outputTokens),k=G(g.reasoning_output_tokens??g.reasoningOutputTokens),x=g.total_tokens??g.totalTokens,j=typeof x==="number"&&Number.isFinite(x)?x:D+W+N+k;F.usage={inputTokens:D,cachedInputTokens:W,outputTokens:N,reasoningOutputTokens:k,totalTokens:j};continue}if(H==="usage"||H==="totalTokens"||H==="prompt")continue;F[H]=q}V=F,P=!0}break}case"TodoWrite":{let E=A(Q);if(E){if(Array.isArray(E.todos))E.todos=Y(E.todos);v=E,w=!0}let C=A(K);if(C){let F={...C},H=!1;if(Array.isArray(F.newTodos))F.newTodos=Y(F.newTodos),H=!0;if(Array.isArray(F.oldTodos))F.oldTodos=Y(F.oldTodos),H=!0;V=H?F:C,P=H}break}case"BashOutput":{let E=A(K);if(E)delete E.stdoutLines,delete E.stderrLines,V=E,P=!0;break}default:break}if(X==="KillShell"&&typeof O==="boolean")O=String(O);let B={..._};if(v!==void 0)v=S0(v,$);if(V!==void 0)V=S0(V,$);if(w||v!==Q)if(typeof v>"u")delete B.input;else B.input=v;if(P||V!==K)if(typeof V>"u")delete B.output;else B.output=V;if(typeof O>"u"){if(typeof B.error==="string"&&B.error.trim())O=!0;else if(typeof V==="string"&&/^error:/i.test(V.trim()))O=!0}if(typeof O<"u")B.isError=O;let T={},y=["id","input","model","output","timestamp","toolName","error","isError","type"];for(let E of y)if(Object.prototype.hasOwnProperty.call(B,E))T[E]=B[E];for(let E of Object.keys(B))if(!Object.prototype.hasOwnProperty.call(T,E))T[E]=B[E];return k6.parse(T)}import cW from"node:crypto";import YJ from"node:path";var rW={read_file:"Read",write_to_file:"Write",replace_in_file:"Edit",execute_command:"Bash",search_files:"Grep",list_files:"Glob",list_code_definition_names:"Ls",load_mcp_documentation:"LoadMcpDocs",access_mcp_resource:"AccessMcpResource",focus_chain:"TodoWrite",web_fetch:"WebFetch",web_search:"WebSearch",ask_followup_question:"AskUserQuestion",use_subagents:"Task",attempt_completion:"AgentResponse",plan_mode_respond:"AgentResponse"},nW=/<environment_details|feedback>[\s\S]*?<\/environment_details|feedback>/g,lW=/^<task>\n?([\s\S]*?)\n?<\/task>/,pW=/^\[[\w_]+ for '[^']*'\] Result:\n?/;function r4(_,$={}){if(!Array.isArray(_)||_.length===0)return null;let b=new Map,Z=[],z=new Map,A=0,J=0,U=0,G=new Map,Y=null,X=$.clientVersion??$.metadata?.environment_history?.[0]?.cline_version??null,Q=$.cwd??null;for(let E of _)if(E.role==="user")dW(E,Z,z,b,Q);else if(E.role==="assistant"){let C=E.modelInfo?Zg(E.modelInfo.modelId,E.modelInfo.providerId):null;if(C&&!Y)Y=C;if(E.metrics?.tokens){let F=E.metrics.tokens,H=F.prompt??0,q=F.completion??0,g=F.cached??0;if(A+=H+g,J+=q,U+=g,C){let D=G.get(C)??{inputTokens:0,cachedInputTokens:0,outputTokens:0,reasoningOutputTokens:0,totalTokens:0};D.inputTokens+=H+g,D.cachedInputTokens+=g,D.outputTokens+=q,D.totalTokens+=H+g+q,G.set(C,D)}}iW(E,C,Z,z,b,Q)}if(Z.length===0)return null;let K={inputTokens:A,cachedInputTokens:U,outputTokens:J,reasoningOutputTokens:0,totalTokens:A+J},v=bg(K),V=Y?Ug(Y,K,$.pricing):0,w=$g(Z),P=$.now??new Date,O=$.gitContext!==void 0?$.gitContext:null,B=Q?z_(Q):"",T=t_(Z),y=$.taskId??`cline-${P.getTime()}`;return{transcript:y_.parse({v:1,id:y,source:"cline",timestamp:P,preview:w,summary:null,model:Y,clientVersion:X,blendedTokens:v,costUsd:V,messageCount:Z.length,...T,tokenUsage:K,modelUsage:Array.from(G.entries()).map(([E,C])=>e_.parse({model:E,usage:C})),git:O,cwd:B,messages:Z}),blobs:b}}function dW(_,$,b,Z,z){for(let A of _.content)if(A.type==="text"){let J=XJ(A.text);if(!J)continue;if(pW.test(J))continue;let U=J.replace(nW,"").trim();if(!U)continue;let G=U.match(lW),Y=G?G[1].trim():U;if(!Y)continue;if(_g(Y))continue;$.push(s.parse({type:"user",text:Y}))}else if(A.type==="tool_result"){let J=A,U=b.get(J.tool_use_id);if(U!==void 0){let G=$[U],Y=oW(J.content);if(G.output=Y,J.is_error)G.isError=!0;let X=dX(G,z);$[U]=X}}else if(A.type==="image"){let U=aW(A,Z);if(U){let G=$[$.length-1];if(G&&G.type==="user"){let Y=G,X=Y.images??[];X.push(U),Y.images=X}}}}function iW(_,$,b,Z,z,A){for(let J of _.content)if(J.type==="text"){let U=XJ(J.text);if(!U)continue;b.push(s.parse({type:"agent",text:U,model:$??void 0}))}else if(J.type==="tool_use"){let U=J,G=tW(U.name),Y=sW(G,U.input,A);if(G==="AgentResponse"){let K=Y&&typeof Y==="object"?Y?.response:typeof Y==="string"?Y:void 0,v=XJ(K);if(v)b.push(s.parse({type:"agent",text:v,model:$??void 0}));continue}let X=s.parse({type:"tool-call",id:U.id,toolName:G,input:Y,model:$??void 0}),Q=dX(X,A);Z.set(U.id,b.length),b.push(Q)}}function XJ(_){if(typeof _==="string"){let $=_.trim();return $.length>0?$:null}if(_==null)return null;if(typeof _==="number"||typeof _==="boolean"||typeof _==="bigint")return String(_);if(typeof _==="object")try{let $=JSON.stringify(_);if(!$)return null;let b=$.trim();return b.length>0?b:null}catch{return String(_).trim()||null}return String(_).trim()||null}function oW(_){if(typeof _==="string")return _||void 0;if(Array.isArray(_)){let $=[];for(let b of _)if(b.type==="text"&&b.text)$.push(b.text);return $.length>0?$.join(`
100
- `):void 0}return}function aW(_,$){let b=_.source;if(!b?.data)return null;let Z=b.media_type??b.mediaType??"image/unknown",z=Buffer.from(b.data,"base64"),A=eW(z);if(!$.has(A))$.set(A,{data:z,mediaType:Z});return{sha256:A,mediaType:Z}}function eW(_){return cW.createHash("sha256").update(_).digest("hex")}function tW(_){return rW[_]??_}function sW(_,$,b){if(!$||typeof $!=="object")return $;let Z={...$};if(delete Z.task_progress,typeof Z.path==="string"&&b)Z.file_path=pX(Z.path,b),delete Z.path;if(typeof Z.file_path==="string"&&b)Z.file_path=pX(Z.file_path,b);if(_==="Write"&&typeof Z.content==="string");if(_==="Edit"&&typeof Z.diff==="string");if(_==="Bash"&&typeof Z.command==="string");if(_==="Grep"){if(typeof Z.regex==="string")Z.pattern=Z.regex,delete Z.regex}if(_==="AskUserQuestion")Z.answers={question:Z.question,options:typeof Z.options==="object"?{...Z.options}:Z.options},delete Z.question,delete Z.options;if(_==="AgentResponse")return Z.response||Z.result;return b?S0(Z,b):Z}function dX(_,$){if(!$)return _;let{input:b,output:Z}=_;b=S0(b,$),Z=S0(Z,$);let z={..._,input:b,output:Z};return k6.parse(z)}function pX(_,$){if(!_)return _;let b=YJ.isAbsolute(_),Z=_.replace(/\\/g,"/");if(!b){if(Z==="."||Z==="./")return".";if(Z.startsWith("./")||Z.startsWith("../"))return Z;return`./${Z}`}try{let z=YJ.relative($,_).replace(/\\/g,"/");if(z==="")return".";if(z.startsWith("..")||YJ.isAbsolute(z))return _;return`./${z}`}catch{return _}}function _g(_){if(_.includes("# TODO LIST UPDATE REQUIRED"))return!0;if(_.includes("# task_progress RECOMMENDED"))return!0;if(_.startsWith("[apply_patch for patch application]")||_.startsWith("[read_file for ")||_.startsWith("[write_to_file for ")||_.startsWith("[subagents] Result:")||_.includes("[ERROR] You did not use a tool"))return!0;if(_.startsWith("[replace_in_file for ")||_.startsWith("[execute_command for "))return!0;if(_.startsWith("[search_files for ")||_.startsWith("[list_files for "))return!0;if(_.startsWith("[list_code_definition_names for ")||_.startsWith("[access_mcp_resource for "))return!0;if(_.startsWith("[attempt_completion] ")||_.startsWith("[ask_followup_question] "))return!0;if(_.startsWith("[focus_chain] ")||_.startsWith("[plan_mode_respond] "))return!0;if(_.startsWith("[load_mcp_documentation] "))return!0;if(_.includes("# Current Mode")&&_.includes("environment_details"))return!0;if(_.startsWith("The user has provided feedback on the results."))return!0;return!1}function $g(_){for(let $ of _)if($.type==="user"&&$.text)return zg($.text);return null}function zg(_){return _.replace(/\s+/g," ").trim()}function bg(_){return Math.max(0,_.inputTokens-_.cachedInputTokens)+_.outputTokens+_.reasoningOutputTokens}function Zg(_,$){if(_.includes("/"))return _;return`${$}/${_}`}var Ag=["anthropic/","openai/","google/"],Jg=200000;function Ug(_,$,b){if(!b||!_)return 0;let Z=Gg(_,b);if(!Z)return 0;return Yg({input_tokens:Math.max(0,$.inputTokens-$.cachedInputTokens),output_tokens:$.outputTokens,cache_read_input_tokens:$.cachedInputTokens},Z)}function Gg(_,$){let b=_.trim();if(!b)return null;let Z=new Set;Z.add(b);for(let z of Ag)Z.add(`${z}${b}`);for(let z of Z){let A=$[z];if(A)return A}return null}function Yg(_,$){let b=(J,U,G,Y=Jg)=>{if(J==null||J<=0)return 0;if(J>Y&&G!=null){let X=Math.min(J,Y),K=Math.max(0,J-Y)*G;if(U!=null)K+=X*U;return K}if(U!=null)return J*U;return 0},Z=b(_.input_tokens,$.input_cost_per_token,$.input_cost_per_token_above_200k_tokens),z=b(_.output_tokens,$.output_cost_per_token,$.output_cost_per_token_above_200k_tokens),A=b(_.cache_read_input_tokens,$.cache_read_input_token_cost,$.cache_read_input_token_cost_above_200k_tokens);return Z+z+A}import Xg from"node:crypto";import QJ from"node:path";var KJ={inputTokens:0,cachedInputTokens:0,outputTokens:0,reasoningOutputTokens:0,totalTokens:0},iX=["anthropic/","claude-3-5-","claude-3-","claude-","openai/","azure/","openrouter/openai/"],Qg=200000,Kg={shell:"Bash",exec_command:"Bash"},vg=["<user_instructions","<environment_context","# agents.md instructions for","<permissions instructions>"],Fg=/^<image name=\[Image #\d+\]>$/i,Hg=[/<image[^>]*>/gi,/<\/image>/gi,/\[\s*image\s*#?\d+\s*\]/gi],qg=new Set(["image/png","image/jpeg","image/gif","image/webp","image/avif"]);function qJ(_,$={}){let b=Vg(_);if(b.length===0)return null;let Z=new Map,z=new Set,A=[],J=[],U=new Map,G=null,Y=null,X=null,Q,K={...KJ},v={...KJ};for(let C of b){if(!C)continue;let{type:F,payload:H,timestamp:q}=C;if(q&&(!Q||mg(q,Q)>0))Q=q;if(F==="session_meta"&&H){if(G=Dg(H),!Y)Y=G.cwd;continue}if(F==="turn_context"&&H){let D=a(H.cwd);if(D)Y=D;let W=a(H.model);if(W)X=cg(W);continue}if(F==="event_msg"&&H){if(a(H.type)==="token_count"){let W=oX(H.info,"last_token_usage"),N=oX(H.info,"total_token_usage"),k=null;if(W)k=W;else if(N)k={inputTokens:Math.max(0,N.inputTokens-v.inputTokens),cachedInputTokens:Math.max(0,N.cachedInputTokens-v.cachedInputTokens),outputTokens:Math.max(0,N.outputTokens-v.outputTokens),reasoningOutputTokens:Math.max(0,N.reasoningOutputTokens-v.reasoningOutputTokens),totalTokens:Math.max(0,N.totalTokens-v.totalTokens)};if(k)K={inputTokens:K.inputTokens+k.inputTokens,cachedInputTokens:K.cachedInputTokens+k.cachedInputTokens,outputTokens:K.outputTokens+k.outputTokens,reasoningOutputTokens:K.reasoningOutputTokens+k.reasoningOutputTokens,totalTokens:K.totalTokens+k.totalTokens};if(N)v=N}continue}if(F!=="response_item"||!H)continue;switch(a(H.type)){case"message":{let D=a(H.role);if(D==="user"){let{texts:W,images:N}=gg(H.content,U),k=B6(W.join(`
99
+ `}if(delete O.old_string,delete O.new_string,delete O.oldString,delete O.newString,F)O.diff=F;if(H!==void 0&&H>0)O.lineOffset=H;v=O,w=!0}if(T){let q=J(T,["filePath","newString","oldString","originalFile","structuredPatch","replaceAll"]);D=Object.keys(q).length>0?q:void 0,P=!0}break}case"Glob":case"Grep":{let O=A(K);if(O&&Array.isArray(O.filenames))O.filenames=O.filenames.map((T)=>typeof T==="string"?Z(T):T),delete O.numFiles,D=O,P=!0;break}case"Bash":{let O=A(Q);if(O&&typeof O.command==="string"){let F=O.command.match(/^(?:bash|zsh)\s+-lc\s+['"](.*)['"]$/s);if(F)O.command=F[1];v=O,w=!0}let T=A(K);if(T)delete T.stdoutLines,delete T.stderrLines,D=T,P=!0;break}case"Task":{let O=A(Q);if(O)v=O,w=!0;let T=A(K);if(T){let F={};for(let[H,q]of Object.entries(T)){if(H==="usage"&&z(q)){let W=q,V=G(W.input_tokens??W.inputTokens),k=G(W.cached_input_tokens??W.cachedInputTokens)+G(W.cache_creation_input_tokens??W.cacheCreationInputTokens)+G(W.cache_read_input_tokens??W.cacheReadInputTokens),N=G(W.output_tokens??W.outputTokens),g=G(W.reasoning_output_tokens??W.reasoningOutputTokens),x=W.total_tokens??W.totalTokens,j=typeof x==="number"&&Number.isFinite(x)?x:V+k+N+g;F.usage={inputTokens:V,cachedInputTokens:k,outputTokens:N,reasoningOutputTokens:g,totalTokens:j};continue}if(H==="usage"||H==="totalTokens"||H==="prompt")continue;F[H]=q}D=F,P=!0}break}case"TodoWrite":{let O=A(Q);if(O){if(Array.isArray(O.todos))O.todos=Y(O.todos);v=O,w=!0}let T=A(K);if(T){let F={...T},H=!1;if(Array.isArray(F.newTodos))F.newTodos=Y(F.newTodos),H=!0;if(Array.isArray(F.oldTodos))F.oldTodos=Y(F.oldTodos),H=!0;D=H?F:T,P=H}break}case"BashOutput":{let O=A(K);if(O)delete O.stdoutLines,delete O.stderrLines,D=O,P=!0;break}default:break}if(X==="KillShell"&&typeof E==="boolean")E=String(E);let B={..._};if(v!==void 0)v=S0(v,$);if(D!==void 0)D=S0(D,$);if(w||v!==Q)if(typeof v>"u")delete B.input;else B.input=v;if(P||D!==K)if(typeof D>"u")delete B.output;else B.output=D;if(typeof E>"u"){if(typeof B.error==="string"&&B.error.trim())E=!0;else if(typeof D==="string"&&/^error:/i.test(D.trim()))E=!0}if(typeof E<"u")B.isError=E;let C={},f=["id","input","model","output","timestamp","toolName","error","isError","type"];for(let O of f)if(Object.prototype.hasOwnProperty.call(B,O))C[O]=B[O];for(let O of Object.keys(B))if(!Object.prototype.hasOwnProperty.call(C,O))C[O]=B[O];return V6.parse(C)}import ik from"node:crypto";import FJ from"node:path";var ok={read_file:"Read",write_to_file:"Write",replace_in_file:"Edit",execute_command:"Bash",search_files:"Grep",list_files:"Glob",list_code_definition_names:"Ls",load_mcp_documentation:"LoadMcpDocs",access_mcp_resource:"AccessMcpResource",focus_chain:"TodoWrite",web_fetch:"WebFetch",web_search:"WebSearch",ask_followup_question:"AskUserQuestion",use_subagents:"Task",attempt_completion:"AgentResponse",plan_mode_respond:"AgentResponse"},ak=/<environment_details|feedback>[\s\S]*?<\/environment_details|feedback>/g,ek=/^<task>\n?([\s\S]*?)\n?<\/task>/,tk=/^\[[\w_]+ for '[^']*'\] Result:\n?/;function n4(_,$={}){if(!Array.isArray(_)||_.length===0)return null;let b=new Map,Z=[],z=new Map,A=0,J=0,U=0,G=new Map,Y=null,X=$.clientVersion??$.metadata?.environment_history?.[0]?.cline_version??null,Q=$.cwd??null;for(let O of _)if(O.role==="user")sk(O,Z,z,b,Q);else if(O.role==="assistant"){let T=O.modelInfo?XW(O.modelInfo.modelId,O.modelInfo.providerId):null;if(T&&!Y)Y=T;if(O.metrics?.tokens){let F=O.metrics.tokens,H=F.prompt??0,q=F.completion??0,W=F.cached??0;if(A+=H+W,J+=q,U+=W,T){let V=G.get(T)??{inputTokens:0,cachedInputTokens:0,outputTokens:0,reasoningOutputTokens:0,totalTokens:0};V.inputTokens+=H+W,V.cachedInputTokens+=W,V.outputTokens+=q,V.totalTokens+=H+W+q,G.set(T,V)}}_W(O,T,Z,z,b,Q)}if(Z.length===0)return null;let K={inputTokens:A,cachedInputTokens:U,outputTokens:J,reasoningOutputTokens:0,totalTokens:A+J},v=YW(K),D=Y?FW(Y,K,$.pricing):0,w=UW(Z),P=$.now??new Date,E=$.gitContext!==void 0?$.gitContext:null,B=Q?b_(Q):"",C=b4(Z),f=$.taskId??`cline-${P.getTime()}`;return{transcript:C_.parse({v:1,id:f,source:"cline",timestamp:P,preview:w,summary:null,model:Y,clientVersion:X,blendedTokens:v,costUsd:D,messageCount:Z.length,...C,tokenUsage:K,modelUsage:Array.from(G.entries()).map(([O,T])=>z4.parse({model:O,usage:T})),git:E,cwd:B,messages:Z}),blobs:b}}function sk(_,$,b,Z,z){for(let A of _.content)if(A.type==="text"){let J=vJ(A.text);if(!J)continue;if(tk.test(J))continue;let U=J.replace(ak,"").trim();if(!U)continue;let G=U.match(ek),Y=G?G[1].trim():U;if(!Y)continue;if(JW(Y))continue;$.push(s.parse({type:"user",text:Y}))}else if(A.type==="tool_result"){let J=A,U=b.get(J.tool_use_id);if(U!==void 0){let G=$[U],Y=$W(J.content);if(G.output=Y,J.is_error)G.isError=!0;let X=eX(G,z);$[U]=X}}else if(A.type==="image"){let U=zW(A,Z);if(U){let G=$[$.length-1];if(G&&G.type==="user"){let Y=G,X=Y.images??[];X.push(U),Y.images=X}}}}function _W(_,$,b,Z,z,A){for(let J of _.content)if(J.type==="text"){let U=vJ(J.text);if(!U)continue;b.push(s.parse({type:"agent",text:U,model:$??void 0}))}else if(J.type==="tool_use"){let U=J,G=ZW(U.name),Y=AW(G,U.input,A);if(G==="AgentResponse"){let K=Y&&typeof Y==="object"?Y?.response:typeof Y==="string"?Y:void 0,v=vJ(K);if(v)b.push(s.parse({type:"agent",text:v,model:$??void 0}));continue}let X=s.parse({type:"tool-call",id:U.id,toolName:G,input:Y,model:$??void 0}),Q=eX(X,A);Z.set(U.id,b.length),b.push(Q)}}function vJ(_){if(typeof _==="string"){let $=_.trim();return $.length>0?$:null}if(_==null)return null;if(typeof _==="number"||typeof _==="boolean"||typeof _==="bigint")return String(_);if(typeof _==="object")try{let $=JSON.stringify(_);if(!$)return null;let b=$.trim();return b.length>0?b:null}catch{return String(_).trim()||null}return String(_).trim()||null}function $W(_){if(typeof _==="string")return _||void 0;if(Array.isArray(_)){let $=[];for(let b of _)if(b.type==="text"&&b.text)$.push(b.text);return $.length>0?$.join(`
100
+ `):void 0}return}function zW(_,$){let b=_.source;if(!b?.data)return null;let Z=b.media_type??b.mediaType??"image/unknown",z=Buffer.from(b.data,"base64"),A=bW(z);if(!$.has(A))$.set(A,{data:z,mediaType:Z});return{sha256:A,mediaType:Z}}function bW(_){return ik.createHash("sha256").update(_).digest("hex")}function ZW(_){return ok[_]??_}function AW(_,$,b){if(!$||typeof $!=="object")return $;let Z={...$};if(delete Z.task_progress,typeof Z.path==="string"&&b)Z.file_path=aX(Z.path,b),delete Z.path;if(typeof Z.file_path==="string"&&b)Z.file_path=aX(Z.file_path,b);if(_==="Write"&&typeof Z.content==="string");if(_==="Edit"&&typeof Z.diff==="string");if(_==="Bash"&&typeof Z.command==="string");if(_==="Grep"){if(typeof Z.regex==="string")Z.pattern=Z.regex,delete Z.regex}if(_==="AskUserQuestion")Z.answers={question:Z.question,options:typeof Z.options==="object"?{...Z.options}:Z.options},delete Z.question,delete Z.options;if(_==="AgentResponse")return Z.response||Z.result;return b?S0(Z,b):Z}function eX(_,$){if(!$)return _;let{input:b,output:Z}=_;b=S0(b,$),Z=S0(Z,$);let z={..._,input:b,output:Z};return V6.parse(z)}function aX(_,$){if(!_)return _;let b=FJ.isAbsolute(_),Z=_.replace(/\\/g,"/");if(!b){if(Z==="."||Z==="./")return".";if(Z.startsWith("./")||Z.startsWith("../"))return Z;return`./${Z}`}try{let z=FJ.relative($,_).replace(/\\/g,"/");if(z==="")return".";if(z.startsWith("..")||FJ.isAbsolute(z))return _;return`./${z}`}catch{return _}}function JW(_){if(_.includes("# TODO LIST UPDATE REQUIRED"))return!0;if(_.includes("# task_progress RECOMMENDED"))return!0;if(_.startsWith("[apply_patch for patch application]")||_.startsWith("[read_file for ")||_.startsWith("[write_to_file for ")||_.startsWith("[subagents] Result:")||_.includes("[ERROR] You did not use a tool"))return!0;if(_.startsWith("[replace_in_file for ")||_.startsWith("[execute_command for "))return!0;if(_.startsWith("[search_files for ")||_.startsWith("[list_files for "))return!0;if(_.startsWith("[list_code_definition_names for ")||_.startsWith("[access_mcp_resource for "))return!0;if(_.startsWith("[attempt_completion] ")||_.startsWith("[ask_followup_question] "))return!0;if(_.startsWith("[focus_chain] ")||_.startsWith("[plan_mode_respond] "))return!0;if(_.startsWith("[load_mcp_documentation] "))return!0;if(_.includes("# Current Mode")&&_.includes("environment_details"))return!0;if(_.startsWith("The user has provided feedback on the results."))return!0;return!1}function UW(_){for(let $ of _)if($.type==="user"&&$.text)return GW($.text);return null}function GW(_){return _.replace(/\s+/g," ").trim()}function YW(_){return Math.max(0,_.inputTokens-_.cachedInputTokens)+_.outputTokens+_.reasoningOutputTokens}function XW(_,$){if(_.includes("/"))return _;return`${$}/${_}`}var QW=["anthropic/","openai/","google/"],KW=200000;function FW(_,$,b){if(!b||!_)return 0;let Z=vW(_,b);if(!Z)return 0;return HW({input_tokens:Math.max(0,$.inputTokens-$.cachedInputTokens),output_tokens:$.outputTokens,cache_read_input_tokens:$.cachedInputTokens},Z)}function vW(_,$){let b=_.trim();if(!b)return null;let Z=new Set;Z.add(b);for(let z of QW)Z.add(`${z}${b}`);for(let z of Z){let A=$[z];if(A)return A}return null}function HW(_,$){let b=(J,U,G,Y=KW)=>{if(J==null||J<=0)return 0;if(J>Y&&G!=null){let X=Math.min(J,Y),K=Math.max(0,J-Y)*G;if(U!=null)K+=X*U;return K}if(U!=null)return J*U;return 0},Z=b(_.input_tokens,$.input_cost_per_token,$.input_cost_per_token_above_200k_tokens),z=b(_.output_tokens,$.output_cost_per_token,$.output_cost_per_token_above_200k_tokens),A=b(_.cache_read_input_tokens,$.cache_read_input_token_cost,$.cache_read_input_token_cost_above_200k_tokens);return Z+z+A}import qW from"node:crypto";import HJ from"node:path";var qJ={inputTokens:0,cachedInputTokens:0,outputTokens:0,reasoningOutputTokens:0,totalTokens:0},tX=["anthropic/","claude-3-5-","claude-3-","claude-","openai/","azure/","openrouter/openai/"],DW=200000,VW={shell:"Bash",exec_command:"Bash"},gW=["<user_instructions","<environment_context","# agents.md instructions for","<permissions instructions>"],kW=/^<image name=\[Image #\d+\]>$/i,WW=[/<image[^>]*>/gi,/<\/image>/gi,/\[\s*image\s*#?\d+\s*\]/gi],wW=new Set(["image/png","image/jpeg","image/gif","image/webp","image/avif"]);function kJ(_,$={}){let b=BW(_);if(b.length===0)return null;let Z=new Map,z=new Set,A=[],J=[],U=new Map,G=null,Y=null,X=null,Q,K={...qJ},v={...qJ};for(let T of b){if(!T)continue;let{type:F,payload:H,timestamp:q}=T;if(q&&(!Q||lW(q,Q)>0))Q=q;if(F==="session_meta"&&H){if(G=xW(H),!Y)Y=G.cwd;continue}if(F==="turn_context"&&H){let V=a(H.cwd);if(V)Y=V;let k=a(H.model);if(k)X=iW(k);continue}if(F==="event_msg"&&H){if(a(H.type)==="token_count"){let k=sX(H.info,"last_token_usage"),N=sX(H.info,"total_token_usage"),g=null;if(k)g=k;else if(N)g={inputTokens:Math.max(0,N.inputTokens-v.inputTokens),cachedInputTokens:Math.max(0,N.cachedInputTokens-v.cachedInputTokens),outputTokens:Math.max(0,N.outputTokens-v.outputTokens),reasoningOutputTokens:Math.max(0,N.reasoningOutputTokens-v.reasoningOutputTokens),totalTokens:Math.max(0,N.totalTokens-v.totalTokens)};if(g)K={inputTokens:K.inputTokens+g.inputTokens,cachedInputTokens:K.cachedInputTokens+g.cachedInputTokens,outputTokens:K.outputTokens+g.outputTokens,reasoningOutputTokens:K.reasoningOutputTokens+g.reasoningOutputTokens,totalTokens:K.totalTokens+g.totalTokens};if(N)v=N}continue}if(F!=="response_item"||!H)continue;switch(a(H.type)){case"message":{let V=a(H.role);if(V==="user"){let{texts:k,images:N}=MW(H.content,U),g=W6(k.join(`
101
101
 
102
- `));if(!k&&N.length===0)break;if(k&&Lg(k))break;if(k)J.push(k);let x=a(H.id),j={type:"user",timestamp:q,text:k||""};if(x)j.id=x;if(N.length>0)j.images=N;FJ(j,A,z)}else if(D==="assistant"){let W=kg(H.content,!0);if(W.length===0)break;let N=W.join(`
102
+ `));if(!g&&N.length===0)break;if(g&&uW(g))break;if(g)J.push(g);let x=a(H.id),j={type:"user",timestamp:q,text:g||""};if(x)j.id=x;if(N.length>0)j.images=N;VJ(j,A,z)}else if(V==="assistant"){let k=NW(H.content,!0);if(k.length===0)break;let N=k.join(`
103
103
 
104
- `).trim();if(!N)break;let k=a(H.id),x={type:"agent",timestamp:q,model:X??void 0,text:N};if(k)x.id=k;FJ(x,A,z)}break}case"reasoning":{let D=wg(H);for(let W of D){let N=a(H.id),k={type:"thinking",timestamp:q,model:X??void 0,text:W};if(N)k.id=N;FJ(k,A,z)}break}case"function_call":{let D=a(H.call_id)??a(H.id)??void 0,W=a(H.name),N=sX(W),k=vJ(H.arguments),x=xg(k,Y),j=s.parse({type:"tool-call",id:D,timestamp:q,model:X??void 0,toolName:N,input:x}),S=HJ(j,Y,W);Z.set(D??"",{index:A.push(S)-1,rawName:W});break}case"function_call_output":{let D=a(H.call_id);if(!D)break;let W=Z.get(D);if(!W)break;let N=vJ(H.output),k=eX(A[W.index],N,Y,W.rawName);A[W.index]=k;break}case"custom_tool_call":{let D=a(H.call_id)??a(H.id)??void 0,W=a(H.name),N=sX(W),k=Ng(W,H.input,Y),x=s.parse({type:"tool-call",id:D,timestamp:q,model:X??void 0,toolName:N,input:k}),j=HJ(x,Y,W);Z.set(D??"",{index:A.push(j)-1,rawName:W});break}case"custom_tool_call_output":{let D=a(H.call_id);if(!D)break;let W=Z.get(D);if(!W)break;let N=vJ(H.output),k=eX(A[W.index],N,Y,W.rawName);A[W.index]=k;break}default:break}}if(A.length===0)return null;let V=ug(Q)??$.now??new Date,w=Tg(J),P=K??{...KJ},O=Rg(P),B=rg(X,P,$.pricing),T=$.gitContext!==void 0?$.gitContext:yg(G,Y),y=Y?z_(Y):"",u=t_(A);return{transcript:y_.parse({v:1,id:G?.id??A[0]?.id??hg(V),source:"codex",timestamp:V,preview:w,summary:null,model:X,clientVersion:$.clientVersion??G?.cliVersion??null,blendedTokens:O,costUsd:B,messageCount:A.length,...u,tokenUsage:P,modelUsage:X?[e_.parse({model:X,usage:P})]:[],git:T,cwd:y,messages:A}),blobs:U}}function Vg(_){let $=[];for(let b of _){if(!b||typeof b!=="object")continue;let Z=b,z=a(Z.type);if(!z)continue;let A=a(Z.timestamp)??void 0,J=Z.payload&&typeof Z.payload==="object"?Z.payload:null;$.push({type:z,timestamp:A,payload:J})}return $}function Dg(_){let $=_.git??{};return{id:a(_.id),cwd:a(_.cwd),cliVersion:a(_.cli_version??_.cliVersion),git:{branch:a($.branch),repositoryUrl:a($.repository_url??$.repositoryUrl)}}}function oX(_,$="total_token_usage"){if(!_||typeof _!=="object")return null;let b=_,Z;if($==="last_token_usage")Z=b.last_token_usage??b.lastTokenUsage??b.total_token_usage??b.totalTokenUsage;else Z=b.total_token_usage??b.totalTokenUsage??b.last_token_usage??b.lastTokenUsage;if(!Z||typeof Z!=="object")return null;let z=Z;return{inputTokens:s_(z.input_tokens??z.inputTokens),cachedInputTokens:s_(z.cached_input_tokens??z.cachedInputTokens),outputTokens:s_(z.output_tokens??z.outputTokens),reasoningOutputTokens:s_(z.reasoning_output_tokens??z.reasoningOutputTokens),totalTokens:s_(z.total_tokens??z.totalTokens)}}function kg(_,$=!1){let b=(z)=>{if($)return z.trim();return B6(z)};if(typeof _==="string"){let z=b(_);return z?[z]:[]}if(!Array.isArray(_))return[];let Z=[];for(let z of _){if(!z)continue;if(typeof z==="string"){let A=b(z);if(A)Z.push(A);continue}if(typeof z==="object"){let A=z,J=a(A.text??A.content);if(J){let U=b(J);if(U)Z.push(U)}}}return Z}function Wg(_){return Xg.createHash("sha256").update(_).digest("hex")}function gg(_,$){let b=[],Z=[],z=(A)=>{if(!A)return;let J=Bg(A),U=J.trim();if(!U||Fg.test(U))return;b.push(J)};if(typeof _==="string")return z(_),{texts:b,images:Z};if(!Array.isArray(_))return{texts:b,images:Z};for(let A of _){if(!A)continue;if(typeof A==="string"){z(A);continue}if(typeof A!=="object")continue;let J=A,U=a(J.type);if(U==="input_text"||U==="text"||U==="output_text"){z(a(J.text??J.content));continue}if(U==="input_image"||U==="image"){let G=aX(J,$);if(G)Z.push(G);continue}if(J.image_url||J.imageUrl||J.url){let G=aX(J,$);if(G){Z.push(G);continue}}z(a(J.text??J.content))}return{texts:b,images:Z}}function Bg(_){let $=_;for(let b of Hg)$=$.replace(b,"");return $}function aX(_,$){let b=_.image_url??_.imageUrl??_.url,Z=typeof b==="string"?b:b&&typeof b==="object"?a(b.url):void 0;if(!Z)return null;let z=Z.match(/^data:([^;]+);base64,([\s\S]+)$/);if(!z)return null;let A=(z[1]||"").trim().toLowerCase();if(!qg.has(A))return null;let J=z[2];if(!J)return null;let U=Buffer.from(J,"base64"),G=Wg(U);if(!$.has(G))$.set(G,{data:U,mediaType:A});return{sha256:G,mediaType:A}}function wg(_){let $=[],b=_.summary;if(Array.isArray(b)){for(let z of b)if(z&&typeof z==="object"){let A=a(z.text);if(A)$.push(A)}}let Z=_.content;if(Array.isArray(Z)){for(let z of Z)if(z&&typeof z==="object"){let A=z;if(a(A.type)==="reasoning"||a(A.type)==="text"){let J=a(A.text??A.content);if(J)$.push(J)}}}return $}function vJ(_){let $=a(_);if(!$)return _;try{return JSON.parse($)}catch{return _}}function xg(_,$){if(!_||typeof _!=="object")return _;let b={..._};if(typeof b.workdir==="string"&&$)b.workdir=n4(b.workdir,$);return b}function Ng(_,$,b){if(!$)return $;if(_==="apply_patch"){let Z=a($);if(!Z)return $;let z=Sg(Z,b);if(z.diff||z.file_path)return z}return $}function eX(_,$,b,Z){if(_.type!=="tool-call")return _;let z=$;if(Z==="shell")z=_Q($);else if(Z==="exec_command")z=Pg($);else if(Z==="apply_patch")z=jg($);let A={..._,output:z};if(Z==="shell"||Z==="exec_command"){let J=Ig(A,b);if(J)return J}return HJ(A,b,Z)}function Ig(_,$){if(_.type!=="tool-call"||!_.input)return null;let b=_.input,Z=null;if(typeof b.cmd==="string")Z=b.cmd;else if(typeof b.command==="string")Z=b.command;else if(Array.isArray(b.command)&&b.command.length>=3){let U=b.command[0];if((U==="bash"||U==="zsh"||U==="/bin/zsh"||U==="/bin/bash")&&b.command[1]==="-lc")Z=a(b.command[2])}if(!Z)return null;let z=Z.match(/^cat\s+<<'EOF'\s+>\s+(\S+)\s*\n([\s\S]*?)EOF$/);if(z){let[,U,G]=z,Y=$?n4(`${$}/${U}`,$):`./${U}`;return s.parse({..._,toolName:"Write",input:{file_path:Y,content:G||""},output:void 0})}let A=Z.match(/^cat\s+(\S+)$/);if(A){let[,U]=A,G=$?n4(`${$}/${U}`,$):`./${U}`,Y;if(_.output&&typeof _.output==="object"){let X=_.output;Y=a(X.stdout)??void 0}return s.parse({..._,toolName:"Read",input:{file_path:G},output:Y})}let J=Mg(Z);if(J.length>0&&J[0]==="rg"){let U=Eg(J,$);if(U){let G=tX(_.output),Y;if(G){let X=G.split(`
105
- `).filter((Q)=>Q.trim().length>0);if(U.input.output_mode==="files_with_matches")Y={mode:"files_with_matches",filenames:X,numMatches:X.length};else Y={mode:"content",content:G,numMatches:X.length,numLines:X.length}}return s.parse({..._,toolName:"Grep",input:U.input,output:Y})}}if(J.length>=4&&J[0]==="sed"){let U=Og(J,$);if(U){let{filePath:G,startLine:Y}=U,X=tX(_.output),Q;if(X){let K=X.split(`
106
- `).length;Q={file:{content:X,numLines:K,startLine:Y}}}return s.parse({..._,toolName:"Read",input:{file_path:G},output:Q})}}return null}function Mg(_){let $=[],b="",Z=null,z=!1;for(let A of _){if(z){b+=A,z=!1;continue}if(A==="\\"&&Z!=="'"){z=!0;continue}if(Z){if(A===Z)Z=null;else b+=A;continue}if(A==="'"||A==='"'){Z=A;continue}if(/\s/.test(A)){if(b.length>0)$.push(b),b="";continue}b+=A}if(b.length>0)$.push(b);return $}function tX(_){if(typeof _==="string")return _;if(_&&typeof _==="object"){let b=a(_.stdout);if(b)return b}return}function Eg(_,$){if(_.length<2)return null;let b={},Z=null,z=null;for(let A=1;A<_.length;A+=1){let J=_[A];if(J==="--")continue;if(J.startsWith("-")){switch(J){case"-i":b["-i"]=!0;break;case"-U":b.multiline=!0;break;case"-A":case"-B":case"-C":{let U=_[A+1];if(U)b[J]=U,A+=1;break}case"-l":case"--files-with-matches":b.output_mode="files_with_matches";break;case"-c":case"--count":b.output_mode="count";break;case"-g":case"--glob":{let U=_[A+1];if(U)b.glob=U,A+=1;break}case"-t":case"--type":{let U=_[A+1];if(U)b.type=U,A+=1;break}case"-e":case"--regexp":{let U=_[A+1];if(U)Z=U,A+=1;break}default:break}continue}if(!Z){Z=J;continue}if(!z){z=J;continue}}if(!Z)return null;if(b.pattern=Z,z)b.path=$?n4(z,$):z;return{input:b}}function Og(_,$){let b=_.indexOf("-n");if(b===-1)return null;let Z=_[b+1],z=_[b+2];if(!Z||!z)return null;let A=Z.match(/^(\d+)(?:,(\d+))?p$/);if(!A)return null;let J=parseInt(A[1],10);if(!Number.isFinite(J)||J<=0)return null;return{filePath:$?n4(z,$):z,startLine:J}}function HJ(_,$,b){if(_.type!=="tool-call")return _;let{toolName:Z,input:z,output:A}=_;if(b==="shell"||b==="exec_command"){if(Z="Bash",z&&typeof z==="object"){let J=z,U={},G=null;if(typeof J.cmd==="string")G=J.cmd;else if(Array.isArray(J.command)&&J.command.length>=3){let Y=J.command[0];if((Y==="bash"||Y==="zsh"||Y==="/bin/zsh"||Y==="/bin/bash")&&J.command[1]==="-lc")G=a(J.command[2])}else if(typeof J.command==="string")G=J.command;if(G)U.command=G;if(typeof J.description==="string")U.description=J.description;z=U}}if(b==="apply_patch"){if(Z="Edit",z&&typeof z==="object"){let J={...z},U=a(J.file_path);if(U&&$)J.file_path=n4(U,$);z=J}}if($)z=S0(z,$),A=S0(A,$);return s.parse({..._,toolName:Z,input:z,output:A})}function _Q(_){if(!_||typeof _!=="object")return _;let $=_,b={},Z=a($.output??$.stdout);if(typeof $.stdout==="string")b.stdout=$.stdout;else if(Z)b.stdout=Z;let z=a($.stderr);if(z)b.stderr=z;let A=$.metadata&&typeof $.metadata==="object"?$.metadata:{},J=s_(A.exit_code??A.exitCode??$.exit_code??$.exitCode);if(Number.isFinite(J))b.exitCode=J;let U=s_(A.duration_seconds??A.durationSeconds);if(Number.isFinite(U)&&U>0)b.durationSeconds=U;return Object.keys(b).length>0?b:void 0}function Pg(_){let $=a(_);if(!$)return _Q(_);let b={},Z=$.match(/Process exited with code (\d+)/);if(Z)b.exitCode=parseInt(Z[1],10);let z=$.match(/Wall time: ([\d.]+) seconds/);if(z){let J=parseFloat(z[1]);if(J>0)b.durationSeconds=J}let A=$.match(/Output:\n([\s\S]*?)$/);if(A&&A[1]){let J=A[1].trim();if(J)b.stdout=J}return Object.keys(b).length>0?b:void 0}function jg(_){if(!_||typeof _!=="object")return _;let $=_,b={},Z=a($.output);if(Z)b.message=Z;let z=$.metadata&&typeof $.metadata==="object"?$.metadata:null;if(z){let A=s_(z.exit_code??z.exitCode);if(Number.isFinite(A))b.exitCode=A;let J=s_(z.duration_seconds??z.durationSeconds);if(Number.isFinite(J)&&J>0)b.durationSeconds=J}return Object.keys(b).length>0?b:void 0}function Sg(_,$){let b=_.split(/\r?\n/),Z=null,z=[];for(let U of b){if(U.startsWith("*** ")){let G=U.match(/^\*\*\* (?:Update|Add|Delete) File: (.+)$/);if(G&&G[1])Z=G[1].trim();continue}z.push(U)}let A=z.join(`
107
- `).trim(),J={};if(Z)J.file_path=$?n4(Z,$):Z;if(A)J.diff=A.endsWith(`
104
+ `).trim();if(!N)break;let g=a(H.id),x={type:"agent",timestamp:q,model:X??void 0,text:N};if(g)x.id=g;VJ(x,A,z)}break}case"reasoning":{let V=OW(H);for(let k of V){let N=a(H.id),g={type:"thinking",timestamp:q,model:X??void 0,text:k};if(N)g.id=N;VJ(g,A,z)}break}case"function_call":{let V=a(H.call_id)??a(H.id)??void 0,k=a(H.name),N=bQ(k),g=DJ(H.arguments),x=PW(g,Y),j=s.parse({type:"tool-call",id:V,timestamp:q,model:X??void 0,toolName:N,input:x}),S=gJ(j,Y,k);Z.set(V??"",{index:A.push(S)-1,rawName:k});break}case"function_call_output":{let V=a(H.call_id);if(!V)break;let k=Z.get(V);if(!k)break;let N=DJ(H.output),g=$Q(A[k.index],N,Y,k.rawName);A[k.index]=g;break}case"custom_tool_call":{let V=a(H.call_id)??a(H.id)??void 0,k=a(H.name),N=bQ(k),g=jW(k,H.input,Y),x=s.parse({type:"tool-call",id:V,timestamp:q,model:X??void 0,toolName:N,input:g}),j=gJ(x,Y,k);Z.set(V??"",{index:A.push(j)-1,rawName:k});break}case"custom_tool_call_output":{let V=a(H.call_id);if(!V)break;let k=Z.get(V);if(!k)break;let N=DJ(H.output),g=$Q(A[k.index],N,Y,k.rawName);A[k.index]=g;break}default:break}}if(A.length===0)return null;let D=pW(Q)??$.now??new Date,w=cW(J),P=K??{...qJ},E=mW(P),B=oW(X,P,$.pricing),C=$.gitContext!==void 0?$.gitContext:hW(G,Y),f=Y?b_(Y):"",u=b4(A);return{transcript:C_.parse({v:1,id:G?.id??A[0]?.id??dW(D),source:"codex",timestamp:D,preview:w,summary:null,model:X,clientVersion:$.clientVersion??G?.cliVersion??null,blendedTokens:E,costUsd:B,messageCount:A.length,...u,tokenUsage:P,modelUsage:X?[z4.parse({model:X,usage:P})]:[],git:C,cwd:f,messages:A}),blobs:U}}function BW(_){let $=[];for(let b of _){if(!b||typeof b!=="object")continue;let Z=b,z=a(Z.type);if(!z)continue;let A=a(Z.timestamp)??void 0,J=Z.payload&&typeof Z.payload==="object"?Z.payload:null;$.push({type:z,timestamp:A,payload:J})}return $}function xW(_){let $=_.git??{};return{id:a(_.id),cwd:a(_.cwd),cliVersion:a(_.cli_version??_.cliVersion),git:{branch:a($.branch),repositoryUrl:a($.repository_url??$.repositoryUrl)}}}function sX(_,$="total_token_usage"){if(!_||typeof _!=="object")return null;let b=_,Z;if($==="last_token_usage")Z=b.last_token_usage??b.lastTokenUsage??b.total_token_usage??b.totalTokenUsage;else Z=b.total_token_usage??b.totalTokenUsage??b.last_token_usage??b.lastTokenUsage;if(!Z||typeof Z!=="object")return null;let z=Z;return{inputTokens:Z4(z.input_tokens??z.inputTokens),cachedInputTokens:Z4(z.cached_input_tokens??z.cachedInputTokens),outputTokens:Z4(z.output_tokens??z.outputTokens),reasoningOutputTokens:Z4(z.reasoning_output_tokens??z.reasoningOutputTokens),totalTokens:Z4(z.total_tokens??z.totalTokens)}}function NW(_,$=!1){let b=(z)=>{if($)return z.trim();return W6(z)};if(typeof _==="string"){let z=b(_);return z?[z]:[]}if(!Array.isArray(_))return[];let Z=[];for(let z of _){if(!z)continue;if(typeof z==="string"){let A=b(z);if(A)Z.push(A);continue}if(typeof z==="object"){let A=z,J=a(A.text??A.content);if(J){let U=b(J);if(U)Z.push(U)}}}return Z}function IW(_){return qW.createHash("sha256").update(_).digest("hex")}function MW(_,$){let b=[],Z=[],z=(A)=>{if(!A)return;let J=EW(A),U=J.trim();if(!U||kW.test(U))return;b.push(J)};if(typeof _==="string")return z(_),{texts:b,images:Z};if(!Array.isArray(_))return{texts:b,images:Z};for(let A of _){if(!A)continue;if(typeof A==="string"){z(A);continue}if(typeof A!=="object")continue;let J=A,U=a(J.type);if(U==="input_text"||U==="text"||U==="output_text"){z(a(J.text??J.content));continue}if(U==="input_image"||U==="image"){let G=_Q(J,$);if(G)Z.push(G);continue}if(J.image_url||J.imageUrl||J.url){let G=_Q(J,$);if(G){Z.push(G);continue}}z(a(J.text??J.content))}return{texts:b,images:Z}}function EW(_){let $=_;for(let b of WW)$=$.replace(b,"");return $}function _Q(_,$){let b=_.image_url??_.imageUrl??_.url,Z=typeof b==="string"?b:b&&typeof b==="object"?a(b.url):void 0;if(!Z)return null;let z=Z.match(/^data:([^;]+);base64,([\s\S]+)$/);if(!z)return null;let A=(z[1]||"").trim().toLowerCase();if(!wW.has(A))return null;let J=z[2];if(!J)return null;let U=Buffer.from(J,"base64"),G=IW(U);if(!$.has(G))$.set(G,{data:U,mediaType:A});return{sha256:G,mediaType:A}}function OW(_){let $=[],b=_.summary;if(Array.isArray(b)){for(let z of b)if(z&&typeof z==="object"){let A=a(z.text);if(A)$.push(A)}}let Z=_.content;if(Array.isArray(Z)){for(let z of Z)if(z&&typeof z==="object"){let A=z;if(a(A.type)==="reasoning"||a(A.type)==="text"){let J=a(A.text??A.content);if(J)$.push(J)}}}return $}function DJ(_){let $=a(_);if(!$)return _;try{return JSON.parse($)}catch{return _}}function PW(_,$){if(!_||typeof _!=="object")return _;let b={..._};if(typeof b.workdir==="string"&&$)b.workdir=l4(b.workdir,$);return b}function jW(_,$,b){if(!$)return $;if(_==="apply_patch"){let Z=a($);if(!Z)return $;let z=fW(Z,b);if(z.diff||z.file_path)return z}return $}function $Q(_,$,b,Z){if(_.type!=="tool-call")return _;let z=$;if(Z==="shell")z=ZQ($);else if(Z==="exec_command")z=yW($);else if(Z==="apply_patch")z=CW($);let A={..._,output:z};if(Z==="shell"||Z==="exec_command"){let J=SW(A,b);if(J)return J}return gJ(A,b,Z)}function SW(_,$){if(_.type!=="tool-call"||!_.input)return null;let b=_.input,Z=null;if(typeof b.cmd==="string")Z=b.cmd;else if(typeof b.command==="string")Z=b.command;else if(Array.isArray(b.command)&&b.command.length>=3){let U=b.command[0];if((U==="bash"||U==="zsh"||U==="/bin/zsh"||U==="/bin/bash")&&b.command[1]==="-lc")Z=a(b.command[2])}if(!Z)return null;let z=Z.match(/^cat\s+<<'EOF'\s+>\s+(\S+)\s*\n([\s\S]*?)EOF$/);if(z){let[,U,G]=z,Y=$?l4(`${$}/${U}`,$):`./${U}`;return s.parse({..._,toolName:"Write",input:{file_path:Y,content:G||""},output:void 0})}let A=Z.match(/^cat\s+(\S+)$/);if(A){let[,U]=A,G=$?l4(`${$}/${U}`,$):`./${U}`,Y;if(_.output&&typeof _.output==="object"){let X=_.output;Y=a(X.stdout)??void 0}return s.parse({..._,toolName:"Read",input:{file_path:G},output:Y})}let J=RW(Z);if(J.length>0&&J[0]==="rg"){let U=LW(J,$);if(U){let G=zQ(_.output),Y;if(G){let X=G.split(`
105
+ `).filter((Q)=>Q.trim().length>0);if(U.input.output_mode==="files_with_matches")Y={mode:"files_with_matches",filenames:X,numMatches:X.length};else Y={mode:"content",content:G,numMatches:X.length,numLines:X.length}}return s.parse({..._,toolName:"Grep",input:U.input,output:Y})}}if(J.length>=4&&J[0]==="sed"){let U=TW(J,$);if(U){let{filePath:G,startLine:Y}=U,X=zQ(_.output),Q;if(X){let K=X.split(`
106
+ `).length;Q={file:{content:X,numLines:K,startLine:Y}}}return s.parse({..._,toolName:"Read",input:{file_path:G},output:Q})}}return null}function RW(_){let $=[],b="",Z=null,z=!1;for(let A of _){if(z){b+=A,z=!1;continue}if(A==="\\"&&Z!=="'"){z=!0;continue}if(Z){if(A===Z)Z=null;else b+=A;continue}if(A==="'"||A==='"'){Z=A;continue}if(/\s/.test(A)){if(b.length>0)$.push(b),b="";continue}b+=A}if(b.length>0)$.push(b);return $}function zQ(_){if(typeof _==="string")return _;if(_&&typeof _==="object"){let b=a(_.stdout);if(b)return b}return}function LW(_,$){if(_.length<2)return null;let b={},Z=null,z=null;for(let A=1;A<_.length;A+=1){let J=_[A];if(J==="--")continue;if(J.startsWith("-")){switch(J){case"-i":b["-i"]=!0;break;case"-U":b.multiline=!0;break;case"-A":case"-B":case"-C":{let U=_[A+1];if(U)b[J]=U,A+=1;break}case"-l":case"--files-with-matches":b.output_mode="files_with_matches";break;case"-c":case"--count":b.output_mode="count";break;case"-g":case"--glob":{let U=_[A+1];if(U)b.glob=U,A+=1;break}case"-t":case"--type":{let U=_[A+1];if(U)b.type=U,A+=1;break}case"-e":case"--regexp":{let U=_[A+1];if(U)Z=U,A+=1;break}default:break}continue}if(!Z){Z=J;continue}if(!z){z=J;continue}}if(!Z)return null;if(b.pattern=Z,z)b.path=$?l4(z,$):z;return{input:b}}function TW(_,$){let b=_.indexOf("-n");if(b===-1)return null;let Z=_[b+1],z=_[b+2];if(!Z||!z)return null;let A=Z.match(/^(\d+)(?:,(\d+))?p$/);if(!A)return null;let J=parseInt(A[1],10);if(!Number.isFinite(J)||J<=0)return null;return{filePath:$?l4(z,$):z,startLine:J}}function gJ(_,$,b){if(_.type!=="tool-call")return _;let{toolName:Z,input:z,output:A}=_;if(b==="shell"||b==="exec_command"){if(Z="Bash",z&&typeof z==="object"){let J=z,U={},G=null;if(typeof J.cmd==="string")G=J.cmd;else if(Array.isArray(J.command)&&J.command.length>=3){let Y=J.command[0];if((Y==="bash"||Y==="zsh"||Y==="/bin/zsh"||Y==="/bin/bash")&&J.command[1]==="-lc")G=a(J.command[2])}else if(typeof J.command==="string")G=J.command;if(G)U.command=G;if(typeof J.description==="string")U.description=J.description;z=U}}if(b==="apply_patch"){if(Z="Edit",z&&typeof z==="object"){let J={...z},U=a(J.file_path);if(U&&$)J.file_path=l4(U,$);z=J}}if($)z=S0(z,$),A=S0(A,$);return s.parse({..._,toolName:Z,input:z,output:A})}function ZQ(_){if(!_||typeof _!=="object")return _;let $=_,b={},Z=a($.output??$.stdout);if(typeof $.stdout==="string")b.stdout=$.stdout;else if(Z)b.stdout=Z;let z=a($.stderr);if(z)b.stderr=z;let A=$.metadata&&typeof $.metadata==="object"?$.metadata:{},J=Z4(A.exit_code??A.exitCode??$.exit_code??$.exitCode);if(Number.isFinite(J))b.exitCode=J;let U=Z4(A.duration_seconds??A.durationSeconds);if(Number.isFinite(U)&&U>0)b.durationSeconds=U;return Object.keys(b).length>0?b:void 0}function yW(_){let $=a(_);if(!$)return ZQ(_);let b={},Z=$.match(/Process exited with code (\d+)/);if(Z)b.exitCode=parseInt(Z[1],10);let z=$.match(/Wall time: ([\d.]+) seconds/);if(z){let J=parseFloat(z[1]);if(J>0)b.durationSeconds=J}let A=$.match(/Output:\n([\s\S]*?)$/);if(A&&A[1]){let J=A[1].trim();if(J)b.stdout=J}return Object.keys(b).length>0?b:void 0}function CW(_){if(!_||typeof _!=="object")return _;let $=_,b={},Z=a($.output);if(Z)b.message=Z;let z=$.metadata&&typeof $.metadata==="object"?$.metadata:null;if(z){let A=Z4(z.exit_code??z.exitCode);if(Number.isFinite(A))b.exitCode=A;let J=Z4(z.duration_seconds??z.durationSeconds);if(Number.isFinite(J)&&J>0)b.durationSeconds=J}return Object.keys(b).length>0?b:void 0}function fW(_,$){let b=_.split(/\r?\n/),Z=null,z=[];for(let U of b){if(U.startsWith("*** ")){let G=U.match(/^\*\*\* (?:Update|Add|Delete) File: (.+)$/);if(G&&G[1])Z=G[1].trim();continue}z.push(U)}let A=z.join(`
107
+ `).trim(),J={};if(Z)J.file_path=$?l4(Z,$):Z;if(A)J.diff=A.endsWith(`
108
108
  `)?A:`${A}
109
- `;return J}function n4(_,$){if(!_)return _;let b=QJ.isAbsolute(_),Z=_.replace(/\\/g,"/");if(!b){if(Z==="."||Z==="./")return".";if(Z.startsWith("./")||Z.startsWith("../"))return Z;return`./${Z}`}try{let z=QJ.relative($,_).replace(/\\/g,"/");if(z==="")return".";if(z.startsWith("..")||QJ.isAbsolute(z))return _;return z==="."?".":`./${z}`}catch{return _}}function Rg(_){return Math.max(0,_.inputTokens-_.cachedInputTokens)+_.outputTokens+_.reasoningOutputTokens}function Lg(_){let $=_.trim().toLowerCase();return vg.some((b)=>$.startsWith(b))}function Tg(_){for(let $ of _){let b=B6($);if(!b)continue;if(b.startsWith("<user_instructions>")||b.startsWith("<environment_context>"))continue;return b}return _.length>0?B6(_[0]):null}function yg(_,$){let b=$??_?.cwd??null;if(!_)return m0.parse({repo:null,branch:null,relativeCwd:null});let Z=_.git.repositoryUrl?Kz(_.git.repositoryUrl):null,z=_.git.branch,A=Z?Z.split("/").pop()??null:null,J=Cg(b,A);return m0.parse({repo:Z,branch:z,relativeCwd:i$(J)})}function Cg(_,$){if(!_)return null;let Z=_.replace(/\\/g,"/").split("/").filter(Boolean);if(Z.length===0)return null;if($){let z=Z.lastIndexOf($);if(z>=0){let A=Z.slice(z+1).join("/");return A.length>0?A:"."}}return null}function FJ(_,$,b){let Z=fg(_);if(Z&&b.has(Z))return;let z=s.parse(_);if($.push(z),Z)b.add(Z)}function fg(_){if("text"in _&&typeof _.text==="string")return`${_.type}|${_.timestamp??""}|${_.text}`;if(_.type==="tool-call")return`${_.type}|${_.timestamp??""}|${_.id??""}|${_.toolName??""}`;return null}function sX(_){if(!_)return _;return Kg[_]??_}function mg(_,$){let b=Date.parse(_),Z=Date.parse($);if(Number.isNaN(b)||Number.isNaN(Z))return 0;return b===Z?0:b>Z?1:-1}function ug(_){if(!_)return null;let $=new Date(_);return Number.isNaN($.getTime())?null:$}function s_(_){return typeof _==="number"&&Number.isFinite(_)?_:0}function a(_){if(typeof _!=="string")return null;let $=_.trim();return $.length>0?$:null}function B6(_){return _.replace(/\s+/g," ").trim()}function hg(_){return`codex-${_.getTime()}`}function cg(_){if(_.includes("/"))return _;return`openai/${_}`}function rg(_,$,b){if(!b||!_)return 0;let Z=ng(_,b);if(!Z)return 0;return lg({input_tokens:Math.max(0,$.inputTokens-$.cachedInputTokens),output_tokens:$.outputTokens+$.reasoningOutputTokens,cache_creation_input_tokens:0,cache_read_input_tokens:$.cachedInputTokens},Z)}function ng(_,$){let b=_.trim();if(!b)return null;let Z=new Set;Z.add(b);for(let A of iX)Z.add(`${A}${b}`);for(let A of iX)if(b.startsWith(A))Z.add(b.slice(A.length));for(let A of Z){let J=$[A];if(J)return J}let z=b.toLowerCase();for(let[A,J]of Object.entries($)){let U=A.toLowerCase();if(U.includes(z)||z.includes(U))return J}return null}function lg(_,$){let b=(U,G,Y,X=Qg)=>{if(U==null||U<=0)return 0;if(U>X&&Y!=null){let Q=Math.min(U,X),v=Math.max(0,U-X)*Y;if(G!=null)v+=Q*G;return v}if(G!=null)return U*G;return 0},Z=b(_.input_tokens,$.input_cost_per_token,$.input_cost_per_token_above_200k_tokens),z=b(_.output_tokens,$.output_cost_per_token,$.output_cost_per_token_above_200k_tokens),A=b(_.cache_creation_input_tokens,$.cache_creation_input_token_cost,$.cache_creation_input_token_cost_above_200k_tokens),J=b(_.cache_read_input_tokens,$.cache_read_input_token_cost,$.cache_read_input_token_cost_above_200k_tokens);return Z+z+A+J}import o$ from"node:path";var VJ={shell:"Bash",bash:"Bash",execute:"Bash",read_file:"Read",read:"Read",write_file:"Write",write:"Write",edit_file:"Edit",edit:"Edit",apply_patch:"Edit",multiedit:"Edit",glob:"Glob",grep:"Grep",find:"Glob",list_files:"Glob",ls:"Glob",webfetch:"WebFetch",websearch:"WebSearch",task:"Task",explore:"Explore",skill:"Skill",todowrite:"TodoWrite",todoread:"TodoRead",question:"Question",plan:"Plan",codesearch:"CodeSearch",lsp:"LSP"},pg=["anthropic/","claude-3-5-","claude-3-","claude-","openai/","azure/","openrouter/","google/","gemini/"],dg=200000;function l4(_,$={}){let{info:b,messages:Z}=_;if(!Z||Z.length===0)return null;let z=$.cwd??b.directory??null,A=[],J=[],U=null,G=0,Y=0,X=0,Q=0,K=0,v=[...Z].sort((C,F)=>{return C.info.time.created-F.info.time.created});for(let C of v){let F=C.info,H=ag(F);if(F.role==="assistant"&&H&&!U)U=H;if(F.role==="assistant"&&F.tokens)Y+=F.tokens.input??0,X+=F.tokens.output??0,Q+=F.tokens.reasoning??0,K+=F.tokens.cache?.read??0;if(F.role==="assistant"&&F.cost)G+=F.cost;for(let q of C.parts){if(q.type==="step-start"||q.type==="step-finish")continue;let g=new Date(F.time.created).toISOString();switch(q.type){case"text":{let D=q.text?.trim();if(!D)break;if(F.role==="user")J.push(D),A.push(s.parse({type:"user",text:D,id:F.id,timestamp:g}));else A.push(s.parse({type:"agent",text:D,id:F.id,timestamp:g,model:H??void 0}));break}case"reasoning":{let D=q.text?.trim();if(!D)break;A.push(s.parse({type:"thinking",text:D,timestamp:g,model:H??void 0}));break}case"tool":{let D=q.state??{},W=D.input;if(q.tool==="todoread")break;let N=ig(q.tool);if(N==="Task"&&W?.subagent_type&&typeof W.subagent_type==="string")N=og(W.subagent_type);let k=_B(N,D.input,z,D.metadata),x=$B(q.tool,N,D.output,D.metadata,z);A.push(s.parse({type:"tool-call",id:q.callID,timestamp:g,model:H??void 0,toolName:N,input:k,output:x,error:D.error,isError:D.status==="error"||!!D.error}));break}}}}if(A.length===0)return null;let V={inputTokens:Y,cachedInputTokens:K,outputTokens:X,reasoningOutputTokens:Q,totalTokens:Y+X},w=V.inputTokens+V.outputTokens,P=G>0?G:zB(U,V,$.pricing),O=new Date(b.time.created),B=tg(J),T=$.gitContext!==void 0?$.gitContext:m0.parse({repo:null,branch:null,relativeCwd:eg(v)}),y=z?z_(z):null,u=t_(A);return y_.parse({v:1,id:b.id,source:"opencode",timestamp:O,preview:B,summary:null,model:U,clientVersion:$.clientVersion??b.version??null,blendedTokens:w,costUsd:P,messageCount:A.length,...u,tokenUsage:V,modelUsage:U?[e_.parse({model:U,usage:V})]:[],git:T,cwd:y,messages:A})}function ig(_){let $=_.toLowerCase();return VJ[$]??_}function og(_){let $=_.toLowerCase();if(VJ[$])return VJ[$];return _.charAt(0).toUpperCase()+_.slice(1)}function ag(_){let $=_.modelID??_.model?.modelID,b=_.providerID??_.model?.providerID;if(!$)return null;if(b)return`${b}/${$}`;return $}function eg(_){for(let $ of _){let b=$.info.path;if(b?.root&&b?.cwd){if(b.root===b.cwd)return null;try{let Z=o$.relative(b.root,b.cwd).replace(/\\/g,"/");if(Z&&!Z.startsWith("..")&&!o$.isAbsolute(Z))return Z}catch{}}}return null}function tg(_){for(let $ of _){let b=$.trim().replace(/\s+/g," ");if(!b)continue;if(b.startsWith("<")&&b.includes(">"))continue;return b.replace(/^["']|["']$/g,"")}return _.length>0?_[0].trim().replace(/\s+/g," "):null}function sg(_){let $=_,b=$.match(/<file>\n?([\s\S]*?)\n?<\/file>/);if(b)$=b[1];return $=$.replace(/\n?\(End of file - total \d+ lines\)\n?$/,""),$.split(`
109
+ `;return J}function l4(_,$){if(!_)return _;let b=HJ.isAbsolute(_),Z=_.replace(/\\/g,"/");if(!b){if(Z==="."||Z==="./")return".";if(Z.startsWith("./")||Z.startsWith("../"))return Z;return`./${Z}`}try{let z=HJ.relative($,_).replace(/\\/g,"/");if(z==="")return".";if(z.startsWith("..")||HJ.isAbsolute(z))return _;return z==="."?".":`./${z}`}catch{return _}}function mW(_){return Math.max(0,_.inputTokens-_.cachedInputTokens)+_.outputTokens+_.reasoningOutputTokens}function uW(_){let $=_.trim().toLowerCase();return gW.some((b)=>$.startsWith(b))}function cW(_){for(let $ of _){let b=W6($);if(!b)continue;if(b.startsWith("<user_instructions>")||b.startsWith("<environment_context>"))continue;return b}return _.length>0?W6(_[0]):null}function hW(_,$){let b=$??_?.cwd??null;if(!_)return m0.parse({repo:null,branch:null,relativeCwd:null});let Z=_.git.repositoryUrl?qz(_.git.repositoryUrl):null,z=_.git.branch,A=Z?Z.split("/").pop()??null:null,J=rW(b,A);return m0.parse({repo:Z,branch:z,relativeCwd:d$(J)})}function rW(_,$){if(!_)return null;let Z=_.replace(/\\/g,"/").split("/").filter(Boolean);if(Z.length===0)return null;if($){let z=Z.lastIndexOf($);if(z>=0){let A=Z.slice(z+1).join("/");return A.length>0?A:"."}}return null}function VJ(_,$,b){let Z=nW(_);if(Z&&b.has(Z))return;let z=s.parse(_);if($.push(z),Z)b.add(Z)}function nW(_){if("text"in _&&typeof _.text==="string")return`${_.type}|${_.timestamp??""}|${_.text}`;if(_.type==="tool-call")return`${_.type}|${_.timestamp??""}|${_.id??""}|${_.toolName??""}`;return null}function bQ(_){if(!_)return _;return VW[_]??_}function lW(_,$){let b=Date.parse(_),Z=Date.parse($);if(Number.isNaN(b)||Number.isNaN(Z))return 0;return b===Z?0:b>Z?1:-1}function pW(_){if(!_)return null;let $=new Date(_);return Number.isNaN($.getTime())?null:$}function Z4(_){return typeof _==="number"&&Number.isFinite(_)?_:0}function a(_){if(typeof _!=="string")return null;let $=_.trim();return $.length>0?$:null}function W6(_){return _.replace(/\s+/g," ").trim()}function dW(_){return`codex-${_.getTime()}`}function iW(_){if(_.includes("/"))return _;return`openai/${_}`}function oW(_,$,b){if(!b||!_)return 0;let Z=aW(_,b);if(!Z)return 0;return eW({input_tokens:Math.max(0,$.inputTokens-$.cachedInputTokens),output_tokens:$.outputTokens+$.reasoningOutputTokens,cache_creation_input_tokens:0,cache_read_input_tokens:$.cachedInputTokens},Z)}function aW(_,$){let b=_.trim();if(!b)return null;let Z=new Set;Z.add(b);for(let A of tX)Z.add(`${A}${b}`);for(let A of tX)if(b.startsWith(A))Z.add(b.slice(A.length));for(let A of Z){let J=$[A];if(J)return J}let z=b.toLowerCase();for(let[A,J]of Object.entries($)){let U=A.toLowerCase();if(U.includes(z)||z.includes(U))return J}return null}function eW(_,$){let b=(U,G,Y,X=DW)=>{if(U==null||U<=0)return 0;if(U>X&&Y!=null){let Q=Math.min(U,X),v=Math.max(0,U-X)*Y;if(G!=null)v+=Q*G;return v}if(G!=null)return U*G;return 0},Z=b(_.input_tokens,$.input_cost_per_token,$.input_cost_per_token_above_200k_tokens),z=b(_.output_tokens,$.output_cost_per_token,$.output_cost_per_token_above_200k_tokens),A=b(_.cache_creation_input_tokens,$.cache_creation_input_token_cost,$.cache_creation_input_token_cost_above_200k_tokens),J=b(_.cache_read_input_tokens,$.cache_read_input_token_cost,$.cache_read_input_token_cost_above_200k_tokens);return Z+z+A+J}import i$ from"node:path";var WJ={shell:"Bash",bash:"Bash",execute:"Bash",read_file:"Read",read:"Read",write_file:"Write",write:"Write",edit_file:"Edit",edit:"Edit",apply_patch:"Edit",multiedit:"Edit",glob:"Glob",grep:"Grep",find:"Glob",list_files:"Glob",ls:"Glob",webfetch:"WebFetch",websearch:"WebSearch",task:"Task",explore:"Explore",skill:"Skill",todowrite:"TodoWrite",todoread:"TodoRead",question:"Question",plan:"Plan",codesearch:"CodeSearch",lsp:"LSP"},tW=["anthropic/","claude-3-5-","claude-3-","claude-","openai/","azure/","openrouter/","google/","gemini/"],sW=200000;function p4(_,$={}){let{info:b,messages:Z}=_;if(!Z||Z.length===0)return null;let z=$.cwd??b.directory??null,A=[],J=[],U=null,G=0,Y=0,X=0,Q=0,K=0,v=[...Z].sort((T,F)=>{return T.info.time.created-F.info.time.created});for(let T of v){let F=T.info,H=zw(F);if(F.role==="assistant"&&H&&!U)U=H;if(F.role==="assistant"&&F.tokens)Y+=F.tokens.input??0,X+=F.tokens.output??0,Q+=F.tokens.reasoning??0,K+=F.tokens.cache?.read??0;if(F.role==="assistant"&&F.cost)G+=F.cost;for(let q of T.parts){if(q.type==="step-start"||q.type==="step-finish")continue;let W=new Date(F.time.created).toISOString();switch(q.type){case"text":{let V=q.text?.trim();if(!V)break;if(F.role==="user")J.push(V),A.push(s.parse({type:"user",text:V,id:F.id,timestamp:W}));else A.push(s.parse({type:"agent",text:V,id:F.id,timestamp:W,model:H??void 0}));break}case"reasoning":{let V=q.text?.trim();if(!V)break;A.push(s.parse({type:"thinking",text:V,timestamp:W,model:H??void 0}));break}case"tool":{let V=q.state??{},k=V.input;if(q.tool==="todoread")break;let N=_w(q.tool);if(N==="Task"&&k?.subagent_type&&typeof k.subagent_type==="string")N=$w(k.subagent_type);let g=Jw(N,V.input,z,V.metadata),x=Uw(q.tool,N,V.output,V.metadata,z);A.push(s.parse({type:"tool-call",id:q.callID,timestamp:W,model:H??void 0,toolName:N,input:g,output:x,error:V.error,isError:V.status==="error"||!!V.error}));break}}}}if(A.length===0)return null;let D={inputTokens:Y,cachedInputTokens:K,outputTokens:X,reasoningOutputTokens:Q,totalTokens:Y+X},w=D.inputTokens+D.outputTokens,P=G>0?G:Gw(U,D,$.pricing),E=new Date(b.time.created),B=Zw(J),C=$.gitContext!==void 0?$.gitContext:m0.parse({repo:null,branch:null,relativeCwd:bw(v)}),f=z?b_(z):null,u=b4(A);return C_.parse({v:1,id:b.id,source:"opencode",timestamp:E,preview:B,summary:null,model:U,clientVersion:$.clientVersion??b.version??null,blendedTokens:w,costUsd:P,messageCount:A.length,...u,tokenUsage:D,modelUsage:U?[z4.parse({model:U,usage:D})]:[],git:C,cwd:f,messages:A})}function _w(_){let $=_.toLowerCase();return WJ[$]??_}function $w(_){let $=_.toLowerCase();if(WJ[$])return WJ[$];return _.charAt(0).toUpperCase()+_.slice(1)}function zw(_){let $=_.modelID??_.model?.modelID,b=_.providerID??_.model?.providerID;if(!$)return null;if(b)return`${b}/${$}`;return $}function bw(_){for(let $ of _){let b=$.info.path;if(b?.root&&b?.cwd){if(b.root===b.cwd)return null;try{let Z=i$.relative(b.root,b.cwd).replace(/\\/g,"/");if(Z&&!Z.startsWith("..")&&!i$.isAbsolute(Z))return Z}catch{}}}return null}function Zw(_){for(let $ of _){let b=$.trim().replace(/\s+/g," ");if(!b)continue;if(b.startsWith("<")&&b.includes(">"))continue;return b.replace(/^["']|["']$/g,"")}return _.length>0?_[0].trim().replace(/\s+/g," "):null}function Aw(_){let $=_,b=$.match(/<file>\n?([\s\S]*?)\n?<\/file>/);if(b)$=b[1];return $=$.replace(/\n?\(End of file - total \d+ lines\)\n?$/,""),$.split(`
110
110
  `).map((A)=>{let J=A.match(/^\d+\| (.*)$/);return J?J[1]:A}).join(`
111
- `)}function $Q(_){if(!_)return _;let $=_.split(`
111
+ `)}function AQ(_){if(!_)return _;let $=_.split(`
112
112
  `),b=[],Z=!1;for(let z of $){if(z.startsWith("Index: ")||z.startsWith("===")||z.startsWith("--- ")||z.startsWith("+++ "))continue;if(z.startsWith("@@")){Z=!0;continue}if(Z)b.push(z)}return b.join(`
113
- `).trim()||void 0}function _B(_,$,b,Z){if(!$||typeof $!=="object")return $;let z={...$};if(_==="Edit"&&typeof z.patchText==="string"&&Z?.files){let A=Z.files;if(A.length===1){let J=A[0];return{file_path:J.relativePath??(b&&J.filePath?k4(J.filePath,b):J.filePath),diff:$Q(J.diff),type:J.type}}else if(A.length>1)return{files:A.map((J)=>({file_path:J.relativePath??(b&&J.filePath?k4(J.filePath,b):J.filePath),type:J.type,diff:$Q(J.diff)}))}}if(typeof z.filePath==="string")z.file_path=b?k4(z.filePath,b):z.filePath,delete z.filePath;else if(typeof z.file_path==="string"&&b)z.file_path=k4(z.file_path,b);if(_==="Grep"&&typeof z.include==="string")z.glob=z.include,delete z.include;if((_==="Glob"||_==="Grep")&&typeof z.path==="string")delete z.path;else if(typeof z.path==="string"&&b)z.path=k4(z.path,b);if(typeof z.workdir==="string"&&b)z.workdir=k4(z.workdir,b);return b?S0(z,b):z}function $B(_,$,b,Z,z){let A=b;if($==="Bash"&&Z){let J={};if(typeof Z.output==="string")J.stdout=Z.output;if(typeof Z.exit==="number")J.exitCode=Z.exit;if(typeof Z.description==="string")J.description=Z.description;A=Object.keys(J).length>0?J:b}else if($==="Read"){let J=Z?.preview??(typeof b==="string"?sg(b):null);if(J){let U=J.split(`
113
+ `).trim()||void 0}function Jw(_,$,b,Z){if(!$||typeof $!=="object")return $;let z={...$};if(_==="Edit"&&typeof z.patchText==="string"&&Z?.files){let A=Z.files;if(A.length===1){let J=A[0];return{file_path:J.relativePath??(b&&J.filePath?x4(J.filePath,b):J.filePath),diff:AQ(J.diff),type:J.type}}else if(A.length>1)return{files:A.map((J)=>({file_path:J.relativePath??(b&&J.filePath?x4(J.filePath,b):J.filePath),type:J.type,diff:AQ(J.diff)}))}}if(typeof z.filePath==="string")z.file_path=b?x4(z.filePath,b):z.filePath,delete z.filePath;else if(typeof z.file_path==="string"&&b)z.file_path=x4(z.file_path,b);if(_==="Grep"&&typeof z.include==="string")z.glob=z.include,delete z.include;if((_==="Glob"||_==="Grep")&&typeof z.path==="string")delete z.path;else if(typeof z.path==="string"&&b)z.path=x4(z.path,b);if(typeof z.workdir==="string"&&b)z.workdir=x4(z.workdir,b);return b?S0(z,b):z}function Uw(_,$,b,Z,z){let A=b;if($==="Bash"&&Z){let J={};if(typeof Z.output==="string")J.stdout=Z.output;if(typeof Z.exit==="number")J.exitCode=Z.exit;if(typeof Z.description==="string")J.description=Z.description;A=Object.keys(J).length>0?J:b}else if($==="Read"){let J=Z?.preview??(typeof b==="string"?Aw(b):null);if(J){let U=J.split(`
114
114
  `).length;A={file:{content:J,numLines:U,totalLines:U}}}}else if($==="Glob"){let U=(typeof b==="string"?b:"").split(`
115
- `).map((G)=>G.trim()).filter(Boolean).map((G)=>z?k4(G,z):G);A={filenames:U,numFiles:Z?.count??U.length}}else if($==="Grep"){let U=(typeof b==="string"?b:"").split(`
115
+ `).map((G)=>G.trim()).filter(Boolean).map((G)=>z?x4(G,z):G);A={filenames:U,numFiles:Z?.count??U.length}}else if($==="Grep"){let U=(typeof b==="string"?b:"").split(`
116
116
  `),G=Z?.matches??0,Y=U.slice(1).filter((X)=>X.trim());A={mode:"content",content:Y.join(`
117
- `),numMatches:G,numLines:Y.length}}else if(_==="apply_patch"&&Z?.files){let J=Z.files;if(J.length===1){let U=J[0];A={additions:U.additions,deletions:U.deletions}}else A={files:J.map((U)=>({file_path:U.relativePath??(z&&U.filePath?k4(U.filePath,z):U.filePath),additions:U.additions,deletions:U.deletions}))}}else if($==="Edit"&&Z?.filediff)A={diff:Z.diff,additions:Z.filediff.additions,deletions:Z.filediff.deletions};else if($==="Write"&&Z)A={created:!Z.exists};else if($==="Explore")A={content:(typeof b==="string"?b:"").replace(/<task_metadata>[\s\S]*?<\/task_metadata>/g,"").trim()};else if($==="Skill")A={content:typeof b==="string"?b:""};else if($==="WebFetch")A={content:typeof b==="string"?b:""};else if($==="TodoWrite"||$==="TodoRead")A={todos:Z?.todos??[]};return z?S0(A,z):A}function k4(_,$){if(!_)return _;let b=o$.isAbsolute(_),Z=_.replace(/\\/g,"/");if(!b){if(Z==="."||Z==="./")return".";if(Z.startsWith("./")||Z.startsWith("../"))return Z;return`./${Z}`}try{let z=o$.relative($,_).replace(/\\/g,"/");if(z==="")return".";if(z.startsWith("..")||o$.isAbsolute(z))return _;return z==="."?".":`./${z}`}catch{return _}}function zB(_,$,b){if(!b||!_)return 0;let Z=bB(_,b);if(!Z)return 0;return ZB({input_tokens:$.inputTokens,output_tokens:$.outputTokens,cache_creation_input_tokens:0,cache_read_input_tokens:$.cachedInputTokens},Z)}function bB(_,$){let b=_.trim();if(!b)return null;let Z=new Set;Z.add(b);for(let A of pg)Z.add(`${A}${b}`);for(let A of Z){let J=$[A];if(J)return J}let z=b.toLowerCase();for(let[A,J]of Object.entries($)){let U=A.toLowerCase();if(U.includes(z)||z.includes(U))return J}return null}function ZB(_,$){let b=(U,G,Y,X=dg)=>{if(U==null||U<=0)return 0;if(U>X&&Y!=null){let Q=Math.min(U,X),v=Math.max(0,U-X)*Y;if(G!=null)v+=Q*G;return v}if(G!=null)return U*G;return 0},Z=b(_.input_tokens,$.input_cost_per_token,$.input_cost_per_token_above_200k_tokens),z=b(_.output_tokens,$.output_cost_per_token,$.output_cost_per_token_above_200k_tokens),A=b(_.cache_creation_input_tokens,$.cache_creation_input_token_cost,$.cache_creation_input_token_cost_above_200k_tokens),J=b(_.cache_read_input_tokens,$.cache_read_input_token_cost,$.cache_read_input_token_cost_above_200k_tokens);return Z+z+A+J}import AB from"node:crypto";var JB={read:"Read",write:"Write",edit:"Edit",bash:"Bash",grep:"Grep",find:"Glob",ls:"Ls"};function p4(_,$={}){let{header:b,entries:Z}=_;if(Z.length===0)return null;let z=$.leafId??UB(Z);if(!z)return null;let A=GB(Z,z);if(A.length===0)return null;let J=YB(Z,z),U=J?`${b.id}-${J}`:b.id,G=$.cwd??b.cwd,{messages:Y,blobs:X,tokenUsage:Q,modelUsageMap:K,primaryModel:v,cwd:V}=XB(A,G);if(Y.length===0)return null;let w=VB(Y),P=kB(b.timestamp)??$.now??new Date,O=WB(Q),B=Q.cost??wB(v,Q,$.pricing),T=$.gitContext!==void 0?$.gitContext:null,y=V?z_(V):"",u=t_(Y);return{transcript:y_.parse({v:1,id:U,source:"pi",timestamp:P,preview:w,summary:null,model:v,clientVersion:$.clientVersion??null,blendedTokens:O,costUsd:B,messageCount:Y.length,...u,tokenUsage:{inputTokens:Q.inputTokens,cachedInputTokens:Q.cachedInputTokens,outputTokens:Q.outputTokens,reasoningOutputTokens:Q.reasoningOutputTokens,totalTokens:Q.totalTokens},modelUsage:Array.from(K.entries()).map(([C,F])=>e_.parse({model:C,usage:F})),git:T,cwd:y,messages:Y}),blobs:X}}function UB(_){let $=new Set;for(let Z of _)if(Z.parentId)$.add(Z.parentId);let b=null;for(let Z of _)if(!$.has(Z.id)){if(!b||Z.timestamp>b.timestamp)b={id:Z.id,timestamp:Z.timestamp}}return b?.id??null}function GB(_,$){let b=new Map(_.map((A)=>[A.id,A])),Z=[],z=$;while(z){let A=b.get(z);if(!A)break;Z.unshift(A),z=A.parentId}return Z}function YB(_,$){let b=new Map;for(let A of _){let J=b.get(A.parentId)??[];J.push(A.id),b.set(A.parentId,J)}let Z=new Map(_.map((A)=>[A.id,A])),z=$;while(z){let A=Z.get(z);if(!A)break;let J=A.parentId;if((b.get(J)??[]).length>1)return z;z=J}return null}function XB(_,$){let b={messages:[],blobs:new Map,tokenUsage:{inputTokens:0,cachedInputTokens:0,outputTokens:0,reasoningOutputTokens:0,totalTokens:0,cost:0},modelUsageMap:new Map,primaryModel:null,cwd:$,toolCallsById:new Map};for(let Z of _)if(Z.type==="message")QB(Z,b);else if(Z.type==="compaction")KB(Z,b);return b}function QB(_,$){let{message:b,timestamp:Z}=_,z=$.cwd;switch(b.role){case"user":{let{text:A,images:J}=vB(b.content,$.blobs);if(A||J.length>0){let U={type:"user",text:A||"",timestamp:Z};if(J.length>0)U.images=J;$.messages.push(s.parse(U))}break}case"assistant":{let A=`${b.provider}/${b.model}`;if(!$.primaryModel)$.primaryModel=A;if(b.usage){$.tokenUsage.inputTokens+=b.usage.input??0,$.tokenUsage.cachedInputTokens+=b.usage.cacheRead??0,$.tokenUsage.outputTokens+=b.usage.output??0,$.tokenUsage.totalTokens+=b.usage.totalTokens??0,$.tokenUsage.cost+=b.usage.cost?.total??0;let J=$.modelUsageMap.get(A)??{inputTokens:0,cachedInputTokens:0,outputTokens:0,reasoningOutputTokens:0,totalTokens:0};J.inputTokens+=b.usage.input??0,J.cachedInputTokens+=b.usage.cacheRead??0,J.outputTokens+=b.usage.output??0,J.totalTokens+=b.usage.totalTokens??0,$.modelUsageMap.set(A,J)}for(let J of b.content)if(J.type==="thinking"&&J.thinking)$.messages.push(s.parse({type:"thinking",text:J.thinking,timestamp:Z,model:A}));else if(J.type==="text"&&J.text)$.messages.push(s.parse({type:"agent",text:J.text,timestamp:Z,model:A}));else if(J.type==="toolCall"){let U=FB(J.name),G=HB(U,J.arguments,z),Y=s.parse({type:"tool-call",id:J.id,toolName:U,input:G,timestamp:Z,model:A});$.toolCallsById.set(J.id,$.messages.length),$.messages.push(Y)}break}case"toolResult":{let A=$.toolCallsById.get(b.toolCallId);if(A!==void 0){let J=$.messages[A],{output:U,images:G}=qB(b.toolName,b.content,b.details,z,$.blobs);if(J.output=U,G.length>0)J.images=G;if(b.isError)J.isError=!0}break}case"bashExecution":{$.messages.push(s.parse({type:"command",name:b.excludeFromContext?"!!":"!",args:b.command,output:b.output||void 0,timestamp:Z}));break}case"compactionSummary":{$.messages.push(s.parse({type:"compaction-summary",text:b.summary,timestamp:Z}));break}case"branchSummary":{$.messages.push(s.parse({type:"agent",text:`[Branch summary] ${b.summary}`,timestamp:Z}));break}case"custom":break}}function KB(_,$){$.messages.push(s.parse({type:"compaction-summary",text:_.summary,timestamp:_.timestamp}))}function vB(_,$){if(typeof _==="string")return{text:_,images:[]};let b=[],Z=[];for(let z of _)if(z.type==="text"&&z.text)b.push(z.text);else if(z.type==="image"){let A=Buffer.from(z.data,"base64"),J=bQ(A);if(!$.has(J))$.set(J,{data:A,mediaType:z.mimeType});Z.push({sha256:J,mediaType:z.mimeType})}return{text:b.join(`
117
+ `),numMatches:G,numLines:Y.length}}else if(_==="apply_patch"&&Z?.files){let J=Z.files;if(J.length===1){let U=J[0];A={additions:U.additions,deletions:U.deletions}}else A={files:J.map((U)=>({file_path:U.relativePath??(z&&U.filePath?x4(U.filePath,z):U.filePath),additions:U.additions,deletions:U.deletions}))}}else if($==="Edit"&&Z?.filediff)A={diff:Z.diff,additions:Z.filediff.additions,deletions:Z.filediff.deletions};else if($==="Write"&&Z)A={created:!Z.exists};else if($==="Explore")A={content:(typeof b==="string"?b:"").replace(/<task_metadata>[\s\S]*?<\/task_metadata>/g,"").trim()};else if($==="Skill")A={content:typeof b==="string"?b:""};else if($==="WebFetch")A={content:typeof b==="string"?b:""};else if($==="TodoWrite"||$==="TodoRead")A={todos:Z?.todos??[]};return z?S0(A,z):A}function x4(_,$){if(!_)return _;let b=i$.isAbsolute(_),Z=_.replace(/\\/g,"/");if(!b){if(Z==="."||Z==="./")return".";if(Z.startsWith("./")||Z.startsWith("../"))return Z;return`./${Z}`}try{let z=i$.relative($,_).replace(/\\/g,"/");if(z==="")return".";if(z.startsWith("..")||i$.isAbsolute(z))return _;return z==="."?".":`./${z}`}catch{return _}}function Gw(_,$,b){if(!b||!_)return 0;let Z=Yw(_,b);if(!Z)return 0;return Xw({input_tokens:$.inputTokens,output_tokens:$.outputTokens,cache_creation_input_tokens:0,cache_read_input_tokens:$.cachedInputTokens},Z)}function Yw(_,$){let b=_.trim();if(!b)return null;let Z=new Set;Z.add(b);for(let A of tW)Z.add(`${A}${b}`);for(let A of Z){let J=$[A];if(J)return J}let z=b.toLowerCase();for(let[A,J]of Object.entries($)){let U=A.toLowerCase();if(U.includes(z)||z.includes(U))return J}return null}function Xw(_,$){let b=(U,G,Y,X=sW)=>{if(U==null||U<=0)return 0;if(U>X&&Y!=null){let Q=Math.min(U,X),v=Math.max(0,U-X)*Y;if(G!=null)v+=Q*G;return v}if(G!=null)return U*G;return 0},Z=b(_.input_tokens,$.input_cost_per_token,$.input_cost_per_token_above_200k_tokens),z=b(_.output_tokens,$.output_cost_per_token,$.output_cost_per_token_above_200k_tokens),A=b(_.cache_creation_input_tokens,$.cache_creation_input_token_cost,$.cache_creation_input_token_cost_above_200k_tokens),J=b(_.cache_read_input_tokens,$.cache_read_input_token_cost,$.cache_read_input_token_cost_above_200k_tokens);return Z+z+A+J}import Qw from"node:crypto";var Kw={read:"Read",write:"Write",edit:"Edit",bash:"Bash",grep:"Grep",find:"Glob",ls:"Ls"};function d4(_,$={}){let{header:b,entries:Z}=_;if(Z.length===0)return null;let z=$.leafId??Fw(Z);if(!z)return null;let A=vw(Z,z);if(A.length===0)return null;let J=Hw(Z,z),U=J?`${b.id}-${J}`:b.id,G=$.cwd??b.cwd,{messages:Y,blobs:X,tokenUsage:Q,modelUsageMap:K,primaryModel:v,cwd:D}=qw(A,G);if(Y.length===0)return null;let w=Bw(Y),P=Nw(b.timestamp)??$.now??new Date,E=Iw(Q),B=Q.cost??Ow(v,Q,$.pricing),C=$.gitContext!==void 0?$.gitContext:null,f=D?b_(D):"",u=b4(Y);return{transcript:C_.parse({v:1,id:U,source:"pi",timestamp:P,preview:w,summary:null,model:v,clientVersion:$.clientVersion??null,blendedTokens:E,costUsd:B,messageCount:Y.length,...u,tokenUsage:{inputTokens:Q.inputTokens,cachedInputTokens:Q.cachedInputTokens,outputTokens:Q.outputTokens,reasoningOutputTokens:Q.reasoningOutputTokens,totalTokens:Q.totalTokens},modelUsage:Array.from(K.entries()).map(([T,F])=>z4.parse({model:T,usage:F})),git:C,cwd:f,messages:Y}),blobs:X}}function Fw(_){let $=new Set;for(let Z of _)if(Z.parentId)$.add(Z.parentId);let b=null;for(let Z of _)if(!$.has(Z.id)){if(!b||Z.timestamp>b.timestamp)b={id:Z.id,timestamp:Z.timestamp}}return b?.id??null}function vw(_,$){let b=new Map(_.map((A)=>[A.id,A])),Z=[],z=$;while(z){let A=b.get(z);if(!A)break;Z.unshift(A),z=A.parentId}return Z}function Hw(_,$){let b=new Map;for(let A of _){let J=b.get(A.parentId)??[];J.push(A.id),b.set(A.parentId,J)}let Z=new Map(_.map((A)=>[A.id,A])),z=$;while(z){let A=Z.get(z);if(!A)break;let J=A.parentId;if((b.get(J)??[]).length>1)return z;z=J}return null}function qw(_,$){let b={messages:[],blobs:new Map,tokenUsage:{inputTokens:0,cachedInputTokens:0,outputTokens:0,reasoningOutputTokens:0,totalTokens:0,cost:0},modelUsageMap:new Map,primaryModel:null,cwd:$,toolCallsById:new Map};for(let Z of _)if(Z.type==="message")Dw(Z,b);else if(Z.type==="compaction")Vw(Z,b);return b}function Dw(_,$){let{message:b,timestamp:Z}=_,z=$.cwd;switch(b.role){case"user":{let{text:A,images:J}=gw(b.content,$.blobs);if(A||J.length>0){let U={type:"user",text:A||"",timestamp:Z};if(J.length>0)U.images=J;$.messages.push(s.parse(U))}break}case"assistant":{let A=`${b.provider}/${b.model}`;if(!$.primaryModel)$.primaryModel=A;if(b.usage){$.tokenUsage.inputTokens+=b.usage.input??0,$.tokenUsage.cachedInputTokens+=b.usage.cacheRead??0,$.tokenUsage.outputTokens+=b.usage.output??0,$.tokenUsage.totalTokens+=b.usage.totalTokens??0,$.tokenUsage.cost+=b.usage.cost?.total??0;let J=$.modelUsageMap.get(A)??{inputTokens:0,cachedInputTokens:0,outputTokens:0,reasoningOutputTokens:0,totalTokens:0};J.inputTokens+=b.usage.input??0,J.cachedInputTokens+=b.usage.cacheRead??0,J.outputTokens+=b.usage.output??0,J.totalTokens+=b.usage.totalTokens??0,$.modelUsageMap.set(A,J)}for(let J of b.content)if(J.type==="thinking"&&J.thinking)$.messages.push(s.parse({type:"thinking",text:J.thinking,timestamp:Z,model:A}));else if(J.type==="text"&&J.text)$.messages.push(s.parse({type:"agent",text:J.text,timestamp:Z,model:A}));else if(J.type==="toolCall"){let U=kw(J.name),G=Ww(U,J.arguments,z),Y=s.parse({type:"tool-call",id:J.id,toolName:U,input:G,timestamp:Z,model:A});$.toolCallsById.set(J.id,$.messages.length),$.messages.push(Y)}break}case"toolResult":{let A=$.toolCallsById.get(b.toolCallId);if(A!==void 0){let J=$.messages[A],{output:U,images:G}=ww(b.toolName,b.content,b.details,z,$.blobs);if(J.output=U,G.length>0)J.images=G;if(b.isError)J.isError=!0}break}case"bashExecution":{$.messages.push(s.parse({type:"command",name:b.excludeFromContext?"!!":"!",args:b.command,output:b.output||void 0,timestamp:Z}));break}case"compactionSummary":{$.messages.push(s.parse({type:"compaction-summary",text:b.summary,timestamp:Z}));break}case"branchSummary":{$.messages.push(s.parse({type:"agent",text:`[Branch summary] ${b.summary}`,timestamp:Z}));break}case"custom":break}}function Vw(_,$){$.messages.push(s.parse({type:"compaction-summary",text:_.summary,timestamp:_.timestamp}))}function gw(_,$){if(typeof _==="string")return{text:_,images:[]};let b=[],Z=[];for(let z of _)if(z.type==="text"&&z.text)b.push(z.text);else if(z.type==="image"){let A=Buffer.from(z.data,"base64"),J=UQ(A);if(!$.has(J))$.set(J,{data:A,mediaType:z.mimeType});Z.push({sha256:J,mediaType:z.mimeType})}return{text:b.join(`
118
118
 
119
- `),images:Z}}function bQ(_){return AB.createHash("sha256").update(_).digest("hex")}function FB(_){return JB[_.toLowerCase()]??_}function HB(_,$,b){if(!$||typeof $!=="object")return $;let Z={...$};if(typeof Z.path==="string")Z.file_path=b?zQ(Z.path,b):Z.path,delete Z.path;if(typeof Z.file_path==="string"&&b)Z.file_path=zQ(Z.file_path,b);return b?S0(Z,b):Z}function qB(_,$,b,Z,z){let A=[],J=[];for(let Y of $)if(Y.type==="text"&&Y.text)A.push(Y.text);else if(Y.type==="image"){let X=Buffer.from(Y.data,"base64"),Q=bQ(X);if(!z.has(Q))z.set(Q,{data:X,mediaType:Y.mimeType});J.push({sha256:Q,mediaType:Y.mimeType})}let U=A.join(`
119
+ `),images:Z}}function UQ(_){return Qw.createHash("sha256").update(_).digest("hex")}function kw(_){return Kw[_.toLowerCase()]??_}function Ww(_,$,b){if(!$||typeof $!=="object")return $;let Z={...$};if(typeof Z.path==="string")Z.file_path=b?JQ(Z.path,b):Z.path,delete Z.path;if(typeof Z.file_path==="string"&&b)Z.file_path=JQ(Z.file_path,b);return b?S0(Z,b):Z}function ww(_,$,b,Z,z){let A=[],J=[];for(let Y of $)if(Y.type==="text"&&Y.text)A.push(Y.text);else if(Y.type==="image"){let X=Buffer.from(Y.data,"base64"),Q=UQ(X);if(!z.has(Q))z.set(Q,{data:X,mediaType:Y.mimeType});J.push({sha256:Q,mediaType:Y.mimeType})}let U=A.join(`
120
120
  `);if(_==="edit"&&b&&typeof b==="object"){let Y=b;if(Y.diff)return{output:{diff:Y.diff},images:J}}if(_==="read"&&U){let Y=U.split(`
121
- `).length;return{output:{file:{content:U,numLines:Y,totalLines:Y}},images:J}}return{output:U||(Z?S0(b,Z):b),images:J}}function zQ(_,$){if(!_)return _;let b=_.startsWith("/"),Z=_.replace(/\\/g,"/");if(!b){if(Z==="."||Z==="./")return".";if(Z.startsWith("./")||Z.startsWith("../"))return Z;return`./${Z}`}let z=$.replace(/\\/g,"/");if(Z.startsWith(z+"/"))return`./${Z.slice(z.length+1)}`;return z_(Z)}function VB(_){for(let $ of _)if($.type==="user"&&$.text)return DB($.text);return null}function DB(_){return _.replace(/\s+/g," ").trim()}function kB(_){if(!_)return null;let $=new Date(_);return Number.isNaN($.getTime())?null:$}function WB(_){return Math.max(0,_.inputTokens-_.cachedInputTokens)+_.outputTokens+_.reasoningOutputTokens}var gB=["anthropic/","openai/","google/"],BB=200000;function wB(_,$,b){if(!b||!_)return 0;let Z=xB(_,b);if(!Z)return 0;return NB({input_tokens:Math.max(0,$.inputTokens-$.cachedInputTokens),output_tokens:$.outputTokens,cache_read_input_tokens:$.cachedInputTokens},Z)}function xB(_,$){let b=_.trim();if(!b)return null;let Z=new Set;Z.add(b);for(let z of gB)Z.add(`${z}${b}`);for(let z of Z){let A=$[z];if(A)return A}return null}function NB(_,$){let b=(J,U,G,Y=BB)=>{if(J==null||J<=0)return 0;if(J>Y&&G!=null){let X=Math.min(J,Y),K=Math.max(0,J-Y)*G;if(U!=null)K+=X*U;return K}if(U!=null)return J*U;return 0},Z=b(_.input_tokens,$.input_cost_per_token,$.input_cost_per_token_above_200k_tokens),z=b(_.output_tokens,$.output_cost_per_token,$.output_cost_per_token_above_200k_tokens),A=b(_.cache_read_input_tokens,$.cache_read_input_token_cost,$.cache_read_input_token_cost_above_200k_tokens);return Z+z+A}var IB="https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json",MB=200000,EB=M.object({input_cost_per_token:M.number().optional(),output_cost_per_token:M.number().optional(),cache_creation_input_token_cost:M.number().optional(),cache_read_input_token_cost:M.number().optional(),max_tokens:M.number().optional(),max_input_tokens:M.number().optional(),max_output_tokens:M.number().optional(),input_cost_per_token_above_200k_tokens:M.number().optional(),output_cost_per_token_above_200k_tokens:M.number().optional(),cache_creation_input_token_cost_above_200k_tokens:M.number().optional(),cache_read_input_token_cost_above_200k_tokens:M.number().optional(),input_cost_per_token_above_128k_tokens:M.number().optional(),output_cost_per_token_above_128k_tokens:M.number().optional()}),OB=["anthropic/","claude-3-5-","claude-3-","claude-","openai/","azure/","openrouter/openai/"],PB=1e4;function jB(_){if(_!=null)return _;return{debug:()=>{},error:()=>{},info:()=>{},warn:()=>{}}}class k0{cachedPricing=null;logger;offline;offlineLoader;url;providerPrefixes;timeoutMs;constructor(_={}){this.logger=jB(_.logger),this.offline=Boolean(_.offline),this.offlineLoader=_.offlineLoader,this.url=_.url??IB,this.providerPrefixes=_.providerPrefixes??OB,this.timeoutMs=_.timeoutMs??PB}[Symbol.dispose](){this.clearCache()}clearCache(){this.cachedPricing=null}async loadOfflinePricing(){if(this.offlineLoader==null)throw Error("Offline loader was not provided");let _=new Map(Object.entries(await this.offlineLoader()));return this.cachedPricing=_,_}async fetchRemotePricing(){this.logger.warn("Fetching latest model pricing from LiteLLM...");let _=await fetch(this.url,{signal:AbortSignal.timeout(this.timeoutMs)});if(!_.ok)throw Error(`Failed to fetch pricing data: ${_.statusText}`);let $=await _.json(),b=new Map;for(let[Z,z]of Object.entries($)){if(typeof z!=="object"||z==null)continue;let A=EB.safeParse(z);if(!A.success)continue;b.set(Z,A.data)}return this.cachedPricing=b,this.logger.info(`Loaded pricing for ${b.size} models`),b}async ensurePricingLoaded(){if(this.cachedPricing!=null)return this.cachedPricing;if(this.offline)return this.loadOfflinePricing();try{return await this.fetchRemotePricing()}catch(_){if(this.logger.warn("Failed to fetch model pricing from LiteLLM, falling back to offline loader (if available)."),this.offlineLoader!=null)return this.loadOfflinePricing();this.logger.warn("No offline pricing loader configured; continuing without model pricing data."),this.logger.debug(_);let $=new Map;return this.cachedPricing=$,$}}async fetchModelPricing(){return this.ensurePricingLoaded()}createMatchingCandidates(_){let $=new Set;$.add(_);for(let b of this.providerPrefixes)$.add(`${b}${_}`);return Array.from($)}async getModelPricing(_){let $=await this.ensurePricingLoaded();for(let Z of this.createMatchingCandidates(_)){let z=$.get(Z);if(z!=null)return z}let b=_.toLowerCase();for(let[Z,z]of $){let A=Z.toLowerCase();if(A.includes(b)||b.includes(A))return z}return null}async getModelContextLimit(_){return(await this.getModelPricing(_))?.max_input_tokens??null}calculateCostFromPricing(_,$){let b=(U,G,Y,X=MB)=>{if(U==null||U<=0)return 0;if(U>X&&Y!=null){let Q=Math.min(U,X),v=Math.max(0,U-X)*Y;if(G!=null)v+=Q*G;return v}if(G!=null)return U*G;return 0},Z=b(_.input_tokens,$.input_cost_per_token,$.input_cost_per_token_above_200k_tokens),z=b(_.output_tokens,$.output_cost_per_token,$.output_cost_per_token_above_200k_tokens),A=b(_.cache_creation_input_tokens,$.cache_creation_input_token_cost,$.cache_creation_input_token_cost_above_200k_tokens),J=b(_.cache_read_input_tokens,$.cache_read_input_token_cost,$.cache_read_input_token_cost_above_200k_tokens);return Z+z+A+J}async calculateCostFromTokens(_,$){if($==null||$==="")return 0;let b=await this.getModelPricing($);if(b==null)throw Error(`Model pricing not found for ${$}`);return this.calculateCostFromPricing(_,b)}}async function ZQ(_={}){let $=_.serverUrl??process.env.VI_SERVER_URL??"http://localhost:3000",b=_.authToken??null,Z=_.timeoutMs??1e4;try{let z=await fetch(`${$}/api/transcripts`,{method:"GET",headers:{...b&&{Authorization:`Bearer ${b}`}},signal:AbortSignal.timeout(Z)});if(!z.ok)return console.error(`Failed to fetch transcript metadata: ${z.status} ${z.statusText}`),[];let A=await z.json();if(SB(A))return A.transcripts;return console.error("Transcript metadata response had unexpected shape:",A),[]}catch(z){if(z instanceof Error)console.error("Failed to fetch transcript metadata:",z.message);return[]}}function SB(_){if(typeof _!=="object"||_===null||!("transcripts"in _))return!1;let{transcripts:$}=_;if(!Array.isArray($))return!1;return $.every((b)=>{if(typeof b!=="object"||b===null)return!1;let Z=b;return typeof Z.transcriptId==="string"&&Z.transcriptId.length>0&&typeof Z.sha256==="string"&&Z.sha256.length>0&&typeof Z.repoId==="string"&&Z.repoId.length>0})}var AQ=[{name:"OpenAI API Key",regex:"sk-[a-zA-Z0-9]{20,}"},{name:"OpenAI Project Key",regex:"sk-proj-[a-zA-Z0-9\\-_]{20,}"},{name:"Anthropic API Key",regex:"sk-ant-[a-zA-Z0-9\\-_]{20,}"},{name:"Cohere API Key",regex:"co-[a-zA-Z0-9]{40,}"},{name:"HuggingFace Token",regex:"hf_[a-zA-Z0-9]{34,}"},{name:"Replicate API Token",regex:"r8_[a-zA-Z0-9]{40}"},{name:"JWT Token",regex:"eyJ[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_.+/=]*"},{name:"OAuth Client Secret",regex:`(?i)client_secret['"\\s:=]+[a-zA-Z0-9\\-_.~]{10,100}`},{name:"OAuth Client ID",regex:`(?i)client_id['"\\s:=]+[a-zA-Z0-9\\-_.~]{10,100}`},{name:"Bearer Token",regex:"Bearer\\s+[a-zA-Z0-9\\-._~+/]+=*"},{name:"Authorization Bearer",regex:"(?i)authorization:\\s*Bearer\\s+[a-zA-Z0-9\\-._~+/]+=*"},{name:"Google OAuth Access Token",regex:"ya29\\.[0-9A-Za-z\\-_]+"},{name:"GitHub Fine-Grained Token",regex:"github_pat_[0-9a-zA-Z_]{20,}"},{name:"GitHub OAuth App Secret",regex:`[g|G][i|I][t|T][h|H][u|U][b|B].*['|"][0-9a-zA-Z]{35,40}['|"]`},{name:"GitLab PAT",regex:"glpat-[a-zA-Z0-9_-]{16,}"},{name:"GitLab Runner Token",regex:"glrt-[a-zA-Z0-9_-]{16,}"},{name:"MongoDB URI",regex:`mongodb(\\+srv)?:\\/\\/[^\\s'"]+`},{name:"PostgreSQL URI",regex:`postgres(?:ql)?:\\/\\/[^\\s'"]+`},{name:"MySQL URI",regex:`mysql:\\/\\/[^\\s'"]+`},{name:"Redis URI",regex:`redis:\\/\\/[^\\s'"]+`},{name:"JDBC URL",regex:`jdbc:\\w+:\\/\\/[^\\s'"]+`},{name:"Password in URL",regex:`[a-zA-Z]{3,10}://[^/\\s:@]{3,20}:[^/\\s:@]{3,20}@.{1,100}["'\\s]`},{name:"DigitalOcean Token",regex:"dop_v1_[a-z0-9]{64}"},{name:"CircleCI Token",regex:"circle-token=[a-z0-9]{40}"},{name:"New Relic Key",regex:"NRII-[a-zA-Z0-9]{20,}"},{name:"Sentry DSN",regex:"https:\\/\\/[a-zA-Z0-9]+@[a-z]+\\.ingest\\.sentry\\.io\\/\\d+"},{name:"Cloudinary URL",regex:"cloudinary:\\/\\/[0-9]{15}:[a-zA-Z0-9]+@[a-zA-Z]+"},{name:"Discord Bot Token",regex:"[MN][A-Za-z\\d]{23}\\.[\\w-]{6}\\.[\\w-]{27}"},{name:"Discord Webhook",regex:"https:\\/\\/discord(?:app)?\\.com\\/api\\/webhooks\\/[0-9]+\\/[a-zA-Z0-9_-]+"},{name:"Telegram Bot Token",regex:"\\d{9}:[a-zA-Z0-9_-]{35}"},{name:"Microsoft Teams Webhook",regex:"https:\\/\\/[a-z]+\\.webhook\\.office\\.com\\/webhookb2\\/[a-zA-Z0-9@\\-]+\\/.*"},{name:"Stripe Publishable Key",regex:"pk_live_[0-9a-zA-Z]{24}"},{name:"PayPal Braintree Token",regex:"access_token\\$production\\$[0-9a-z]{16}\\$[0-9a-f]{32}"},{name:"Square Access Token",regex:"sq0atp-[0-9A-Za-z\\-_]{22}"},{name:"Square OAuth Secret",regex:"sq0csp-[0-9A-Za-z\\-_]{43}"},{name:"SendGrid API Key",regex:"SG\\.[\\w\\d\\-_]{22}\\.[\\w\\d\\-_]{43}"},{name:"Mailgun API Key",regex:"key-[0-9a-zA-Z]{32}"},{name:"MailChimp API Key",regex:"[0-9a-f]{32}-us[0-9]{1,2}"},{name:"Shopify Access Token",regex:"shpat_[0-9a-fA-F]{32}"},{name:"Dropbox Access Token",regex:"sl\\.[A-Za-z0-9_-]{20,100}"},{name:"Asana Token",regex:"0\\/[0-9a-z]{32}"},{name:"Linear API Key",regex:"lin_api_[a-zA-Z0-9]{40}"},{name:"Riot Games API Key",regex:"RGAPI-[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}"},{name:"Generic API Key",regex:`(?i)(api[_-]?key)['"\\s:=]+[a-zA-Z0-9\\-_.]{16,}`},{name:"Generic Secret",regex:`(?i)(secret|password|passwd|pwd)['"\\s:=]+[^\\s'"]{8,}`},{name:"Generic Token",regex:`(?i)(token)['"\\s:=]+[a-zA-Z0-9\\-_.]{16,}`},{name:"Private Key Block",regex:"-----BEGIN (RSA|DSA|EC|OPENSSH|PGP)?\\s*PRIVATE\\s+KEY"},{name:"Certificate Block",regex:"-----BEGIN CERTIFICATE-----"},{name:"AWS API Gateway",regex:"[0-9a-z]+.execute-api.[0-9a-z._-]+.amazonaws.com"},{name:"AWS API Key",regex:"AKIA[0-9A-Z]{16}"},{name:"AWS ARN",regex:"arn:aws:[a-z0-9-]+:[a-z]{2}-[a-z]+-[0-9]+:[0-9]+:.+"},{name:"AWS Access Key ID Value",regex:"(A3T[A-Z0-9]|AKIA|AGPA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}"},{name:"AWS AppSync GraphQL Key",regex:"da2-[a-z0-9]{26}"},{name:"AWS EC2 External",regex:"ec2-[0-9a-z._-]+.compute(-1)?.amazonaws.com"},{name:"AWS EC2 Internal",regex:"[0-9a-z._-]+.compute(-1)?.internal"},{name:"AWS ELB",regex:"[0-9a-z._-]+.elb.amazonaws.com"},{name:"AWS ElasticCache",regex:"[0-9a-z._-]+.cache.amazonaws.com"},{name:"AWS MWS ID",regex:"mzn\\.mws\\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"},{name:"AWS MWS key",regex:"amzn\\.mws\\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"},{name:"AWS RDS",regex:"[0-9a-z._-]+.rds.amazonaws.com"},{name:"AWS S3 Bucket",regex:"s3://[0-9a-z._/-]+"},{name:"AWS client ID",regex:"(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}"},{name:"AWS cred file info",regex:"(aws_access_key_id|aws_secret_access_key)"},{name:"Abbysale",regex:"(?:abbysale).{0,40}\\b([a-z0-9A-Z]{40})\\b"},{name:"Abstract",regex:"(?:abstract).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Abuseipdb",regex:"(?:abuseipdb).{0,40}\\b([a-z0-9]{80})\\b"},{name:"Accuweather",regex:"(?:accuweather).{0,40}([a-z0-9A-Z\\%]{35})\\b"},{name:"Adafruitio",regex:"\\b(aio\\_[a-zA-Z0-9]{28})\\b"},{name:"Adobeio - 1",regex:"(?:adobe).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Adzuna - 1",regex:"(?:adzuna).{0,40}\\b([a-z0-9]{8})\\b"},{name:"Adzuna - 2",regex:"(?:adzuna).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Aeroworkflow - 1",regex:"(?:aeroworkflow).{0,40}\\b([0-9]{1,})\\b"},{name:"Aeroworkflow - 2",regex:"(?:aeroworkflow).{0,40}\\b([a-zA-Z0-9^!]{20})\\b"},{name:"Agora",regex:"(?:agora).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Airbrakeprojectkey - 1",regex:"(?:airbrake).{0,40}\\b([0-9]{6})\\b"},{name:"Airbrakeprojectkey - 2",regex:"(?:airbrake).{0,40}\\b([a-zA-Z-0-9]{32})\\b"},{name:"Airbrakeuserkey",regex:"(?:airbrake).{0,40}\\b([a-zA-Z-0-9]{40})\\b"},{name:"Airship",regex:"(?:airship).{0,40}\\b([0-9Aa-zA-Z]{91})\\b"},{name:"Airvisual",regex:"(?:airvisual).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Alconost",regex:"(?:alconost).{0,40}\\b([0-9Aa-z]{32})\\b"},{name:"Alegra - 1",regex:"(?:alegra).{0,40}\\b([a-z0-9-]{20})\\b"},{name:"Alegra - 2",regex:"(?:alegra).{0,40}\\b([a-zA-Z0-9.-@]{25,30})\\b"},{name:"Aletheiaapi",regex:"(?:aletheiaapi).{0,40}\\b([A-Z0-9]{32})\\b"},{name:"Algoliaadminkey - 1",regex:"(?:algolia).{0,40}\\b([A-Z0-9]{10})\\b"},{name:"Algoliaadminkey - 2",regex:"(?:algolia).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Alibaba - 2",regex:"\\b(LTAI[a-zA-Z0-9]{17,21})[\\\"' ;\\s]*"},{name:"Alienvault",regex:"(?:alienvault).{0,40}\\b([a-z0-9]{64})\\b"},{name:"Allsports",regex:"(?:allsports).{0,40}\\b([0-9a-z]{64})\\b"},{name:"Amadeus - 1",regex:"(?:amadeus).{0,40}\\b([0-9A-Za-z]{32})\\b"},{name:"Amadeus - 2",regex:"(?:amadeus).{0,40}\\b([0-9A-Za-z]{16})\\b"},{name:"Amazon SNS Topic",regex:"arn:aws:sns:[a-z0-9\\-]+:[0-9]+:[A-Za-z0-9\\-_]+"},{name:"Ambee",regex:"(?:ambee).{0,40}\\b([0-9a-f]{64})\\b"},{name:"Amplitudeapikey",regex:"(?:amplitude).{0,40}\\b([a-f0-9]{32})"},{name:"Apacta",regex:"(?:apacta).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Api2cart",regex:"(?:api2cart).{0,40}\\b([0-9a-f]{32})\\b"},{name:"Apideck - 1",regex:"\\b(sk_live_[a-z0-9A-Z-]{93})\\b"},{name:"Apideck - 2",regex:"(?:apideck).{0,40}\\b([a-z0-9A-Z]{40})\\b"},{name:"Apiflash - 1",regex:"(?:apiflash).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Apiflash - 2",regex:"(?:apiflash).{0,40}\\b([a-zA-Z0-9\\S]{21,30})\\b"},{name:"Apifonica",regex:"(?:apifonica).{0,40}\\b([0-9a-z]{11}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12})\\b"},{name:"Apify",regex:"\\b(apify\\_api\\_[a-zA-Z-0-9]{36})\\b"},{name:"Apimatic - 1",regex:"(?:apimatic).{0,40}\\b([a-z0-9-\\S]{8,32})\\b"},{name:"Apimatic - 2",regex:"(?:apimatic).{0,40}\\b([a-zA-Z0-9]{3,20}@[a-zA-Z0-9]{2,12}.[a-zA-Z0-9]{2,5})\\b"},{name:"Apiscience",regex:"(?:apiscience).{0,40}\\b([a-bA-Z0-9\\S]{22})\\b"},{name:"Apollo",regex:"(?:apollo).{0,40}\\b([a-zA-Z0-9]{22})\\b"},{name:"Appcues - 1",regex:"(?:appcues).{0,40}\\b([0-9]{5})\\b"},{name:"Appcues - 2",regex:"(?:appcues).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Appcues - 3",regex:"(?:appcues).{0,40}\\b([a-z0-9-]{39})\\b"},{name:"Appfollow",regex:"(?:appfollow).{0,40}\\b([0-9A-Za-z]{20})\\b"},{name:"Appsynergy",regex:"(?:appsynergy).{0,40}\\b([a-z0-9]{64})\\b"},{name:"Apptivo - 1",regex:"(?:apptivo).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Apptivo - 2",regex:"(?:apptivo).{0,40}\\b([a-zA-Z0-9-]{32})\\b"},{name:"Artifactory - 2",regex:"\\b([A-Za-z0-9](?:[A-Za-z0-9\\-]{0,61}[A-Za-z0-9])\\.jfrog\\.io)"},{name:"Artifactory API Token",regex:'(?:\\s|=|:|"|^)AKC[a-zA-Z0-9]{10,}'},{name:"Artifactory Password",regex:'(?:\\s|=|:|"|^)AP[\\dABCDEF][a-zA-Z0-9]{8,}'},{name:"Artsy - 1",regex:"(?:artsy).{0,40}\\b([0-9a-zA-Z]{20})\\b"},{name:"Artsy - 2",regex:"(?:artsy).{0,40}\\b([0-9a-zA-Z]{32})\\b"},{name:"Asanaoauth",regex:"(?:asana).{0,40}\\b([a-z\\/:0-9]{51})\\b"},{name:"Asanapersonalaccesstoken",regex:"(?:asana).{0,40}\\b([0-9]{1,}\\/[0-9]{16,}:[A-Za-z0-9]{32,})\\b"},{name:"Assemblyai",regex:"(?:assemblyai).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Asymmetric Private Key",regex:"-----BEGIN ((EC|PGP|DSA|RSA|OPENSSH) )?PRIVATE KEY( BLOCK)?-----"},{name:"Audd",regex:"(?:audd).{0,40}\\b([a-z0-9-]{32})\\b"},{name:"Auth0managementapitoken",regex:"(?:auth0).{0,40}\\b(ey[a-zA-Z0-9._-]+)\\b"},{name:"Auth0oauth - 1",regex:"(?:auth0).{0,40}\\b([a-zA-Z0-9_-]{32,60})\\b"},{name:"Autodesk - 1",regex:"(?:autodesk).{0,40}\\b([0-9A-Za-z]{32})\\b"},{name:"Autodesk - 2",regex:"(?:autodesk).{0,40}\\b([0-9A-Za-z]{16})\\b"},{name:"Autoklose",regex:"(?:autoklose).{0,40}\\b([a-zA-Z0-9-]{32})\\b"},{name:"Autopilot",regex:"(?:autopilot).{0,40}\\b([0-9a-f]{32})\\b"},{name:"Avazapersonalaccesstoken",regex:"(?:avaza).{0,40}\\b([0-9]+-[0-9a-f]{40})\\b"},{name:"Aviationstack",regex:"(?:aviationstack).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Aws - 1",regex:"\\b((?:AKIA|ABIA|ACCA|ASIA)[0-9A-Z]{16})\\b"},{name:"Axonaut",regex:"(?:axonaut).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Aylien - 1",regex:"(?:aylien).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Aylien - 2",regex:"(?:aylien).{0,40}\\b([a-z0-9]{8})\\b"},{name:"Ayrshare",regex:"(?:ayrshare).{0,40}\\b([A-Z]{7}-[A-Z0-9]{7}-[A-Z0-9]{7}-[A-Z0-9]{7})\\b"},{name:"Bannerbear",regex:"(?:bannerbear).{0,40}\\b([0-9a-zA-Z]{22}tt)\\b"},{name:"Baremetrics",regex:"(?:baremetrics).{0,40}\\b([a-zA-Z0-9_]{25})\\b"},{name:"Baseapiio",regex:"(?:baseapi|base-api).{0,40}\\b([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\\b"},{name:"Beamer",regex:"(?:beamer).{0,40}\\b([a-zA-Z0-9_+/]{45}=)"},{name:"Beebole",regex:"(?:beebole).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Besttime",regex:"(?:besttime).{0,40}\\b([0-9A-Za-z_]{36})\\b"},{name:"Billomat - 1",regex:"(?:billomat).{0,40}\\b([0-9a-z]{1,})\\b"},{name:"Billomat - 2",regex:"(?:billomat).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Bitbar",regex:"(?:bitbar).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Bitcoinaverage",regex:"(?:bitcoinaverage).{0,40}\\b([a-zA-Z0-9]{43})\\b"},{name:"Bitfinex",regex:"(?:bitfinex).{0,40}\\b([A-Za-z0-9_-]{43})\\b"},{name:"Bitly Secret Key",regex:"R_[0-9a-f]{32}"},{name:"Bitlyaccesstoken",regex:"(?:bitly).{0,40}\\b([a-zA-Z-0-9]{40})\\b"},{name:"Bitmex - 1",regex:"(?:bitmex).{0,40}([ \\r\\n]{1}[0-9a-zA-Z\\-\\_]{24}[ \\r\\n]{1})"},{name:"Bitmex - 2",regex:"(?:bitmex).{0,40}([ \\r\\n]{1}[0-9a-zA-Z\\-\\_]{48}[ \\r\\n]{1})"},{name:"Blablabus",regex:"(?:blablabus).{0,40}\\b([0-9A-Za-z]{22})\\b"},{name:"Blazemeter",regex:"(?:blazemeter|runscope).{0,40}\\b([0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12})\\b"},{name:"Blitapp",regex:"(?:blitapp).{0,40}\\b([a-zA-Z0-9_-]{39})\\b"},{name:"Blogger",regex:"(?:blogger).{0,40}\\b([0-9A-Za-z-]{39})\\b"},{name:"Bombbomb",regex:"(?:bombbomb).{0,40}\\b([a-zA-Z0-9-._]{704})\\b"},{name:"Boostnote",regex:"(?:boostnote).{0,40}\\b([0-9a-f]{64})\\b"},{name:"Borgbase",regex:"(?:borgbase).{0,40}\\b([a-zA-Z0-9/_.-]{148,152})\\b"},{name:"Braintree API Key",regex:"access_token$production$[0-9a-z]{16}$[0-9a-f]{32}"},{name:"Brandfetch",regex:"(?:brandfetch).{0,40}\\b([0-9A-Za-z]{40})\\b"},{name:"Browshot",regex:"(?:browshot).{0,40}\\b([a-zA-Z-0-9]{28})\\b"},{name:"Buddyns",regex:"(?:buddyns).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Bugherd",regex:"(?:bugherd).{0,40}\\b([0-9a-z]{22})\\b"},{name:"Bugsnag",regex:"(?:bugsnag).{0,40}\\b([0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12})\\b"},{name:"Buildkite",regex:"(?:buildkite).{0,40}\\b([a-z0-9]{40})\\b"},{name:"Bulbul",regex:"(?:bulbul).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Buttercms",regex:"(?:buttercms).{0,40}\\b([a-z0-9]{40})\\b"},{name:"Caflou",regex:"(?:caflou).{0,40}\\b([a-bA-Z0-9\\S]{155})\\b"},{name:"Calendarific",regex:"(?:calendarific).{0,40}\\b([a-z0-9]{40})\\b"},{name:"Calendlyapikey",regex:"(?:calendly).{0,40}\\b([a-zA-Z-0-9]{20}.[a-zA-Z-0-9]{171}.[a-zA-Z-0-9_]{43})\\b"},{name:"Calorieninja",regex:"(?:calorieninja).{0,40}\\b([0-9A-Za-z]{40})\\b"},{name:"Campayn",regex:"(?:campayn).{0,40}\\b([a-z0-9]{64})\\b"},{name:"Cannyio",regex:"(?:canny).{0,40}\\b([a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[0-9]{4}-[a-z0-9]{12})\\b"},{name:"Capsulecrm",regex:"(?:capsulecrm).{0,40}\\b([a-zA-Z0-9-._+=]{64})\\b"},{name:"Captaindata - 1",regex:"(?:captaindata).{0,40}\\b([0-9a-f]{8}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{12})\\b"},{name:"Captaindata - 2",regex:"(?:captaindata).{0,40}\\b([0-9a-f]{64})\\b"},{name:"Carboninterface",regex:"(?:carboninterface).{0,40}\\b([a-zA-Z0-9]{21})\\b"},{name:"Cashboard - 1",regex:"(?:cashboard).{0,40}\\b([0-9A-Z]{3}-[0-9A-Z]{3}-[0-9A-Z]{3}-[0-9A-Z]{3})\\b"},{name:"Cashboard - 2",regex:"(?:cashboard).{0,40}\\b([0-9a-z]{1,})\\b"},{name:"Caspio - 1",regex:"(?:caspio).{0,40}\\b([a-z0-9]{8})\\b"},{name:"Caspio - 2",regex:"(?:caspio).{0,40}\\b([a-z0-9]{50})\\b"},{name:"Censys - 1",regex:"(?:censys).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Censys - 2",regex:"(?:censys).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Centralstationcrm",regex:"(?:centralstation).{0,40}\\b([a-z0-9]{30})\\b"},{name:"Cexio - 1",regex:"(?:cexio|cex.io).{0,40}\\b([a-z]{2}[0-9]{9})\\b"},{name:"Cexio - 2",regex:"(?:cexio|cex.io).{0,40}\\b([0-9A-Za-z]{24,27})\\b"},{name:"Chatbot",regex:"(?:chatbot).{0,40}\\b([a-zA-Z0-9_]{32})\\b"},{name:"Chatfule",regex:"(?:chatfuel).{0,40}\\b([a-zA-Z0-9]{128})\\b"},{name:"Checio",regex:"(?:checio).{0,40}\\b(pk_[a-z0-9]{45})\\b"},{name:"Checklyhq",regex:"(?:checklyhq).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Checkout - 1",regex:"(?:checkout).{0,40}\\b((sk_|sk_test_)[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})\\b"},{name:"Checkout - 2",regex:"(?:checkout).{0,40}\\b(cus_[0-9a-zA-Z]{26})\\b"},{name:"Checkvist - 1",regex:"(?:checkvist).{0,40}\\b([\\w\\.-]+@[\\w-]+\\.[\\w\\.-]{2,5})\\b"},{name:"Checkvist - 2",regex:"(?:checkvist).{0,40}\\b([0-9a-zA-Z]{14})\\b"},{name:"Cicero",regex:"(?:cicero).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Circleci",regex:"(?:circle).{0,40}([a-fA-F0-9]{40})"},{name:"Clearbit",regex:"(?:clearbit).{0,40}\\b([0-9a-z_]{35})\\b"},{name:"Clickhelp - 1",regex:"\\b([0-9A-Za-z]{3,20}.try.clickhelp.co)\\b"},{name:"Clickhelp - 2",regex:"(?:clickhelp).{0,40}\\b([0-9A-Za-z]{24})\\b"},{name:"Clicksendsms - 2",regex:"(?:sms).{0,40}\\b([a-zA-Z0-9]{3,20}@[a-zA-Z0-9]{2,12}.[a-zA-Z0-9]{2,5})\\b"},{name:"Clickuppersonaltoken",regex:"(?:clickup).{0,40}\\b(pk_[0-9]{8}_[0-9A-Z]{32})\\b"},{name:"Cliengo",regex:"(?:cliengo).{0,40}\\b([0-9a-f]{8}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{12})\\b"},{name:"Clinchpad",regex:"(?:clinchpad).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Clockify",regex:"(?:clockify).{0,40}\\b([a-zA-Z0-9]{48})\\b"},{name:"Clockworksms - 1",regex:"(?:clockwork|textanywhere).{0,40}\\b([0-9a-zA-Z]{24})\\b"},{name:"Clockworksms - 2",regex:"(?:clockwork|textanywhere).{0,40}\\b([0-9]{5})\\b"},{name:"Closecrm",regex:"\\b(api_[a-z0-9A-Z.]{45})\\b"},{name:"Cloudelements - 1",regex:"(?:cloudelements).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Cloudelements - 2",regex:"(?:cloudelements).{0,40}\\b([a-zA-Z0-9]{43})\\b"},{name:"Cloudflareapitoken",regex:"(?:cloudflare).{0,40}\\b([A-Za-z0-9_-]{40})\\b"},{name:"Cloudflarecakey",regex:"(?:cloudflare).{0,40}\\b(v[A-Za-z0-9._-]{173,})\\b"},{name:"Cloudimage",regex:"(?:cloudimage).{0,40}\\b([a-z0-9_]{30})\\b"},{name:"Cloudinary Credentials",regex:"cloudinary://[0-9]+:[A-Za-z0-9\\-_\\.]+@[A-Za-z0-9\\-_\\.]+"},{name:"Cloudmersive",regex:"(?:cloudmersive).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Cloudplan",regex:"(?:cloudplan).{0,40}\\b([A-Z0-9-]{32})\\b"},{name:"Cloverly",regex:"(?:cloverly).{0,40}\\b([a-z0-9:_]{28})\\b"},{name:"Cloze - 1",regex:"(?:cloze).{0,40}\\b([0-9a-f]{32})\\b"},{name:"Cloze - 2",regex:"(?:cloze).{0,40}\\b([\\w\\.-]+@[\\w-]+\\.[\\w\\.-]{2,5})\\b"},{name:"Clustdoc",regex:"(?:clustdoc).{0,40}\\b([0-9a-zA-Z]{60})\\b"},{name:"Codacy",regex:"(?:codacy).{0,40}\\b([0-9A-Za-z]{20})\\b"},{name:"Coinapi",regex:"(?:coinapi).{0,40}\\b([A-Z0-9-]{36})\\b"},{name:"Coinbase",regex:"(?:coinbase).{0,40}\\b([a-zA-Z-0-9]{64})\\b"},{name:"Coinlayer",regex:"(?:coinlayer).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Coinlib",regex:"(?:coinlib).{0,40}\\b([a-z0-9]{16})\\b"},{name:"Column",regex:"(?:column).{0,40}\\b((?:test|live)_[a-zA-Z0-9]{27})\\b"},{name:"Commercejs",regex:"(?:commercejs).{0,40}\\b([a-z0-9_]{48})\\b"},{name:"Commodities",regex:"(?:commodities).{0,40}\\b([a-zA-Z0-9]{60})\\b"},{name:"Companyhub - 1",regex:"(?:companyhub).{0,40}\\b([0-9a-zA-Z]{20})\\b"},{name:"Companyhub - 2",regex:"(?:companyhub).{0,40}\\b([a-zA-Z0-9$%^=-]{4,32})\\b"},{name:"Confluent - 1",regex:"(?:confluent).{0,40}\\b([a-zA-Z-0-9]{16})\\b"},{name:"Confluent - 2",regex:"(?:confluent).{0,40}\\b([a-zA-Z-0-9]{64})\\b"},{name:"Convertkit",regex:"(?:convertkit).{0,40}\\b([a-z0-9A-Z_]{22})\\b"},{name:"Convier",regex:"(?:convier).{0,40}\\b([0-9]{2}\\|[a-zA-Z0-9]{40})\\b"},{name:"Copper - 2",regex:"(?:copper).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Countrylayer",regex:"(?:countrylayer).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Courier",regex:"(?:courier).{0,40}\\b(pk\\_[a-zA-Z0-9]{1,}\\_[a-zA-Z0-9]{28})\\b"},{name:"Coveralls",regex:"(?:coveralls).{0,40}\\b([a-zA-Z0-9-]{37})\\b"},{name:"Crowdin",regex:"(?:crowdin).{0,40}\\b([0-9A-Za-z]{80})\\b"},{name:"Cryptocompare",regex:"(?:cryptocompare).{0,40}\\b([a-z-0-9]{64})\\b"},{name:"Currencycloud - 1",regex:"(?:currencycloud).{0,40}\\b([0-9a-z]{64})\\b"},{name:"Currencyfreaks",regex:"(?:currencyfreaks).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Currencylayer",regex:"(?:currencylayer).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Currencyscoop",regex:"(?:currencyscoop).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Currentsapi",regex:"(?:currentsapi).{0,40}\\b([a-zA-Z0-9\\S]{48})\\b"},{name:"Customerguru - 1",regex:"(?:guru).{0,40}\\b([a-z0-9A-Z]{50})\\b"},{name:"Customerguru - 2",regex:"(?:guru).{0,40}\\b([a-z0-9A-Z]{30})\\b"},{name:"Customerio",regex:"(?:customer).{0,40}\\b([a-z0-9A-Z]{20})\\b"},{name:"D7network",regex:"(?:d7network).{0,40}\\b([a-zA-Z0-9\\W\\S]{23}\\=)"},{name:"Dailyco",regex:"(?:daily).{0,40}\\b([0-9a-f]{64})\\b"},{name:"Dandelion",regex:"(?:dandelion).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Databricks",regex:"dapi[a-f0-9]{32}\\b"},{name:"Datadogtoken - 1",regex:"(?:datadog).{0,40}\\b([a-zA-Z-0-9]{32})\\b"},{name:"Datadogtoken - 2",regex:"(?:datadog).{0,40}\\b([a-zA-Z-0-9]{40})\\b"},{name:"Datafire",regex:"(?:datafire).{0,40}\\b([a-z0-9\\S]{175,190})\\b"},{name:"Datagov",regex:"(?:data.gov).{0,40}\\b([a-zA-Z0-9]{40})\\b"},{name:"Debounce",regex:"(?:debounce).{0,40}\\b([a-zA-Z0-9]{13})\\b"},{name:"Deepai",regex:"(?:deepai).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Deepgram",regex:"(?:deepgram).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Delighted",regex:"(?:delighted).{0,40}\\b([a-z0-9A-Z]{32})\\b"},{name:"Deputy - 1",regex:"\\b([0-9a-z]{1,}.as.deputy.com)\\b"},{name:"Deputy - 2",regex:"(?:deputy).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Detectlanguage",regex:"(?:detectlanguage).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Dfuse",regex:"\\b(web\\_[0-9a-z]{32})\\b"},{name:"Diffbot",regex:"(?:diffbot).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Digitaloceantoken",regex:"(?:digitalocean).{0,40}\\b([A-Za-z0-9_-]{64})\\b"},{name:"Discordbottoken - 1",regex:"(?:discord).{0,40}\\b([A-Za-z0-9_-]{24}\\.[A-Za-z0-9_-]{6}\\.[A-Za-z0-9_-]{27})\\b"},{name:"Discordbottoken - 2",regex:"(?:discord).{0,40}\\b([0-9]{17})\\b"},{name:"Discordwebhook",regex:"(https:\\/\\/discord.com\\/api\\/webhooks\\/[0-9]{18}\\/[0-9a-zA-Z-]{68})"},{name:"Ditto",regex:"(?:ditto).{0,40}\\b([a-z0-9]{8}\\-[a-z0-9]{4}\\-[a-z0-9]{4}\\-[a-z0-9]{4}\\-[a-z0-9]{12}\\.[a-z0-9]{40})\\b"},{name:"Dnscheck - 1",regex:"(?:dnscheck).{0,40}\\b([a-z0-9A-Z-]{36})\\b"},{name:"Dnscheck - 2",regex:"(?:dnscheck).{0,40}\\b([a-z0-9A-Z]{32})\\b"},{name:"Documo",regex:"\\b(ey[a-zA-Z0-9]{34}.ey[a-zA-Z0-9]{154}.[a-zA-Z0-9_-]{43})\\b"},{name:"Doppler",regex:"\\b(dp\\.pt\\.[a-zA-Z0-9]{43})\\b"},{name:"Dotmailer - 1",regex:"(?:dotmailer).{0,40}\\b(apiuser-[a-z0-9]{12}@apiconnector.com)\\b"},{name:"Dotmailer - 2",regex:"(?:dotmailer).{0,40}\\b([a-zA-Z0-9\\S]{8,24})\\b"},{name:"Dovico",regex:"(?:dovico).{0,40}\\b([0-9a-z]{32}\\.[0-9a-z]{1,}\\b)"},{name:"Dronahq",regex:"(?:dronahq).{0,40}\\b([a-z0-9]{50})\\b"},{name:"Droneci",regex:"(?:droneci).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Dropbox",regex:"\\b(sl\\.[A-Za-z0-9\\-\\_]{130,140})\\b"},{name:"Dwolla",regex:"(?:dwolla).{0,40}\\b([a-zA-Z-0-9]{50})\\b"},{name:"Dynalist",regex:"(?:dynalist).{0,40}\\b([a-zA-Z0-9-_]{128})\\b"},{name:"Dynatrace token",regex:"dt0[a-zA-Z]{1}[0-9]{2}\\.[A-Z0-9]{24}\\.[A-Z0-9]{64}"},{name:"Dyspatch",regex:"(?:dyspatch).{0,40}\\b([A-Z0-9]{52})\\b"},{name:"EC",regex:"-----BEGIN EC PRIVATE KEY-----"},{name:"Eagleeyenetworks - 1",regex:"(?:eagleeyenetworks).{0,40}\\b([a-zA-Z0-9]{3,20}@[a-zA-Z0-9]{2,12}.[a-zA-Z0-9]{2,5})\\b"},{name:"Eagleeyenetworks - 2",regex:"(?:eagleeyenetworks).{0,40}\\b([a-zA-Z0-9]{15})\\b"},{name:"Easyinsight - 1",regex:"(?:easyinsight|easy-insight).{0,40}\\b([a-zA-Z0-9]{20})\\b"},{name:"Easyinsight - 2",regex:"(?:easyinsight|easy-insight).{0,40}\\b([0-9Aa-zA-Z]{20})\\b"},{name:"Edamam - 1",regex:"(?:edamam).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Edamam - 2",regex:"(?:edamam).{0,40}\\b([0-9a-z]{8})\\b"},{name:"Edenai",regex:"(?:edenai).{0,40}\\b([a-zA-Z0-9]{36}.[a-zA-Z0-9]{92}.[a-zA-Z0-9_]{43})\\b"},{name:"Eightxeight - 1",regex:"(?:8x8).{0,40}\\b([a-zA-Z0-9_]{18,30})\\b"},{name:"Eightxeight - 2",regex:"(?:8x8).{0,40}\\b([a-zA-Z0-9]{43})\\b"},{name:"Elasticemail",regex:"(?:elastic).{0,40}\\b([A-Za-z0-9_-]{96})\\b"},{name:"Enablex - 1",regex:"(?:enablex).{0,40}\\b([a-zA-Z0-9]{36})\\b"},{name:"Enablex - 2",regex:"(?:enablex).{0,40}\\b([a-z0-9]{24})\\b"},{name:"Enigma",regex:"(?:enigma).{0,40}\\b([a-zA-Z0-9]{40})\\b"},{name:"Ethplorer",regex:"(?:ethplorer).{0,40}\\b([a-z0-9A-Z-]{22})\\b"},{name:"Etsyapikey",regex:"(?:etsy).{0,40}\\b([a-zA-Z-0-9]{24})\\b"},{name:"Everhour",regex:"(?:everhour).{0,40}\\b([0-9Aa-f]{4}-[0-9a-f]{4}-[0-9a-f]{6}-[0-9a-f]{6}-[0-9a-f]{8})\\b"},{name:"Exchangerateapi",regex:"(?:exchangerate).{0,40}\\b([a-z0-9]{24})\\b"},{name:"Exchangeratesapi",regex:"(?:exchangerates).{0,40}\\b([a-z0-9]{32})\\b"},{name:"FCM Server Key",regex:"AAAA[a-zA-Z0-9_-]{7}:[a-zA-Z0-9_-]{140}"},{name:"FCM_server_key",regex:"(AAAA[a-zA-Z0-9_-]{7}:[a-zA-Z0-9_-]{140})"},{name:"Facebook Access Token",regex:"EAACEdEose0cBA[0-9A-Za-z]+"},{name:"Facebook OAuth",regex:`[fF][aA][cC][eE][bB][oO][oO][kK].*['|"][0-9a-f]{32}['|"]`},{name:"Facebookoauth",regex:"(?:facebook).{0,40}\\b([A-Za-z0-9]{32})\\b"},{name:"Faceplusplus",regex:"(?:faceplusplus).{0,40}\\b([0-9a-zA-Z_-]{32})\\b"},{name:"Fakejson",regex:"(?:fakejson).{0,40}\\b([a-zA-Z0-9]{22})\\b"},{name:"Fastforex",regex:"(?:fastforex).{0,40}\\b([a-z0-9-]{28})\\b"},{name:"Fastlypersonaltoken",regex:"(?:fastly).{0,40}\\b([A-Za-z0-9_-]{32})\\b"},{name:"Feedier",regex:"(?:feedier).{0,40}\\b([a-z0-9A-Z]{32})\\b"},{name:"Fetchrss",regex:"(?:fetchrss).{0,40}\\b([0-9A-Za-z.]{40})\\b"},{name:"Figmapersonalaccesstoken",regex:"(?:figma).{0,40}\\b([0-9]{6}-[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12})\\b"},{name:"Fileio",regex:"(?:fileio).{0,40}\\b([A-Z0-9.-]{39})\\b"},{name:"Finage",regex:"\\b(API_KEY[0-9A-Z]{32})\\b"},{name:"Financialmodelingprep",regex:"(?:financialmodelingprep).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Findl",regex:"(?:findl).{0,40}\\b([a-z0-9]{8}\\-[a-z0-9]{4}\\-[a-z0-9]{4}\\-[a-z0-9]{4}\\-[a-z0-9]{12})\\b"},{name:"Finnhub",regex:"(?:finnhub).{0,40}\\b([0-9a-z]{20})\\b"},{name:"Firebase Database Detect - 1",regex:"[a-z0-9.-]+\\.firebaseio\\.com"},{name:"Firebase Database Detect - 2",regex:"[a-z0-9.-]+\\.firebaseapp\\.com"},{name:"Fixerio",regex:"(?:fixer).{0,40}\\b([A-Za-z0-9]{32})\\b"},{name:"Flatio",regex:"(?:flat).{0,40}\\b([0-9a-z]{128})\\b"},{name:"Fleetbase",regex:"\\b(flb_live_[0-9a-zA-Z]{20})\\b"},{name:"Flickr",regex:"(?:flickr).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Flightapi",regex:"(?:flightapi).{0,40}\\b([a-z0-9]{24})\\b"},{name:"Flightstats - 1",regex:"(?:flightstats).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Flightstats - 2",regex:"(?:flightstats).{0,40}\\b([0-9a-z]{8})\\b"},{name:"Float",regex:"(?:float).{0,40}\\b([a-zA-Z0-9-._+=]{59,60})\\b"},{name:"Flowflu - 2",regex:"(?:flowflu).{0,40}\\b([a-zA-Z0-9]{51})\\b"},{name:"Flutterwave",regex:"\\b(FLWSECK-[0-9a-z]{32}-X)\\b"},{name:"Fmfw - 1",regex:"(?:fmfw).{0,40}\\b([a-zA-Z0-9-]{32})\\b"},{name:"Fmfw - 2",regex:"(?:fmfw).{0,40}\\b([a-zA-Z0-9_-]{32})\\b"},{name:"Formbucket",regex:"(?:formbucket).{0,40}\\b([0-9A-Za-z]{1,}.[0-9A-Za-z]{1,}\\.[0-9A-Z-a-z\\-_]{1,})"},{name:"Formio",regex:"(?:formio).{0,40}\\b(eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9\\.[0-9A-Za-z]{310}\\.[0-9A-Z-a-z\\-_]{43}[ \\r\\n]{1})"},{name:"Foursquare",regex:"(?:foursquare).{0,40}\\b([0-9A-Z]{48})\\b"},{name:"Frameio",regex:"\\b(fio-u-[0-9a-zA-Z_-]{64})\\b"},{name:"Freshbooks - 1",regex:"(?:freshbooks).{0,40}\\b([0-9a-z]{64})\\b"},{name:"Freshbooks - 2",regex:"(?:freshbooks).{0,40}\\b(https://www.[0-9A-Za-z_-]{1,}.com)\\b"},{name:"Freshdesk - 1",regex:"(?:freshdesk).{0,40}\\b([0-9A-Za-z]{20})\\b"},{name:"Freshdesk - 2",regex:"\\b([0-9a-z-]{1,}.freshdesk.com)\\b"},{name:"Front",regex:"(?:front).{0,40}\\b([0-9a-zA-Z]{36}.[0-9a-zA-Z\\.\\-\\_]{188,244})\\b"},{name:"Fulcrum",regex:"(?:fulcrum).{0,40}\\b([a-z0-9]{80})\\b"},{name:"Fullstory",regex:"(?:fullstory).{0,40}\\b([a-zA-Z-0-9/+]{88})\\b"},{name:"Fusebill",regex:"(?:fusebill).{0,40}\\b([a-zA-Z0-9]{88})\\b"},{name:"Fxmarket",regex:"(?:fxmarket).{0,40}\\b([0-9Aa-zA-Z-_=]{20})\\b"},{name:"Gcp",regex:"\\{[^{]+auth_provider_x509_cert_url[^}]+\\}"},{name:"Geckoboard",regex:"(?:geckoboard).{0,40}\\b([a-zA-Z0-9]{44})\\b"},{name:"Generic - 1376",regex:"jdbc:mysql(=| =|:| :)"},{name:"Generic - 1688",regex:"TOKEN[\\\\-|_|A-Z0-9]*(\\'|\\\")?(:|=)(\\'|\\\")?[\\\\-|_|A-Z0-9]{10}"},{name:"Generic - 1689",regex:"API[\\\\-|_|A-Z0-9]*(\\'|\\\")?(:|=)(\\'|\\\")?[\\\\-|_|A-Z0-9]{10}"},{name:"Generic - 1691",regex:"SECRET[\\\\-|_|A-Z0-9]*(\\'|\\\")?(:|=)(\\'|\\\")?[\\\\-|_|A-Z0-9]{10}"},{name:"Generic - 1692",regex:"AUTHORIZATION[\\\\-|_|A-Z0-9]*(\\'|\\\")?(:|=)(\\'|\\\")?[\\\\-|_|A-Z0-9]{10}"},{name:"Generic - 1693",regex:"PASSWORD[\\\\-|_|A-Z0-9]*(\\'|\\\")?(:|=)(\\'|\\\")?[\\\\-|_|A-Z0-9]{10}"},{name:"Generic - 1695",regex:`(A|a)(P|p)(Ii)[\\-|_|A-Za-z0-9]*(\\''|")?( )*(:|=)( )*(\\''|")?[0-9A-Za-z\\-_]+(\\''|")?`},{name:"Generic - 1700",regex:"BEGIN OPENSSH PRIVATE KEY"},{name:"Generic - 1701",regex:"BEGIN PRIVATE KEY"},{name:"Generic - 1702",regex:"BEGIN RSA PRIVATE KEY"},{name:"Generic - 1703",regex:"BEGIN DSA PRIVATE KEY"},{name:"Generic - 1704",regex:"BEGIN EC PRIVATE KEY"},{name:"Generic - 1705",regex:"BEGIN PGP PRIVATE KEY BLOCK"},{name:"Generic - 1707",regex:"[a-z0-9.-]+\\.s3-[a-z0-9-]\\.amazonaws\\.com"},{name:"Generic - 1708",regex:"[a-z0-9.-]+\\.s3-website[.-](eu|ap|us|ca|sa|cn)"},{name:"Generic - 1710",regex:"algolia_api_key"},{name:"Generic - 1711",regex:"asana_access_token"},{name:"Generic - 1713",regex:"azure_tenant"},{name:"Generic - 1714",regex:"bitly_access_token"},{name:"Generic - 1715",regex:"branchio_secret"},{name:"Generic - 1716",regex:"browserstack_access_key"},{name:"Generic - 1717",regex:"buildkite_access_token"},{name:"Generic - 1718",regex:"comcast_access_token"},{name:"Generic - 1719",regex:"datadog_api_key"},{name:"Generic - 1720",regex:"deviantart_secret"},{name:"Generic - 1721",regex:"deviantart_access_token"},{name:"Generic - 1722",regex:"dropbox_api_token"},{name:"Generic - 1723",regex:"facebook_appsecret"},{name:"Generic - 1724",regex:"facebook_access_token"},{name:"Generic - 1725",regex:"firebase_custom_token"},{name:"Generic - 1726",regex:"firebase_id_token"},{name:"Generic - 1727",regex:"github_client"},{name:"Generic - 1728",regex:"github_ssh_key"},{name:"Generic - 1730",regex:"gitlab_private_token"},{name:"Generic - 1731",regex:"google_cm"},{name:"Generic - 1732",regex:"google_maps_key"},{name:"Generic - 1733",regex:"heroku_api_key"},{name:"Generic - 1734",regex:"instagram_access_token"},{name:"Generic - 1735",regex:"mailchimp_api_key"},{name:"Generic - 1736",regex:"mailgun_api_key"},{name:"Generic - 1737",regex:"mailjet"},{name:"Generic - 1738",regex:"mapbox_access_token"},{name:"Generic - 1739",regex:"pagerduty_api_token"},{name:"Generic - 1740",regex:"paypal_key_sb"},{name:"Generic - 1741",regex:"paypal_key_live"},{name:"Generic - 1742",regex:"paypal_token_sb"},{name:"Generic - 1743",regex:"paypal_token_live"},{name:"Generic - 1744",regex:"pendo_integration_key"},{name:"Generic - 1745",regex:"salesforce_access_token"},{name:"Generic - 1746",regex:"saucelabs_ukey"},{name:"Generic - 1747",regex:"sendgrid_api_key"},{name:"Generic - 1748",regex:"slack_api_token"},{name:"Generic - 1749",regex:"slack_webhook"},{name:"Generic - 1750",regex:"square_secret"},{name:"Generic - 1751",regex:"square_auth_token"},{name:"Generic - 1752",regex:"travisci_api_token"},{name:"Generic - 1753",regex:"twilio_sid_token"},{name:"Generic - 1754",regex:"twitter_api_secret"},{name:"Generic - 1755",regex:"twitter_bearer_token"},{name:"Generic - 1756",regex:"spotify_access_token"},{name:"Generic - 1757",regex:"stripe_key_live"},{name:"Generic - 1758",regex:"wakatime_api_key"},{name:"Generic - 1759",regex:"wompi_auth_bearer_sb"},{name:"Generic - 1760",regex:"wompi_auth_bearer_live"},{name:"Generic - 1761",regex:"wpengine_api_key"},{name:"Generic - 1762",regex:"zapier_webhook"},{name:"Generic - 1763",regex:"zendesk_access_token"},{name:"Generic - 1764",regex:"ssh-rsa"},{name:"Generic - 1765",regex:"s3-[a-z0-9-]+\\.amazonaws\\.com/[a-z0-9._-]+"},{name:"Generic webhook secret",regex:"(webhook).+(secret|token|key).+"},{name:"Gengo",regex:"(?:gengo).{0,40}([ ]{0,1}[0-9a-zA-Z\\[\\]\\-\\(\\)\\{\\}|_^@$=~]{64}[ \\r\\n]{1})"},{name:"Geoapify",regex:"(?:geoapify).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Geocode",regex:"(?:geocode).{0,40}\\b([a-z0-9]{28})\\b"},{name:"Geocodify",regex:"(?:geocodify).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Geocodio - 2",regex:"(?:geocod).{0,40}\\b([a-z0-9]{39})\\b"},{name:"Geoipifi",regex:"(?:ipifi).{0,40}\\b([a-z0-9A-Z_]{32})\\b"},{name:"Getemail",regex:"(?:getemail).{0,40}\\b([a-zA-Z0-9-]{20})\\b"},{name:"Getemails - 1",regex:"(?:getemails).{0,40}\\b([a-z0-9-]{26})\\b"},{name:"Getemails - 2",regex:"(?:getemails).{0,40}\\b([a-z0-9-]{18})\\b"},{name:"Getgeoapi",regex:"(?:getgeoapi).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Getgist",regex:"(?:getgist).{0,40}\\b([a-z0-9A-Z+=]{68})"},{name:"Getsandbox - 1",regex:"(?:getsandbox).{0,40}\\b([a-z0-9-]{40})\\b"},{name:"Getsandbox - 2",regex:"(?:getsandbox).{0,40}\\b([a-z0-9-]{15,30})\\b"},{name:"GitHub",regex:`[gG][iI][tT][hH][uU][bB].*['|"][0-9a-zA-Z]{35,40}['|"]`},{name:"Github - 2",regex:"\\b((?:ghp|gho|ghu|ghs|ghr)_[a-zA-Z0-9]{36,255}\\b)"},{name:"Github App Token",regex:"(ghu|ghs)_[0-9a-zA-Z]{36}"},{name:"Github OAuth Access Token",regex:"gho_[0-9a-zA-Z]{36}"},{name:"Github Personal Access Token",regex:"ghp_[0-9a-zA-Z]{36}"},{name:"Github Refresh Token",regex:"ghr_[0-9a-zA-Z]{76}"},{name:"Github_old",regex:`(?:github)[^\\.].{0,40}[ =:'"]+([a-f0-9]{40})\\b`},{name:"Githubapp - 1",regex:"(?:github).{0,40}\\b([0-9]{6})\\b"},{name:"Githubapp - 2",regex:"(?:github).{0,40}(-----BEGIN RSA PRIVATE KEY-----\\s[A-Za-z0-9+\\/\\s]*\\s-----END RSA PRIVATE KEY-----)"},{name:"Gitlab",regex:"(?:gitlab).{0,40}\\b([a-zA-Z0-9\\-=_]{20,22})\\b"},{name:"Gitlabv2",regex:"\\b(glpat-[a-zA-Z0-9\\-=_]{20,22})\\b"},{name:"Gitter",regex:"(?:gitter).{0,40}\\b([a-z0-9-]{40})\\b"},{name:"Glassnode",regex:"(?:glassnode).{0,40}\\b([0-9A-Za-z]{27})\\b"},{name:"Gocanvas - 1",regex:"(?:gocanvas).{0,40}\\b([0-9A-Za-z/+]{43}=[ \\r\\n]{1})"},{name:"Gocanvas - 2",regex:"(?:gocanvas).{0,40}\\b([\\w\\.-]+@[\\w-]+\\.[\\w\\.-]{2,5})\\b"},{name:"Gocardless",regex:`\\b(live_[0-9A-Za-z\\_\\-]{40}[ "'\\r\\n]{1})`},{name:"Goodday",regex:"(?:goodday).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Google (GCP) Service Account",regex:'"type": "service_account"'},{name:"Google API Key",regex:"AIza[0-9a-z-_]{35}"},{name:"Google Calendar URI",regex:"https://www\\.google\\.com/calendar/embed\\?src=[A-Za-z0-9%@&;=\\-_\\./]+"},{name:"Graphcms - 1",regex:"(?:graph).{0,40}\\b([a-z0-9]{25})\\b"},{name:"Graphcms - 2",regex:"\\b(ey[a-zA-Z0-9]{73}.ey[a-zA-Z0-9]{365}.[a-zA-Z0-9_-]{683})\\b"},{name:"Graphhopper",regex:"(?:graphhopper).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Groovehq",regex:"(?:groove).{0,40}\\b([a-z0-9A-Z]{64})"},{name:"Guru - 1",regex:"(?:guru).{0,40}\\b([a-zA-Z0-9]{3,20}@[a-zA-Z0-9]{2,12}.[a-zA-Z0-9]{2,5})\\b"},{name:"Guru - 2",regex:"(?:guru).{0,40}\\b([a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})\\b"},{name:"Gyazo",regex:"(?:gyazo).{0,40}\\b([0-9A-Za-z-]{43})\\b"},{name:"Happi",regex:"(?:happi).{0,40}\\b([a-zA-Z0-9]{56})"},{name:"Happyscribe",regex:"(?:happyscribe).{0,40}\\b([0-9a-zA-Z]{24})\\b"},{name:"Harvest - 1",regex:"(?:harvest).{0,40}\\b([a-z0-9A-Z._]{97})\\b"},{name:"Harvest - 2",regex:"(?:harvest).{0,40}\\b([0-9]{4,9})\\b"},{name:"Hellosign",regex:"(?:hellosign).{0,40}\\b([a-zA-Z-0-9/+]{64})\\b"},{name:"Helpcrunch",regex:"(?:helpcrunch).{0,40}\\b([a-zA-Z-0-9+/=]{328})"},{name:"Helpscout",regex:"(?:helpscout).{0,40}\\b([A-Za-z0-9]{56})\\b"},{name:"Hereapi",regex:"(?:hereapi).{0,40}\\b([a-zA-Z0-9\\S]{43})\\b"},{name:"Heroku",regex:"(?:heroku).{0,40}\\b([0-9Aa-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\\b"},{name:"Hive - 1",regex:"(?:hive).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Hive - 2",regex:"(?:hive).{0,40}\\b([0-9A-Za-z]{17})\\b"},{name:"Hiveage",regex:"(?:hiveage).{0,40}\\b([0-9A-Za-z\\_\\-]{20})\\b"},{name:"Holidayapi",regex:"(?:holidayapi).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Host",regex:"(?:host).{0,40}\\b([a-z0-9]{14})\\b"},{name:"Html2pdf",regex:"(?:html2pdf).{0,40}\\b([a-zA-Z0-9]{64})\\b"},{name:"Hubspotapikey",regex:"(?:hubspot).{0,40}\\b([A-Za-z0-9]{8}\\-[A-Za-z0-9]{4}\\-[A-Za-z0-9]{4}\\-[A-Za-z0-9]{4}\\-[A-Za-z0-9]{12})\\b"},{name:"Humanity",regex:"(?:humanity).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Hunter",regex:"(?:hunter).{0,40}\\b([a-z0-9_-]{40})\\b"},{name:"Hypertrack - 1",regex:"(?:hypertrack).{0,40}\\b([0-9a-zA-Z\\_\\-]{54})\\b"},{name:"Hypertrack - 2",regex:"(?:hypertrack).{0,40}\\b([0-9a-zA-Z\\_\\-]{27})\\b"},{name:"Ibmclouduserkey",regex:"(?:ibm).{0,40}\\b([A-Za-z0-9_-]{44})\\b"},{name:"Iconfinder",regex:"(?:iconfinder).{0,40}\\b([a-zA-Z0-9]{64})\\b"},{name:"Iexcloud",regex:"(?:iexcloud).{0,40}\\b([a-z0-9_]{35})\\b"},{name:"Imagekit",regex:"(?:imagekit).{0,40}\\b([a-zA-Z0-9_=]{36})"},{name:"Imagga",regex:"(?:imagga).{0,40}\\b([a-z0-9A-Z=]{72})"},{name:"Impala",regex:"(?:impala).{0,40}\\b([0-9A-Za-z_]{46})\\b"},{name:"Insightly",regex:"(?:insightly).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Integromat",regex:"(?:integromat).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Intercom",regex:"(?:intercom).{0,40}\\b([a-zA-Z0-9\\W\\S]{59}\\=)"},{name:"Intrinio",regex:"(?:intrinio).{0,40}\\b([a-zA-Z0-9]{44})\\b"},{name:"Invoiceocean - 1",regex:"(?:invoiceocean).{0,40}\\b([0-9A-Za-z]{20})\\b"},{name:"Invoiceocean - 2",regex:"\\b([0-9a-z]{1,}.invoiceocean.com)\\b"},{name:"Ipapi",regex:"(?:ipapi).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Ipgeolocation",regex:"(?:ipgeolocation).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Ipify",regex:"(?:ipify).{0,40}\\b([a-zA-Z0-9_-]{32})\\b"},{name:"Ipinfodb",regex:"(?:ipinfodb).{0,40}\\b([a-z0-9]{64})\\b"},{name:"Ipquality",regex:"(?:ipquality).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Ipstack",regex:"(?:ipstack).{0,40}\\b([a-fA-f0-9]{32})\\b"},{name:"JDBC Connection String",regex:"jdbc:[a-z:]+://[A-Za-z0-9\\.\\-_:;=/@?,&]+"},{name:"Jiratoken - 1",regex:"(?:jira).{0,40}\\b([a-zA-Z-0-9]{24})\\b"},{name:"Jiratoken - 2",regex:"(?:jira).{0,40}\\b([a-zA-Z-0-9]{5,24}\\@[a-zA-Z-0-9]{3,16}\\.com)\\b"},{name:"Jiratoken - 3",regex:"(?:jira).{0,40}\\b([a-zA-Z-0-9]{5,24}\\.[a-zA-Z-0-9]{3,16}\\.[a-zA-Z-0-9]{3,16})\\b"},{name:"Jotform",regex:"(?:jotform).{0,40}\\b([0-9Aa-z]{32})\\b"},{name:"Jumpcloud",regex:"(?:jumpcloud).{0,40}\\b([a-zA-Z0-9]{40})\\b"},{name:"Juro",regex:"(?:juro).{0,40}\\b([a-zA-Z0-9]{40})\\b"},{name:"Kanban - 1",regex:"(?:kanban).{0,40}\\b([0-9A-Z]{12})\\b"},{name:"Kanban - 2",regex:"\\b([0-9a-z]{1,}.kanbantool.com)\\b"},{name:"Karmacrm",regex:"(?:karma).{0,40}\\b([a-zA-Z0-9]{20})\\b"},{name:"Keenio - 1",regex:"(?:keen).{0,40}\\b([0-9a-z]{24})\\b"},{name:"Keenio - 2",regex:"(?:keen).{0,40}\\b([0-9A-Z]{64})\\b"},{name:"Kickbox",regex:"(?:kickbox).{0,40}\\b([a-zA-Z0-9_]+[a-zA-Z0-9]{64})\\b"},{name:"Klipfolio",regex:"(?:klipfolio).{0,40}\\b([0-9a-f]{40})\\b"},{name:"Kontent",regex:"(?:kontent).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Kraken - 1",regex:`(?:kraken).{0,40}\\b([0-9A-Za-z\\/\\+=]{56}[ "'\\r\\n]{1})`},{name:"Kraken - 2",regex:`(?:kraken).{0,40}\\b([0-9A-Za-z\\/\\+=]{86,88}[ "'\\r\\n]{1})`},{name:"Kucoin - 1",regex:"(?:kucoin).{0,40}([ \\r\\n]{1}[!-~]{7,32}[ \\r\\n]{1})"},{name:"Kucoin - 2",regex:"(?:kucoin).{0,40}\\b([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\\b"},{name:"Kucoin - 3",regex:"(?:kucoin).{0,40}\\b([0-9a-f]{24})\\b"},{name:"Kylas",regex:"(?:kylas).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Languagelayer",regex:"(?:languagelayer).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Lastfm",regex:"(?:lastfm).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Launchdarkly",regex:"(?:launchdarkly).{0,40}\\b([a-z0-9-]{40})\\b"},{name:"Leadfeeder",regex:"(?:leadfeeder).{0,40}\\b([a-zA-Z0-9-]{43})\\b"},{name:"Lendflow",regex:"(?:lendflow).{0,40}\\b([a-zA-Z0-9]{36}\\.[a-zA-Z0-9]{235}\\.[a-zA-Z0-9]{32}\\-[a-zA-Z0-9]{47}\\-[a-zA-Z0-9_]{162}\\-[a-zA-Z0-9]{42}\\-[a-zA-Z0-9_]{40}\\-[a-zA-Z0-9_]{66}\\-[a-zA-Z0-9_]{59}\\-[a-zA-Z0-9]{7}\\-[a-zA-Z0-9_]{220})\\b"},{name:"Lessannoyingcrm",regex:"(?:less).{0,40}\\b([a-zA-Z0-9-]{57})\\b"},{name:"Lexigram",regex:"(?:lexigram).{0,40}\\b([a-zA-Z0-9\\S]{301})\\b"},{name:"Linearapi",regex:"\\b(lin_api_[0-9A-Za-z]{40})\\b"},{name:"Linemessaging",regex:"(?:line).{0,40}\\b([A-Za-z0-9+/]{171,172})\\b"},{name:"Linenotify",regex:"(?:linenotify).{0,40}\\b([0-9A-Za-z]{43})\\b"},{name:"Linkpreview",regex:"(?:linkpreview).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Liveagent",regex:"(?:liveagent).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Livestorm",regex:"(?:livestorm).{0,40}\\b(eyJhbGciOiJIUzI1NiJ9\\.eyJhdWQiOiJhcGkubGl2ZXN0b3JtLmNvIiwianRpIjoi[0-9A-Z-a-z]{134}\\.[0-9A-Za-z\\-\\_]{43}[ \\r\\n]{1})"},{name:"Locationiq",regex:"\\b(pk\\.[a-zA-Z-0-9]{32})\\b"},{name:"Loginradius",regex:"(?:loginradius).{0,40}\\b([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\\b"},{name:"Lokalisetoken",regex:"(?:lokalise).{0,40}\\b([a-z0-9]{40})\\b"},{name:"Loyverse",regex:"(?:loyverse).{0,40}\\b([0-9-a-z]{32})\\b"},{name:"Luno - 1",regex:"(?:luno).{0,40}\\b([a-z0-9]{13})\\b"},{name:"Luno - 2",regex:"(?:luno).{0,40}\\b([a-zA-Z0-9_-]{43})\\b"},{name:"M3o",regex:"(?:m3o).{0,40}\\b([0-9A-Za-z]{48})\\b"},{name:"Macaddress",regex:"(?:macaddress).{0,40}\\b([a-zA-Z0-9_]{32})\\b"},{name:"Madkudu",regex:"(?:madkudu).{0,40}\\b([0-9a-f]{32})\\b"},{name:"Magnetic",regex:"(?:magnetic).{0,40}\\b([0-9Aa-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12})\\b"},{name:"Mailboxlayer",regex:"(?:mailboxlayer).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Mailerlite",regex:"(?:mailerlite).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Mailgun - 2",regex:"(?:mailgun).{0,40}\\b([a-zA-Z-0-9]{72})\\b"},{name:"Mailgun API Key - 1",regex:"key-[0-9a-zA-Z]{32}"},{name:"Mailgun API key - 2",regex:"(mailgun|mg)[0-9a-z]{32}"},{name:"Mailjetbasicauth",regex:"(?:mailjet).{0,40}\\b([A-Za-z0-9]{87}\\=)"},{name:"Mailjetsms",regex:"(?:mailjet).{0,40}\\b([A-Za-z0-9]{32})\\b"},{name:"Mailmodo",regex:"(?:mailmodo).{0,40}\\b([A-Z0-9]{7}-[A-Z0-9]{7}-[A-Z0-9]{7}-[A-Z0-9]{7})\\b"},{name:"Mailsac",regex:"(?:mailsac).{0,40}\\b(k_[0-9A-Za-z]{36,})\\b"},{name:"Mandrill",regex:"(?:mandrill).{0,40}\\b([A-Za-z0-9_-]{22})\\b"},{name:"Manifest",regex:"(?:manifest).{0,40}\\b([a-zA-z0-9]{32})\\b"},{name:"Mapbox - 2",regex:"\\b(sk\\.[a-zA-Z-0-9\\.]{80,240})\\b"},{name:"Mapquest",regex:"(?:mapquest).{0,40}\\b([0-9A-Za-z]{32})\\b"},{name:"Marketstack",regex:"(?:marketstack).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Mattermostpersonaltoken - 1",regex:"(?:mattermost).{0,40}\\b([A-Za-z0-9-_]{1,}.cloud.mattermost.com)\\b"},{name:"Mattermostpersonaltoken - 2",regex:"(?:mattermost).{0,40}\\b([a-z0-9]{26})\\b"},{name:"Mavenlink",regex:"(?:mavenlink).{0,40}\\b([0-9a-z]{64})\\b"},{name:"Maxmindlicense - 1",regex:"(?:maxmind|geoip).{0,40}\\b([0-9A-Za-z]{16})\\b"},{name:"Maxmindlicense - 2",regex:"(?:maxmind|geoip).{0,40}\\b([0-9]{2,7})\\b"},{name:"Meaningcloud",regex:"(?:meaningcloud).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Mediastack",regex:"(?:mediastack).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Meistertask",regex:"(?:meistertask).{0,40}\\b([a-zA-Z0-9]{43})\\b"},{name:"Mesibo",regex:"(?:mesibo).{0,40}\\b([0-9A-Za-z]{64})\\b"},{name:"Messagebird",regex:"(?:messagebird).{0,40}\\b([A-Za-z0-9_-]{25})\\b"},{name:"Metaapi - 1",regex:"(?:metaapi|meta-api).{0,40}\\b([0-9a-f]{64})\\b"},{name:"Metaapi - 2",regex:"(?:metaapi|meta-api).{0,40}\\b([0-9a-f]{24})\\b"},{name:"Metrilo",regex:"(?:metrilo).{0,40}\\b([a-z0-9]{16})\\b"},{name:"Microsoftteamswebhook",regex:"(https:\\/\\/[a-zA-Z-0-9]+\\.webhook\\.office\\.com\\/webhookb2\\/[a-zA-Z-0-9]{8}-[a-zA-Z-0-9]{4}-[a-zA-Z-0-9]{4}-[a-zA-Z-0-9]{4}-[a-zA-Z-0-9]{12}\\@[a-zA-Z-0-9]{8}-[a-zA-Z-0-9]{4}-[a-zA-Z-0-9]{4}-[a-zA-Z-0-9]{4}-[a-zA-Z-0-9]{12}\\/IncomingWebhook\\/[a-zA-Z-0-9]{32}\\/[a-zA-Z-0-9]{8}-[a-zA-Z-0-9]{4}-[a-zA-Z-0-9]{4}-[a-zA-Z-0-9]{4}-[a-zA-Z-0-9]{12})"},{name:"Midise",regex:"midi-662b69edd2[a-zA-Z0-9]{54}"},{name:"Mindmeister",regex:"(?:mindmeister).{0,40}\\b([a-zA-Z0-9]{43})\\b"},{name:"Mite - 1",regex:"(?:mite).{0,40}\\b([0-9a-z]{16})\\b"},{name:"Mite - 2",regex:"\\b([0-9a-z-]{1,}.mite.yo.lk)\\b"},{name:"Mixmax",regex:"(?:mixmax).{0,40}\\b([a-zA-Z0-9_-]{36})\\b"},{name:"Mixpanel - 1",regex:"(?:mixpanel).{0,40}\\b([a-zA-Z0-9.-]{30,40})\\b"},{name:"Mixpanel - 2",regex:"(?:mixpanel).{0,40}\\b([a-zA-Z0-9-]{32})\\b"},{name:"Moderation",regex:"(?:moderation).{0,40}\\b([a-zA-Z0-9]{36}\\.[a-zA-Z0-9]{115}\\.[a-zA-Z0-9_]{43})\\b"},{name:"Monday",regex:"(?:monday).{0,40}\\b(ey[a-zA-Z0-9_.]{210,225})\\b"},{name:"Moonclerck",regex:"(?:moonclerck).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Moonclerk",regex:"(?:moonclerk).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Moosend",regex:"(?:moosend).{0,40}\\b([0-9Aa-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\\b"},{name:"Mrticktock - 1",regex:"(?:mrticktock).{0,40}\\b([a-zA-Z0-9!=@#$%()_^]{1,50})"},{name:"Myfreshworks - 2",regex:"(?:freshworks).{0,40}\\b([a-z0-9A-Z-]{22})\\b"},{name:"Myintervals",regex:"(?:myintervals).{0,40}\\b([0-9a-z]{11})\\b"},{name:"Nasdaqdatalink",regex:"(?:nasdaq).{0,40}\\b([a-zA-Z0-9_-]{20})\\b"},{name:"Nethunt - 1",regex:"(?:nethunt).{0,40}\\b([a-zA-Z0-9.-@]{25,30})\\b"},{name:"Nethunt - 2",regex:"(?:nethunt).{0,40}\\b([a-z0-9-\\S]{36})\\b"},{name:"Netlify",regex:"(?:netlify).{0,40}\\b([A-Za-z0-9_-]{43,45})\\b"},{name:"Neutrinoapi - 1",regex:"(?:neutrinoapi).{0,40}\\b([a-zA-Z0-9]{48})\\b"},{name:"Neutrinoapi - 2",regex:"(?:neutrinoapi).{0,40}\\b([a-zA-Z0-9]{6,24})\\b"},{name:"Newrelic Admin API Key",regex:"NRAA-[a-f0-9]{27}"},{name:"Newrelic Insights API Key",regex:"NRI(?:I|Q)-[A-Za-z0-9\\-_]{32}"},{name:"Newrelic REST API Key",regex:"NRRA-[a-f0-9]{42}"},{name:"Newrelic Synthetics Location Key",regex:"NRSP-[a-z]{2}[0-9]{2}[a-f0-9]{31}"},{name:"Newrelicpersonalapikey",regex:"(?:newrelic).{0,40}\\b([A-Za-z0-9_\\.]{4}-[A-Za-z0-9_\\.]{42})\\b"},{name:"Newsapi",regex:"(?:newsapi).{0,40}\\b([a-z0-9]{32})"},{name:"Newscatcher",regex:"(?:newscatcher).{0,40}\\b([0-9A-Za-z_]{43})\\b"},{name:"Nexmoapikey - 1",regex:"(?:nexmo).{0,40}\\b([A-Za-z0-9_-]{8})\\b"},{name:"Nexmoapikey - 2",regex:"(?:nexmo).{0,40}\\b([A-Za-z0-9_-]{16})\\b"},{name:"Nftport",regex:"(?:nftport).{0,40}\\b([a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})\\b"},{name:"Nicereply",regex:"(?:nicereply).{0,40}\\b([0-9a-f]{40})\\b"},{name:"Nimble",regex:"(?:nimble).{0,40}\\b([a-zA-Z0-9]{30})\\b"},{name:"Nitro",regex:"(?:nitro).{0,40}\\b([0-9a-f]{32})\\b"},{name:"Noticeable",regex:"(?:noticeable).{0,40}\\b([0-9a-zA-Z]{20})\\b"},{name:"Notion",regex:"\\b(secret_[A-Za-z0-9]{43})\\b"},{name:"Nozbeteams",regex:"(?:nozbe|nozbeteams).{0,40}\\b([0-9A-Za-z]{16}_[0-9A-Za-z\\-_]{64}[ \\r\\n]{1})"},{name:"Numverify",regex:"(?:numverify).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Nutritionix - 1",regex:"(?:nutritionix).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Nutritionix - 2",regex:"(?:nutritionix).{0,40}\\b([a-z0-9]{8})\\b"},{name:"Nylas",regex:"(?:nylas).{0,40}\\b([0-9A-Za-z]{30})\\b"},{name:"Nytimes",regex:"(?:nytimes).{0,40}\\b([a-z0-9A-Z-]{32})\\b"},{name:"Oanda",regex:"(?:oanda).{0,40}\\b([a-zA-Z0-9]{24})\\b"},{name:"Omnisend",regex:"(?:omnisend).{0,40}\\b([a-z0-9A-Z-]{75})\\b"},{name:"Onedesk - 1",regex:"(?:onedesk).{0,40}\\b([a-zA-Z0-9!=@#$%^]{8,64})"},{name:"Onelogin - 2",regex:`secret[a-zA-Z0-9_' "=]{0,20}([a-z0-9]{64})`},{name:"Onepagecrm - 1",regex:"(?:onepagecrm).{0,40}\\b([a-zA-Z0-9=]{44})"},{name:"Onepagecrm - 2",regex:"(?:onepagecrm).{0,40}\\b([a-z0-9]{24})\\b"},{name:"Onwaterio",regex:"(?:onwater).{0,40}\\b([a-zA-Z0-9_-]{20})\\b"},{name:"Oopspam",regex:"(?:oopspam).{0,40}\\b([a-zA-Z0-9]{40})\\b"},{name:"Opencagedata",regex:"(?:opencagedata).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Opengraphr",regex:"(?:opengraphr).{0,40}\\b([0-9Aa-zA-Z]{80})\\b"},{name:"Openuv",regex:"(?:openuv).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Openweather",regex:"(?:openweather).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Optimizely",regex:"(?:optimizely).{0,40}\\b([0-9A-Za-z-:]{54})\\b"},{name:"Owlbot",regex:"(?:owlbot).{0,40}\\b([a-z0-9]{40})\\b"},{name:"PGP private key block",regex:"-----BEGIN PGP PRIVATE KEY BLOCK-----"},{name:"Pagerdutyapikey",regex:"(?:pagerduty).{0,40}\\b([a-z]{1}\\+[a-zA-Z]{9}\\-[a-z]{2}\\-[a-z0-9]{5})\\b"},{name:"Pandadoc",regex:"(?:pandadoc).{0,40}\\b([a-zA-Z0-9]{40})\\b"},{name:"Pandascore",regex:"(?:pandascore).{0,40}([ \\r\\n]{0,1}[0-9A-Za-z\\-\\_]{51}[ \\r\\n]{1})"},{name:"Paralleldots",regex:"(?:paralleldots).{0,40}\\b([0-9A-Za-z]{43})\\b"},{name:"Partnerstack",regex:"(?:partnerstack).{0,40}\\b([0-9A-Za-z]{64})\\b"},{name:"Passbase",regex:"(?:passbase).{0,40}\\b([a-zA-Z0-9]{128})\\b"},{name:"Pastebin",regex:"(?:pastebin).{0,40}\\b([a-zA-Z0-9_]{32})\\b"},{name:"PayPal Braintree access token",regex:"access_token\\$production\\$[0-9a-z]{16}\\$[0-9a-f]{32}"},{name:"Paymoapp",regex:"(?:paymoapp).{0,40}\\b([a-zA-Z0-9]{44})\\b"},{name:"Paymongo",regex:"(?:paymongo).{0,40}\\b([a-zA-Z0-9_]{32})\\b"},{name:"Paypaloauth - 1",regex:"\\b([A-Za-z0-9_\\.]{7}-[A-Za-z0-9_\\.]{72})\\b"},{name:"Paypaloauth - 2",regex:"\\b([A-Za-z0-9_\\.]{69}-[A-Za-z0-9_\\.]{10})\\b"},{name:"Paystack",regex:"\\b(sk\\_[a-z]{1,}\\_[A-Za-z0-9]{40})\\b"},{name:"Pdflayer",regex:"(?:pdflayer).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Pdfshift",regex:"(?:pdfshift).{0,40}\\b([0-9a-f]{32})\\b"},{name:"Peopledatalabs",regex:"(?:peopledatalabs).{0,40}\\b([a-z0-9]{64})\\b"},{name:"Pepipost",regex:"(?:pepipost|netcore).{0,40}\\b([a-zA-Z-0-9]{32})\\b"},{name:"Picatic API key",regex:"sk_live_[0-9a-z]{32}"},{name:"Pipedream",regex:"(?:pipedream).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Pipedrive",regex:"(?:pipedrive).{0,40}\\b([a-zA-Z0-9]{40})\\b"},{name:"Pivotaltracker",regex:"(?:pivotal).{0,40}([a-z0-9]{32})"},{name:"Pixabay",regex:"(?:pixabay).{0,40}\\b([a-z0-9-]{34})\\b"},{name:"Plaidkey - 1",regex:"(?:plaid).{0,40}\\b([a-z0-9]{24})\\b"},{name:"Plaidkey - 2",regex:"(?:plaid).{0,40}\\b([a-z0-9]{30})\\b"},{name:"Planviewleankit - 1",regex:"(?:planviewleankit|planview).{0,40}\\b([0-9a-f]{128})\\b"},{name:"Planviewleankit - 2",regex:"(?:planviewleankit|planview).{0,40}(?:subdomain).\\b([a-zA-Z][a-zA-Z0-9.-]{1,23}[a-zA-Z0-9])\\b"},{name:"Planyo",regex:"(?:planyo).{0,40}\\b([0-9a-z]{62})\\b"},{name:"Plivo - 1",regex:"(?:plivo).{0,40}\\b([A-Za-z0-9_-]{40})\\b"},{name:"Plivo - 2",regex:"(?:plivo).{0,40}\\b([A-Z]{20})\\b"},{name:"Poloniex - 1",regex:"(?:poloniex).{0,40}\\b([0-9a-f]{128})\\b"},{name:"Poloniex - 2",regex:"(?:poloniex).{0,40}\\b([0-9A-Z]{8}-[0-9A-Z]{8}-[0-9A-Z]{8}-[0-9A-Z]{8})\\b"},{name:"Polygon",regex:"(?:polygon).{0,40}\\b([a-z0-9A-Z]{32})\\b"},{name:"Positionstack",regex:"(?:positionstack).{0,40}\\b([a-zA-Z0-9_]{32})\\b"},{name:"Postageapp",regex:"(?:postageapp).{0,40}\\b([0-9A-Za-z]{32})\\b"},{name:"Posthog",regex:"\\b(phc_[a-zA-Z0-9_]{43})\\b"},{name:"Postman",regex:"\\b(PMAK-[a-zA-Z-0-9]{59})\\b"},{name:"Postmark",regex:"(?:postmark).{0,40}\\b([0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12})\\b"},{name:"Powrbot",regex:"(?:powrbot).{0,40}\\b([a-z0-9A-Z]{40})\\b"},{name:"Privatekey",regex:"-----\\s*?BEGIN[ A-Z0-9_-]*?PRIVATE KEY\\s*?-----[\\s\\S]*?----\\s*?END[ A-Z0-9_-]*? PRIVATE KEY\\s*?-----"},{name:"Prospectcrm",regex:"(?:prospect).{0,40}\\b([a-z0-9-]{32})\\b"},{name:"Prospectio",regex:"(?:prospect).{0,40}\\b([a-z0-9A-Z-]{50})\\b"},{name:"Protocolsio",regex:"(?:protocols).{0,40}\\b([a-z0-9]{64})\\b"},{name:"Proxycrawl",regex:"(?:proxycrawl).{0,40}\\b([a-zA-Z0-9_]{22})\\b"},{name:"Pubnubpublishkey - 1",regex:"\\b(sub-c-[0-9a-z]{8}-[a-z]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})\\b"},{name:"Pubnubpublishkey - 2",regex:"\\b(pub-c-[0-9a-z]{8}-[0-9a-z]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})\\b"},{name:"Purestake",regex:"(?:purestake).{0,40}\\b([a-zA-Z0-9]{40})\\b"},{name:"Pushbulletapikey",regex:"(?:pushbullet).{0,40}\\b([A-Za-z0-9_\\.]{34})\\b"},{name:"Pusherchannelkey - 1",regex:"(?:key).{0,40}\\b([a-z0-9]{20})\\b"},{name:"Pusherchannelkey - 2",regex:"(?:pusher).{0,40}\\b([a-z0-9]{20})\\b"},{name:"Pusherchannelkey - 3",regex:"(?:pusher).{0,40}\\b([0-9]{7})\\b"},{name:"PyPI upload token",regex:"pypi-AgEIcHlwaS5vcmc[A-Za-z0-9-_]{50,1000}"},{name:"Qualaroo",regex:"(?:qualaroo).{0,40}\\b([a-z0-9A-Z=]{64})"},{name:"Qubole",regex:"(?:qubole).{0,40}\\b([0-9a-z]{64})\\b"},{name:"Quickmetrics",regex:"(?:quickmetrics).{0,40}\\b([a-zA-Z0-9_-]{22})\\b"},{name:"REDIS_URL",regex:"(REDIS_URL).+"},{name:"RKCS8",regex:"-----BEGIN PRIVATE KEY-----"},{name:"RSA private key",regex:"-----BEGIN RSA PRIVATE KEY-----"},{name:"Rapidapi",regex:"(?:rapidapi).{0,40}\\b([A-Za-z0-9_-]{50})\\b"},{name:"Raven",regex:"(?:raven).{0,40}\\b([A-Z0-9-]{16})\\b"},{name:"Rawg",regex:"(?:rawg).{0,40}\\b([0-9Aa-z]{32})\\b"},{name:"Razorpay - 1",regex:"\\brzp_\\w{2,6}_\\w{10,20}\\b"},{name:"Readme",regex:"(?:readme).{0,40}\\b([a-zA-Z0-9_]{32})\\b"},{name:"Reallysimplesystems",regex:"\\b(ey[a-zA-Z0-9-._]{153}.ey[a-zA-Z0-9-._]{916,1000})\\b"},{name:"Rebrandly",regex:"(?:rebrandly).{0,40}\\b([a-zA-Z0-9_]{32})\\b"},{name:"Refiner",regex:"(?:refiner).{0,40}\\b([0-9Aa-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\\b"},{name:"Repairshopr - 1",regex:"(?:repairshopr).{0,40}\\b([a-zA-Z0-9_.!+$#^*]{3,32})\\b"},{name:"Repairshopr - 2",regex:"(?:repairshopr).{0,40}\\b([a-zA-Z0-9-]{51})\\b"},{name:"Restpack",regex:"(?:restpack).{0,40}\\b([a-zA-Z0-9]{48})\\b"},{name:"Restpackhtmltopdfapi",regex:"(?:restpack).{0,40}\\b([0-9A-Za-z]{48})\\b"},{name:"Rev - 1",regex:"(?:rev).{0,40}\\b([0-9a-zA-Z\\/\\+]{27}\\=[ \\r\\n]{1})"},{name:"Rev - 2",regex:"(?:rev).{0,40}\\b([0-9a-zA-Z\\-]{27}[ \\r\\n]{1})"},{name:"Revampcrm - 1",regex:"(?:revamp).{0,40}\\b([a-zA-Z0-9]{40}\\b)"},{name:"Revampcrm - 2",regex:"(?:revamp).{0,40}\\b([a-zA-Z0-9.-@]{25,30})\\b"},{name:"Ringcentral - 1",regex:"(?:ringcentral).{0,40}\\b(https://www.[0-9A-Za-z_-]{1,}.com)\\b"},{name:"Ringcentral - 2",regex:"(?:ringcentral).{0,40}\\b([0-9A-Za-z_-]{22})\\b"},{name:"Ritekit",regex:"(?:ritekit).{0,40}\\b([0-9a-f]{44})\\b"},{name:"Roaring",regex:"(?:roaring).{0,40}\\b([0-9A-Za-z_-]{28})\\b"},{name:"Rocketreach",regex:"(?:rocketreach).{0,40}\\b([a-z0-9-]{39})\\b"},{name:"Roninapp - 1",regex:"(?:ronin).{0,40}\\b([0-9Aa-zA-Z]{3,32})\\b"},{name:"Roninapp - 2",regex:"(?:ronin).{0,40}\\b([0-9a-zA-Z]{26})\\b"},{name:"Route4me",regex:"(?:route4me).{0,40}\\b([0-9A-Z]{32})\\b"},{name:"Rownd - 1",regex:"(?:rownd).{0,40}\\b([a-z0-9]{8}\\-[a-z0-9]{4}\\-[a-z0-9]{4}\\-[a-z0-9]{4}\\-[a-z0-9]{12})\\b"},{name:"Rownd - 2",regex:"(?:rownd).{0,40}\\b([a-z0-9]{48})\\b"},{name:"Rownd - 3",regex:"(?:rownd).{0,40}\\b([0-9]{18})\\b"},{name:"Rubygems",regex:"\\b(rubygems_[a-zA0-9]{48})\\b"},{name:"Runrunit - 1",regex:"(?:runrunit).{0,40}\\b([0-9a-f]{32})\\b"},{name:"Runrunit - 2",regex:"(?:runrunit).{0,40}\\b([0-9A-Za-z]{18,20})\\b"},{name:"SSH",regex:"-----BEGIN OPENSSH PRIVATE KEY-----"},{name:"SSH (DSA) private key",regex:"-----BEGIN DSA PRIVATE KEY-----"},{name:"Salesblink",regex:"(?:salesblink).{0,40}\\b([a-zA-Z]{16})\\b"},{name:"Salescookie",regex:"(?:salescookie).{0,40}\\b([a-zA-z0-9]{32})\\b"},{name:"Salesflare",regex:"(?:salesflare).{0,40}\\b([a-zA-Z0-9_]{45})\\b"},{name:"Satismeterprojectkey - 1",regex:"(?:satismeter).{0,40}\\b([a-zA-Z0-9]{4,20}@[a-zA-Z0-9]{2,12}.[a-zA-Z0-9]{2,12})\\b"},{name:"Satismeterprojectkey - 2",regex:"(?:satismeter).{0,40}\\b([a-zA-Z0-9]{24})\\b"},{name:"Satismeterprojectkey - 3",regex:"(?:satismeter).{0,40}\\b([a-zA-Z0-9!=@#$%^]{6,32})"},{name:"Satismeterwritekey",regex:"(?:satismeter).{0,40}\\b([a-z0-9A-Z]{16})\\b"},{name:"Saucelabs - 1",regex:"\\b(oauth\\-[a-z0-9]{8,}\\-[a-z0-9]{5})\\b"},{name:"Saucelabs - 2",regex:"(?:saucelabs).{0,40}\\b([a-z0-9]{8}\\-[a-z0-9]{4}\\-[a-z0-9]{4}\\-[a-z0-9]{4}\\-[a-z0-9]{12})\\b"},{name:"Scalewaykey",regex:"(?:scaleway).{0,40}\\b([0-9a-z]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[0-9a-z]{4}-[0-9a-z]{12})\\b"},{name:"Scrapeowl",regex:"(?:scrapeowl).{0,40}\\b([0-9a-z]{30})\\b"},{name:"Scraperapi",regex:"(?:scraperapi).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Scraperbox",regex:"(?:scraperbox).{0,40}\\b([A-Z0-9]{32})\\b"},{name:"Scrapersite",regex:"(?:scrapersite).{0,40}\\b([a-zA-Z0-9]{45})\\b"},{name:"Scrapestack",regex:"(?:scrapestack).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Scrapfly",regex:"(?:scrapfly).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Scrapingant",regex:"(?:scrapingant).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Scrapingbee",regex:"(?:scrapingbee).{0,40}\\b([A-Z0-9]{80})\\b"},{name:"Screenshotapi",regex:"(?:screenshotapi).{0,40}\\b([0-9A-Z]{7}\\-[0-9A-Z]{7}\\-[0-9A-Z]{7}\\-[0-9A-Z]{7})\\b"},{name:"Screenshotlayer",regex:"(?:screenshotlayer).{0,40}\\b([a-zA-Z0-9_]{32})\\b"},{name:"Securitytrails",regex:"(?:securitytrails).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Segmentapikey",regex:"(?:segment).{0,40}\\b([A-Za-z0-9_\\-a-zA-Z]{43}\\.[A-Za-z0-9_\\-a-zA-Z]{43})\\b"},{name:"Selectpdf",regex:"(?:selectpdf).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Semaphore",regex:"(?:semaphore).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Sendbird - 1",regex:"(?:sendbird).{0,40}\\b([0-9a-f]{40})\\b"},{name:"Sendbird - 2",regex:"(?:sendbird).{0,40}\\b([0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})\\b"},{name:"Sendbirdorganizationapi",regex:"(?:sendbird).{0,40}\\b([0-9a-f]{24})\\b"},{name:"Sendgrid",regex:"(SG\\.[\\w\\-_]{20,24}\\.[\\w\\-_]{39,50})\\b"},{name:"Sendinbluev2",regex:"\\b(xkeysib\\-[A-Za-z0-9_-]{81})\\b"},{name:"Sentiment - 1",regex:"(?:sentiment).{0,40}\\b([0-9]{17})\\b"},{name:"Sentiment - 2",regex:"(?:sentiment).{0,40}\\b([a-zA-Z0-9]{20})\\b"},{name:"Sentrytoken",regex:"(?:sentry).{0,40}\\b([a-f0-9]{64})\\b"},{name:"Serphouse",regex:"(?:serphouse).{0,40}\\b([0-9A-Za-z]{60})\\b"},{name:"Serpstack",regex:"(?:serpstack).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Sheety - 1",regex:"(?:sheety).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Sheety - 2",regex:"(?:sheety).{0,40}\\b([0-9a-z]{64})\\b"},{name:"Sherpadesk",regex:"(?:sherpadesk).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Shipday",regex:"(?:shipday).{0,40}\\b([a-zA-Z0-9.]{11}[a-zA-Z0-9]{20})\\b"},{name:"Shodankey",regex:"(?:shodan).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Shopify custom app access token",regex:"shpca_[a-fA-F0-9]{32}"},{name:"Shopify private app access token",regex:"shppa_[a-fA-F0-9]{32}"},{name:"Shopify shared secret",regex:"shpss_[a-fA-F0-9]{32}"},{name:"Shoppable Service Auth",regex:"data-shoppable-auth-token.+"},{name:"Shortcut",regex:"(?:shortcut).{0,40}\\b([0-9a-f-]{36})\\b"},{name:"Shotstack",regex:"(?:shotstack).{0,40}\\b([a-zA-Z0-9]{40})\\b"},{name:"Shutterstock - 1",regex:"(?:shutterstock).{0,40}\\b([0-9a-zA-Z]{32})\\b"},{name:"Shutterstock - 2",regex:"(?:shutterstock).{0,40}\\b([0-9a-zA-Z]{16})\\b"},{name:"Shutterstockoauth",regex:"(?:shutterstock).{0,40}\\b(v2/[0-9A-Za-z]{388})\\b"},{name:"Signalwire - 1",regex:"\\b([0-9a-z-]{3,64}.signalwire.com)\\b"},{name:"Signalwire - 2",regex:"(?:signalwire).{0,40}\\b([0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12})\\b"},{name:"Signalwire - 3",regex:"(?:signalwire).{0,40}\\b([0-9A-Za-z]{50})\\b"},{name:"Signaturit",regex:"(?:signaturit).{0,40}\\b([0-9A-Za-z]{86})\\b"},{name:"Signupgenius",regex:"(?:signupgenius).{0,40}\\b([0-9A-Za-z]{32})\\b"},{name:"Sigopt",regex:"(?:sigopt).{0,40}\\b([A-Z0-9]{48})\\b"},{name:"Simplesat",regex:"(?:simplesat).{0,40}\\b([a-z0-9]{40})"},{name:"Simplynoted",regex:"(?:simplynoted).{0,40}\\b([a-zA-Z0-9\\S]{340,360})\\b"},{name:"Simvoly",regex:"(?:simvoly).{0,40}\\b([a-z0-9]{33})\\b"},{name:"Sinchmessage",regex:"(?:sinch).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Sirv - 1",regex:"(?:sirv).{0,40}\\b([a-zA-Z0-9\\S]{88})"},{name:"Sirv - 2",regex:"(?:sirv).{0,40}\\b([a-zA-Z0-9]{26})\\b"},{name:"Siteleaf",regex:"(?:siteleaf).{0,40}\\b([0-9Aa-z]{32})\\b"},{name:"Skrappio",regex:"(?:skrapp).{0,40}\\b([a-z0-9A-Z]{42})\\b"},{name:"Skybiometry",regex:"(?:skybiometry).{0,40}\\b([0-9a-z]{25,26})\\b"},{name:"Slack",regex:"xox[baprs]-[0-9a-zA-Z-]{10,72}"},{name:"Slack Token",regex:"(xox[pborsa]-[0-9]{12}-[0-9]{12}-[0-9]{12}-[a-z0-9]{32})"},{name:"Slack User token",regex:"xoxp-[0-9A-Za-z\\-]{72}"},{name:"Slack Webhook",regex:"https://hooks.slack.com/services/T[a-zA-Z0-9_]{8,10}/B[a-zA-Z0-9_]{8,12}/[a-zA-Z0-9_]{23,24}"},{name:"Slack access token",regex:"xoxb-[0-9A-Za-z\\-]{51}"},{name:"Slackwebhook",regex:"(https:\\/\\/hooks.slack.com\\/services\\/[A-Za-z0-9+\\/]{44,46})"},{name:"Smartsheets",regex:"(?:smartsheets).{0,40}\\b([a-zA-Z0-9]{37})\\b"},{name:"Smartystreets - 1",regex:"(?:smartystreets).{0,40}\\b([a-zA-Z0-9]{20})\\b"},{name:"Smartystreets - 2",regex:"(?:smartystreets).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Smooch - 1",regex:"(?:smooch).{0,40}\\b(act_[0-9a-z]{24})\\b"},{name:"Smooch - 2",regex:"(?:smooch).{0,40}\\b([0-9a-zA-Z_-]{86})\\b"},{name:"Snipcart",regex:"(?:snipcart).{0,40}\\b([0-9A-Za-z_]{75})\\b"},{name:"Snykkey",regex:"(?:snyk).{0,40}\\b([0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12})\\b"},{name:"SonarQube Token",regex:"sonar.{0,50}(?:\"|'|`)?[0-9a-f]{40}(?:\"|'|`)?"},{name:"Splunkobservabilitytoken",regex:"(?:splunk).{0,40}\\b([a-z0-9A-Z]{22})\\b"},{name:"Spoonacular",regex:"(?:spoonacular).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Sportsmonk",regex:"(?:sportsmonk).{0,40}\\b([0-9a-zA-Z]{60})\\b"},{name:"Square",regex:"(?:square).{0,40}(EAAA[a-zA-Z0-9\\-\\+\\=]{60})"},{name:"Square API Key",regex:"sq0(atp|csp)-[0-9a-z-_]{22,43}"},{name:"Squareapp - 1",regex:"[\\w\\-]*sq0i[a-z]{2}-[0-9A-Za-z\\-_]{22,43}"},{name:"Squareapp - 2",regex:"[\\w\\-]*sq0c[a-z]{2}-[0-9A-Za-z\\-_]{40,50}"},{name:"Squarespace",regex:"(?:squarespace).{0,40}\\b([0-9Aa-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\\b"},{name:"Squareup",regex:"\\b(sq0idp-[0-9A-Za-z]{22})\\b"},{name:"Sslmate",regex:"(?:sslmate).{0,40}\\b([a-zA-Z0-9]{36})\\b"},{name:"Stitchdata",regex:"(?:stitchdata).{0,40}\\b([0-9a-z_]{35})\\b"},{name:"Stockdata",regex:"(?:stockdata).{0,40}\\b([0-9A-Za-z]{40})\\b"},{name:"Storecove",regex:"(?:storecove).{0,40}\\b([a-zA-Z0-9_-]{43})\\b"},{name:"Stormglass",regex:"(?:stormglass).{0,40}\\b([0-9Aa-z-]{73})\\b"},{name:"Storyblok",regex:"(?:storyblok).{0,40}\\b([0-9A-Za-z]{22}t{2})\\b"},{name:"Storychief",regex:"(?:storychief).{0,40}\\b([a-zA-Z0-9_\\-.]{940,1000})"},{name:"Strava - 1",regex:"(?:strava).{0,40}\\b([0-9]{5})\\b"},{name:"Strava - 2",regex:"(?:strava).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Streak",regex:"(?:streak).{0,40}\\b([0-9Aa-f]{32})\\b"},{name:"Stripe",regex:"[rs]k_live_[a-zA-Z0-9]{20,30}"},{name:"Stripe API Key - 1",regex:"sk_live_[0-9a-zA-Z]{24}"},{name:"Stripe API key - 2",regex:"stripe[sr]k_live_[0-9a-zA-Z]{24}"},{name:"Stripe API key - 3",regex:"stripe[sk|rk]_live_[0-9a-zA-Z]{24}"},{name:"Stripe Public Live Key",regex:"pk_live_[0-9a-z]{24}"},{name:"Stripe Public Test Key",regex:"pk_test_[0-9a-z]{24}"},{name:"Stripe Restriced Key",regex:"rk_(?:live|test)_[0-9a-zA-Z]{24}"},{name:"Stripe Restricted API Key",regex:"rk_live_[0-9a-zA-Z]{24}"},{name:"Stripe Secret Key",regex:"sk_(?:live|test)_[0-9a-zA-Z]{24}"},{name:"Stripe Secret Live Key",regex:"(sk|rk)_live_[0-9a-z]{24}"},{name:"Stripe Secret Test Key",regex:"(sk|rk)_test_[0-9a-z]{24}"},{name:"Stytch - 1",regex:"(?:stytch).{0,40}\\b([a-zA-Z0-9-_]{47}=)"},{name:"Stytch - 2",regex:"(?:stytch).{0,40}\\b([a-z0-9-]{49})\\b"},{name:"Sugester - 1",regex:"(?:sugester).{0,40}\\b([a-zA-Z0-9_.!+$#^*%]{3,32})\\b"},{name:"Sugester - 2",regex:"(?:sugester).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Sumologickey - 1",regex:"(?:sumo).{0,40}\\b([A-Za-z0-9]{14})\\b"},{name:"Sumologickey - 2",regex:"(?:sumo).{0,40}\\b([A-Za-z0-9]{64})\\b"},{name:"Supernotesapi",regex:"(?:supernotes).{0,40}([ \\r\\n]{0,1}[0-9A-Za-z\\-_]{43}[ \\r\\n]{1})"},{name:"Surveyanyplace - 1",regex:"(?:survey).{0,40}\\b([a-z0-9A-Z-]{36})\\b"},{name:"Surveyanyplace - 2",regex:"(?:survey).{0,40}\\b([a-z0-9A-Z]{32})\\b"},{name:"Surveybot",regex:"(?:surveybot).{0,40}\\b([A-Za-z0-9-]{80})\\b"},{name:"Surveysparrow",regex:"(?:surveysparrow).{0,40}\\b([a-zA-Z0-9-_]{88})\\b"},{name:"Survicate",regex:"(?:survicate).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Swell - 1",regex:"(?:swell).{0,40}\\b([a-zA-Z0-9]{6,24})\\b"},{name:"Swell - 2",regex:"(?:swell).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Swiftype",regex:"(?:swiftype).{0,40}\\b([a-zA-z-0-9]{6}\\_[a-zA-z-0-9]{6}\\-[a-zA-z-0-9]{6})\\b"},{name:"Tallyfy",regex:"(?:tallyfy).{0,40}\\b([0-9A-Za-z]{36}\\.[0-9A-Za-z]{264}\\.[0-9A-Za-z\\-\\_]{683})\\b"},{name:"Tatumio",regex:"(?:tatum).{0,40}\\b([0-9a-z-]{36})\\b"},{name:"Taxjar",regex:"(?:taxjar).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Teamgate - 1",regex:"(?:teamgate).{0,40}\\b([a-z0-9]{40})\\b"},{name:"Teamgate - 2",regex:"(?:teamgate).{0,40}\\b([a-zA-Z0-9]{80})\\b"},{name:"Teamworkcrm",regex:"(?:teamwork|teamworkcrm).{0,40}\\b(tkn\\.v1_[0-9A-Za-z]{71}=[ \\r\\n]{1})"},{name:"Teamworkdesk",regex:"(?:teamwork|teamworkdesk).{0,40}\\b(tkn\\.v1_[0-9A-Za-z]{71}=[ \\r\\n]{1})"},{name:"Teamworkspaces",regex:"(?:teamwork|teamworkspaces).{0,40}\\b(tkn\\.v1_[0-9A-Za-z]{71}=[ \\r\\n]{1})"},{name:"Technicalanalysisapi",regex:"(?:technicalanalysisapi).{0,40}\\b([A-Z0-9]{48})\\b"},{name:"Telegram Bot API Key",regex:"[0-9]+:AA[0-9A-Za-z\\-_]{33}"},{name:"Telegram Secret",regex:"d{5,}:A[0-9a-z_-]{34,34}"},{name:"Telegrambottoken",regex:"(?:telegram).{0,40}\\b([0-9]{8,10}:[a-zA-Z0-9_-]{35})\\b"},{name:"Telnyx",regex:"(?:telnyx).{0,40}\\b(KEY[0-9A-Za-z_-]{55})\\b"},{name:"Terraformcloudpersonaltoken",regex:"\\b([A-Za-z0-9]{14}.atlasv1.[A-Za-z0-9]{67})\\b"},{name:"Text2data",regex:"(?:text2data).{0,40}\\b([0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})\\b"},{name:"Textmagic - 1",regex:"(?:textmagic).{0,40}\\b([0-9A-Za-z]{30})\\b"},{name:"Textmagic - 2",regex:"(?:textmagic).{0,40}\\b([0-9A-Za-z]{1,25})\\b"},{name:"Theoddsapi",regex:"(?:theoddsapi|the-odds-api).{0,40}\\b([0-9a-f]{32})\\b"},{name:"Thinkific - 1",regex:"(?:thinkific).{0,40}\\b([0-9a-f]{32})\\b"},{name:"Thinkific - 2",regex:"(?:thinkific).{0,40}\\b([0-9A-Za-z]{4,40})\\b"},{name:"Thousandeyes - 1",regex:"(?:thousandeyes).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Thousandeyes - 2",regex:"(?:thousandeyes).{0,40}\\b([a-zA-Z0-9]{3,20}@[a-zA-Z0-9]{2,12}.[a-zA-Z0-9]{2,5})\\b"},{name:"Ticketmaster",regex:"(?:ticketmaster).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Tiingo",regex:"(?:tiingo).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Timezoneapi",regex:"(?:timezoneapi).{0,40}\\b([a-zA-Z0-9]{20})\\b"},{name:"Tly",regex:"(?:tly).{0,40}\\b([0-9A-Za-z]{60})\\b"},{name:"Tmetric",regex:"(?:tmetric).{0,40}\\b([0-9A-Z]{64})\\b"},{name:"Todoist",regex:"(?:todoist).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Toggltrack",regex:"(?:toggl).{0,40}\\b([0-9Aa-z]{32})\\b"},{name:"Tomorrowio",regex:"(?:tomorrow).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Tomtom",regex:"(?:tomtom).{0,40}\\b([0-9Aa-zA-Z]{32})\\b"},{name:"Tradier",regex:"(?:tradier).{0,40}\\b([a-zA-Z0-9]{28})\\b"},{name:"Travelpayouts",regex:"(?:travelpayouts).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Travisci",regex:"(?:travis).{0,40}\\b([a-zA-Z0-9A-Z_]{22})\\b"},{name:"Trello URL",regex:"https://trello.com/b/[0-9a-z]/[0-9a-z_-]+"},{name:"Trelloapikey - 2",regex:"(?:trello).{0,40}\\b([a-zA-Z-0-9]{32})\\b"},{name:"Twelvedata",regex:"(?:twelvedata).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Twilio - 1",regex:"\\bAC[0-9a-f]{32}\\b"},{name:"Twilio API Key",regex:"SK[0-9a-fA-F]{32}"},{name:"Twitter Access Token",regex:"[tT][wW][iI][tT][tT][eE][rR].*[1-9][0-9]+-[0-9a-zA-Z]{40}"},{name:"Twitter Client ID",regex:"twitter[0-9a-z]{18,25}"},{name:"Twitter OAuth",regex:`[tT][wW][iI][tT][tT][eE][rR].*['|"][0-9a-zA-Z]{35,44}['|"]`},{name:"Twitter Secret Key",regex:"twitter[0-9a-z]{35,44}"},{name:"Tyntec",regex:"(?:tyntec).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Typeform",regex:"(?:typeform).{0,40}\\b([0-9A-Za-z]{44})\\b"},{name:"Ubidots",regex:"\\b(BBFF-[0-9a-zA-Z]{30})\\b"},{name:"Unifyid",regex:"(?:unify).{0,40}\\b([0-9A-Za-z_=-]{44})"},{name:"Unplugg",regex:"(?:unplu).{0,40}\\b([a-z0-9]{64})\\b"},{name:"Unsplash",regex:"(?:unsplash).{0,40}\\b([0-9A-Za-z_]{43})\\b"},{name:"Upcdatabase",regex:"(?:upcdatabase).{0,40}\\b([A-Z0-9]{32})\\b"},{name:"Uplead",regex:"(?:uplead).{0,40}\\b([a-z0-9-]{32})\\b"},{name:"Uploadcare",regex:"(?:uploadcare).{0,40}\\b([a-z0-9]{20})\\b"},{name:"Upwave",regex:"(?:upwave).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Uri",regex:"\\b[a-zA-Z]{1,10}:?\\/\\/[-.%\\w{}]{1,50}:([-.%\\S]{3,50})@[-.%\\w\\/:]+\\b"},{name:"Urlscan",regex:"(?:urlscan).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Userstack",regex:"(?:userstack).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Vatlayer",regex:"(?:vatlayer).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Vercel",regex:"(?:vercel).{0,40}\\b([a-zA-Z0-9]{24})\\b"},{name:"Verifier - 1",regex:"(?:verifier).{0,40}\\b([a-zA-Z-0-9-]{5,16}\\@[a-zA-Z-0-9]{4,16}\\.[a-zA-Z-0-9]{3,6})\\b"},{name:"Verifier - 2",regex:"(?:verifier).{0,40}\\b([a-z0-9]{96})\\b"},{name:"Verimail",regex:"(?:verimail).{0,40}\\b([A-Z0-9]{32})\\b"},{name:"Veriphone",regex:"(?:veriphone).{0,40}\\b([0-9A-Z]{32})\\b"},{name:"Versioneye",regex:"(?:versioneye).{0,40}\\b([a-zA-Z0-9-]{40})\\b"},{name:"Viewneo",regex:"(?:viewneo).{0,40}\\b([a-z0-9A-Z]{120,300}.[a-z0-9A-Z]{150,300}.[a-z0-9A-Z-_]{600,800})"},{name:"Virustotal",regex:"(?:virustotal).{0,40}\\b([a-f0-9]{64})\\b"},{name:"Visualcrossing",regex:"(?:visualcrossing).{0,40}\\b([0-9A-Z]{25})\\b"},{name:"Voicegain",regex:"(?:voicegain).{0,40}\\b(ey[0-9a-zA-Z_-]{34}.ey[0-9a-zA-Z_-]{108}.[0-9a-zA-Z_-]{43})\\b"},{name:"Vouchery - 1",regex:"(?:vouchery).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Vouchery - 2",regex:"(?:vouchery).{0,40}\\b([a-zA-Z0-9-\\S]{2,20})\\b"},{name:"Vpnapi",regex:"(?:vpnapi).{0,40}\\b([a-z0-9A-Z]{32})\\b"},{name:"Vultrapikey",regex:"(?:vultr).{0,40} \\b([A-Z0-9]{36})\\b"},{name:"Vyte",regex:"(?:vyte).{0,40}\\b([0-9a-z]{50})\\b"},{name:"Walkscore",regex:"(?:walkscore).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Weatherbit",regex:"(?:weatherbit).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Weatherstack",regex:"(?:weatherstack).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Webex - 1",regex:"(?:error).{0,40}(redirect_uri_mismatch)"},{name:"Webex - 2",regex:"(?:webex).{0,40}\\b([A-Za-z0-9_-]{65})\\b"},{name:"Webex - 3",regex:"(?:webex).{0,40}\\b([A-Za-z0-9_-]{64})\\b"},{name:"Webflow",regex:"(?:webflow).{0,40}\\b([a-zA0-9]{64})\\b"},{name:"Webscraper",regex:"(?:webscraper).{0,40}\\b([a-zA-Z0-9]{60})\\b"},{name:"Webscraping",regex:"(?:webscraping).{0,40}\\b([0-9A-Za-z]{32})\\b"},{name:"Wepay - 2",regex:"(?:wepay).{0,40}\\b([a-zA-Z0-9_?]{62})\\b"},{name:"Whoxy",regex:"(?:whoxy).{0,40}\\b([0-9a-z]{33})\\b"},{name:"Worksnaps",regex:"(?:worksnaps).{0,40}\\b([0-9A-Za-z]{40})\\b"},{name:"Workstack",regex:"(?:workstack).{0,40}\\b([0-9Aa-zA-Z]{60})\\b"},{name:"Worldcoinindex",regex:"(?:worldcoinindex).{0,40}\\b([a-zA-Z0-9]{35})\\b"},{name:"Worldweather",regex:"(?:worldweather).{0,40}\\b([0-9a-z]{31})\\b"},{name:"Wrike",regex:"(?:wrike).{0,40}\\b(ey[a-zA-Z0-9-._]{333})\\b"},{name:"Yandex",regex:"(?:yandex).{0,40}\\b([a-z0-9A-Z.]{83})\\b"},{name:"Youneedabudget",regex:"(?:youneedabudget).{0,40}\\b([0-9a-f]{64})\\b"},{name:"Yousign",regex:"(?:yousign).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Youtubeapikey - 1",regex:"(?:youtube).{0,40}\\b([a-zA-Z-0-9_]{39})\\b"},{name:"Zapier Webhook",regex:"https://(?:www.)?hooks\\.zapier\\.com/hooks/catch/[A-Za-z0-9]+/[A-Za-z0-9]+/"},{name:"Zapierwebhook",regex:"(https:\\/\\/hooks.zapier.com\\/hooks\\/catch\\/[A-Za-z0-9\\/]{16})"},{name:"Zendeskapi - 3",regex:"(?:zendesk).{0,40}([A-Za-z0-9_-]{40})"},{name:"Zenkitapi",regex:"(?:zenkit).{0,40}\\b([0-9a-z]{8}\\-[0-9A-Za-z]{32})\\b"},{name:"Zenscrape",regex:"(?:zenscrape).{0,40}\\b([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\\b"},{name:"Zenserp",regex:"(?:zenserp).{0,40}\\b([0-9a-z-]{36})\\b"},{name:"Zeplin",regex:"(?:zeplin).{0,40}\\b([a-zA-Z0-9-.]{350,400})\\b"},{name:"Zerobounce",regex:"(?:zerobounce).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Zipapi - 1",regex:"(?:zipapi).{0,40}\\b([a-zA-Z0-9!=@#$%^]{7,})"},{name:"Zipapi - 3",regex:"(?:zipapi).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Zipcodeapi",regex:"(?:zipcodeapi).{0,40}\\b([a-zA-Z0-9]{64})\\b"},{name:"Zoho Webhook",regex:"https://creator\\.zoho\\.com/api/[A-Za-z0-9/\\-_\\.]+\\?authtoken=[A-Za-z0-9]+"},{name:"Zonkafeedback",regex:"(?:zonka).{0,40}\\b([A-Za-z0-9]{36})\\b"},{name:"access_key_secret",regex:"access[_-]?key[_-]?secret(=| =|:| :)"},{name:"access_secret",regex:"access[_-]?secret(=| =|:| :)"},{name:"access_token",regex:"access[_-]?token(=| =|:| :)"},{name:"account_sid",regex:"account[_-]?sid(=| =|:| :)"},{name:"admin_email",regex:"admin[_-]?email(=| =|:| :)"},{name:"adzerk_api_key",regex:"adzerk[_-]?api[_-]?key(=| =|:| :)"},{name:"algolia_admin_key_1",regex:"algolia[_-]?admin[_-]?key[_-]?1(=| =|:| :)"},{name:"algolia_admin_key_2",regex:"algolia[_-]?admin[_-]?key[_-]?2(=| =|:| :)"},{name:"algolia_admin_key_mcm",regex:"algolia[_-]?admin[_-]?key[_-]?mcm(=| =|:| :)"},{name:"algolia_api_key",regex:"algolia[_-]?api[_-]?key(=| =|:| :)"},{name:"algolia_api_key_mcm",regex:"algolia[_-]?api[_-]?key[_-]?mcm(=| =|:| :)"},{name:"algolia_api_key_search",regex:"algolia[_-]?api[_-]?key[_-]?search(=| =|:| :)"},{name:"algolia_search_api_key",regex:"algolia[_-]?search[_-]?api[_-]?key(=| =|:| :)"},{name:"algolia_search_key",regex:"algolia[_-]?search[_-]?key(=| =|:| :)"},{name:"algolia_search_key_1",regex:"algolia[_-]?search[_-]?key[_-]?1(=| =|:| :)"},{name:"alias_pass",regex:"alias[_-]?pass(=| =|:| :)"},{name:"alicloud_access_key",regex:"alicloud[_-]?access[_-]?key(=| =|:| :)"},{name:"alicloud_secret_key",regex:"alicloud[_-]?secret[_-]?key(=| =|:| :)"},{name:"amazon_bucket_name",regex:"amazon[_-]?bucket[_-]?name(=| =|:| :)"},{name:"amazon_secret_access_key",regex:"amazon[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"anaconda_token",regex:"anaconda[_-]?token(=| =|:| :)"},{name:"android_docs_deploy_token",regex:"android[_-]?docs[_-]?deploy[_-]?token(=| =|:| :)"},{name:"ansible_vault_password",regex:"ansible[_-]?vault[_-]?password(=| =|:| :)"},{name:"aos_key",regex:"aos[_-]?key(=| =|:| :)"},{name:"aos_sec",regex:"aos[_-]?sec(=| =|:| :)"},{name:"api_key",regex:"api[_-]?key(=| =|:| :)"},{name:"api_key_secret",regex:"api[_-]?key[_-]?secret(=| =|:| :)"},{name:"api_key_sid",regex:"api[_-]?key[_-]?sid(=| =|:| :)"},{name:"api_secret",regex:"api[_-]?secret(=| =|:| :)"},{name:"apiary_api_key",regex:"apiary[_-]?api[_-]?key(=| =|:| :)"},{name:"apigw_access_token",regex:"apigw[_-]?access[_-]?token(=| =|:| :)"},{name:"apikey_patterns",regex:`apikey[:](?:['"]?[a-zA-Z0-9-_|]+['"]?)`},{name:"app_bucket_perm",regex:"app[_-]?bucket[_-]?perm(=| =|:| :)"},{name:"app_report_token_key",regex:"app[_-]?report[_-]?token[_-]?key(=| =|:| :)"},{name:"app_secrete",regex:"app[_-]?secrete(=| =|:| :)"},{name:"app_token",regex:"app[_-]?token(=| =|:| :)"},{name:"appclientsecret",regex:"appclientsecret(=| =|:| :)"},{name:"apple_id_password",regex:"apple[_-]?id[_-]?password(=| =|:| :)"},{name:"argos_token",regex:"argos[_-]?token(=| =|:| :)"},{name:"artifactory",regex:`(artifactory.{0,50}("|')?[a-zA-Z0-9=]{112}("|')?)`},{name:"artifactory_key",regex:"artifactory[_-]?key(=| =|:| :)"},{name:"artifacts_aws_access_key_id",regex:"artifacts[_-]?aws[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"artifacts_aws_secret_access_key",regex:"artifacts[_-]?aws[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"artifacts_bucket",regex:"artifacts[_-]?bucket(=| =|:| :)"},{name:"artifacts_key",regex:"artifacts[_-]?key(=| =|:| :)"},{name:"artifacts_secret",regex:"artifacts[_-]?secret(=| =|:| :)"},{name:"assistant_iam_apikey",regex:"assistant[_-]?iam[_-]?apikey(=| =|:| :)"},{name:"auth0_api_clientsecret",regex:"auth0[_-]?api[_-]?clientsecret(=| =|:| :)"},{name:"auth0_client_secret",regex:"auth0[_-]?client[_-]?secret(=| =|:| :)"},{name:"auth_token",regex:"auth[_-]?token(=| =|:| :)"},{name:"author_email_addr",regex:"author[_-]?email[_-]?addr(=| =|:| :)"},{name:"author_npm_api_key",regex:"author[_-]?npm[_-]?api[_-]?key(=| =|:| :)"},{name:"aws_access",regex:"aws[_-]?access(=| =|:| :)"},{name:"aws_access_key",regex:"aws[_-]?access[_-]?key(=| =|:| :)"},{name:"aws_access_key_id - 1",regex:"aws[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"aws_config_accesskeyid",regex:"aws[_-]?config[_-]?accesskeyid(=| =|:| :)"},{name:"aws_config_secretaccesskey",regex:"aws[_-]?config[_-]?secretaccesskey(=| =|:| :)"},{name:"aws_key",regex:"aws[_-]?key(=| =|:| :)"},{name:"aws_patterns",regex:"(?:accesskeyid|secretaccesskey|aws_access_key_id|aws_secret_access_key)"},{name:"aws_secret",regex:"aws[_-]?secret(=| =|:| :)"},{name:"aws_secret_access_key",regex:"aws[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"aws_secret_key",regex:"aws[_-]?secret[_-]?key(=| =|:| :)"},{name:"aws_secrets",regex:"aws[_-]?secrets(=| =|:| :)"},{name:"aws_ses_access_key_id",regex:"aws[_-]?ses[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"aws_ses_secret_access_key",regex:"aws[_-]?ses[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"awsaccesskeyid",regex:"awsaccesskeyid(=| =|:| :)"},{name:"awscn_access_key_id",regex:"awscn[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"awscn_secret_access_key",regex:"awscn[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"awssecretkey",regex:"awssecretkey(=| =|:| :)"},{name:"b2_app_key",regex:"b2[_-]?app[_-]?key(=| =|:| :)"},{name:"b2_bucket",regex:"b2[_-]?bucket(=| =|:| :)"},{name:"bintray_api_key",regex:"bintray[_-]?api[_-]?key(=| =|:| :)"},{name:"bintray_apikey",regex:"bintray[_-]?apikey(=| =|:| :)"},{name:"bintray_gpg_password",regex:"bintray[_-]?gpg[_-]?password(=| =|:| :)"},{name:"bintray_key",regex:"bintray[_-]?key(=| =|:| :)"},{name:"bintray_token",regex:"bintray[_-]?token(=| =|:| :)"},{name:"bintraykey",regex:"bintraykey(=| =|:| :)"},{name:"bluemix_api_key",regex:"bluemix[_-]?api[_-]?key(=| =|:| :)"},{name:"bluemix_auth",regex:"bluemix[_-]?auth(=| =|:| :)"},{name:"bluemix_pass",regex:"bluemix[_-]?pass(=| =|:| :)"},{name:"bluemix_pass_prod",regex:"bluemix[_-]?pass[_-]?prod(=| =|:| :)"},{name:"bluemix_password",regex:"bluemix[_-]?password(=| =|:| :)"},{name:"bluemix_pwd",regex:"bluemix[_-]?pwd(=| =|:| :)"},{name:"bluemix_username",regex:"bluemix[_-]?username(=| =|:| :)"},{name:"brackets_repo_oauth_token",regex:"brackets[_-]?repo[_-]?oauth[_-]?token(=| =|:| :)"},{name:"browser_stack_access_key",regex:"browser[_-]?stack[_-]?access[_-]?key(=| =|:| :)"},{name:"browserstack_access_key",regex:"browserstack[_-]?access[_-]?key(=| =|:| :)"},{name:"bucketeer_aws_access_key_id",regex:"bucketeer[_-]?aws[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"bucketeer_aws_secret_access_key",regex:"bucketeer[_-]?aws[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"built_branch_deploy_key",regex:"built[_-]?branch[_-]?deploy[_-]?key(=| =|:| :)"},{name:"bundlesize_github_token",regex:"bundlesize[_-]?github[_-]?token(=| =|:| :)"},{name:"bx_password",regex:"bx[_-]?password(=| =|:| :)"},{name:"bx_username",regex:"bx[_-]?username(=| =|:| :)"},{name:"cache_s3_secret_key",regex:"cache[_-]?s3[_-]?secret[_-]?key(=| =|:| :)"},{name:"cargo_token",regex:"cargo[_-]?token(=| =|:| :)"},{name:"cattle_access_key",regex:"cattle[_-]?access[_-]?key(=| =|:| :)"},{name:"cattle_agent_instance_auth",regex:"cattle[_-]?agent[_-]?instance[_-]?auth(=| =|:| :)"},{name:"cattle_secret_key",regex:"cattle[_-]?secret[_-]?key(=| =|:| :)"},{name:"censys_secret",regex:"censys[_-]?secret(=| =|:| :)"},{name:"certificate_password",regex:"certificate[_-]?password(=| =|:| :)"},{name:"cf_password",regex:"cf[_-]?password(=| =|:| :)"},{name:"cheverny_token",regex:"cheverny[_-]?token(=| =|:| :)"},{name:"chrome_client_secret",regex:"chrome[_-]?client[_-]?secret(=| =|:| :)"},{name:"chrome_refresh_token",regex:"chrome[_-]?refresh[_-]?token(=| =|:| :)"},{name:"ci_deploy_password",regex:"ci[_-]?deploy[_-]?password(=| =|:| :)"},{name:"ci_project_url",regex:"ci[_-]?project[_-]?url(=| =|:| :)"},{name:"ci_registry_user",regex:"ci[_-]?registry[_-]?user(=| =|:| :)"},{name:"ci_server_name",regex:"ci[_-]?server[_-]?name(=| =|:| :)"},{name:"ci_user_token",regex:"ci[_-]?user[_-]?token(=| =|:| :)"},{name:"claimr_database",regex:"claimr[_-]?database(=| =|:| :)"},{name:"claimr_db",regex:"claimr[_-]?db(=| =|:| :)"},{name:"claimr_superuser",regex:"claimr[_-]?superuser(=| =|:| :)"},{name:"claimr_token",regex:"claimr[_-]?token(=| =|:| :)"},{name:"cli_e2e_cma_token",regex:"cli[_-]?e2e[_-]?cma[_-]?token(=| =|:| :)"},{name:"client_secret",regex:"client[_-]?secret(=| =|:| :)"},{name:"clojars_password",regex:"clojars[_-]?password(=| =|:| :)"},{name:"cloud_api_key",regex:"cloud[_-]?api[_-]?key(=| =|:| :)"},{name:"cloudant_archived_database",regex:"cloudant[_-]?archived[_-]?database(=| =|:| :)"},{name:"cloudant_audited_database",regex:"cloudant[_-]?audited[_-]?database(=| =|:| :)"},{name:"cloudant_database",regex:"cloudant[_-]?database(=| =|:| :)"},{name:"cloudant_instance",regex:"cloudant[_-]?instance(=| =|:| :)"},{name:"cloudant_order_database",regex:"cloudant[_-]?order[_-]?database(=| =|:| :)"},{name:"cloudant_parsed_database",regex:"cloudant[_-]?parsed[_-]?database(=| =|:| :)"},{name:"cloudant_password",regex:"cloudant[_-]?password(=| =|:| :)"},{name:"cloudant_processed_database",regex:"cloudant[_-]?processed[_-]?database(=| =|:| :)"},{name:"cloudant_service_database",regex:"cloudant[_-]?service[_-]?database(=| =|:| :)"},{name:"cloudflare_api_key",regex:"cloudflare[_-]?api[_-]?key(=| =|:| :)"},{name:"cloudflare_auth_email",regex:"cloudflare[_-]?auth[_-]?email(=| =|:| :)"},{name:"cloudflare_auth_key",regex:"cloudflare[_-]?auth[_-]?key(=| =|:| :)"},{name:"cloudflare_email",regex:"cloudflare[_-]?email(=| =|:| :)"},{name:"cloudinary_url",regex:"cloudinary[_-]?url(=| =|:| :)"},{name:"cloudinary_url_staging",regex:"cloudinary[_-]?url[_-]?staging(=| =|:| :)"},{name:"clu_repo_url",regex:"clu[_-]?repo[_-]?url(=| =|:| :)"},{name:"clu_ssh_private_key_base64",regex:"clu[_-]?ssh[_-]?private[_-]?key[_-]?base64(=| =|:| :)"},{name:"cn_access_key_id",regex:"cn[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"cn_secret_access_key",regex:"cn[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"cocoapods_trunk_email",regex:"cocoapods[_-]?trunk[_-]?email(=| =|:| :)"},{name:"cocoapods_trunk_token",regex:"cocoapods[_-]?trunk[_-]?token(=| =|:| :)"},{name:"codacy_project_token",regex:"codacy[_-]?project[_-]?token(=| =|:| :)"},{name:"codeclimate",regex:`(codeclima.{0,50}("|')?[0-9a-f]{64}("|')?)`},{name:"codeclimate_repo_token",regex:"codeclimate[_-]?repo[_-]?token(=| =|:| :)"},{name:"codecov_token",regex:"codecov[_-]?token(=| =|:| :)"},{name:"coding_token",regex:"coding[_-]?token(=| =|:| :)"},{name:"conekta_apikey",regex:"conekta[_-]?apikey(=| =|:| :)"},{name:"consumer_key",regex:"consumer[_-]?key(=| =|:| :)"},{name:"consumerkey",regex:"consumerkey(=| =|:| :)"},{name:"contentful_access_token",regex:"contentful[_-]?access[_-]?token(=| =|:| :)"},{name:"contentful_cma_test_token",regex:"contentful[_-]?cma[_-]?test[_-]?token(=| =|:| :)"},{name:"contentful_integration_management_token",regex:"contentful[_-]?integration[_-]?management[_-]?token(=| =|:| :)"},{name:"contentful_php_management_test_token",regex:"contentful[_-]?php[_-]?management[_-]?test[_-]?token(=| =|:| :)"},{name:"contentful_test_org_cma_token",regex:"contentful[_-]?test[_-]?org[_-]?cma[_-]?token(=| =|:| :)"},{name:"contentful_v2_access_token",regex:"contentful[_-]?v2[_-]?access[_-]?token(=| =|:| :)"},{name:"conversation_password",regex:"conversation[_-]?password(=| =|:| :)"},{name:"conversation_username",regex:"conversation[_-]?username(=| =|:| :)"},{name:"cos_secrets",regex:"cos[_-]?secrets(=| =|:| :)"},{name:"coveralls_api_token",regex:"coveralls[_-]?api[_-]?token(=| =|:| :)"},{name:"coveralls_repo_token",regex:"coveralls[_-]?repo[_-]?token(=| =|:| :)"},{name:"coveralls_token",regex:"coveralls[_-]?token(=| =|:| :)"},{name:"coverity_scan_token",regex:"coverity[_-]?scan[_-]?token(=| =|:| :)"},{name:"cypress_record_key",regex:"cypress[_-]?record[_-]?key(=| =|:| :)"},{name:"danger_github_api_token",regex:"danger[_-]?github[_-]?api[_-]?token(=| =|:| :)"},{name:"database_host",regex:"database[_-]?host(=| =|:| :)"},{name:"database_name",regex:"database[_-]?name(=| =|:| :)"},{name:"database_password",regex:"database[_-]?password(=| =|:| :)"},{name:"database_port",regex:"database[_-]?port(=| =|:| :)"},{name:"database_user",regex:"database[_-]?user(=| =|:| :)"},{name:"database_username",regex:"database[_-]?username(=| =|:| :)"},{name:"datadog_api_key",regex:"datadog[_-]?api[_-]?key(=| =|:| :)"},{name:"datadog_app_key",regex:"datadog[_-]?app[_-]?key(=| =|:| :)"},{name:"db_connection",regex:"db[_-]?connection(=| =|:| :)"},{name:"db_database",regex:"db[_-]?database(=| =|:| :)"},{name:"db_host",regex:"db[_-]?host(=| =|:| :)"},{name:"db_password",regex:"db[_-]?password(=| =|:| :)"},{name:"db_pw",regex:"db[_-]?pw(=| =|:| :)"},{name:"db_user",regex:"db[_-]?user(=| =|:| :)"},{name:"db_username",regex:"db[_-]?username(=| =|:| :)"},{name:"ddg_test_email",regex:"ddg[_-]?test[_-]?email(=| =|:| :)"},{name:"ddg_test_email_pw",regex:"ddg[_-]?test[_-]?email[_-]?pw(=| =|:| :)"},{name:"ddgc_github_token",regex:"ddgc[_-]?github[_-]?token(=| =|:| :)"},{name:"deploy_password",regex:"deploy[_-]?password(=| =|:| :)"},{name:"deploy_secure",regex:"deploy[_-]?secure(=| =|:| :)"},{name:"deploy_token",regex:"deploy[_-]?token(=| =|:| :)"},{name:"deploy_user",regex:"deploy[_-]?user(=| =|:| :)"},{name:"dgpg_passphrase",regex:"dgpg[_-]?passphrase(=| =|:| :)"},{name:"digitalocean_access_token",regex:"digitalocean[_-]?access[_-]?token(=| =|:| :)"},{name:"digitalocean_ssh_key_body",regex:"digitalocean[_-]?ssh[_-]?key[_-]?body(=| =|:| :)"},{name:"digitalocean_ssh_key_ids",regex:"digitalocean[_-]?ssh[_-]?key[_-]?ids(=| =|:| :)"},{name:"docker_hub_password",regex:"docker[_-]?hub[_-]?password(=| =|:| :)"},{name:"docker_key",regex:"docker[_-]?key(=| =|:| :)"},{name:"docker_pass",regex:"docker[_-]?pass(=| =|:| :)"},{name:"docker_passwd",regex:"docker[_-]?passwd(=| =|:| :)"},{name:"docker_password",regex:"docker[_-]?password(=| =|:| :)"},{name:"docker_postgres_url",regex:"docker[_-]?postgres[_-]?url(=| =|:| :)"},{name:"docker_token",regex:"docker[_-]?token(=| =|:| :)"},{name:"dockerhub_password",regex:"dockerhub[_-]?password(=| =|:| :)"},{name:"dockerhubpassword",regex:"dockerhubpassword(=| =|:| :)"},{name:"doordash_auth_token",regex:"doordash[_-]?auth[_-]?token(=| =|:| :)"},{name:"dropbox_oauth_bearer",regex:"dropbox[_-]?oauth[_-]?bearer(=| =|:| :)"},{name:"droplet_travis_password",regex:"droplet[_-]?travis[_-]?password(=| =|:| :)"},{name:"dsonar_login",regex:"dsonar[_-]?login(=| =|:| :)"},{name:"dsonar_projectkey",regex:"dsonar[_-]?projectkey(=| =|:| :)"},{name:"elastic_cloud_auth",regex:"elastic[_-]?cloud[_-]?auth(=| =|:| :)"},{name:"elasticsearch_password",regex:"elasticsearch[_-]?password(=| =|:| :)"},{name:"encryption_password",regex:"encryption[_-]?password(=| =|:| :)"},{name:"end_user_password",regex:"end[_-]?user[_-]?password(=| =|:| :)"},{name:"env_github_oauth_token",regex:"env[_-]?github[_-]?oauth[_-]?token(=| =|:| :)"},{name:"env_heroku_api_key",regex:"env[_-]?heroku[_-]?api[_-]?key(=| =|:| :)"},{name:"env_key",regex:"env[_-]?key(=| =|:| :)"},{name:"env_secret",regex:"env[_-]?secret(=| =|:| :)"},{name:"env_secret_access_key",regex:"env[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"env_sonatype_password",regex:"env[_-]?sonatype[_-]?password(=| =|:| :)"},{name:"eureka_awssecretkey",regex:"eureka[_-]?awssecretkey(=| =|:| :)"},{name:"exp_password",regex:"exp[_-]?password(=| =|:| :)"},{name:"facebook_access_token",regex:"(EAACEdEose0cBA[0-9A-Za-z]+)"},{name:"facebook_oauth",regex:`[f|F][a|A][c|C][e|E][b|B][o|O][o|O][k|K].*['|"][0-9a-f]{32}['|"]`},{name:"file_password",regex:"file[_-]?password(=| =|:| :)"},{name:"firebase_api_json",regex:"firebase[_-]?api[_-]?json(=| =|:| :)"},{name:"firebase_api_token",regex:"firebase[_-]?api[_-]?token(=| =|:| :)"},{name:"firebase_key",regex:"firebase[_-]?key(=| =|:| :)"},{name:"firebase_project_develop",regex:"firebase[_-]?project[_-]?develop(=| =|:| :)"},{name:"firebase_token",regex:"firebase[_-]?token(=| =|:| :)"},{name:"firefox_secret",regex:"firefox[_-]?secret(=| =|:| :)"},{name:"flask_secret_key",regex:"flask[_-]?secret[_-]?key(=| =|:| :)"},{name:"flickr_api_key",regex:"flickr[_-]?api[_-]?key(=| =|:| :)"},{name:"flickr_api_secret",regex:"flickr[_-]?api[_-]?secret(=| =|:| :)"},{name:"fossa_api_key",regex:"fossa[_-]?api[_-]?key(=| =|:| :)"},{name:"ftp_host",regex:"ftp[_-]?host(=| =|:| :)"},{name:"ftp_login",regex:"ftp[_-]?login(=| =|:| :)"},{name:"ftp_password",regex:"ftp[_-]?password(=| =|:| :)"},{name:"ftp_pw",regex:"ftp[_-]?pw(=| =|:| :)"},{name:"ftp_user",regex:"ftp[_-]?user(=| =|:| :)"},{name:"ftp_username",regex:"ftp[_-]?username(=| =|:| :)"},{name:"gcloud_bucket",regex:"gcloud[_-]?bucket(=| =|:| :)"},{name:"gcloud_project",regex:"gcloud[_-]?project(=| =|:| :)"},{name:"gcloud_service_key",regex:"gcloud[_-]?service[_-]?key(=| =|:| :)"},{name:"gcr_password",regex:"gcr[_-]?password(=| =|:| :)"},{name:"gcs_bucket",regex:"gcs[_-]?bucket(=| =|:| :)"},{name:"gh_api_key",regex:"gh[_-]?api[_-]?key(=| =|:| :)"},{name:"gh_email",regex:"gh[_-]?email(=| =|:| :)"},{name:"gh_next_oauth_client_secret",regex:"gh[_-]?next[_-]?oauth[_-]?client[_-]?secret(=| =|:| :)"},{name:"gh_next_unstable_oauth_client_id",regex:"gh[_-]?next[_-]?unstable[_-]?oauth[_-]?client[_-]?id(=| =|:| :)"},{name:"gh_next_unstable_oauth_client_secret",regex:"gh[_-]?next[_-]?unstable[_-]?oauth[_-]?client[_-]?secret(=| =|:| :)"},{name:"gh_oauth_client_secret",regex:"gh[_-]?oauth[_-]?client[_-]?secret(=| =|:| :)"},{name:"gh_oauth_token",regex:"gh[_-]?oauth[_-]?token(=| =|:| :)"},{name:"gh_repo_token",regex:"gh[_-]?repo[_-]?token(=| =|:| :)"},{name:"gh_token",regex:"gh[_-]?token(=| =|:| :)"},{name:"gh_unstable_oauth_client_secret",regex:"gh[_-]?unstable[_-]?oauth[_-]?client[_-]?secret(=| =|:| :)"},{name:"ghb_token",regex:"ghb[_-]?token(=| =|:| :)"},{name:"ghost_api_key",regex:"ghost[_-]?api[_-]?key(=| =|:| :)"},{name:"git_author_email",regex:"git[_-]?author[_-]?email(=| =|:| :)"},{name:"git_author_name",regex:"git[_-]?author[_-]?name(=| =|:| :)"},{name:"git_committer_email",regex:"git[_-]?committer[_-]?email(=| =|:| :)"},{name:"git_committer_name",regex:"git[_-]?committer[_-]?name(=| =|:| :)"},{name:"git_email",regex:"git[_-]?email(=| =|:| :)"},{name:"git_name",regex:"git[_-]?name(=| =|:| :)"},{name:"git_token",regex:"git[_-]?token(=| =|:| :)"},{name:"github_access_token - 1",regex:"github[_-]?access[_-]?token(=| =|:| :)"},{name:"github_access_token - 2",regex:"[a-zA-Z0-9_-]*:[a-zA-Z0-9_-]+@github.com*"},{name:"github_api_key",regex:"github[_-]?api[_-]?key(=| =|:| :)"},{name:"github_api_token",regex:"github[_-]?api[_-]?token(=| =|:| :)"},{name:"github_auth",regex:"github[_-]?auth(=| =|:| :)"},{name:"github_auth_token",regex:"github[_-]?auth[_-]?token(=| =|:| :)"},{name:"github_client_secret",regex:"github[_-]?client[_-]?secret(=| =|:| :)"},{name:"github_deploy_hb_doc_pass",regex:"github[_-]?deploy[_-]?hb[_-]?doc[_-]?pass(=| =|:| :)"},{name:"github_deployment_token",regex:"github[_-]?deployment[_-]?token(=| =|:| :)"},{name:"github_hunter_token",regex:"github[_-]?hunter[_-]?token(=| =|:| :)"},{name:"github_hunter_username",regex:"github[_-]?hunter[_-]?username(=| =|:| :)"},{name:"github_key",regex:"github[_-]?key(=| =|:| :)"},{name:"github_oauth",regex:"github[_-]?oauth(=| =|:| :)"},{name:"github_oauth_token",regex:"github[_-]?oauth[_-]?token(=| =|:| :)"},{name:"github_password",regex:"github[_-]?password(=| =|:| :)"},{name:"github_pwd",regex:"github[_-]?pwd(=| =|:| :)"},{name:"github_release_token",regex:"github[_-]?release[_-]?token(=| =|:| :)"},{name:"github_repo",regex:"github[_-]?repo(=| =|:| :)"},{name:"github_token",regex:"github[_-]?token(=| =|:| :)"},{name:"github_tokens",regex:"github[_-]?tokens(=| =|:| :)"},{name:"gitlab_user_email",regex:"gitlab[_-]?user[_-]?email(=| =|:| :)"},{name:"gogs_password",regex:"gogs[_-]?password(=| =|:| :)"},{name:"google_account_type",regex:"google[_-]?account[_-]?type(=| =|:| :)"},{name:"google_client_email",regex:"google[_-]?client[_-]?email(=| =|:| :)"},{name:"google_client_id",regex:"google[_-]?client[_-]?id(=| =|:| :)"},{name:"google_client_secret",regex:"google[_-]?client[_-]?secret(=| =|:| :)"},{name:"google_maps_api_key",regex:"google[_-]?maps[_-]?api[_-]?key(=| =|:| :)"},{name:"google_oauth",regex:"(ya29.[0-9A-Za-z-_]+)"},{name:"google_patterns",regex:"(?:google_client_id|google_client_secret|google_client_token)"},{name:"google_private_key",regex:"google[_-]?private[_-]?key(=| =|:| :)"},{name:"google_url",regex:"([0-9]{12}-[a-z0-9]{32}.apps.googleusercontent.com)"},{name:"gpg_key_name",regex:"gpg[_-]?key[_-]?name(=| =|:| :)"},{name:"gpg_keyname",regex:"gpg[_-]?keyname(=| =|:| :)"},{name:"gpg_ownertrust",regex:"gpg[_-]?ownertrust(=| =|:| :)"},{name:"gpg_passphrase",regex:"gpg[_-]?passphrase(=| =|:| :)"},{name:"gpg_private_key",regex:"gpg[_-]?private[_-]?key(=| =|:| :)"},{name:"gpg_secret_keys",regex:"gpg[_-]?secret[_-]?keys(=| =|:| :)"},{name:"gradle_publish_key",regex:"gradle[_-]?publish[_-]?key(=| =|:| :)"},{name:"gradle_publish_secret",regex:"gradle[_-]?publish[_-]?secret(=| =|:| :)"},{name:"gradle_signing_key_id",regex:"gradle[_-]?signing[_-]?key[_-]?id(=| =|:| :)"},{name:"gradle_signing_password",regex:"gradle[_-]?signing[_-]?password(=| =|:| :)"},{name:"gren_github_token",regex:"gren[_-]?github[_-]?token(=| =|:| :)"},{name:"grgit_user",regex:"grgit[_-]?user(=| =|:| :)"},{name:"hab_auth_token",regex:"hab[_-]?auth[_-]?token(=| =|:| :)"},{name:"hab_key",regex:"hab[_-]?key(=| =|:| :)"},{name:"hb_codesign_gpg_pass",regex:"hb[_-]?codesign[_-]?gpg[_-]?pass(=| =|:| :)"},{name:"hb_codesign_key_pass",regex:"hb[_-]?codesign[_-]?key[_-]?pass(=| =|:| :)"},{name:"heroku_api_key",regex:"heroku[_-]?api[_-]?key(=| =|:| :)"},{name:"heroku_api_key_api_key",regex:"([h|H][e|E][r|R][o|O][k|K][u|U].{0,30}[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})"},{name:"heroku_email",regex:"heroku[_-]?email(=| =|:| :)"},{name:"heroku_token",regex:"heroku[_-]?token(=| =|:| :)"},{name:"hockeyapp",regex:`hockey.{0,50}("|')?[0-9a-f]{32}("|')?`},{name:"hockeyapp_token",regex:"hockeyapp[_-]?token(=| =|:| :)"},{name:"homebrew_github_api_token",regex:"homebrew[_-]?github[_-]?api[_-]?token(=| =|:| :)"},{name:"hub_dxia2_password",regex:"hub[_-]?dxia2[_-]?password(=| =|:| :)"},{name:"ij_repo_password",regex:"ij[_-]?repo[_-]?password(=| =|:| :)"},{name:"ij_repo_username",regex:"ij[_-]?repo[_-]?username(=| =|:| :)"},{name:"index_name",regex:"index[_-]?name(=| =|:| :)"},{name:"integration_test_api_key",regex:"integration[_-]?test[_-]?api[_-]?key(=| =|:| :)"},{name:"integration_test_appid",regex:"integration[_-]?test[_-]?appid(=| =|:| :)"},{name:"internal_secrets",regex:"internal[_-]?secrets(=| =|:| :)"},{name:"ios_docs_deploy_token",regex:"ios[_-]?docs[_-]?deploy[_-]?token(=| =|:| :)"},{name:"itest_gh_token",regex:"itest[_-]?gh[_-]?token(=| =|:| :)"},{name:"jdbc",regex:"mysql: jdbc:mysql(=| =|:| :)"},{name:"jdbc_databaseurl",regex:"jdbc[_-]?databaseurl(=| =|:| :)"},{name:"jdbc_host",regex:"jdbc[_-]?host(=| =|:| :)"},{name:"jwt_secret",regex:"jwt[_-]?secret(=| =|:| :)"},{name:"kafka_admin_url",regex:"kafka[_-]?admin[_-]?url(=| =|:| :)"},{name:"kafka_instance_name",regex:"kafka[_-]?instance[_-]?name(=| =|:| :)"},{name:"kafka_rest_url",regex:"kafka[_-]?rest[_-]?url(=| =|:| :)"},{name:"keystore_pass",regex:"keystore[_-]?pass(=| =|:| :)"},{name:"kovan_private_key",regex:"kovan[_-]?private[_-]?key(=| =|:| :)"},{name:"kubecfg_s3_path",regex:"kubecfg[_-]?s3[_-]?path(=| =|:| :)"},{name:"kubeconfig",regex:"kubeconfig(=| =|:| :)"},{name:"kxoltsn3vogdop92m",regex:"kxoltsn3vogdop92m(=| =|:| :)"},{name:"leanplum_key",regex:"leanplum[_-]?key(=| =|:| :)"},{name:"lektor_deploy_password",regex:"lektor[_-]?deploy[_-]?password(=| =|:| :)"},{name:"lektor_deploy_username",regex:"lektor[_-]?deploy[_-]?username(=| =|:| :)"},{name:"lighthouse_api_key",regex:"lighthouse[_-]?api[_-]?key(=| =|:| :)"},{name:"linux_signing_key",regex:"linux[_-]?signing[_-]?key(=| =|:| :)"},{name:"ll_publish_url",regex:"ll[_-]?publish[_-]?url(=| =|:| :)"},{name:"ll_shared_key",regex:"ll[_-]?shared[_-]?key(=| =|:| :)"},{name:"looker_test_runner_client_secret",regex:"looker[_-]?test[_-]?runner[_-]?client[_-]?secret(=| =|:| :)"},{name:"lottie_happo_api_key",regex:"lottie[_-]?happo[_-]?api[_-]?key(=| =|:| :)"},{name:"lottie_happo_secret_key",regex:"lottie[_-]?happo[_-]?secret[_-]?key(=| =|:| :)"},{name:"lottie_s3_secret_key",regex:"lottie[_-]?s3[_-]?secret[_-]?key(=| =|:| :)"},{name:"lottie_upload_cert_key_password",regex:"lottie[_-]?upload[_-]?cert[_-]?key[_-]?password(=| =|:| :)"},{name:"lottie_upload_cert_key_store_password",regex:"lottie[_-]?upload[_-]?cert[_-]?key[_-]?store[_-]?password(=| =|:| :)"},{name:"magento_auth_password",regex:"magento[_-]?auth[_-]?password(=| =|:| :)"},{name:"magento_auth_username",regex:"magento[_-]?auth[_-]?username (=| =|:| :)"},{name:"magento_password",regex:"magento[_-]?password(=| =|:| :)"},{name:"mail_password",regex:"mail[_-]?password(=| =|:| :)"},{name:"mailchimp",regex:"(W(?:[a-f0-9]{32}(-us[0-9]{1,2}))a-zA-Z0-9)"},{name:"mailchimp_api_key",regex:"mailchimp[_-]?api[_-]?key(=| =|:| :)"},{name:"mailchimp_key",regex:"mailchimp[_-]?key(=| =|:| :)"},{name:"mailer_password",regex:"mailer[_-]?password(=| =|:| :)"},{name:"mailgun",regex:"(key-[0-9a-f]{32})"},{name:"mailgun_api_key",regex:"mailgun[_-]?api[_-]?key(=| =|:| :)"},{name:"mailgun_apikey",regex:"mailgun[_-]?apikey(=| =|:| :)"},{name:"mailgun_password",regex:"mailgun[_-]?password(=| =|:| :)"},{name:"mailgun_priv_key",regex:"mailgun[_-]?priv[_-]?key(=| =|:| :)"},{name:"mailgun_pub_apikey",regex:"mailgun[_-]?pub[_-]?apikey(=| =|:| :)"},{name:"mailgun_pub_key",regex:"mailgun[_-]?pub[_-]?key(=| =|:| :)"},{name:"mailgun_secret_api_key",regex:"mailgun[_-]?secret[_-]?api[_-]?key(=| =|:| :)"},{name:"manage_key",regex:"manage[_-]?key(=| =|:| :)"},{name:"manage_secret",regex:"manage[_-]?secret(=| =|:| :)"},{name:"management_token",regex:"management[_-]?token(=| =|:| :)"},{name:"managementapiaccesstoken",regex:"managementapiaccesstoken(=| =|:| :)"},{name:"mandrill_api_key",regex:"mandrill[_-]?api[_-]?key(=| =|:| :)"},{name:"manifest_app_token",regex:"manifest[_-]?app[_-]?token(=| =|:| :)"},{name:"manifest_app_url",regex:"manifest[_-]?app[_-]?url(=| =|:| :)"},{name:"mapbox_access_token",regex:"mapbox[_-]?access[_-]?token(=| =|:| :)"},{name:"mapbox_api_token",regex:"mapbox[_-]?api[_-]?token(=| =|:| :)"},{name:"mapbox_aws_access_key_id",regex:"mapbox[_-]?aws[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"mapbox_aws_secret_access_key",regex:"mapbox[_-]?aws[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"mapboxaccesstoken",regex:"mapboxaccesstoken(=| =|:| :)"},{name:"master_password",regex:"(master_password).+"},{name:"mg_api_key",regex:"mg[_-]?api[_-]?key(=| =|:| :)"},{name:"mg_public_api_key",regex:"mg[_-]?public[_-]?api[_-]?key(=| =|:| :)"},{name:"mh_apikey",regex:"mh[_-]?apikey(=| =|:| :)"},{name:"mh_password",regex:"mh[_-]?password(=| =|:| :)"},{name:"mile_zero_key",regex:"mile[_-]?zero[_-]?key(=| =|:| :)"},{name:"minio_access_key",regex:"minio[_-]?access[_-]?key(=| =|:| :)"},{name:"minio_secret_key",regex:"minio[_-]?secret[_-]?key(=| =|:| :)"},{name:"multi_bob_sid",regex:"multi[_-]?bob[_-]?sid(=| =|:| :)"},{name:"multi_connect_sid",regex:"multi[_-]?connect[_-]?sid(=| =|:| :)"},{name:"multi_disconnect_sid",regex:"multi[_-]?disconnect[_-]?sid(=| =|:| :)"},{name:"multi_workflow_sid",regex:"multi[_-]?workflow[_-]?sid(=| =|:| :)"},{name:"multi_workspace_sid",regex:"multi[_-]?workspace[_-]?sid(=| =|:| :)"},{name:"my_secret_env",regex:"my[_-]?secret[_-]?env(=| =|:| :)"},{name:"mysql_database",regex:"mysql[_-]?database(=| =|:| :)"},{name:"mysql_hostname",regex:"mysql[_-]?hostname(=| =|:| :)"},{name:"mysql_password",regex:"mysql[_-]?password(=| =|:| :)"},{name:"mysql_root_password",regex:"mysql[_-]?root[_-]?password(=| =|:| :)"},{name:"mysql_user",regex:"mysql[_-]?user(=| =|:| :)"},{name:"mysql_username",regex:"mysql[_-]?username(=| =|:| :)"},{name:"mysqlmasteruser",regex:"mysqlmasteruser(=| =|:| :)"},{name:"mysqlsecret",regex:"mysqlsecret(=| =|:| :)"},{name:"nativeevents",regex:"nativeevents(=| =|:| :)"},{name:"netlify_api_key",regex:"netlify[_-]?api[_-]?key(=| =|:| :)"},{name:"new_relic_beta_token",regex:"new[_-]?relic[_-]?beta[_-]?token(=| =|:| :)"},{name:"nexus_password",regex:"nexus[_-]?password(=| =|:| :)"},{name:"nexuspassword",regex:"nexuspassword(=| =|:| :)"},{name:"ngrok_auth_token",regex:"ngrok[_-]?auth[_-]?token(=| =|:| :)"},{name:"ngrok_token",regex:"ngrok[_-]?token(=| =|:| :)"},{name:"node_env",regex:"node[_-]?env(=| =|:| :)"},{name:"node_pre_gyp_accesskeyid",regex:"node[_-]?pre[_-]?gyp[_-]?accesskeyid(=| =|:| :)"},{name:"node_pre_gyp_github_token",regex:"node[_-]?pre[_-]?gyp[_-]?github[_-]?token(=| =|:| :)"},{name:"node_pre_gyp_secretaccesskey",regex:"node[_-]?pre[_-]?gyp[_-]?secretaccesskey(=| =|:| :)"},{name:"non_token",regex:"non[_-]?token(=| =|:| :)"},{name:"now_token",regex:"now[_-]?token(=| =|:| :)"},{name:"npm_api_key",regex:"npm[_-]?api[_-]?key(=| =|:| :)"},{name:"npm_api_token",regex:"npm[_-]?api[_-]?token(=| =|:| :)"},{name:"npm_auth_token",regex:"npm[_-]?auth[_-]?token(=| =|:| :)"},{name:"npm_email",regex:"npm[_-]?email(=| =|:| :)"},{name:"npm_password",regex:"npm[_-]?password(=| =|:| :)"},{name:"npm_secret_key",regex:"npm[_-]?secret[_-]?key(=| =|:| :)"},{name:"npm_token - 1",regex:"npm[_-]?token(=| =|:| :)"},{name:"nuget_api_key - 1",regex:"(oy2[a-z0-9]{43})"},{name:"nuget_api_key - 2",regex:"nuget[_-]?api[_-]?key(=| =|:| :)"},{name:"numbers_service_pass",regex:"numbers[_-]?service[_-]?pass(=| =|:| :)"},{name:"oauth_token",regex:"oauth[_-]?token(=| =|:| :)"},{name:"object_storage_password",regex:"object[_-]?storage[_-]?password(=| =|:| :)"},{name:"object_storage_region_name",regex:"object[_-]?storage[_-]?region[_-]?name(=| =|:| :)"},{name:"object_store_bucket",regex:"object[_-]?store[_-]?bucket(=| =|:| :)"},{name:"object_store_creds",regex:"object[_-]?store[_-]?creds(=| =|:| :)"},{name:"oc_pass",regex:"oc[_-]?pass(=| =|:| :)"},{name:"octest_app_password",regex:"octest[_-]?app[_-]?password(=| =|:| :)"},{name:"octest_app_username",regex:"octest[_-]?app[_-]?username(=| =|:| :)"},{name:"octest_password",regex:"octest[_-]?password(=| =|:| :)"},{name:"ofta_key",regex:"ofta[_-]?key(=| =|:| :)"},{name:"ofta_region",regex:"ofta[_-]?region(=| =|:| :)"},{name:"ofta_secret",regex:"ofta[_-]?secret(=| =|:| :)"},{name:"okta_client_token",regex:"okta[_-]?client[_-]?token(=| =|:| :)"},{name:"okta_oauth2_client_secret",regex:"okta[_-]?oauth2[_-]?client[_-]?secret(=| =|:| :)"},{name:"okta_oauth2_clientsecret",regex:"okta[_-]?oauth2[_-]?clientsecret(=| =|:| :)"},{name:"omise_key",regex:"omise[_-]?key(=| =|:| :)"},{name:"omise_pkey",regex:"omise[_-]?pkey(=| =|:| :)"},{name:"omise_pubkey",regex:"omise[_-]?pubkey(=| =|:| :)"},{name:"omise_skey",regex:"omise[_-]?skey(=| =|:| :)"},{name:"onesignal_api_key",regex:"onesignal[_-]?api[_-]?key(=| =|:| :)"},{name:"onesignal_user_auth_key",regex:"onesignal[_-]?user[_-]?auth[_-]?key(=| =|:| :)"},{name:"open_whisk_key",regex:"open[_-]?whisk[_-]?key(=| =|:| :)"},{name:"openwhisk_key",regex:"openwhisk[_-]?key(=| =|:| :)"},{name:"os_auth_url",regex:"os[_-]?auth[_-]?url(=| =|:| :)"},{name:"os_password",regex:"os[_-]?password(=| =|:| :)"},{name:"ossrh_jira_password",regex:"ossrh[_-]?jira[_-]?password(=| =|:| :)"},{name:"ossrh_pass",regex:"ossrh[_-]?pass(=| =|:| :)"},{name:"ossrh_password",regex:"ossrh[_-]?password(=| =|:| :)"},{name:"ossrh_secret",regex:"ossrh[_-]?secret(=| =|:| :)"},{name:"ossrh_username",regex:"ossrh[_-]?username(=| =|:| :)"},{name:"outlook_team",regex:"(https://outlook.office.com/webhook/[0-9a-f-]{36}@)"},{name:"packagecloud_token",regex:"packagecloud[_-]?token(=| =|:| :)"},{name:"pagerduty_apikey",regex:"pagerduty[_-]?apikey(=| =|:| :)"},{name:"parse_js_key",regex:"parse[_-]?js[_-]?key(=| =|:| :)"},{name:"passwordtravis",regex:"passwordtravis(=| =|:| :)"},{name:"paypal_braintree_access_token",regex:"(access_token$production$[0-9a-z]{16}$[0-9a-f]{32})"},{name:"paypal_client_secret",regex:"paypal[_-]?client[_-]?secret(=| =|:| :)"},{name:"percy_project",regex:"percy[_-]?project(=| =|:| :)"},{name:"percy_token",regex:"percy[_-]?token(=| =|:| :)"},{name:"personal_key",regex:"personal[_-]?key(=| =|:| :)"},{name:"personal_secret",regex:"personal[_-]?secret(=| =|:| :)"},{name:"pg_database",regex:"pg[_-]?database(=| =|:| :)"},{name:"pg_host",regex:"pg[_-]?host(=| =|:| :)"},{name:"places_api_key",regex:"places[_-]?api[_-]?key(=| =|:| :)"},{name:"places_apikey",regex:"places[_-]?apikey(=| =|:| :)"},{name:"plotly_apikey",regex:"plotly[_-]?apikey(=| =|:| :)"},{name:"plugin_password",regex:"plugin[_-]?password(=| =|:| :)"},{name:"postgres_env_postgres_db",regex:"postgres[_-]?env[_-]?postgres[_-]?db(=| =|:| :)"},{name:"postgres_env_postgres_password",regex:"postgres[_-]?env[_-]?postgres[_-]?password(=| =|:| :)"},{name:"postgresql_db",regex:"postgresql[_-]?db(=| =|:| :)"},{name:"postgresql_pass",regex:"postgresql[_-]?pass(=| =|:| :)"},{name:"prebuild_auth",regex:"prebuild[_-]?auth(=| =|:| :)"},{name:"preferred_username",regex:"preferred[_-]?username(=| =|:| :)"},{name:"pring_mail_username",regex:"pring[_-]?mail[_-]?username(=| =|:| :)"},{name:"private_key",regex:"-----(?:(?:BEGIN|END) )(?:(?:EC|PGP|DSA|RSA|OPENSSH).)?PRIVATE.KEY(.BLOCK)?-----"},{name:"private_signing_password",regex:"private[_-]?signing[_-]?password(=| =|:| :)"},{name:"prod_access_key_id",regex:"prod[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"prod_password",regex:"prod[_-]?password(=| =|:| :)"},{name:"prod_secret_key",regex:"prod[_-]?secret[_-]?key(=| =|:| :)"},{name:"project_config",regex:"project[_-]?config(=| =|:| :)"},{name:"publish_access",regex:"publish[_-]?access(=| =|:| :)"},{name:"publish_key",regex:"publish[_-]?key(=| =|:| :)"},{name:"publish_secret",regex:"publish[_-]?secret(=| =|:| :)"},{name:"pushover_token",regex:"pushover[_-]?token(=| =|:| :)"},{name:"pypi_passowrd",regex:"pypi[_-]?passowrd(=| =|:| :)"},{name:"qiita_token",regex:"qiita[_-]?token(=| =|:| :)"},{name:"quip_token",regex:"quip[_-]?token(=| =|:| :)"},{name:"rabbitmq_password",regex:"rabbitmq[_-]?password(=| =|:| :)"},{name:"randrmusicapiaccesstoken",regex:"randrmusicapiaccesstoken(=| =|:| :)"},{name:"redis_stunnel_urls",regex:"redis[_-]?stunnel[_-]?urls(=| =|:| :)"},{name:"rediscloud_url",regex:"rediscloud[_-]?url(=| =|:| :)"},{name:"refresh_token",regex:"refresh[_-]?token(=| =|:| :)"},{name:"registry_pass",regex:"registry[_-]?pass(=| =|:| :)"},{name:"registry_secure",regex:"registry[_-]?secure(=| =|:| :)"},{name:"release_gh_token",regex:"release[_-]?gh[_-]?token(=| =|:| :)"},{name:"release_token",regex:"release[_-]?token(=| =|:| :)"},{name:"reporting_webdav_pwd",regex:"reporting[_-]?webdav[_-]?pwd(=| =|:| :)"},{name:"reporting_webdav_url",regex:"reporting[_-]?webdav[_-]?url(=| =|:| :)"},{name:"repotoken",regex:"repotoken(=| =|:| :)"},{name:"rest_api_key",regex:"rest[_-]?api[_-]?key(=| =|:| :)"},{name:"rinkeby_private_key",regex:"rinkeby[_-]?private[_-]?key(=| =|:| :)"},{name:"ropsten_private_key",regex:"ropsten[_-]?private[_-]?key(=| =|:| :)"},{name:"route53_access_key_id",regex:"route53[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"rtd_key_pass",regex:"rtd[_-]?key[_-]?pass(=| =|:| :)"},{name:"rtd_store_pass",regex:"rtd[_-]?store[_-]?pass(=| =|:| :)"},{name:"rubygems_auth_token",regex:"rubygems[_-]?auth[_-]?token(=| =|:| :)"},{name:"s3_access_key",regex:"s3[_-]?access[_-]?key(=| =|:| :)"},{name:"s3_access_key_id",regex:"s3[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"s3_bucket_name_app_logs",regex:"s3[_-]?bucket[_-]?name[_-]?app[_-]?logs(=| =|:| :)"},{name:"s3_bucket_name_assets",regex:"s3[_-]?bucket[_-]?name[_-]?assets(=| =|:| :)"},{name:"s3_external_3_amazonaws_com",regex:"s3[_-]?external[_-]?3[_-]?amazonaws[_-]?com(=| =|:| :)"},{name:"s3_key",regex:"s3[_-]?key(=| =|:| :)"},{name:"s3_key_app_logs",regex:"s3[_-]?key[_-]?app[_-]?logs(=| =|:| :)"},{name:"s3_key_assets",regex:"s3[_-]?key[_-]?assets(=| =|:| :)"},{name:"s3_secret_app_logs",regex:"s3[_-]?secret[_-]?app[_-]?logs(=| =|:| :)"},{name:"s3_secret_assets",regex:"s3[_-]?secret[_-]?assets(=| =|:| :)"},{name:"s3_secret_key",regex:"s3[_-]?secret[_-]?key(=| =|:| :)"},{name:"s3_user_secret",regex:"s3[_-]?user[_-]?secret(=| =|:| :)"},{name:"sacloud_access_token",regex:"sacloud[_-]?access[_-]?token(=| =|:| :)"},{name:"sacloud_access_token_secret",regex:"sacloud[_-]?access[_-]?token[_-]?secret(=| =|:| :)"},{name:"sacloud_api",regex:"sacloud[_-]?api(=| =|:| :)"},{name:"salesforce_bulk_test_password",regex:"salesforce[_-]?bulk[_-]?test[_-]?password(=| =|:| :)"},{name:"salesforce_bulk_test_security_token",regex:"salesforce[_-]?bulk[_-]?test[_-]?security[_-]?token(=| =|:| :)"},{name:"sandbox_access_token",regex:"sandbox[_-]?access[_-]?token(=| =|:| :)"},{name:"sandbox_aws_access_key_id",regex:"sandbox[_-]?aws[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"sandbox_aws_secret_access_key",regex:"sandbox[_-]?aws[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"sauce_access_key",regex:"sauce[_-]?access[_-]?key(=| =|:| :)"},{name:"sauce_token",regex:`(sauce.{0,50}("|')?[0-9a-f-]{36}("|')?)`},{name:"scrutinizer_token",regex:"scrutinizer[_-]?token(=| =|:| :)"},{name:"sdr_token",regex:"sdr[_-]?token(=| =|:| :)"},{name:"secret_0",regex:"secret[_-]?0(=| =|:| :)"},{name:"secret_1",regex:"secret[_-]?1(=| =|:| :)"},{name:"secret_10",regex:"secret[_-]?10(=| =|:| :)"},{name:"secret_11",regex:"secret[_-]?11(=| =|:| :)"},{name:"secret_2",regex:"secret[_-]?2(=| =|:| :)"},{name:"secret_3",regex:"secret[_-]?3(=| =|:| :)"},{name:"secret_4",regex:"secret[_-]?4(=| =|:| :)"},{name:"secret_5",regex:"secret[_-]?5(=| =|:| :)"},{name:"secret_6",regex:"secret[_-]?6(=| =|:| :)"},{name:"secret_7",regex:"secret[_-]?7(=| =|:| :)"},{name:"secret_8",regex:"secret[_-]?8(=| =|:| :)"},{name:"secret_9",regex:"secret[_-]?9(=| =|:| :)"},{name:"secret_key_base",regex:"secret[_-]?key[_-]?base(=| =|:| :)"},{name:"secretaccesskey",regex:"secretaccesskey(=| =|:| :)"},{name:"secretkey",regex:"secretkey(=| =|:| :)"},{name:"segment_api_key",regex:"segment[_-]?api[_-]?key(=| =|:| :)"},{name:"selion_log_level_dev",regex:"selion[_-]?log[_-]?level[_-]?dev(=| =|:| :)"},{name:"selion_selenium_host",regex:"selion[_-]?selenium[_-]?host(=| =|:| :)"},{name:"sendgrid - 2",regex:"sendgrid(=| =|:| :)"},{name:"sendgrid_api_key - 1",regex:"sendgrid[_-]?api[_-]?key(=| =|:| :)"},{name:"sendgrid_key",regex:"sendgrid[_-]?key(=| =|:| :)"},{name:"sendgrid_password",regex:"sendgrid[_-]?password(=| =|:| :)"},{name:"sendgrid_user",regex:"sendgrid[_-]?user(=| =|:| :)"},{name:"sendgrid_username",regex:"sendgrid[_-]?username(=| =|:| :)"},{name:"sendwithus_key",regex:"sendwithus[_-]?key(=| =|:| :)"},{name:"sentry_auth_token",regex:"sentry[_-]?auth[_-]?token(=| =|:| :)"},{name:"sentry_default_org",regex:"sentry[_-]?default[_-]?org(=| =|:| :)"},{name:"sentry_endpoint",regex:"sentry[_-]?endpoint(=| =|:| :)"},{name:"sentry_key",regex:"sentry[_-]?key(=| =|:| :)"},{name:"service_account_secret",regex:"service[_-]?account[_-]?secret(=| =|:| :)"},{name:"ses_access_key",regex:"ses[_-]?access[_-]?key(=| =|:| :)"},{name:"ses_secret_key",regex:"ses[_-]?secret[_-]?key(=| =|:| :)"},{name:"setdstaccesskey",regex:"setdstaccesskey(=| =|:| :)"},{name:"setdstsecretkey",regex:"setdstsecretkey(=| =|:| :)"},{name:"setsecretkey",regex:"setsecretkey(=| =|:| :)"},{name:"signing_key",regex:"signing[_-]?key(=| =|:| :)"},{name:"signing_key_password",regex:"signing[_-]?key[_-]?password(=| =|:| :)"},{name:"signing_key_secret",regex:"signing[_-]?key[_-]?secret(=| =|:| :)"},{name:"signing_key_sid",regex:"signing[_-]?key[_-]?sid(=| =|:| :)"},{name:"slack_webhook_url",regex:"(hooks.slack.com/services/T[A-Z0-9]{8}/B[A-Z0-9]{8}/[a-zA-Z0-9]{1,})"},{name:"slash_developer_space",regex:"slash[_-]?developer[_-]?space(=| =|:| :)"},{name:"slash_developer_space_key",regex:"slash[_-]?developer[_-]?space[_-]?key(=| =|:| :)"},{name:"slate_user_email",regex:"slate[_-]?user[_-]?email(=| =|:| :)"},{name:"snoowrap_client_secret",regex:"snoowrap[_-]?client[_-]?secret(=| =|:| :)"},{name:"snoowrap_password",regex:"snoowrap[_-]?password(=| =|:| :)"},{name:"snoowrap_refresh_token",regex:"snoowrap[_-]?refresh[_-]?token(=| =|:| :)"},{name:"snyk_api_token",regex:"snyk[_-]?api[_-]?token(=| =|:| :)"},{name:"snyk_token",regex:"snyk[_-]?token(=| =|:| :)"},{name:"socrata_app_token",regex:"socrata[_-]?app[_-]?token(=| =|:| :)"},{name:"socrata_password",regex:"socrata[_-]?password(=| =|:| :)"},{name:"sonar_organization_key",regex:"sonar[_-]?organization[_-]?key(=| =|:| :)"},{name:"sonar_project_key",regex:"sonar[_-]?project[_-]?key(=| =|:| :)"},{name:"sonar_token",regex:"sonar[_-]?token(=| =|:| :)"},{name:"sonarqube_docs_api_key",regex:`(sonar.{0,50}("|')?[0-9a-f]{40}("|')?)`},{name:"sonatype_gpg_key_name",regex:"sonatype[_-]?gpg[_-]?key[_-]?name(=| =|:| :)"},{name:"sonatype_gpg_passphrase",regex:"sonatype[_-]?gpg[_-]?passphrase(=| =|:| :)"},{name:"sonatype_nexus_password",regex:"sonatype[_-]?nexus[_-]?password(=| =|:| :)"},{name:"sonatype_pass",regex:"sonatype[_-]?pass(=| =|:| :)"},{name:"sonatype_password",regex:"sonatype[_-]?password(=| =|:| :)"},{name:"sonatype_token_password",regex:"sonatype[_-]?token[_-]?password(=| =|:| :)"},{name:"sonatype_token_user",regex:"sonatype[_-]?token[_-]?user(=| =|:| :)"},{name:"sonatypepassword",regex:"sonatypepassword(=| =|:| :)"},{name:"soundcloud_client_secret",regex:"soundcloud[_-]?client[_-]?secret(=| =|:| :)"},{name:"soundcloud_password",regex:"soundcloud[_-]?password(=| =|:| :)"},{name:"spaces_access_key_id",regex:"spaces[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"spaces_secret_access_key",regex:"spaces[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"spotify_api_access_token",regex:"spotify[_-]?api[_-]?access[_-]?token(=| =|:| :)"},{name:"spotify_api_client_secret",regex:"spotify[_-]?api[_-]?client[_-]?secret(=| =|:| :)"},{name:"spring_mail_password",regex:"spring[_-]?mail[_-]?password(=| =|:| :)"},{name:"sqsaccesskey",regex:"sqsaccesskey(=| =|:| :)"},{name:"sqssecretkey",regex:"sqssecretkey(=| =|:| :)"},{name:"square_app_secret",regex:"(sq0[a-z]{3}-[0-9A-Za-z-_]{20,50})"},{name:"square_reader_sdk_repository_password",regex:"square[_-]?reader[_-]?sdk[_-]?repository[_-]?password(=| =|:| :)"},{name:"srcclr_api_token",regex:"srcclr[_-]?api[_-]?token(=| =|:| :)"},{name:"ssh_password",regex:`(sshpass -p.*['|"])`},{name:"sshpass",regex:"sshpass(=| =|:| :)"},{name:"ssmtp_config",regex:"ssmtp[_-]?config(=| =|:| :)"},{name:"staging_base_url_runscope",regex:"staging[_-]?base[_-]?url[_-]?runscope(=| =|:| :)"},{name:"star_test_aws_access_key_id",regex:"star[_-]?test[_-]?aws[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"star_test_bucket",regex:"star[_-]?test[_-]?bucket(=| =|:| :)"},{name:"star_test_location",regex:"star[_-]?test[_-]?location(=| =|:| :)"},{name:"star_test_secret_access_key",regex:"star[_-]?test[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"starship_account_sid",regex:"starship[_-]?account[_-]?sid(=| =|:| :)"},{name:"starship_auth_token",regex:"starship[_-]?auth[_-]?token(=| =|:| :)"},{name:"stormpath_api_key_id",regex:"stormpath[_-]?api[_-]?key[_-]?id(=| =|:| :)"},{name:"stormpath_api_key_secret",regex:"stormpath[_-]?api[_-]?key[_-]?secret(=| =|:| :)"},{name:"strip_publishable_key",regex:"strip[_-]?publishable[_-]?key(=| =|:| :)"},{name:"strip_secret_key",regex:"strip[_-]?secret[_-]?key(=| =|:| :)"},{name:"stripe_private",regex:"stripe[_-]?private(=| =|:| :)"},{name:"stripe_public",regex:"stripe[_-]?public(=| =|:| :)"},{name:"stripe_restricted_api",regex:"(rk_live_[0-9a-zA-Z]{24,34})"},{name:"stripe_standard_api",regex:"(sk_live_[0-9a-zA-Z]{24,34})"},{name:"surge_login",regex:"surge[_-]?login(=| =|:| :)"},{name:"surge_token",regex:"surge[_-]?token(=| =|:| :)"},{name:"svn_pass",regex:"svn[_-]?pass(=| =|:| :)"},{name:"tesco_api_key",regex:"tesco[_-]?api[_-]?key(=| =|:| :)"},{name:"test_github_token",regex:"test[_-]?github[_-]?token(=| =|:| :)"},{name:"test_test",regex:"test[_-]?test(=| =|:| :)"},{name:"tester_keys_password",regex:"tester[_-]?keys[_-]?password(=| =|:| :)"},{name:"thera_oss_access_key",regex:"thera[_-]?oss[_-]?access[_-]?key(=| =|:| :)"},{name:"token_core_java",regex:"token[_-]?core[_-]?java(=| =|:| :)"},{name:"travis_access_token",regex:"travis[_-]?access[_-]?token(=| =|:| :)"},{name:"travis_api_token",regex:"travis[_-]?api[_-]?token(=| =|:| :)"},{name:"travis_branch",regex:"travis[_-]?branch(=| =|:| :)"},{name:"travis_com_token",regex:"travis[_-]?com[_-]?token(=| =|:| :)"},{name:"travis_e2e_token",regex:"travis[_-]?e2e[_-]?token(=| =|:| :)"},{name:"travis_gh_token",regex:"travis[_-]?gh[_-]?token(=| =|:| :)"},{name:"travis_pull_request",regex:"travis[_-]?pull[_-]?request(=| =|:| :)"},{name:"travis_secure_env_vars",regex:"travis[_-]?secure[_-]?env[_-]?vars(=| =|:| :)"},{name:"travis_token",regex:"travis[_-]?token(=| =|:| :)"},{name:"trex_client_token",regex:"trex[_-]?client[_-]?token(=| =|:| :)"},{name:"trex_okta_client_token",regex:"trex[_-]?okta[_-]?client[_-]?token(=| =|:| :)"},{name:"twilio_api_key",regex:"twilio[_-]?api[_-]?key(=| =|:| :)"},{name:"twilio_api_secret",regex:"twilio[_-]?api[_-]?secret(=| =|:| :)"},{name:"twilio_chat_account_api_service",regex:"twilio[_-]?chat[_-]?account[_-]?api[_-]?service(=| =|:| :)"},{name:"twilio_configuration_sid",regex:"twilio[_-]?configuration[_-]?sid(=| =|:| :)"},{name:"twilio_sid",regex:"twilio[_-]?sid(=| =|:| :)"},{name:"twilio_token",regex:"twilio[_-]?token(=| =|:| :)"},{name:"twine_password",regex:"twine[_-]?password(=| =|:| :)"},{name:"twitter_consumer_key",regex:"twitter[_-]?consumer[_-]?key(=| =|:| :)"},{name:"twitter_consumer_secret",regex:"twitter[_-]?consumer[_-]?secret(=| =|:| :)"},{name:"twitteroauthaccesssecret",regex:"twitteroauthaccesssecret(=| =|:| :)"},{name:"twitteroauthaccesstoken",regex:"twitteroauthaccesstoken(=| =|:| :)"},{name:"unity_password",regex:"unity[_-]?password(=| =|:| :)"},{name:"unity_serial",regex:"unity[_-]?serial(=| =|:| :)"},{name:"urban_key",regex:"urban[_-]?key(=| =|:| :)"},{name:"urban_master_secret",regex:"urban[_-]?master[_-]?secret(=| =|:| :)"},{name:"urban_secret",regex:"urban[_-]?secret(=| =|:| :)"},{name:"us_east_1_elb_amazonaws_com",regex:"us[_-]?east[_-]?1[_-]?elb[_-]?amazonaws[_-]?com(=| =|:| :)"},{name:"use_ssh",regex:"use[_-]?ssh(=| =|:| :)"},{name:"user_assets_access_key_id",regex:"user[_-]?assets[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"user_assets_secret_access_key",regex:"user[_-]?assets[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"usertravis",regex:"usertravis(=| =|:| :)"},{name:"v_sfdc_client_secret",regex:"v[_-]?sfdc[_-]?client[_-]?secret(=| =|:| :)"},{name:"v_sfdc_password",regex:"v[_-]?sfdc[_-]?password(=| =|:| :)"},{name:"vip_github_build_repo_deploy_key",regex:"vip[_-]?github[_-]?build[_-]?repo[_-]?deploy[_-]?key(=| =|:| :)"},{name:"vip_github_deploy_key",regex:"vip[_-]?github[_-]?deploy[_-]?key(=| =|:| :)"},{name:"vip_github_deploy_key_pass",regex:"vip[_-]?github[_-]?deploy[_-]?key[_-]?pass(=| =|:| :)"},{name:"virustotal_apikey",regex:"virustotal[_-]?apikey(=| =|:| :)"},{name:"visual_recognition_api_key",regex:"visual[_-]?recognition[_-]?api[_-]?key(=| =|:| :)"},{name:"vscetoken",regex:"vscetoken(=| =|:| :)"},{name:"wakatime_api_key",regex:"wakatime[_-]?api[_-]?key(=| =|:| :)"},{name:"watson_conversation_password",regex:"watson[_-]?conversation[_-]?password(=| =|:| :)"},{name:"watson_device_password",regex:"watson[_-]?device[_-]?password(=| =|:| :)"},{name:"watson_password",regex:"watson[_-]?password(=| =|:| :)"},{name:"widget_basic_password",regex:"widget[_-]?basic[_-]?password(=| =|:| :)"},{name:"widget_basic_password_2",regex:"widget[_-]?basic[_-]?password[_-]?2(=| =|:| :)"},{name:"widget_basic_password_3",regex:"widget[_-]?basic[_-]?password[_-]?3(=| =|:| :)"},{name:"widget_basic_password_4",regex:"widget[_-]?basic[_-]?password[_-]?4(=| =|:| :)"},{name:"widget_basic_password_5",regex:"widget[_-]?basic[_-]?password[_-]?5(=| =|:| :)"},{name:"widget_fb_password",regex:"widget[_-]?fb[_-]?password(=| =|:| :)"},{name:"widget_fb_password_2",regex:"widget[_-]?fb[_-]?password[_-]?2(=| =|:| :)"},{name:"widget_fb_password_3",regex:"widget[_-]?fb[_-]?password[_-]?3(=| =|:| :)"},{name:"widget_test_server",regex:"widget[_-]?test[_-]?server(=| =|:| :)"},{name:"wincert_password",regex:"wincert[_-]?password(=| =|:| :)"},{name:"wordpress_db_password",regex:"wordpress[_-]?db[_-]?password(=| =|:| :)"},{name:"wordpress_db_user",regex:"wordpress[_-]?db[_-]?user(=| =|:| :)"},{name:"wpjm_phpunit_google_geocode_api_key",regex:"wpjm[_-]?phpunit[_-]?google[_-]?geocode[_-]?api[_-]?key(=| =|:| :)"},{name:"wporg_password",regex:"wporg[_-]?password(=| =|:| :)"},{name:"wpt_db_password",regex:"wpt[_-]?db[_-]?password(=| =|:| :)"},{name:"wpt_db_user",regex:"wpt[_-]?db[_-]?user(=| =|:| :)"},{name:"wpt_prepare_dir",regex:"wpt[_-]?prepare[_-]?dir(=| =|:| :)"},{name:"wpt_report_api_key",regex:"wpt[_-]?report[_-]?api[_-]?key(=| =|:| :)"},{name:"wpt_ssh_connect",regex:"wpt[_-]?ssh[_-]?connect(=| =|:| :)"},{name:"wpt_ssh_private_key_base64",regex:"wpt[_-]?ssh[_-]?private[_-]?key[_-]?base64(=| =|:| :)"},{name:"www_googleapis_com",regex:"www[_-]?googleapis[_-]?com(=| =|:| :)"},{name:"yangshun_gh_password",regex:"yangshun[_-]?gh[_-]?password(=| =|:| :)"},{name:"yangshun_gh_token",regex:"yangshun[_-]?gh[_-]?token(=| =|:| :)"},{name:"yt_account_client_secret",regex:"yt[_-]?account[_-]?client[_-]?secret(=| =|:| :)"},{name:"yt_account_refresh_token",regex:"yt[_-]?account[_-]?refresh[_-]?token(=| =|:| :)"},{name:"yt_api_key",regex:"yt[_-]?api[_-]?key(=| =|:| :)"},{name:"yt_client_secret",regex:"yt[_-]?client[_-]?secret(=| =|:| :)"},{name:"yt_partner_client_secret",regex:"yt[_-]?partner[_-]?client[_-]?secret(=| =|:| :)"},{name:"yt_partner_refresh_token",regex:"yt[_-]?partner[_-]?refresh[_-]?token(=| =|:| :)"},{name:"yt_server_api_key",regex:"yt[_-]?server[_-]?api[_-]?key(=| =|:| :)"},{name:"zendesk_travis_github",regex:"zendesk[_-]?travis[_-]?github(=| =|:| :)"},{name:"zensonatypepassword",regex:"zensonatypepassword(=| =|:| :)"},{name:"zhuliang_gh_token",regex:"zhuliang[_-]?gh[_-]?token(=| =|:| :)"},{name:"zopim_account_key",regex:"zopim[_-]?account[_-]?key(=| =|:| :)"},{name:"docker_registry_auth",regex:'auth":.*"(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{4}|[A-Za-z0-9+\\/]{3}=|[A-Za-z0-9+\\/]{2}={2})'}];var JQ="*",RB=new Set([`
122
- `,"\r","\t",'"',"'",":",",","{","}","[","]","\\"]),UQ=[];for(let{regex:_}of AQ)try{let $=_,b="g";if($.startsWith("(?i)"))$=$.slice(4),b="gi";UQ.push(new RegExp($,b))}catch{}function w6(_,$=JQ){let b=$.length>0?$[0]:JQ,Z=_;for(let z of UQ)Z=Z.replace(z,(A)=>Array.from(A,(J)=>RB.has(J)?J:b).join(""));return Z}function d4(_){if(typeof _==="string")return w6(_);if(Array.isArray(_))return _.map(($)=>d4($));if(_ instanceof Date)return _;if(_!==null&&typeof _==="object"){let $={};for(let[b,Z]of Object.entries(_))$[b]=d4(Z);return $}return _}var LB=[".env",".env.local",".env.development",".env.production",".env.test",".env.staging",/\.env\.(dev|prod|stage|preview|ci|build|docker)$/i,".zshrc",".bashrc",".bash_profile",".profile",".zprofile",".zshenv",".zsh_history",".bash_history","id_rsa","id_ed25519","id_ecdsa","id_dsa",/^id_[a-z0-9]+$/i,/\.pem$/i,/\.key$/i,".aws/credentials",".aws/config",".docker/config.json",".npmrc",".yarnrc",".yarnrc.yml",".git-credentials",".netrc",".kube/config","kubeconfig","database.yml","secrets.yml","secrets.yaml","master.key","credentials.yml.enc",".gcloud/credentials","service-account.json","service_account.json",/gcp.*credentials.*\.json$/i,/firebase.*\.json$/i];function TB(_){let $=_.replace(/\\/g,"/"),b=$.split("/").pop()||"";for(let Z of LB)if(typeof Z==="string"){if(b===Z||$.endsWith(`/${Z}`)||$===Z)return!0}else if(Z.test(b)||Z.test($))return!0;return!1}function DJ(_){return _.replace(/[^\s]/g,"*")}function kJ(_){let $=_.messages.map((b)=>yB(b));return{..._,messages:$}}function yB(_){if(_.type!=="tool-call")return _;let $=_.toolName;if($!=="Read"&&$!=="Write")return _;let b=_.input,Z=b?.file_path;if(typeof Z!=="string"||!TB(Z))return _;let z={..._};if($==="Write"&&b){let A=b.content;if(typeof A==="string")z.input={...b,content:DJ(A)}}if($==="Read"){let A=_.output;if(typeof A==="string")z.output=DJ(A);else if(A&&typeof A==="object"){let J=A,U=J.file;if(U&&typeof U.content==="string")z.output={...J,file:{...U,content:DJ(U.content)}}}}return z}import{spawn as CB}from"child_process";import{promises as d0}from"fs";import{homedir as x6}from"os";import{basename as fB,extname as mB,join as b_,resolve as GQ}from"path";var f9=100,YQ=80,uB=new Set(["[request interrupted by user]","[request aborted by user]","[request cancelled by user]"]),hB=/^<\/?(?:command|local)-[a-z-]+>/i,cB=/^[α-ωΑ-Ω]\s/i,rB=/<system-reminder>[\s\S]*?<\/system-reminder>/g,nB=["npm ","npm:","npm error","node:","node.js","error:","fatal:","warning:","traceback (most recent call last):","usage:","hint:","note:","code:","requirestack"],lB=b_(x6(),".claude"),pB=b_(x6(),".cline"),dB=b_(x6(),".codex"),iB=b_(x6(),".pi","agent","sessions");async function oB(_){let $=_?.limit??f9,b=process.env.CLAUDE_HOME??lB,Z=b_(b,"projects");if(!await N6(Z))return[];let z=[];try{let U=await d0.readdir(Z,{withFileTypes:!0});for(let G of U){if(!G.isDirectory())continue;let Y=b_(Z,G.name);try{let X=await d0.readdir(Y,{withFileTypes:!0});for(let Q of X){if(!Q.isFile()||mB(Q.name)!==".jsonl")continue;let K=b_(Y,Q.name),v=fB(Q.name,".jsonl");try{let V=await d0.stat(K);z.push({path:K,id:v,mtime:V.mtime})}catch{}}}catch{}}}catch{}z.sort((U,G)=>G.mtime.getTime()-U.mtime.getTime());let A=z.slice(0,$*2),J=[];for(let U of A)try{let G=await zw(U.path);J.push({id:U.id,source:"claude-code",path:U.path,timestamp:G.timestamp,preview:G.preview,cwd:G.cwd,repoId:null,stats:G.stats})}catch{}return J.sort((U,G)=>G.timestamp.getTime()-U.timestamp.getTime()).slice(0,$)}async function aB(_){let $=_?.limit??f9,b=process.env.CODEX_HOME??dB,Z=b_(b,"sessions");if(!await N6(Z))return[];let z=[],J=(await Aw(Z)).slice(0,$*2);for(let U of J)try{let G=await Jw(U);if(!G)continue;z.push({id:G.sessionId,source:"codex",path:U,timestamp:G.timestamp,preview:G.preview,cwd:G.cwd,repoId:null,stats:G.stats})}catch{}return z.sort((U,G)=>G.timestamp.getTime()-U.timestamp.getTime()).slice(0,$)}async function eB(_){let $=_?.limit??f9;try{let b=await tB($*2);if(!b)return[];let Z=JSON.parse(b),z=[];for(let A of Z){if(A.parentId)continue;let J=A.updated?new Date(A.updated):A.created?new Date(A.created):new Date(0);z.push({id:A.id,source:"opencode",path:A.id,timestamp:J,preview:A.title?i4(A.title):null,cwd:A.directory??null,repoId:null,stats:null})}return z.sort((A,J)=>J.timestamp.getTime()-A.timestamp.getTime()).slice(0,$)}catch{return[]}}function tB(_){return new Promise(($)=>{let b=!1,Z=(U)=>{if(!b)b=!0,clearTimeout(J),$(U)},z=CB("opencode",["session","list","--format","json","-n",String(_)],{stdio:["pipe","pipe","pipe"]}),A="",J=setTimeout(()=>{z.kill(),Z(null)},30000);z.stdout.on("data",(U)=>{A+=U.toString()}),z.on("close",(U)=>{Z(U===0?A.trim()||null:null)}),z.on("error",()=>{Z(null)})})}async function sB(_){let $=_?.limit??f9,b=process.env.PI_SESSIONS??iB;if(!await N6(b))return[];let Z=[];try{let z=await d0.readdir(b,{withFileTypes:!0});for(let A of z){if(!A.isDirectory())continue;let J=b_(b,A.name);try{let U=await d0.readdir(J,{withFileTypes:!0});for(let G of U){if(!G.isFile()||!G.name.endsWith(".jsonl"))continue;let Y=b_(J,G.name);try{let X=await Gw(Y);if(!X)continue;Z.push({id:X.sessionId,source:"pi",path:Y,timestamp:X.timestamp,preview:X.preview,cwd:X.cwd,repoId:null,stats:null})}catch{}}}catch{}}}catch{}return Z.sort((z,A)=>A.timestamp.getTime()-z.timestamp.getTime()).slice(0,$)}async function _w(_){let $=_?.limit??f9,b=process.env.CLINE_HOME??pB,Z=b_(b,"data","tasks");if(!await N6(Z))return[];let z=[];try{let A=await d0.readdir(Z,{withFileTypes:!0}),J=[];for(let G of A){if(!G.isDirectory())continue;let Y=b_(Z,G.name,"api_conversation_history.json");try{let X=await d0.stat(Y);J.push({path:Y,id:G.name,mtime:X.mtime})}catch{}}J.sort((G,Y)=>Y.mtime.getTime()-G.mtime.getTime());let U=J.slice(0,$*2);for(let G of U)try{let Y=await Uw(G.path);if(!Y)continue;z.push({id:G.id,source:"cline",path:G.path,timestamp:Y.timestamp,preview:Y.preview,cwd:Y.cwd,repoId:null,stats:null})}catch{}}catch{}return z.sort((A,J)=>J.timestamp.getTime()-A.timestamp.getTime()).slice(0,$)}async function QQ(_){let $=_?.sources??["claude-code","cline","codex","opencode","pi"],b=_?.limit??f9,Z=_?.cwd?GQ(_.cwd):null,z=b*3,A=await Promise.all([$.includes("claude-code")?oB({limit:z}):[],$.includes("cline")?_w({limit:z}):[],$.includes("codex")?aB({limit:z}):[],$.includes("opencode")?eB({limit:z}):[],$.includes("pi")?sB({limit:z}):[]]),J=[];for(let U of A)J.push(...U);if(J=J.filter((U)=>U.preview&&U.preview.trim().length>0),Z)J=J.filter((U)=>{if(!U.cwd)return!1;let G=GQ(U.cwd);return G.startsWith(Z)||Z.startsWith(G)});return J.sort((U,G)=>G.timestamp.getTime()-U.timestamp.getTime()).slice(0,b)}async function N6(_){try{return(await d0.stat(_)).isDirectory()}catch{return!1}}function i4(_){let $=_.replace(/\s+/g," ").trim();if($.length<=YQ)return $;return $.slice(0,YQ-1)+"…"}var o4=51200,$w=524288,C9=20480;async function zw(_){let $=await d0.open(_,"r");try{let Z=(await $.stat()).size,z=null,A=null,J=null,U=Buffer.alloc(Math.min(o4,Z));await $.read(U,0,U.length,0);let G=U.toString("utf8");for(let Y of G.split(/\r?\n/)){if(!Y.trim())continue;if(!Y.endsWith("}"))break;try{let X=JSON.parse(Y);if(!z&&typeof X.cwd==="string")z=X.cwd;if(typeof X.timestamp==="string"){let Q=new Date(X.timestamp);if(!Number.isNaN(Q.getTime())){if(!J||Q>J)J=Q}}if(X.isSidechain||X.isMeta)continue;if(!A&&X.type==="user"){let K=X.message?.content;if(X.toolUseResult||X.tool_use_result)continue;let v=KQ(K);if(v){let V=bw(v);if(V)A=i4(V)}}if(z&&A)break}catch{continue}}if(Z>o4){let Y=Math.max(0,Z-C9),X=Buffer.alloc(Math.min(C9,Z-Y));await $.read(X,0,X.length,Y);let K=X.toString("utf8").split(/\r?\n/);if(Y>0&&K.length>0)K.shift();for(let v of K){if(!v.trim())continue;try{let V=JSON.parse(v);if(typeof V.timestamp==="string"){let w=new Date(V.timestamp);if(!Number.isNaN(w.getTime())){if(!J||w>J)J=w}}}catch{continue}}}return{timestamp:J??new Date(0),cwd:z,preview:A,stats:null}}finally{await $.close()}}function KQ(_){if(typeof _==="string")return _;if(Array.isArray(_))for(let $ of _){if(typeof $==="string")return $;if($&&typeof $==="object"){let b=$;if(b.type==="tool_result")continue;if(b.type==="text"&&typeof b.text==="string")return b.text}}return null}function bw(_){let $=_.replace(rB,""),b=[];for(let Z of $.split(/\r?\n/)){let z=Z.trim();if(!z)continue;let A=z.toLowerCase();if(uB.has(A))continue;if(hB.test(z))continue;if(cB.test(z))continue;if(nB.some((J)=>A.startsWith(J))){if(!z.includes("?")&&!Zw(A))continue}if(!/[a-z]/i.test(z)&&!/\d/.test(z))continue;b.push(z)}if(b.length===0)return null;return b.slice(0,3).join(" ").replace(/\s+/g," ").trim()||null}function Zw(_){return["can you","could you","please","help","how do","what is","why","fix","add","create","update"].some((b)=>_.includes(b))}async function Aw(_){let $=[];async function b(Z,z){if(z>4)return;try{let A=await d0.readdir(Z,{withFileTypes:!0});for(let J of A){let U=b_(Z,J.name);if(J.isDirectory())await b(U,z+1);else if(J.isFile()&&J.name.endsWith(".jsonl")){let G=await d0.stat(U);$.push({path:U,mtime:G.mtime})}}}catch{}}return await b(_,0),$.sort((Z,z)=>z.mtime.getTime()-Z.mtime.getTime()),$.map((Z)=>Z.path)}async function Jw(_){let $=await d0.open(_,"r");try{let Z=(await $.stat()).size,z=null,A=null,J=null,U=null,G=Math.min(Z,$w),Y=Math.min(o4,G);while(Y>0){let X=Buffer.alloc(Y);await $.read(X,0,X.length,0);let Q=X.toString("utf8"),K=!1;for(let v of Q.split(/\r?\n/)){if(!v.trim())continue;if(!v.endsWith("}")){K=!0;break}try{let V=JSON.parse(v),w=V.timestamp,P=V.type,O=V.payload;if(w){let B=new Date(w);if(!Number.isNaN(B.getTime())){if(!A||B>A)A=B}}if(!O)continue;if(P==="session_meta")z=O.id??null,J=O.cwd??null;if(P==="event_msg"&&O.type==="user_message"&&!U){let B=O.message;if(B)U=i4(B)}if(P==="response_item"&&O.type==="message"&&O.role==="user"&&!U&&Array.isArray(O.content)){let B=KQ(O.content);if(B)U=i4(B)}if(z&&J&&U)break}catch{continue}}if(z&&J&&U)break;if(Y>=G||!K&&U)break;Y=Math.min(G,Y*4)}if(Z>o4){let X=Math.max(0,Z-C9),Q=Buffer.alloc(Math.min(C9,Z-X));await $.read(Q,0,Q.length,X);let v=Q.toString("utf8").split(/\r?\n/);if(X>0&&v.length>0)v.shift();for(let V of v){if(!V.trim())continue;try{let P=JSON.parse(V).timestamp;if(P){let O=new Date(P);if(!Number.isNaN(O.getTime())){if(!A||O>A)A=O}}}catch{continue}}}if(!z)return null;return{sessionId:z,timestamp:A??new Date(0),cwd:J,preview:U,stats:null}}finally{await $.close()}}var XQ=/<environment_details|task|feedback>[\s\S]*?<\/environment_details|task|feedback>/g;async function Uw(_){let $=await d0.open(_,"r");try{let b=await $.stat(),Z=b.size,z=Buffer.alloc(Math.min(o4,Z));await $.read(z,0,z.length,0);let A=z.toString("utf8"),J=null,U=null,G=A.match(/<task>\n?([\s\S]*?)\n?<\/task>/);if(G?.[1]){let X=G[1].trim();if(X)J=i4(X)}if(!J){let Q=A.match(/"role"\s*:\s*"user"[\s\S]*?"type"\s*:\s*"text"\s*,\s*"text"\s*:\s*"([^"]{1,200})/)?.[1]?.trim();if(Q){let K=Q.replace(XQ,"").replace(XQ,"").replace(/\\n/g," ").trim();if(K&&!K.startsWith("[")&&!K.startsWith("#"))J=i4(K)}}return{timestamp:b.mtime,cwd:U,preview:J}}finally{await $.close()}}async function Gw(_){let $=await d0.open(_,"r");try{let Z=(await $.stat()).size,z=null,A=null,J=null,U=null,G=null,Y=Buffer.alloc(Math.min(o4,Z));await $.read(Y,0,Y.length,0);let Q=Y.toString("utf8").split(/\r?\n/);for(let K=0;K<Q.length;K++){let v=Q[K];if(!v.trim())continue;if(!v.endsWith("}"))break;try{let V=JSON.parse(v);if(K===0&&V.id&&V.timestamp){z=V.id,J=V.cwd??null,A=new Date(V.timestamp),G=A;continue}if(V.timestamp){let w=new Date(V.timestamp);if(!Number.isNaN(w.getTime())){if(!G||w>G)G=w}}if(!U&&V.type==="message"){let w=V.message;if(w?.role==="user"){let P=w.content;if(Array.isArray(P)){for(let O of P)if(O&&typeof O==="object"&&O.type==="text"){let B=O.text;if(B){U=i4(B);break}}}}}if(z&&J&&U)break}catch{}}if(Z>o4){let K=Math.max(0,Z-C9),v=Buffer.alloc(Math.min(C9,Z-K));await $.read(v,0,v.length,K);let w=v.toString("utf8").split(/\r?\n/);if(K>0&&w.length>0)w.shift();for(let P of w){if(!P.trim())continue;try{let O=JSON.parse(P);if(O.timestamp){let B=new Date(O.timestamp);if(!Number.isNaN(B.getTime())){if(!G||B>G)G=B}}}catch{}}}if(!z)return null;return{sessionId:z,timestamp:G??A??new Date(0),cwd:J,preview:U}}finally{await $.close()}}function FQ(_){return _===161||_===164||_===167||_===168||_===170||_===173||_===174||_>=176&&_<=180||_>=182&&_<=186||_>=188&&_<=191||_===198||_===208||_===215||_===216||_>=222&&_<=225||_===230||_>=232&&_<=234||_===236||_===237||_===240||_===242||_===243||_>=247&&_<=250||_===252||_===254||_===257||_===273||_===275||_===283||_===294||_===295||_===299||_>=305&&_<=307||_===312||_>=319&&_<=322||_===324||_>=328&&_<=331||_===333||_===338||_===339||_===358||_===359||_===363||_===462||_===464||_===466||_===468||_===470||_===472||_===474||_===476||_===593||_===609||_===708||_===711||_>=713&&_<=715||_===717||_===720||_>=728&&_<=731||_===733||_===735||_>=768&&_<=879||_>=913&&_<=929||_>=931&&_<=937||_>=945&&_<=961||_>=963&&_<=969||_===1025||_>=1040&&_<=1103||_===1105||_===8208||_>=8211&&_<=8214||_===8216||_===8217||_===8220||_===8221||_>=8224&&_<=8226||_>=8228&&_<=8231||_===8240||_===8242||_===8243||_===8245||_===8251||_===8254||_===8308||_===8319||_>=8321&&_<=8324||_===8364||_===8451||_===8453||_===8457||_===8467||_===8470||_===8481||_===8482||_===8486||_===8491||_===8531||_===8532||_>=8539&&_<=8542||_>=8544&&_<=8555||_>=8560&&_<=8569||_===8585||_>=8592&&_<=8601||_===8632||_===8633||_===8658||_===8660||_===8679||_===8704||_===8706||_===8707||_===8711||_===8712||_===8715||_===8719||_===8721||_===8725||_===8730||_>=8733&&_<=8736||_===8739||_===8741||_>=8743&&_<=8748||_===8750||_>=8756&&_<=8759||_===8764||_===8765||_===8776||_===8780||_===8786||_===8800||_===8801||_>=8804&&_<=8807||_===8810||_===8811||_===8814||_===8815||_===8834||_===8835||_===8838||_===8839||_===8853||_===8857||_===8869||_===8895||_===8978||_>=9312&&_<=9449||_>=9451&&_<=9547||_>=9552&&_<=9587||_>=9600&&_<=9615||_>=9618&&_<=9621||_===9632||_===9633||_>=9635&&_<=9641||_===9650||_===9651||_===9654||_===9655||_===9660||_===9661||_===9664||_===9665||_>=9670&&_<=9672||_===9675||_>=9678&&_<=9681||_>=9698&&_<=9701||_===9711||_===9733||_===9734||_===9737||_===9742||_===9743||_===9756||_===9758||_===9792||_===9794||_===9824||_===9825||_>=9827&&_<=9829||_>=9831&&_<=9834||_===9836||_===9837||_===9839||_===9886||_===9887||_===9919||_>=9926&&_<=9933||_>=9935&&_<=9939||_>=9941&&_<=9953||_===9955||_===9960||_===9961||_>=9963&&_<=9969||_===9972||_>=9974&&_<=9977||_===9979||_===9980||_===9982||_===9983||_===10045||_>=10102&&_<=10111||_>=11094&&_<=11097||_>=12872&&_<=12879||_>=57344&&_<=63743||_>=65024&&_<=65039||_===65533||_>=127232&&_<=127242||_>=127248&&_<=127277||_>=127280&&_<=127337||_>=127344&&_<=127373||_===127375||_===127376||_>=127387&&_<=127404||_>=917760&&_<=917999||_>=983040&&_<=1048573||_>=1048576&&_<=1114109}function HQ(_){return _===12288||_>=65281&&_<=65376||_>=65504&&_<=65510}function qQ(_){return _>=4352&&_<=4447||_===8986||_===8987||_===9001||_===9002||_>=9193&&_<=9196||_===9200||_===9203||_===9725||_===9726||_===9748||_===9749||_>=9776&&_<=9783||_>=9800&&_<=9811||_===9855||_>=9866&&_<=9871||_===9875||_===9889||_===9898||_===9899||_===9917||_===9918||_===9924||_===9925||_===9934||_===9940||_===9962||_===9970||_===9971||_===9973||_===9978||_===9981||_===9989||_===9994||_===9995||_===10024||_===10060||_===10062||_>=10067&&_<=10069||_===10071||_>=10133&&_<=10135||_===10160||_===10175||_===11035||_===11036||_===11088||_===11093||_>=11904&&_<=11929||_>=11931&&_<=12019||_>=12032&&_<=12245||_>=12272&&_<=12287||_>=12289&&_<=12350||_>=12353&&_<=12438||_>=12441&&_<=12543||_>=12549&&_<=12591||_>=12593&&_<=12686||_>=12688&&_<=12773||_>=12783&&_<=12830||_>=12832&&_<=12871||_>=12880&&_<=42124||_>=42128&&_<=42182||_>=43360&&_<=43388||_>=44032&&_<=55203||_>=63744&&_<=64255||_>=65040&&_<=65049||_>=65072&&_<=65106||_>=65108&&_<=65126||_>=65128&&_<=65131||_>=94176&&_<=94180||_>=94192&&_<=94198||_>=94208&&_<=101589||_>=101631&&_<=101662||_>=101760&&_<=101874||_>=110576&&_<=110579||_>=110581&&_<=110587||_===110589||_===110590||_>=110592&&_<=110882||_===110898||_>=110928&&_<=110930||_===110933||_>=110948&&_<=110951||_>=110960&&_<=111355||_>=119552&&_<=119638||_>=119648&&_<=119670||_===126980||_===127183||_===127374||_>=127377&&_<=127386||_>=127488&&_<=127490||_>=127504&&_<=127547||_>=127552&&_<=127560||_===127568||_===127569||_>=127584&&_<=127589||_>=127744&&_<=127776||_>=127789&&_<=127797||_>=127799&&_<=127868||_>=127870&&_<=127891||_>=127904&&_<=127946||_>=127951&&_<=127955||_>=127968&&_<=127984||_===127988||_>=127992&&_<=128062||_===128064||_>=128066&&_<=128252||_>=128255&&_<=128317||_>=128331&&_<=128334||_>=128336&&_<=128359||_===128378||_===128405||_===128406||_===128420||_>=128507&&_<=128591||_>=128640&&_<=128709||_===128716||_>=128720&&_<=128722||_>=128725&&_<=128728||_>=128732&&_<=128735||_===128747||_===128748||_>=128756&&_<=128764||_>=128992&&_<=129003||_===129008||_>=129292&&_<=129338||_>=129340&&_<=129349||_>=129351&&_<=129535||_>=129648&&_<=129660||_>=129664&&_<=129674||_>=129678&&_<=129734||_===129736||_>=129741&&_<=129756||_>=129759&&_<=129770||_>=129775&&_<=129784||_>=131072&&_<=196605||_>=196608&&_<=262141}function Yw(_){if(!Number.isSafeInteger(_))throw TypeError(`Expected a code point, got \`${typeof _}\`.`)}function WJ(_,{ambiguousAsWide:$=!1}={}){if(Yw(_),HQ(_)||qQ(_)||$&&FQ(_))return 2;return 1}var m9=new Intl.Segmenter(void 0,{granularity:"grapheme"});function I6(){return m9}function Xw(_){let $=_.codePointAt(0);return $>=126976&&$<=130047||$>=8960&&$<=9215||$>=9728&&$<=10175||$>=11088&&$<=11093||_.includes("️")||_.length>2}var Qw=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Mark}|\p{Surrogate})+$/v,Kw=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,vw=/^\p{RGI_Emoji}$/v,Fw=512,a$=new Map;function BJ(_){if(Qw.test(_))return 0;if(Xw(_)&&vw.test(_))return 2;let b=_.replace(Kw,"").codePointAt(0);if(b===void 0)return 0;if(b>=127462&&b<=127487)return 2;let Z=WJ(b);if(_.length>1)for(let z of _.slice(1)){let A=z.codePointAt(0);if(A>=65280&&A<=65519)Z+=WJ(A)}return Z}function _0(_){if(_.length===0)return 0;let $=!0;for(let A=0;A<_.length;A++){let J=_.charCodeAt(A);if(J<32||J>126){$=!1;break}}if($)return _.length;let b=a$.get(_);if(b!==void 0)return b;let Z=_;if(_.includes("\t"))Z=Z.replace(/\t/g," ");if(Z.includes("\x1B")){let A="",J=0;while(J<Z.length){let U=g_(Z,J);if(U){J+=U.length;continue}A+=Z[J],J++}Z=A}let z=0;for(let{segment:A}of m9.segment(Z))z+=BJ(A);if(a$.size>=Fw){let A=a$.keys().next().value;if(A!==void 0)a$.delete(A)}return a$.set(_,z),z}function g_(_,$){if($>=_.length||_[$]!=="\x1B")return null;let b=_[$+1];if(b==="["){let Z=$+2;while(Z<_.length&&!/[mGKHJ]/.test(_[Z]))Z++;if(Z<_.length)return{code:_.substring($,Z+1),length:Z+1-$};return null}if(b==="]"){let Z=$+2;while(Z<_.length){if(_[Z]==="\x07")return{code:_.substring($,Z+1),length:Z+1-$};if(_[Z]==="\x1B"&&_[Z+1]==="\\")return{code:_.substring($,Z+2),length:Z+2-$};Z++}return null}if(b==="_"){let Z=$+2;while(Z<_.length){if(_[Z]==="\x07")return{code:_.substring($,Z+1),length:Z+1-$};if(_[Z]==="\x1B"&&_[Z+1]==="\\")return{code:_.substring($,Z+2),length:Z+2-$};Z++}return null}return null}class M6{bold=!1;dim=!1;italic=!1;underline=!1;blink=!1;inverse=!1;hidden=!1;strikethrough=!1;fgColor=null;bgColor=null;process(_){if(!_.endsWith("m"))return;let $=_.match(/\x1b\[([\d;]*)m/);if(!$)return;let b=$[1];if(b===""||b==="0"){this.reset();return}let Z=b.split(";"),z=0;while(z<Z.length){let A=Number.parseInt(Z[z],10);if(A===38||A===48){if(Z[z+1]==="5"&&Z[z+2]!==void 0){let J=`${Z[z]};${Z[z+1]};${Z[z+2]}`;if(A===38)this.fgColor=J;else this.bgColor=J;z+=3;continue}else if(Z[z+1]==="2"&&Z[z+4]!==void 0){let J=`${Z[z]};${Z[z+1]};${Z[z+2]};${Z[z+3]};${Z[z+4]}`;if(A===38)this.fgColor=J;else this.bgColor=J;z+=5;continue}}switch(A){case 0:this.reset();break;case 1:this.bold=!0;break;case 2:this.dim=!0;break;case 3:this.italic=!0;break;case 4:this.underline=!0;break;case 5:this.blink=!0;break;case 7:this.inverse=!0;break;case 8:this.hidden=!0;break;case 9:this.strikethrough=!0;break;case 21:this.bold=!1;break;case 22:this.bold=!1,this.dim=!1;break;case 23:this.italic=!1;break;case 24:this.underline=!1;break;case 25:this.blink=!1;break;case 27:this.inverse=!1;break;case 28:this.hidden=!1;break;case 29:this.strikethrough=!1;break;case 39:this.fgColor=null;break;case 49:this.bgColor=null;break;default:if(A>=30&&A<=37||A>=90&&A<=97)this.fgColor=String(A);else if(A>=40&&A<=47||A>=100&&A<=107)this.bgColor=String(A);break}z++}}reset(){this.bold=!1,this.dim=!1,this.italic=!1,this.underline=!1,this.blink=!1,this.inverse=!1,this.hidden=!1,this.strikethrough=!1,this.fgColor=null,this.bgColor=null}clear(){this.reset()}getActiveCodes(){let _=[];if(this.bold)_.push("1");if(this.dim)_.push("2");if(this.italic)_.push("3");if(this.underline)_.push("4");if(this.blink)_.push("5");if(this.inverse)_.push("7");if(this.hidden)_.push("8");if(this.strikethrough)_.push("9");if(this.fgColor)_.push(this.fgColor);if(this.bgColor)_.push(this.bgColor);if(_.length===0)return"";return`\x1B[${_.join(";")}m`}hasActiveCodes(){return this.bold||this.dim||this.italic||this.underline||this.blink||this.inverse||this.hidden||this.strikethrough||this.fgColor!==null||this.bgColor!==null}getLineEndReset(){if(this.underline)return"\x1B[24m";return""}}function VQ(_,$){let b=0;while(b<_.length){let Z=g_(_,b);if(Z)$.process(Z.code),b+=Z.length;else b++}}function Hw(_){let $=[],b="",Z="",z=!1,A=0;while(A<_.length){let J=g_(_,A);if(J){Z+=J.code,A+=J.length;continue}let U=_[A],G=U===" ";if(G!==z&&b)$.push(b),b="";if(Z)b+=Z,Z="";z=G,b+=U,A++}if(Z)b+=Z;if(b)$.push(b);return $}function e$(_,$){if(!_)return[""];let b=_.split(`
123
- `),Z=[],z=new M6;for(let A of b){let J=Z.length>0?z.getActiveCodes():"";Z.push(...qw(J+A,$)),VQ(A,z)}return Z.length>0?Z:[""]}function qw(_,$){if(!_)return[""];if(_0(_)<=$)return[_];let Z=[],z=new M6,A=Hw(_),J="",U=0;for(let G of A){let Y=_0(G),X=G.trim()==="";if(Y>$&&!X){if(J){let v=z.getLineEndReset();if(v)J+=v;Z.push(J),J="",U=0}let K=Dw(G,$,z);Z.push(...K.slice(0,-1)),J=K[K.length-1],U=_0(J);continue}if(U+Y>$&&U>0){let K=J.trimEnd(),v=z.getLineEndReset();if(v)K+=v;if(Z.push(K),X)J=z.getActiveCodes(),U=0;else J=z.getActiveCodes()+G,U=Y}else J+=G,U+=Y;VQ(G,z)}if(J)Z.push(J);return Z.length>0?Z.map((G)=>G.trimEnd()):[""]}var Vw=/[(){}[\]<>.,;:'"!?+\-=*/\\|&%^$#@~`]/;function i0(_){return/\s/.test(_)}function o0(_){return Vw.test(_)}function Dw(_,$,b){let Z=[],z=b.getActiveCodes(),A=0,J=0,U=[];while(J<_.length){let G=g_(_,J);if(G)U.push({type:"ansi",value:G.code}),J+=G.length;else{let Y=J;while(Y<_.length){if(g_(_,Y))break;Y++}let X=_.slice(J,Y);for(let Q of m9.segment(X))U.push({type:"grapheme",value:Q.segment});J=Y}}for(let G of U){if(G.type==="ansi"){z+=G.value,b.process(G.value);continue}let Y=G.value;if(!Y)continue;let X=_0(Y);if(A+X>$){let Q=b.getLineEndReset();if(Q)z+=Q;Z.push(z),z=b.getActiveCodes(),A=0}z+=Y,A+=X}if(z)Z.push(z);return Z.length>0?Z:[""]}function t$(_,$,b){let Z=_0(_),z=Math.max(0,$-Z),A=" ".repeat(z),J=_+A;return b(J)}function R0(_,$,b="...",Z=!1){let z=_0(_);if(z<=$)return Z?_+" ".repeat($-z):_;let A=_0(b),J=$-A;if(J<=0)return b.substring(0,$);let U=0,G=[];while(U<_.length){let K=g_(_,U);if(K)G.push({type:"ansi",value:K.code}),U+=K.length;else{let v=U;while(v<_.length){if(g_(_,v))break;v++}let V=_.slice(U,v);for(let w of m9.segment(V))G.push({type:"grapheme",value:w.segment});U=v}}let Y="",X=0;for(let K of G){if(K.type==="ansi"){Y+=K.value;continue}let v=K.value;if(!v)continue;let V=_0(v);if(X+V>J)break;Y+=v,X+=V}let Q=`${Y}\x1B[0m${b}`;if(Z){let K=_0(Q);return Q+" ".repeat(Math.max(0,$-K))}return Q}function wJ(_,$,b,Z=!1){return xJ(_,$,b,Z).text}function xJ(_,$,b,Z=!1){if(b<=0)return{text:"",width:0};let z=$+b,A="",J=0,U=0,G=0,Y="";while(G<_.length){let X=g_(_,G);if(X){if(U>=$&&U<z)A+=X.code;else if(U<$)Y+=X.code;G+=X.length;continue}let Q=G;while(Q<_.length&&!g_(_,Q))Q++;for(let{segment:K}of m9.segment(_.slice(G,Q))){let v=BJ(K),V=U>=$&&U<z,w=!Z||U+v<=z;if(V&&w){if(Y)A+=Y,Y="";A+=K,J+=v}if(U+=v,U>=z)break}if(G=Q,U>=z)break}return{text:A,width:J}}var gJ=new M6;function DQ(_,$,b,Z,z=!1){let A="",J=0,U="",G=0,Y=0,X=0,Q="",K=!1,v=b+Z;gJ.clear();while(X<_.length){let V=g_(_,X);if(V){if(gJ.process(V.code),Y<$)Q+=V.code;else if(Y>=b&&Y<v&&K)U+=V.code;X+=V.length;continue}let w=X;while(w<_.length&&!g_(_,w))w++;for(let{segment:P}of m9.segment(_.slice(X,w))){let O=BJ(P);if(Y<$){if(Q)A+=Q,Q="";A+=P,J+=O}else if(Y>=b&&Y<v){if(!z||Y+O<=v){if(!K)U+=gJ.getActiveCodes(),K=!0;U+=P,G+=O}}if(Y+=O,Z<=0?Y>=$:Y>=v)break}if(X=w,Z<=0?Y>=$:Y>=v)break}return{before:A,beforeWidth:J,after:U,afterWidth:G}}var _4=!1;function s$(_){_4=_}var WQ=new Set(["`","-","=","[","]","\\",";","'",",",".","/","!","@","#","$","%","^","&","*","(",")","_","+","|","~","{","}",":","<",">","?"]),z0={shift:1,alt:2,ctrl:4},NJ=192,B0={escape:27,tab:9,enter:13,space:32,backspace:127,kpEnter:57414},a0={up:-1,down:-2,right:-3,left:-4},w0={delete:-10,insert:-11,pageUp:-12,pageDown:-13,home:-14,end:-15},v_={up:["\x1B[A","\x1BOA"],down:["\x1B[B","\x1BOB"],right:["\x1B[C","\x1BOC"],left:["\x1B[D","\x1BOD"],home:["\x1B[H","\x1BOH","\x1B[1~","\x1B[7~"],end:["\x1B[F","\x1BOF","\x1B[4~","\x1B[8~"],insert:["\x1B[2~"],delete:["\x1B[3~"],pageUp:["\x1B[5~","\x1B[[5~"],pageDown:["\x1B[6~","\x1B[[6~"],clear:["\x1B[E","\x1BOE"],f1:["\x1BOP","\x1B[11~","\x1B[[A"],f2:["\x1BOQ","\x1B[12~","\x1B[[B"],f3:["\x1BOR","\x1B[13~","\x1B[[C"],f4:["\x1BOS","\x1B[14~","\x1B[[D"],f5:["\x1B[15~","\x1B[[E"],f6:["\x1B[17~"],f7:["\x1B[18~"],f8:["\x1B[19~"],f9:["\x1B[20~"],f10:["\x1B[21~"],f11:["\x1B[23~"],f12:["\x1B[24~"]},kw={up:["\x1B[a"],down:["\x1B[b"],right:["\x1B[c"],left:["\x1B[d"],clear:["\x1B[e"],insert:["\x1B[2$"],delete:["\x1B[3$"],pageUp:["\x1B[5$"],pageDown:["\x1B[6$"],home:["\x1B[7$"],end:["\x1B[8$"]},Ww={up:["\x1BOa"],down:["\x1BOb"],right:["\x1BOc"],left:["\x1BOd"],clear:["\x1BOe"],insert:["\x1B[2^"],delete:["\x1B[3^"],pageUp:["\x1B[5^"],pageDown:["\x1B[6^"],home:["\x1B[7^"],end:["\x1B[8^"]};var e0=(_,$)=>$.includes(_),Z_=(_,$,b)=>{if(b===z0.shift)return e0(_,kw[$]);if(b===z0.ctrl)return e0(_,Ww[$]);return!1},E6="press";function IJ(_){if(_.includes("\x1B[200~"))return!1;if(_.includes(":3u")||_.includes(":3~")||_.includes(":3A")||_.includes(":3B")||_.includes(":3C")||_.includes(":3D")||_.includes(":3H")||_.includes(":3F"))return!0;return!1}function O6(_){if(!_)return"press";let $=parseInt(_,10);if($===2)return"repeat";if($===3)return"release";return"press"}function gw(_){let $=_.match(/^\x1b\[(\d+)(?::(\d*))?(?::(\d+))?(?:;(\d+))?(?::(\d+))?u$/);if($){let A=parseInt($[1],10),J=$[2]&&$[2].length>0?parseInt($[2],10):void 0,U=$[3]?parseInt($[3],10):void 0,G=$[4]?parseInt($[4],10):1,Y=O6($[5]);return E6=Y,{codepoint:A,shiftedKey:J,baseLayoutKey:U,modifier:G-1,eventType:Y}}let b=_.match(/^\x1b\[1;(\d+)(?::(\d+))?([ABCD])$/);if(b){let A=parseInt(b[1],10),J=O6(b[2]),U={A:-1,B:-2,C:-3,D:-4};return E6=J,{codepoint:U[b[3]],modifier:A-1,eventType:J}}let Z=_.match(/^\x1b\[(\d+)(?:;(\d+))?(?::(\d+))?~$/);if(Z){let A=parseInt(Z[1],10),J=Z[2]?parseInt(Z[2],10):1,U=O6(Z[3]),Y={2:w0.insert,3:w0.delete,5:w0.pageUp,6:w0.pageDown,7:w0.home,8:w0.end}[A];if(Y!==void 0)return E6=U,{codepoint:Y,modifier:J-1,eventType:U}}let z=_.match(/^\x1b\[1;(\d+)(?::(\d+))?([HF])$/);if(z){let A=parseInt(z[1],10),J=O6(z[2]),U=z[3]==="H"?w0.home:w0.end;return E6=J,{codepoint:U,modifier:A-1,eventType:J}}return null}function d(_,$,b){let Z=gw(_);if(!Z)return!1;let z=Z.modifier&~NJ,A=b&~NJ;if(z!==A)return!1;if(Z.codepoint===$)return!0;if(Z.baseLayoutKey!==void 0&&Z.baseLayoutKey===$){let J=Z.codepoint,U=J>=97&&J<=122,G=WQ.has(String.fromCharCode(J));if(!U&&!G)return!0}return!1}function Bw(_){let $=_.match(/^\x1b\[27;(\d+);(\d+)~$/);if(!$)return null;let b=parseInt($[1],10);return{codepoint:parseInt($[2],10),modifier:b-1}}function j6(_,$,b){let Z=Bw(_);if(!Z)return!1;return Z.codepoint===$&&Z.modifier===b}function ww(_){let $=_.toLowerCase(),b=$.charCodeAt(0);if(b>=97&&b<=122||$==="["||$==="\\"||$==="]"||$==="_")return String.fromCharCode(b&31);if($==="-")return String.fromCharCode(31);return null}function kQ(_){return _>="0"&&_<="9"}function P6(_,$,b){if(b===0)return!1;return j6(_,$,b)}function xw(_){let $=_.toLowerCase().split("+"),b=$[$.length-1];if(!b)return null;return{key:b,ctrl:$.includes("ctrl"),shift:$.includes("shift"),alt:$.includes("alt")}}function C_(_,$){let b=xw($);if(!b)return!1;let{key:Z,ctrl:z,shift:A,alt:J}=b,U=0;if(A)U|=z0.shift;if(J)U|=z0.alt;if(z)U|=z0.ctrl;switch(Z){case"escape":case"esc":if(U!==0)return!1;return _==="\x1B"||d(_,B0.escape,0);case"space":if(!_4){if(z&&!J&&!A&&_==="\x00")return!0;if(J&&!z&&!A&&_==="\x1B ")return!0}if(U===0)return _===" "||d(_,B0.space,0);return d(_,B0.space,U);case"tab":if(A&&!z&&!J)return _==="\x1B[Z"||d(_,B0.tab,z0.shift);if(U===0)return _==="\t"||d(_,B0.tab,0);return d(_,B0.tab,U);case"enter":case"return":if(A&&!z&&!J){if(d(_,B0.enter,z0.shift)||d(_,B0.kpEnter,z0.shift))return!0;if(j6(_,B0.enter,z0.shift))return!0;if(_4)return _==="\x1B\r"||_===`
124
- `;return!1}if(J&&!z&&!A){if(d(_,B0.enter,z0.alt)||d(_,B0.kpEnter,z0.alt))return!0;if(j6(_,B0.enter,z0.alt))return!0;if(!_4)return _==="\x1B\r";return!1}if(U===0)return _==="\r"||!_4&&_===`
125
- `||_==="\x1BOM"||d(_,B0.enter,0)||d(_,B0.kpEnter,0);return d(_,B0.enter,U)||d(_,B0.kpEnter,U)||j6(_,B0.enter,U);case"backspace":if(J&&!z&&!A){if(_==="\x1B"||_==="\x1B\b")return!0;return d(_,B0.backspace,z0.alt)}if(U===0)return _===""||_==="\b"||d(_,B0.backspace,0);return d(_,B0.backspace,U);case"insert":if(U===0)return e0(_,v_.insert)||d(_,w0.insert,0);if(Z_(_,"insert",U))return!0;return d(_,w0.insert,U);case"delete":if(U===0)return e0(_,v_.delete)||d(_,w0.delete,0);if(Z_(_,"delete",U))return!0;return d(_,w0.delete,U);case"clear":if(U===0)return e0(_,v_.clear);return Z_(_,"clear",U);case"home":if(U===0)return e0(_,v_.home)||d(_,w0.home,0);if(Z_(_,"home",U))return!0;return d(_,w0.home,U);case"end":if(U===0)return e0(_,v_.end)||d(_,w0.end,0);if(Z_(_,"end",U))return!0;return d(_,w0.end,U);case"pageup":if(U===0)return e0(_,v_.pageUp)||d(_,w0.pageUp,0);if(Z_(_,"pageUp",U))return!0;return d(_,w0.pageUp,U);case"pagedown":if(U===0)return e0(_,v_.pageDown)||d(_,w0.pageDown,0);if(Z_(_,"pageDown",U))return!0;return d(_,w0.pageDown,U);case"up":if(J&&!z&&!A)return _==="\x1Bp"||d(_,a0.up,z0.alt);if(U===0)return e0(_,v_.up)||d(_,a0.up,0);if(Z_(_,"up",U))return!0;return d(_,a0.up,U);case"down":if(J&&!z&&!A)return _==="\x1Bn"||d(_,a0.down,z0.alt);if(U===0)return e0(_,v_.down)||d(_,a0.down,0);if(Z_(_,"down",U))return!0;return d(_,a0.down,U);case"left":if(J&&!z&&!A)return _==="\x1B[1;3D"||!_4&&_==="\x1BB"||_==="\x1Bb"||d(_,a0.left,z0.alt);if(z&&!J&&!A)return _==="\x1B[1;5D"||Z_(_,"left",z0.ctrl)||d(_,a0.left,z0.ctrl);if(U===0)return e0(_,v_.left)||d(_,a0.left,0);if(Z_(_,"left",U))return!0;return d(_,a0.left,U);case"right":if(J&&!z&&!A)return _==="\x1B[1;3C"||!_4&&_==="\x1BF"||_==="\x1Bf"||d(_,a0.right,z0.alt);if(z&&!J&&!A)return _==="\x1B[1;5C"||Z_(_,"right",z0.ctrl)||d(_,a0.right,z0.ctrl);if(U===0)return e0(_,v_.right)||d(_,a0.right,0);if(Z_(_,"right",U))return!0;return d(_,a0.right,U);case"f1":case"f2":case"f3":case"f4":case"f5":case"f6":case"f7":case"f8":case"f9":case"f10":case"f11":case"f12":{if(U!==0)return!1;return e0(_,v_[Z])}}if(Z.length===1&&(Z>="a"&&Z<="z"||kQ(Z)||WQ.has(Z))){let G=Z.charCodeAt(0),Y=ww(Z),X=Z>="a"&&Z<="z",Q=kQ(Z);if(z&&J&&!A&&!_4&&Y)return _===`\x1B${Y}`;if(J&&!z&&!A&&!_4&&(X||Q)){if(_===`\x1B${Z}`)return!0}if(z&&!A&&!J){if(Y&&_===Y)return!0;return d(_,G,z0.ctrl)||P6(_,G,z0.ctrl)}if(z&&A&&!J)return d(_,G,z0.shift+z0.ctrl)||P6(_,G,z0.shift+z0.ctrl);if(A&&!z&&!J){if(X&&_===Z.toUpperCase())return!0;return d(_,G,z0.shift)||P6(_,G,z0.shift)}if(U!==0)return d(_,G,U)||P6(_,G,U);return _===Z||d(_,G,0)}return!1}var Nw=/^\x1b\[(\d+)(?::(\d*))?(?::(\d+))?(?:;(\d+))?(?::(\d+))?u$/,Iw=z0.shift|NJ;function _2(_){let $=_.match(Nw);if(!$)return;let b=Number.parseInt($[1]??"",10);if(!Number.isFinite(b))return;let Z=$[2]&&$[2].length>0?Number.parseInt($[2],10):void 0,z=$[4]?Number.parseInt($[4],10):1,A=Number.isFinite(z)?z-1:0;if((A&~Iw)!==0)return;if(A&(z0.alt|z0.ctrl))return;let J=b;if(A&z0.shift&&typeof Z==="number")J=Z;if(!Number.isFinite(J)||J<32)return;try{return String.fromCodePoint(J)}catch{return}}var gQ={cursorUp:"up",cursorDown:"down",cursorLeft:["left","ctrl+b"],cursorRight:["right","ctrl+f"],cursorWordLeft:["alt+left","ctrl+left","alt+b"],cursorWordRight:["alt+right","ctrl+right","alt+f"],cursorLineStart:["home","ctrl+a"],cursorLineEnd:["end","ctrl+e"],jumpForward:"ctrl+]",jumpBackward:"ctrl+alt+]",pageUp:"pageUp",pageDown:"pageDown",deleteCharBackward:"backspace",deleteCharForward:["delete","ctrl+d"],deleteWordBackward:["ctrl+w","alt+backspace"],deleteWordForward:["alt+d","alt+delete"],deleteToLineStart:"ctrl+u",deleteToLineEnd:"ctrl+k",newLine:"shift+enter",submit:"enter",tab:"tab",selectUp:"up",selectDown:"down",selectPageUp:"pageUp",selectPageDown:"pageDown",selectConfirm:"enter",selectCancel:["escape","ctrl+c"],copy:"ctrl+c",yank:"ctrl+y",yankPop:"alt+y",undo:"ctrl+-",expandTools:"ctrl+o",treeFoldOrUp:["ctrl+left","alt+left"],treeUnfoldOrDown:["ctrl+right","alt+right"],toggleSessionPath:"ctrl+p",toggleSessionSort:"ctrl+s",renameSession:"ctrl+r",deleteSession:"ctrl+d",deleteSessionNoninvasive:"ctrl+backspace"};class EJ{actionToKeys;constructor(_={}){this.actionToKeys=new Map,this.buildMaps(_)}buildMaps(_){this.actionToKeys.clear();for(let[$,b]of Object.entries(gQ)){let Z=Array.isArray(b)?b:[b];this.actionToKeys.set($,[...Z])}for(let[$,b]of Object.entries(_)){if(b===void 0)continue;let Z=Array.isArray(b)?b:[b];this.actionToKeys.set($,Z)}}matches(_,$){let b=this.actionToKeys.get($);if(!b)return!1;for(let Z of b)if(C_(_,Z))return!0;return!1}getKeys(_){return this.actionToKeys.get(_)??[]}setConfig(_){this.buildMaps(_)}}var MJ=null;function f_(){if(!MJ)MJ=new EJ;return MJ}class u9{text;paddingX;paddingY;customBgFn;cachedText;cachedWidth;cachedLines;constructor(_="",$=1,b=1,Z){this.text=_,this.paddingX=$,this.paddingY=b,this.customBgFn=Z}setText(_){this.text=_,this.cachedText=void 0,this.cachedWidth=void 0,this.cachedLines=void 0}setCustomBgFn(_){this.customBgFn=_,this.cachedText=void 0,this.cachedWidth=void 0,this.cachedLines=void 0}invalidate(){this.cachedText=void 0,this.cachedWidth=void 0,this.cachedLines=void 0}render(_){if(this.cachedLines&&this.cachedText===this.text&&this.cachedWidth===_)return this.cachedLines;if(!this.text||this.text.trim()===""){let X=[];return this.cachedText=this.text,this.cachedWidth=_,this.cachedLines=X,X}let $=this.text.replace(/\t/g," "),b=Math.max(1,_-this.paddingX*2),Z=e$($,b),z=" ".repeat(this.paddingX),A=" ".repeat(this.paddingX),J=[];for(let X of Z){let Q=z+X+A;if(this.customBgFn)J.push(t$(Q,_,this.customBgFn));else{let K=_0(Q),v=Math.max(0,_-K);J.push(Q+" ".repeat(v))}}let U=" ".repeat(_),G=[];for(let X=0;X<this.paddingY;X++){let Q=this.customBgFn?t$(U,_,this.customBgFn):U;G.push(Q)}let Y=[...G,...J,...G];return this.cachedText=this.text,this.cachedWidth=_,this.cachedLines=Y,Y.length>0?Y:[""]}}class S6 extends u9{spinnerColorFn;messageColorFn;message;frames=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];currentFrame=0;intervalId=null;ui=null;constructor(_,$,b,Z="Loading..."){super("",1,0);this.spinnerColorFn=$,this.messageColorFn=b,this.message=Z,this.ui=_,this.start()}render(_){return["",...super.render(_)]}start(){this.updateDisplay(),this.intervalId=setInterval(()=>{this.currentFrame=(this.currentFrame+1)%this.frames.length,this.updateDisplay()},80)}stop(){if(this.intervalId)clearInterval(this.intervalId),this.intervalId=null}setMessage(_){this.message=_,this.updateDisplay()}updateDisplay(){let _=this.frames[this.currentFrame];if(this.setText(`${this.spinnerColorFn(_)} ${this.messageColorFn(this.message)}`),this.ui)this.ui.requestRender()}}class BQ extends S6{abortController=new AbortController;onAbort;get signal(){return this.abortController.signal}get aborted(){return this.abortController.signal.aborted}handleInput(_){if(f_().matches(_,"selectCancel"))this.abortController.abort(),this.onAbort?.()}dispose(){this.stop()}}class $2{ring=[];push(_,$){if(!_)return;if($.accumulate&&this.ring.length>0){let b=this.ring.pop();this.ring.push($.prepend?_+b:b+_)}else this.ring.push(_)}peek(){return this.ring.length>0?this.ring[this.ring.length-1]:void 0}rotate(){if(this.ring.length>1){let _=this.ring.pop();this.ring.unshift(_)}}get length(){return this.ring.length}}import*as W4 from"node:fs";import*as jJ from"node:os";import*as h9 from"node:path";var OJ=null,Mw={widthPx:9,heightPx:18};function PJ(_){Mw=_}function NQ(){let _=process.env.TERM_PROGRAM?.toLowerCase()||"",$=process.env.TERM?.toLowerCase()||"",b=process.env.COLORTERM?.toLowerCase()||"";if(process.env.KITTY_WINDOW_ID||_==="kitty")return{images:"kitty",trueColor:!0,hyperlinks:!0};if(_==="ghostty"||$.includes("ghostty")||process.env.GHOSTTY_RESOURCES_DIR)return{images:"kitty",trueColor:!0,hyperlinks:!0};if(process.env.WEZTERM_PANE||_==="wezterm")return{images:"kitty",trueColor:!0,hyperlinks:!0};if(process.env.ITERM_SESSION_ID||_==="iterm.app")return{images:"iterm2",trueColor:!0,hyperlinks:!0};if(_==="vscode")return{images:null,trueColor:!0,hyperlinks:!0};if(_==="alacritty")return{images:null,trueColor:!0,hyperlinks:!0};return{images:null,trueColor:b==="truecolor"||b==="24bit",hyperlinks:!0}}function R6(){if(!OJ)OJ=NQ();return OJ}var wQ="\x1B_G",xQ="\x1B]1337;File=";function z2(_){if(_.startsWith(wQ)||_.startsWith(xQ))return!0;return _.includes(wQ)||_.includes(xQ)}function SJ(_){return _!==null&&"focused"in _}var a4="\x1B_pi:c\x07";function IQ(_,$){if(_===void 0)return;if(typeof _==="number")return _;let b=_.match(/^(\d+(?:\.\d+)?)%$/);if(b)return Math.floor($*parseFloat(b[1])/100);return}class RJ{children=[];addChild(_){this.children.push(_)}removeChild(_){let $=this.children.indexOf(_);if($!==-1)this.children.splice($,1)}clear(){this.children=[]}invalidate(){for(let _ of this.children)_.invalidate?.()}render(_){let $=[];for(let b of this.children)$.push(...b.render(_));return $}}class c9 extends RJ{terminal;previousLines=[];previousWidth=0;previousHeight=0;focusedComponent=null;inputListeners=new Set;onDebug;renderRequested=!1;cursorRow=0;hardwareCursorRow=0;inputBuffer="";cellSizeQueryPending=!1;showHardwareCursor=process.env.PI_HARDWARE_CURSOR==="1";clearOnShrink=process.env.PI_CLEAR_ON_SHRINK==="1";maxLinesRendered=0;previousViewportTop=0;fullRedrawCount=0;stopped=!1;focusOrderCounter=0;overlayStack=[];constructor(_,$){super();if(this.terminal=_,$!==void 0)this.showHardwareCursor=$}get fullRedraws(){return this.fullRedrawCount}getShowHardwareCursor(){return this.showHardwareCursor}setShowHardwareCursor(_){if(this.showHardwareCursor===_)return;if(this.showHardwareCursor=_,!_)this.terminal.hideCursor();this.requestRender()}getClearOnShrink(){return this.clearOnShrink}setClearOnShrink(_){this.clearOnShrink=_}setFocus(_){if(SJ(this.focusedComponent))this.focusedComponent.focused=!1;if(this.focusedComponent=_,SJ(_))_.focused=!0}showOverlay(_,$){let b={component:_,options:$,preFocus:this.focusedComponent,hidden:!1,focusOrder:++this.focusOrderCounter};if(this.overlayStack.push(b),!$?.nonCapturing&&this.isOverlayVisible(b))this.setFocus(_);return this.terminal.hideCursor(),this.requestRender(),{hide:()=>{let Z=this.overlayStack.indexOf(b);if(Z!==-1){if(this.overlayStack.splice(Z,1),this.focusedComponent===_){let z=this.getTopmostVisibleOverlay();this.setFocus(z?.component??b.preFocus)}if(this.overlayStack.length===0)this.terminal.hideCursor();this.requestRender()}},setHidden:(Z)=>{if(b.hidden===Z)return;if(b.hidden=Z,Z){if(this.focusedComponent===_){let z=this.getTopmostVisibleOverlay();this.setFocus(z?.component??b.preFocus)}}else if(!$?.nonCapturing&&this.isOverlayVisible(b))b.focusOrder=++this.focusOrderCounter,this.setFocus(_);this.requestRender()},isHidden:()=>b.hidden,focus:()=>{if(!this.overlayStack.includes(b)||!this.isOverlayVisible(b))return;if(this.focusedComponent!==_)this.setFocus(_);b.focusOrder=++this.focusOrderCounter,this.requestRender()},unfocus:()=>{if(this.focusedComponent!==_)return;let Z=this.getTopmostVisibleOverlay();this.setFocus(Z&&Z!==b?Z.component:b.preFocus),this.requestRender()},isFocused:()=>this.focusedComponent===_}}hideOverlay(){let _=this.overlayStack.pop();if(!_)return;if(this.focusedComponent===_.component){let $=this.getTopmostVisibleOverlay();this.setFocus($?.component??_.preFocus)}if(this.overlayStack.length===0)this.terminal.hideCursor();this.requestRender()}hasOverlay(){return this.overlayStack.some((_)=>this.isOverlayVisible(_))}isOverlayVisible(_){if(_.hidden)return!1;if(_.options?.visible)return _.options.visible(this.terminal.columns,this.terminal.rows);return!0}getTopmostVisibleOverlay(){for(let _=this.overlayStack.length-1;_>=0;_--){if(this.overlayStack[_].options?.nonCapturing)continue;if(this.isOverlayVisible(this.overlayStack[_]))return this.overlayStack[_]}return}invalidate(){super.invalidate();for(let _ of this.overlayStack)_.component.invalidate?.()}start(){this.stopped=!1,this.terminal.start((_)=>this.handleInput(_),()=>this.requestRender()),this.terminal.hideCursor(),this.queryCellSize(),this.requestRender()}addInputListener(_){return this.inputListeners.add(_),()=>{this.inputListeners.delete(_)}}removeInputListener(_){this.inputListeners.delete(_)}queryCellSize(){if(!R6().images)return;this.cellSizeQueryPending=!0,this.terminal.write("\x1B[16t")}stop(){if(this.stopped=!0,this.previousLines.length>0){let $=this.previousLines.length-this.hardwareCursorRow;if($>0)this.terminal.write(`\x1B[${$}B`);else if($<0)this.terminal.write(`\x1B[${-$}A`);this.terminal.write(`\r
126
- `)}this.terminal.showCursor(),this.terminal.stop()}requestRender(_=!1){if(_)this.previousLines=[],this.previousWidth=-1,this.previousHeight=-1,this.cursorRow=0,this.hardwareCursorRow=0,this.maxLinesRendered=0,this.previousViewportTop=0;if(this.renderRequested)return;this.renderRequested=!0,process.nextTick(()=>{this.renderRequested=!1,this.doRender()})}handleInput(_){if(this.inputListeners.size>0){let b=_;for(let Z of this.inputListeners){let z=Z(b);if(z?.consume)return;if(z?.data!==void 0)b=z.data}if(b.length===0)return;_=b}if(this.cellSizeQueryPending){this.inputBuffer+=_;let b=this.parseCellSizeResponse();if(b.length===0)return;_=b}if(C_(_,"shift+ctrl+d")&&this.onDebug){this.onDebug();return}let $=this.overlayStack.find((b)=>b.component===this.focusedComponent);if($&&!this.isOverlayVisible($)){let b=this.getTopmostVisibleOverlay();if(b)this.setFocus(b.component);else this.setFocus($.preFocus)}if(this.focusedComponent?.handleInput){if(IJ(_)&&!this.focusedComponent.wantsKeyRelease)return;this.focusedComponent.handleInput(_),this.requestRender()}}parseCellSizeResponse(){let _=/\x1b\[6;(\d+);(\d+)t/,$=this.inputBuffer.match(_);if($){let z=parseInt($[1],10),A=parseInt($[2],10);if(z>0&&A>0)PJ({widthPx:A,heightPx:z}),this.invalidate(),this.requestRender();this.inputBuffer=this.inputBuffer.replace(_,""),this.cellSizeQueryPending=!1}if(/\x1b(\[6?;?[\d;]*)?$/.test(this.inputBuffer)){let z=this.inputBuffer[this.inputBuffer.length-1];if(!/[a-zA-Z~]/.test(z))return""}let Z=this.inputBuffer;return this.inputBuffer="",this.cellSizeQueryPending=!1,Z}resolveOverlayLayout(_,$,b,Z){let z=_??{},A=typeof z.margin==="number"?{top:z.margin,right:z.margin,bottom:z.margin,left:z.margin}:z.margin??{},J=Math.max(0,A.top??0),U=Math.max(0,A.right??0),G=Math.max(0,A.bottom??0),Y=Math.max(0,A.left??0),X=Math.max(1,b-Y-U),Q=Math.max(1,Z-J-G),K=IQ(z.width,b)??Math.min(80,X);if(z.minWidth!==void 0)K=Math.max(K,z.minWidth);K=Math.max(1,Math.min(K,X));let v=IQ(z.maxHeight,Z);if(v!==void 0)v=Math.max(1,Math.min(v,Q));let V=v!==void 0?Math.min($,v):$,w,P;if(z.row!==void 0)if(typeof z.row==="string"){let O=z.row.match(/^(\d+(?:\.\d+)?)%$/);if(O){let B=Math.max(0,Q-V),T=parseFloat(O[1])/100;w=J+Math.floor(B*T)}else w=this.resolveAnchorRow("center",V,Q,J)}else w=z.row;else{let O=z.anchor??"center";w=this.resolveAnchorRow(O,V,Q,J)}if(z.col!==void 0)if(typeof z.col==="string"){let O=z.col.match(/^(\d+(?:\.\d+)?)%$/);if(O){let B=Math.max(0,X-K),T=parseFloat(O[1])/100;P=Y+Math.floor(B*T)}else P=this.resolveAnchorCol("center",K,X,Y)}else P=z.col;else{let O=z.anchor??"center";P=this.resolveAnchorCol(O,K,X,Y)}if(z.offsetY!==void 0)w+=z.offsetY;if(z.offsetX!==void 0)P+=z.offsetX;return w=Math.max(J,Math.min(w,Z-G-V)),P=Math.max(Y,Math.min(P,b-U-K)),{width:K,row:w,col:P,maxHeight:v}}resolveAnchorRow(_,$,b,Z){switch(_){case"top-left":case"top-center":case"top-right":return Z;case"bottom-left":case"bottom-center":case"bottom-right":return Z+b-$;case"left-center":case"center":case"right-center":return Z+Math.floor((b-$)/2)}}resolveAnchorCol(_,$,b,Z){switch(_){case"top-left":case"left-center":case"bottom-left":return Z;case"top-right":case"right-center":case"bottom-right":return Z+b-$;case"top-center":case"center":case"bottom-center":return Z+Math.floor((b-$)/2)}}compositeOverlays(_,$,b){if(this.overlayStack.length===0)return _;let Z=[..._],z=[],A=Z.length,J=this.overlayStack.filter((Y)=>this.isOverlayVisible(Y));J.sort((Y,X)=>Y.focusOrder-X.focusOrder);for(let Y of J){let{component:X,options:Q}=Y,{width:K,maxHeight:v}=this.resolveOverlayLayout(Q,0,$,b),V=X.render(K);if(v!==void 0&&V.length>v)V=V.slice(0,v);let{row:w,col:P}=this.resolveOverlayLayout(Q,V.length,$,b);z.push({overlayLines:V,row:w,col:P,w:K}),A=Math.max(A,w+V.length)}let U=Math.max(this.maxLinesRendered,A);while(Z.length<U)Z.push("");let G=Math.max(0,U-b);for(let{overlayLines:Y,row:X,col:Q,w:K}of z)for(let v=0;v<Y.length;v++){let V=G+X+v;if(V>=0&&V<Z.length){let w=_0(Y[v])>K?wJ(Y[v],0,K,!0):Y[v];Z[V]=this.compositeLineAt(Z[V],w,Q,K,$)}}return Z}static SEGMENT_RESET="\x1B[0m\x1B]8;;\x07";applyLineResets(_){let $=c9.SEGMENT_RESET;for(let b=0;b<_.length;b++){let Z=_[b];if(!z2(Z))_[b]=Z+$}return _}compositeLineAt(_,$,b,Z,z){if(z2(_))return _;let A=b+Z,J=DQ(_,b,A,z-A,!0),U=xJ($,0,Z,!0),G=Math.max(0,b-J.beforeWidth),Y=Math.max(0,Z-U.width),X=Math.max(b,J.beforeWidth),Q=Math.max(Z,U.width),K=Math.max(0,z-X-Q),v=Math.max(0,K-J.afterWidth),V=c9.SEGMENT_RESET,w=J.before+" ".repeat(G)+V+U.text+" ".repeat(Y)+V+J.after+" ".repeat(v);if(_0(w)<=z)return w;return wJ(w,0,z,!0)}extractCursorPosition(_,$){let b=Math.max(0,_.length-$);for(let Z=_.length-1;Z>=b;Z--){let z=_[Z],A=z.indexOf(a4);if(A!==-1){let J=z.slice(0,A),U=_0(J);return _[Z]=z.slice(0,A)+z.slice(A+a4.length),{row:Z,col:U}}}return null}doRender(){if(this.stopped)return;let _=this.terminal.columns,$=this.terminal.rows,b=Math.max(0,this.maxLinesRendered-$),Z=this.previousViewportTop,z=this.hardwareCursorRow,A=(H)=>{let q=z-Z;return H-b-q},J=this.render(_);if(this.overlayStack.length>0)J=this.compositeOverlays(J,_,$);let U=this.extractCursorPosition(J,$);J=this.applyLineResets(J);let G=this.previousWidth!==0&&this.previousWidth!==_,Y=this.previousHeight!==0&&this.previousHeight!==$,X=(H)=>{this.fullRedrawCount+=1;let q="\x1B[?2026h";if(H)q+="\x1B[3J\x1B[2J\x1B[H";for(let g=0;g<J.length;g++){if(g>0)q+=`\r
127
- `;q+=J[g]}if(q+="\x1B[?2026l",this.terminal.write(q),this.cursorRow=Math.max(0,J.length-1),this.hardwareCursorRow=this.cursorRow,H)this.maxLinesRendered=J.length;else this.maxLinesRendered=Math.max(this.maxLinesRendered,J.length);this.previousViewportTop=Math.max(0,this.maxLinesRendered-$),this.positionHardwareCursor(U,J.length),this.previousLines=J,this.previousWidth=_,this.previousHeight=$},Q=process.env.PI_DEBUG_REDRAW==="1",K=(H)=>{if(!Q)return;let q=h9.join(jJ.homedir(),".pi","agent","pi-debug.log"),g=`[${new Date().toISOString()}] fullRender: ${H} (prev=${this.previousLines.length}, new=${J.length}, height=${$})
128
- `;W4.appendFileSync(q,g)};if(this.previousLines.length===0&&!G&&!Y){K("first render"),X(!1);return}if(G||Y){K(`terminal size changed (${this.previousWidth}x${this.previousHeight} -> ${_}x${$})`),X(!0);return}if(this.clearOnShrink&&J.length<this.maxLinesRendered&&this.overlayStack.length===0){K(`clearOnShrink (maxLinesRendered=${this.maxLinesRendered})`),X(!0);return}let v=-1,V=-1,w=Math.max(J.length,this.previousLines.length);for(let H=0;H<w;H++){let q=H<this.previousLines.length?this.previousLines[H]:"",g=H<J.length?J[H]:"";if(q!==g){if(v===-1)v=H;V=H}}let P=J.length>this.previousLines.length;if(P){if(v===-1)v=this.previousLines.length;V=J.length-1}let O=P&&v===this.previousLines.length&&v>0;if(v===-1){this.positionHardwareCursor(U,J.length),this.previousViewportTop=Math.max(0,this.maxLinesRendered-$),this.previousHeight=$;return}if(v>=J.length){if(this.previousLines.length>J.length){let H="\x1B[?2026h",q=Math.max(0,J.length-1),g=A(q);if(g>0)H+=`\x1B[${g}B`;else if(g<0)H+=`\x1B[${-g}A`;H+="\r";let D=this.previousLines.length-J.length;if(D>$){K(`extraLines > height (${D} > ${$})`),X(!0);return}if(D>0)H+="\x1B[1B";for(let W=0;W<D;W++)if(H+="\r\x1B[2K",W<D-1)H+="\x1B[1B";if(D>0)H+=`\x1B[${D}A`;H+="\x1B[?2026l",this.terminal.write(H),this.cursorRow=q,this.hardwareCursorRow=q}this.positionHardwareCursor(U,J.length),this.previousLines=J,this.previousWidth=_,this.previousHeight=$,this.previousViewportTop=Math.max(0,this.maxLinesRendered-$);return}let B=Math.max(0,this.previousLines.length-$);if(v<B){K(`firstChanged < viewportTop (${v} < ${B})`),X(!0);return}let T="\x1B[?2026h",y=Z+$-1,u=O?v-1:v;if(u>y){let H=Math.max(0,Math.min($-1,z-Z)),q=$-1-H;if(q>0)T+=`\x1B[${q}B`;let g=u-y;T+=`\r
129
- `.repeat(g),Z+=g,b+=g,z=u}let E=A(u);if(E>0)T+=`\x1B[${E}B`;else if(E<0)T+=`\x1B[${-E}A`;T+=O?`\r
130
- `:"\r";let C=Math.min(V,J.length-1);for(let H=v;H<=C;H++){if(H>v)T+=`\r
131
- `;T+="\x1B[2K";let q=J[H];if(!z2(q)&&_0(q)>_){let D=h9.join(jJ.homedir(),".pi","agent","pi-crash.log"),W=[`Crash at ${new Date().toISOString()}`,`Terminal width: ${_}`,`Line ${H} visible width: ${_0(q)}`,"","=== All rendered lines ===",...J.map((k,x)=>`[${x}] (w=${_0(k)}) ${k}`),""].join(`
132
- `);W4.mkdirSync(h9.dirname(D),{recursive:!0}),W4.writeFileSync(D,W),this.stop();let N=[`Rendered line ${H} exceeds terminal width (${_0(q)} > ${_}).`,"","This is likely caused by a custom TUI component not truncating its output.","Use visibleWidth() to measure and truncateToWidth() to truncate lines.","",`Debug log written to: ${D}`].join(`
133
- `);throw Error(N)}T+=q}let F=C;if(this.previousLines.length>J.length){if(C<J.length-1){let q=J.length-1-C;T+=`\x1B[${q}B`,F=J.length-1}let H=this.previousLines.length-J.length;for(let q=J.length;q<this.previousLines.length;q++)T+=`\r
134
- \x1B[2K`;T+=`\x1B[${H}A`}if(T+="\x1B[?2026l",process.env.PI_TUI_DEBUG==="1"){W4.mkdirSync("/tmp/tui",{recursive:!0});let q=h9.join("/tmp/tui",`render-${Date.now()}-${Math.random().toString(36).slice(2)}.log`),g=[`firstChanged: ${v}`,`viewportTop: ${b}`,`cursorRow: ${this.cursorRow}`,`height: ${$}`,`lineDiff: ${E}`,`hardwareCursorRow: ${z}`,`renderEnd: ${C}`,`finalCursorRow: ${F}`,`cursorPos: ${JSON.stringify(U)}`,`newLines.length: ${J.length}`,`previousLines.length: ${this.previousLines.length}`,"","=== newLines ===",JSON.stringify(J,null,2),"","=== previousLines ===",JSON.stringify(this.previousLines,null,2),"","=== buffer ===",JSON.stringify(T)].join(`
135
- `);W4.writeFileSync(q,g)}this.terminal.write(T),this.cursorRow=Math.max(0,J.length-1),this.hardwareCursorRow=F,this.maxLinesRendered=Math.max(this.maxLinesRendered,J.length),this.previousViewportTop=Math.max(0,this.maxLinesRendered-$),this.positionHardwareCursor(U,J.length),this.previousLines=J,this.previousWidth=_,this.previousHeight=$}positionHardwareCursor(_,$){if(!_||$<=0){this.terminal.hideCursor();return}let b=Math.max(0,Math.min(_.row,$-1)),Z=Math.max(0,_.col),z=b-this.hardwareCursorRow,A="";if(z>0)A+=`\x1B[${z}B`;else if(z<0)A+=`\x1B[${-z}A`;if(A+=`\x1B[${Z+1}G`,A)this.terminal.write(A);if(this.hardwareCursorRow=b,this.showHardwareCursor)this.terminal.showCursor();else this.terminal.hideCursor()}}class b2{stack=[];push(_){this.stack.push(structuredClone(_))}pop(){return this.stack.pop()}clear(){this.stack.length=0}get length(){return this.stack.length}}var Ew=(_)=>_.replace(/[\r\n]+/g," ").trim();class g4{items=[];filteredItems=[];selectedIndex=0;maxVisible=5;theme;onSelect;onCancel;onSelectionChange;constructor(_,$,b){this.items=_,this.filteredItems=_,this.maxVisible=$,this.theme=b}setFilter(_){this.filteredItems=this.items.filter(($)=>$.value.toLowerCase().startsWith(_.toLowerCase())),this.selectedIndex=0}setSelectedIndex(_){this.selectedIndex=Math.max(0,Math.min(_,this.filteredItems.length-1))}invalidate(){}render(_){let $=[];if(this.filteredItems.length===0)return $.push(this.theme.noMatch(" No matching commands")),$;let b=Math.max(0,Math.min(this.selectedIndex-Math.floor(this.maxVisible/2),this.filteredItems.length-this.maxVisible)),Z=Math.min(b+this.maxVisible,this.filteredItems.length);for(let z=b;z<Z;z++){let A=this.filteredItems[z];if(!A)continue;let J=z===this.selectedIndex,U=A.description?Ew(A.description):void 0,G="";if(J){let X=A.label||A.value;if(U&&_>40){let Q=Math.min(30,_-2-4),K=R0(X,Q,""),v=" ".repeat(Math.max(1,32-K.length)),V=2+K.length+v.length,w=_-V-2;if(w>10){let P=R0(U,w,"");G=this.theme.selectedText(`→ ${K}${v}${P}`)}else{let P=_-2-2;G=this.theme.selectedText(`→ ${R0(X,P,"")}`)}}else{let Q=_-2-2;G=this.theme.selectedText(`→ ${R0(X,Q,"")}`)}}else{let Y=A.label||A.value,X=" ";if(U&&_>40){let Q=Math.min(30,_-2-4),K=R0(Y,Q,""),v=" ".repeat(Math.max(1,32-K.length)),V=2+K.length+v.length,w=_-V-2;if(w>10){let P=R0(U,w,""),O=this.theme.description(v+P);G=" "+K+O}else{let P=_-2-2;G=" "+R0(Y,P,"")}}else{let Q=_-2-2;G=" "+R0(Y,Q,"")}}$.push(G)}if(b>0||Z<this.filteredItems.length){let z=` (${this.selectedIndex+1}/${this.filteredItems.length})`;$.push(this.theme.scrollInfo(R0(z,_-2,"")))}return $}handleInput(_){let $=f_();if($.matches(_,"selectUp"))this.selectedIndex=this.selectedIndex===0?this.filteredItems.length-1:this.selectedIndex-1,this.notifySelectionChange();else if($.matches(_,"selectDown"))this.selectedIndex=this.selectedIndex===this.filteredItems.length-1?0:this.selectedIndex+1,this.notifySelectionChange();else if($.matches(_,"selectConfirm")){let b=this.filteredItems[this.selectedIndex];if(b&&this.onSelect)this.onSelect(b)}else if($.matches(_,"selectCancel")){if(this.onCancel)this.onCancel()}}notifySelectionChange(){let _=this.filteredItems[this.selectedIndex];if(_&&this.onSelectionChange)this.onSelectionChange(_)}getSelectedItem(){return this.filteredItems[this.selectedIndex]||null}}var B4=I6();function MQ(_,$){if(!_||$<=0)return[{text:"",startIndex:0,endIndex:0}];if(_0(_)<=$)return[{text:_,startIndex:0,endIndex:_.length}];let Z=[],z=[...B4.segment(_)],A=0,J=0,U=-1,G=0;for(let Y=0;Y<z.length;Y++){let X=z[Y],Q=X.segment,K=_0(Q),v=X.index,V=i0(Q);if(A+K>$){if(U>=0)Z.push({text:_.slice(J,U),startIndex:J,endIndex:U}),J=U,A-=G;else if(J<v)Z.push({text:_.slice(J,v),startIndex:J,endIndex:v}),J=v,A=0;U=-1}A+=K;let w=z[Y+1];if(V&&w&&!i0(w.segment))U=w.index,G=A}return Z.push({text:_.slice(J),startIndex:J,endIndex:_.length}),Z}class EQ{state={lines:[""],cursorLine:0,cursorCol:0};focused=!1;tui;theme;paddingX=0;lastWidth=80;scrollOffset=0;borderColor;autocompleteProvider;autocompleteList;autocompleteState=null;autocompletePrefix="";autocompleteMaxVisible=5;pastes=new Map;pasteCounter=0;pasteBuffer="";isInPaste=!1;history=[];historyIndex=-1;killRing=new $2;lastAction=null;jumpMode=null;preferredVisualCol=null;undoStack=new b2;onSubmit;onChange;disableSubmit=!1;constructor(_,$,b={}){this.tui=_,this.theme=$,this.borderColor=$.borderColor;let Z=b.paddingX??0;this.paddingX=Number.isFinite(Z)?Math.max(0,Math.floor(Z)):0;let z=b.autocompleteMaxVisible??5;this.autocompleteMaxVisible=Number.isFinite(z)?Math.max(3,Math.min(20,Math.floor(z))):5}getPaddingX(){return this.paddingX}setPaddingX(_){let $=Number.isFinite(_)?Math.max(0,Math.floor(_)):0;if(this.paddingX!==$)this.paddingX=$,this.tui.requestRender()}getAutocompleteMaxVisible(){return this.autocompleteMaxVisible}setAutocompleteMaxVisible(_){let $=Number.isFinite(_)?Math.max(3,Math.min(20,Math.floor(_))):5;if(this.autocompleteMaxVisible!==$)this.autocompleteMaxVisible=$,this.tui.requestRender()}setAutocompleteProvider(_){this.autocompleteProvider=_}addToHistory(_){let $=_.trim();if(!$)return;if(this.history.length>0&&this.history[0]===$)return;if(this.history.unshift($),this.history.length>100)this.history.pop()}isEditorEmpty(){return this.state.lines.length===1&&this.state.lines[0]===""}isOnFirstVisualLine(){let _=this.buildVisualLineMap(this.lastWidth);return this.findCurrentVisualLine(_)===0}isOnLastVisualLine(){let _=this.buildVisualLineMap(this.lastWidth);return this.findCurrentVisualLine(_)===_.length-1}navigateHistory(_){if(this.lastAction=null,this.history.length===0)return;let $=this.historyIndex-_;if($<-1||$>=this.history.length)return;if(this.historyIndex===-1&&$>=0)this.pushUndoSnapshot();if(this.historyIndex=$,this.historyIndex===-1)this.setTextInternal("");else this.setTextInternal(this.history[this.historyIndex]||"")}setTextInternal(_){let $=_.replace(/\r\n/g,`
121
+ `).length;return{output:{file:{content:U,numLines:Y,totalLines:Y}},images:J}}return{output:U||(Z?S0(b,Z):b),images:J}}function JQ(_,$){if(!_)return _;let b=_.startsWith("/"),Z=_.replace(/\\/g,"/");if(!b){if(Z==="."||Z==="./")return".";if(Z.startsWith("./")||Z.startsWith("../"))return Z;return`./${Z}`}let z=$.replace(/\\/g,"/");if(Z.startsWith(z+"/"))return`./${Z.slice(z.length+1)}`;return b_(Z)}function Bw(_){for(let $ of _)if($.type==="user"&&$.text)return xw($.text);return null}function xw(_){return _.replace(/\s+/g," ").trim()}function Nw(_){if(!_)return null;let $=new Date(_);return Number.isNaN($.getTime())?null:$}function Iw(_){return Math.max(0,_.inputTokens-_.cachedInputTokens)+_.outputTokens+_.reasoningOutputTokens}var Mw=["anthropic/","openai/","google/"],Ew=200000;function Ow(_,$,b){if(!b||!_)return 0;let Z=Pw(_,b);if(!Z)return 0;return jw({input_tokens:Math.max(0,$.inputTokens-$.cachedInputTokens),output_tokens:$.outputTokens,cache_read_input_tokens:$.cachedInputTokens},Z)}function Pw(_,$){let b=_.trim();if(!b)return null;let Z=new Set;Z.add(b);for(let z of Mw)Z.add(`${z}${b}`);for(let z of Z){let A=$[z];if(A)return A}return null}function jw(_,$){let b=(J,U,G,Y=Ew)=>{if(J==null||J<=0)return 0;if(J>Y&&G!=null){let X=Math.min(J,Y),K=Math.max(0,J-Y)*G;if(U!=null)K+=X*U;return K}if(U!=null)return J*U;return 0},Z=b(_.input_tokens,$.input_cost_per_token,$.input_cost_per_token_above_200k_tokens),z=b(_.output_tokens,$.output_cost_per_token,$.output_cost_per_token_above_200k_tokens),A=b(_.cache_read_input_tokens,$.cache_read_input_token_cost,$.cache_read_input_token_cost_above_200k_tokens);return Z+z+A}var Sw="https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json",Rw=200000,Lw=M.object({input_cost_per_token:M.number().optional(),output_cost_per_token:M.number().optional(),cache_creation_input_token_cost:M.number().optional(),cache_read_input_token_cost:M.number().optional(),max_tokens:M.number().optional(),max_input_tokens:M.number().optional(),max_output_tokens:M.number().optional(),input_cost_per_token_above_200k_tokens:M.number().optional(),output_cost_per_token_above_200k_tokens:M.number().optional(),cache_creation_input_token_cost_above_200k_tokens:M.number().optional(),cache_read_input_token_cost_above_200k_tokens:M.number().optional(),input_cost_per_token_above_128k_tokens:M.number().optional(),output_cost_per_token_above_128k_tokens:M.number().optional()}),Tw=["anthropic/","claude-3-5-","claude-3-","claude-","openai/","azure/","openrouter/openai/"],yw=1e4;function Cw(_){if(_!=null)return _;return{debug:()=>{},error:()=>{},info:()=>{},warn:()=>{}}}class g0{cachedPricing=null;logger;offline;offlineLoader;url;providerPrefixes;timeoutMs;constructor(_={}){this.logger=Cw(_.logger),this.offline=Boolean(_.offline),this.offlineLoader=_.offlineLoader,this.url=_.url??Sw,this.providerPrefixes=_.providerPrefixes??Tw,this.timeoutMs=_.timeoutMs??yw}[Symbol.dispose](){this.clearCache()}clearCache(){this.cachedPricing=null}async loadOfflinePricing(){if(this.offlineLoader==null)throw Error("Offline loader was not provided");let _=new Map(Object.entries(await this.offlineLoader()));return this.cachedPricing=_,_}async fetchRemotePricing(){this.logger.warn("Fetching latest model pricing from LiteLLM...");let _=await fetch(this.url,{signal:AbortSignal.timeout(this.timeoutMs)});if(!_.ok)throw Error(`Failed to fetch pricing data: ${_.statusText}`);let $=await _.json(),b=new Map;for(let[Z,z]of Object.entries($)){if(typeof z!=="object"||z==null)continue;let A=Lw.safeParse(z);if(!A.success)continue;b.set(Z,A.data)}return this.cachedPricing=b,this.logger.info(`Loaded pricing for ${b.size} models`),b}async ensurePricingLoaded(){if(this.cachedPricing!=null)return this.cachedPricing;if(this.offline)return this.loadOfflinePricing();try{return await this.fetchRemotePricing()}catch(_){if(this.logger.warn("Failed to fetch model pricing from LiteLLM, falling back to offline loader (if available)."),this.offlineLoader!=null)return this.loadOfflinePricing();this.logger.warn("No offline pricing loader configured; continuing without model pricing data."),this.logger.debug(_);let $=new Map;return this.cachedPricing=$,$}}async fetchModelPricing(){return this.ensurePricingLoaded()}createMatchingCandidates(_){let $=new Set;$.add(_);for(let b of this.providerPrefixes)$.add(`${b}${_}`);return Array.from($)}async getModelPricing(_){let $=await this.ensurePricingLoaded();for(let Z of this.createMatchingCandidates(_)){let z=$.get(Z);if(z!=null)return z}let b=_.toLowerCase();for(let[Z,z]of $){let A=Z.toLowerCase();if(A.includes(b)||b.includes(A))return z}return null}async getModelContextLimit(_){return(await this.getModelPricing(_))?.max_input_tokens??null}calculateCostFromPricing(_,$){let b=(U,G,Y,X=Rw)=>{if(U==null||U<=0)return 0;if(U>X&&Y!=null){let Q=Math.min(U,X),v=Math.max(0,U-X)*Y;if(G!=null)v+=Q*G;return v}if(G!=null)return U*G;return 0},Z=b(_.input_tokens,$.input_cost_per_token,$.input_cost_per_token_above_200k_tokens),z=b(_.output_tokens,$.output_cost_per_token,$.output_cost_per_token_above_200k_tokens),A=b(_.cache_creation_input_tokens,$.cache_creation_input_token_cost,$.cache_creation_input_token_cost_above_200k_tokens),J=b(_.cache_read_input_tokens,$.cache_read_input_token_cost,$.cache_read_input_token_cost_above_200k_tokens);return Z+z+A+J}async calculateCostFromTokens(_,$){if($==null||$==="")return 0;let b=await this.getModelPricing($);if(b==null)throw Error(`Model pricing not found for ${$}`);return this.calculateCostFromPricing(_,b)}}async function GQ(_={}){let $=_.serverUrl??process.env.VI_SERVER_URL??"http://localhost:3000",b=_.authToken??null,Z=_.timeoutMs??1e4;try{let z=await fetch(`${$}/api/transcripts`,{method:"GET",headers:{...b&&{Authorization:`Bearer ${b}`}},signal:AbortSignal.timeout(Z)});if(!z.ok)return console.error(`Failed to fetch transcript metadata: ${z.status} ${z.statusText}`),[];let A=await z.json();if(fw(A))return A.transcripts;return console.error("Transcript metadata response had unexpected shape:",A),[]}catch(z){if(z instanceof Error)console.error("Failed to fetch transcript metadata:",z.message);return[]}}function fw(_){if(typeof _!=="object"||_===null||!("transcripts"in _))return!1;let{transcripts:$}=_;if(!Array.isArray($))return!1;return $.every((b)=>{if(typeof b!=="object"||b===null)return!1;let Z=b;return typeof Z.transcriptId==="string"&&Z.transcriptId.length>0&&typeof Z.sha256==="string"&&Z.sha256.length>0&&typeof Z.repoId==="string"&&Z.repoId.length>0})}var YQ=[{name:"OpenAI API Key",regex:"sk-[a-zA-Z0-9]{20,}"},{name:"OpenAI Project Key",regex:"sk-proj-[a-zA-Z0-9\\-_]{20,}"},{name:"Anthropic API Key",regex:"sk-ant-[a-zA-Z0-9\\-_]{20,}"},{name:"Cohere API Key",regex:"co-[a-zA-Z0-9]{40,}"},{name:"HuggingFace Token",regex:"hf_[a-zA-Z0-9]{34,}"},{name:"Replicate API Token",regex:"r8_[a-zA-Z0-9]{40}"},{name:"JWT Token",regex:"eyJ[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_.+/=]*"},{name:"OAuth Client Secret",regex:`(?i)client_secret['"\\s:=]+[a-zA-Z0-9\\-_.~]{10,100}`},{name:"OAuth Client ID",regex:`(?i)client_id['"\\s:=]+[a-zA-Z0-9\\-_.~]{10,100}`},{name:"Bearer Token",regex:"Bearer\\s+[a-zA-Z0-9\\-._~+/]+=*"},{name:"Authorization Bearer",regex:"(?i)authorization:\\s*Bearer\\s+[a-zA-Z0-9\\-._~+/]+=*"},{name:"Google OAuth Access Token",regex:"ya29\\.[0-9A-Za-z\\-_]+"},{name:"GitHub Fine-Grained Token",regex:"github_pat_[0-9a-zA-Z_]{20,}"},{name:"GitHub OAuth App Secret",regex:`[g|G][i|I][t|T][h|H][u|U][b|B].*['|"][0-9a-zA-Z]{35,40}['|"]`},{name:"GitLab PAT",regex:"glpat-[a-zA-Z0-9_-]{16,}"},{name:"GitLab Runner Token",regex:"glrt-[a-zA-Z0-9_-]{16,}"},{name:"MongoDB URI",regex:`mongodb(\\+srv)?:\\/\\/[^\\s'"]+`},{name:"PostgreSQL URI",regex:`postgres(?:ql)?:\\/\\/[^\\s'"]+`},{name:"MySQL URI",regex:`mysql:\\/\\/[^\\s'"]+`},{name:"Redis URI",regex:`redis:\\/\\/[^\\s'"]+`},{name:"JDBC URL",regex:`jdbc:\\w+:\\/\\/[^\\s'"]+`},{name:"Password in URL",regex:`[a-zA-Z]{3,10}://[^/\\s:@]{3,20}:[^/\\s:@]{3,20}@.{1,100}["'\\s]`},{name:"DigitalOcean Token",regex:"dop_v1_[a-z0-9]{64}"},{name:"CircleCI Token",regex:"circle-token=[a-z0-9]{40}"},{name:"New Relic Key",regex:"NRII-[a-zA-Z0-9]{20,}"},{name:"Sentry DSN",regex:"https:\\/\\/[a-zA-Z0-9]+@[a-z]+\\.ingest\\.sentry\\.io\\/\\d+"},{name:"Cloudinary URL",regex:"cloudinary:\\/\\/[0-9]{15}:[a-zA-Z0-9]+@[a-zA-Z]+"},{name:"Discord Bot Token",regex:"[MN][A-Za-z\\d]{23}\\.[\\w-]{6}\\.[\\w-]{27}"},{name:"Discord Webhook",regex:"https:\\/\\/discord(?:app)?\\.com\\/api\\/webhooks\\/[0-9]+\\/[a-zA-Z0-9_-]+"},{name:"Telegram Bot Token",regex:"\\d{9}:[a-zA-Z0-9_-]{35}"},{name:"Microsoft Teams Webhook",regex:"https:\\/\\/[a-z]+\\.webhook\\.office\\.com\\/webhookb2\\/[a-zA-Z0-9@\\-]+\\/.*"},{name:"Stripe Publishable Key",regex:"pk_live_[0-9a-zA-Z]{24}"},{name:"PayPal Braintree Token",regex:"access_token\\$production\\$[0-9a-z]{16}\\$[0-9a-f]{32}"},{name:"Square Access Token",regex:"sq0atp-[0-9A-Za-z\\-_]{22}"},{name:"Square OAuth Secret",regex:"sq0csp-[0-9A-Za-z\\-_]{43}"},{name:"SendGrid API Key",regex:"SG\\.[\\w\\d\\-_]{22}\\.[\\w\\d\\-_]{43}"},{name:"Mailgun API Key",regex:"key-[0-9a-zA-Z]{32}"},{name:"MailChimp API Key",regex:"[0-9a-f]{32}-us[0-9]{1,2}"},{name:"Shopify Access Token",regex:"shpat_[0-9a-fA-F]{32}"},{name:"Dropbox Access Token",regex:"sl\\.[A-Za-z0-9_-]{20,100}"},{name:"Asana Token",regex:"0\\/[0-9a-z]{32}"},{name:"Linear API Key",regex:"lin_api_[a-zA-Z0-9]{40}"},{name:"Riot Games API Key",regex:"RGAPI-[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}"},{name:"Generic API Key",regex:`(?i)(api[_-]?key)['"\\s:=]+[a-zA-Z0-9\\-_.]{16,}`},{name:"Generic Secret",regex:`(?i)(secret|password|passwd|pwd)['"\\s:=]+[^\\s'"]{8,}`},{name:"Generic Token",regex:`(?i)(token)['"\\s:=]+[a-zA-Z0-9\\-_.]{16,}`},{name:"Private Key Block",regex:"-----BEGIN (RSA|DSA|EC|OPENSSH|PGP)?\\s*PRIVATE\\s+KEY"},{name:"Certificate Block",regex:"-----BEGIN CERTIFICATE-----"},{name:"AWS API Gateway",regex:"[0-9a-z]+.execute-api.[0-9a-z._-]+.amazonaws.com"},{name:"AWS API Key",regex:"AKIA[0-9A-Z]{16}"},{name:"AWS ARN",regex:"arn:aws:[a-z0-9-]+:[a-z]{2}-[a-z]+-[0-9]+:[0-9]+:.+"},{name:"AWS Access Key ID Value",regex:"(A3T[A-Z0-9]|AKIA|AGPA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}"},{name:"AWS AppSync GraphQL Key",regex:"da2-[a-z0-9]{26}"},{name:"AWS EC2 External",regex:"ec2-[0-9a-z._-]+.compute(-1)?.amazonaws.com"},{name:"AWS EC2 Internal",regex:"[0-9a-z._-]+.compute(-1)?.internal"},{name:"AWS ELB",regex:"[0-9a-z._-]+.elb.amazonaws.com"},{name:"AWS ElasticCache",regex:"[0-9a-z._-]+.cache.amazonaws.com"},{name:"AWS MWS ID",regex:"mzn\\.mws\\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"},{name:"AWS MWS key",regex:"amzn\\.mws\\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"},{name:"AWS RDS",regex:"[0-9a-z._-]+.rds.amazonaws.com"},{name:"AWS S3 Bucket",regex:"s3://[0-9a-z._/-]+"},{name:"AWS client ID",regex:"(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}"},{name:"AWS cred file info",regex:"(aws_access_key_id|aws_secret_access_key)"},{name:"Abbysale",regex:"(?:abbysale).{0,40}\\b([a-z0-9A-Z]{40})\\b"},{name:"Abstract",regex:"(?:abstract).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Abuseipdb",regex:"(?:abuseipdb).{0,40}\\b([a-z0-9]{80})\\b"},{name:"Accuweather",regex:"(?:accuweather).{0,40}([a-z0-9A-Z\\%]{35})\\b"},{name:"Adafruitio",regex:"\\b(aio\\_[a-zA-Z0-9]{28})\\b"},{name:"Adobeio - 1",regex:"(?:adobe).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Adzuna - 1",regex:"(?:adzuna).{0,40}\\b([a-z0-9]{8})\\b"},{name:"Adzuna - 2",regex:"(?:adzuna).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Aeroworkflow - 1",regex:"(?:aeroworkflow).{0,40}\\b([0-9]{1,})\\b"},{name:"Aeroworkflow - 2",regex:"(?:aeroworkflow).{0,40}\\b([a-zA-Z0-9^!]{20})\\b"},{name:"Agora",regex:"(?:agora).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Airbrakeprojectkey - 1",regex:"(?:airbrake).{0,40}\\b([0-9]{6})\\b"},{name:"Airbrakeprojectkey - 2",regex:"(?:airbrake).{0,40}\\b([a-zA-Z-0-9]{32})\\b"},{name:"Airbrakeuserkey",regex:"(?:airbrake).{0,40}\\b([a-zA-Z-0-9]{40})\\b"},{name:"Airship",regex:"(?:airship).{0,40}\\b([0-9Aa-zA-Z]{91})\\b"},{name:"Airvisual",regex:"(?:airvisual).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Alconost",regex:"(?:alconost).{0,40}\\b([0-9Aa-z]{32})\\b"},{name:"Alegra - 1",regex:"(?:alegra).{0,40}\\b([a-z0-9-]{20})\\b"},{name:"Alegra - 2",regex:"(?:alegra).{0,40}\\b([a-zA-Z0-9.-@]{25,30})\\b"},{name:"Aletheiaapi",regex:"(?:aletheiaapi).{0,40}\\b([A-Z0-9]{32})\\b"},{name:"Algoliaadminkey - 1",regex:"(?:algolia).{0,40}\\b([A-Z0-9]{10})\\b"},{name:"Algoliaadminkey - 2",regex:"(?:algolia).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Alibaba - 2",regex:"\\b(LTAI[a-zA-Z0-9]{17,21})[\\\"' ;\\s]*"},{name:"Alienvault",regex:"(?:alienvault).{0,40}\\b([a-z0-9]{64})\\b"},{name:"Allsports",regex:"(?:allsports).{0,40}\\b([0-9a-z]{64})\\b"},{name:"Amadeus - 1",regex:"(?:amadeus).{0,40}\\b([0-9A-Za-z]{32})\\b"},{name:"Amadeus - 2",regex:"(?:amadeus).{0,40}\\b([0-9A-Za-z]{16})\\b"},{name:"Amazon SNS Topic",regex:"arn:aws:sns:[a-z0-9\\-]+:[0-9]+:[A-Za-z0-9\\-_]+"},{name:"Ambee",regex:"(?:ambee).{0,40}\\b([0-9a-f]{64})\\b"},{name:"Amplitudeapikey",regex:"(?:amplitude).{0,40}\\b([a-f0-9]{32})"},{name:"Apacta",regex:"(?:apacta).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Api2cart",regex:"(?:api2cart).{0,40}\\b([0-9a-f]{32})\\b"},{name:"Apideck - 1",regex:"\\b(sk_live_[a-z0-9A-Z-]{93})\\b"},{name:"Apideck - 2",regex:"(?:apideck).{0,40}\\b([a-z0-9A-Z]{40})\\b"},{name:"Apiflash - 1",regex:"(?:apiflash).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Apiflash - 2",regex:"(?:apiflash).{0,40}\\b([a-zA-Z0-9\\S]{21,30})\\b"},{name:"Apifonica",regex:"(?:apifonica).{0,40}\\b([0-9a-z]{11}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12})\\b"},{name:"Apify",regex:"\\b(apify\\_api\\_[a-zA-Z-0-9]{36})\\b"},{name:"Apimatic - 1",regex:"(?:apimatic).{0,40}\\b([a-z0-9-\\S]{8,32})\\b"},{name:"Apimatic - 2",regex:"(?:apimatic).{0,40}\\b([a-zA-Z0-9]{3,20}@[a-zA-Z0-9]{2,12}.[a-zA-Z0-9]{2,5})\\b"},{name:"Apiscience",regex:"(?:apiscience).{0,40}\\b([a-bA-Z0-9\\S]{22})\\b"},{name:"Apollo",regex:"(?:apollo).{0,40}\\b([a-zA-Z0-9]{22})\\b"},{name:"Appcues - 1",regex:"(?:appcues).{0,40}\\b([0-9]{5})\\b"},{name:"Appcues - 2",regex:"(?:appcues).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Appcues - 3",regex:"(?:appcues).{0,40}\\b([a-z0-9-]{39})\\b"},{name:"Appfollow",regex:"(?:appfollow).{0,40}\\b([0-9A-Za-z]{20})\\b"},{name:"Appsynergy",regex:"(?:appsynergy).{0,40}\\b([a-z0-9]{64})\\b"},{name:"Apptivo - 1",regex:"(?:apptivo).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Apptivo - 2",regex:"(?:apptivo).{0,40}\\b([a-zA-Z0-9-]{32})\\b"},{name:"Artifactory - 2",regex:"\\b([A-Za-z0-9](?:[A-Za-z0-9\\-]{0,61}[A-Za-z0-9])\\.jfrog\\.io)"},{name:"Artifactory API Token",regex:'(?:\\s|=|:|"|^)AKC[a-zA-Z0-9]{10,}'},{name:"Artifactory Password",regex:'(?:\\s|=|:|"|^)AP[\\dABCDEF][a-zA-Z0-9]{8,}'},{name:"Artsy - 1",regex:"(?:artsy).{0,40}\\b([0-9a-zA-Z]{20})\\b"},{name:"Artsy - 2",regex:"(?:artsy).{0,40}\\b([0-9a-zA-Z]{32})\\b"},{name:"Asanaoauth",regex:"(?:asana).{0,40}\\b([a-z\\/:0-9]{51})\\b"},{name:"Asanapersonalaccesstoken",regex:"(?:asana).{0,40}\\b([0-9]{1,}\\/[0-9]{16,}:[A-Za-z0-9]{32,})\\b"},{name:"Assemblyai",regex:"(?:assemblyai).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Asymmetric Private Key",regex:"-----BEGIN ((EC|PGP|DSA|RSA|OPENSSH) )?PRIVATE KEY( BLOCK)?-----"},{name:"Audd",regex:"(?:audd).{0,40}\\b([a-z0-9-]{32})\\b"},{name:"Auth0managementapitoken",regex:"(?:auth0).{0,40}\\b(ey[a-zA-Z0-9._-]+)\\b"},{name:"Auth0oauth - 1",regex:"(?:auth0).{0,40}\\b([a-zA-Z0-9_-]{32,60})\\b"},{name:"Autodesk - 1",regex:"(?:autodesk).{0,40}\\b([0-9A-Za-z]{32})\\b"},{name:"Autodesk - 2",regex:"(?:autodesk).{0,40}\\b([0-9A-Za-z]{16})\\b"},{name:"Autoklose",regex:"(?:autoklose).{0,40}\\b([a-zA-Z0-9-]{32})\\b"},{name:"Autopilot",regex:"(?:autopilot).{0,40}\\b([0-9a-f]{32})\\b"},{name:"Avazapersonalaccesstoken",regex:"(?:avaza).{0,40}\\b([0-9]+-[0-9a-f]{40})\\b"},{name:"Aviationstack",regex:"(?:aviationstack).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Aws - 1",regex:"\\b((?:AKIA|ABIA|ACCA|ASIA)[0-9A-Z]{16})\\b"},{name:"Axonaut",regex:"(?:axonaut).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Aylien - 1",regex:"(?:aylien).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Aylien - 2",regex:"(?:aylien).{0,40}\\b([a-z0-9]{8})\\b"},{name:"Ayrshare",regex:"(?:ayrshare).{0,40}\\b([A-Z]{7}-[A-Z0-9]{7}-[A-Z0-9]{7}-[A-Z0-9]{7})\\b"},{name:"Bannerbear",regex:"(?:bannerbear).{0,40}\\b([0-9a-zA-Z]{22}tt)\\b"},{name:"Baremetrics",regex:"(?:baremetrics).{0,40}\\b([a-zA-Z0-9_]{25})\\b"},{name:"Baseapiio",regex:"(?:baseapi|base-api).{0,40}\\b([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\\b"},{name:"Beamer",regex:"(?:beamer).{0,40}\\b([a-zA-Z0-9_+/]{45}=)"},{name:"Beebole",regex:"(?:beebole).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Besttime",regex:"(?:besttime).{0,40}\\b([0-9A-Za-z_]{36})\\b"},{name:"Billomat - 1",regex:"(?:billomat).{0,40}\\b([0-9a-z]{1,})\\b"},{name:"Billomat - 2",regex:"(?:billomat).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Bitbar",regex:"(?:bitbar).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Bitcoinaverage",regex:"(?:bitcoinaverage).{0,40}\\b([a-zA-Z0-9]{43})\\b"},{name:"Bitfinex",regex:"(?:bitfinex).{0,40}\\b([A-Za-z0-9_-]{43})\\b"},{name:"Bitly Secret Key",regex:"R_[0-9a-f]{32}"},{name:"Bitlyaccesstoken",regex:"(?:bitly).{0,40}\\b([a-zA-Z-0-9]{40})\\b"},{name:"Bitmex - 1",regex:"(?:bitmex).{0,40}([ \\r\\n]{1}[0-9a-zA-Z\\-\\_]{24}[ \\r\\n]{1})"},{name:"Bitmex - 2",regex:"(?:bitmex).{0,40}([ \\r\\n]{1}[0-9a-zA-Z\\-\\_]{48}[ \\r\\n]{1})"},{name:"Blablabus",regex:"(?:blablabus).{0,40}\\b([0-9A-Za-z]{22})\\b"},{name:"Blazemeter",regex:"(?:blazemeter|runscope).{0,40}\\b([0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12})\\b"},{name:"Blitapp",regex:"(?:blitapp).{0,40}\\b([a-zA-Z0-9_-]{39})\\b"},{name:"Blogger",regex:"(?:blogger).{0,40}\\b([0-9A-Za-z-]{39})\\b"},{name:"Bombbomb",regex:"(?:bombbomb).{0,40}\\b([a-zA-Z0-9-._]{704})\\b"},{name:"Boostnote",regex:"(?:boostnote).{0,40}\\b([0-9a-f]{64})\\b"},{name:"Borgbase",regex:"(?:borgbase).{0,40}\\b([a-zA-Z0-9/_.-]{148,152})\\b"},{name:"Braintree API Key",regex:"access_token$production$[0-9a-z]{16}$[0-9a-f]{32}"},{name:"Brandfetch",regex:"(?:brandfetch).{0,40}\\b([0-9A-Za-z]{40})\\b"},{name:"Browshot",regex:"(?:browshot).{0,40}\\b([a-zA-Z-0-9]{28})\\b"},{name:"Buddyns",regex:"(?:buddyns).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Bugherd",regex:"(?:bugherd).{0,40}\\b([0-9a-z]{22})\\b"},{name:"Bugsnag",regex:"(?:bugsnag).{0,40}\\b([0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12})\\b"},{name:"Buildkite",regex:"(?:buildkite).{0,40}\\b([a-z0-9]{40})\\b"},{name:"Bulbul",regex:"(?:bulbul).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Buttercms",regex:"(?:buttercms).{0,40}\\b([a-z0-9]{40})\\b"},{name:"Caflou",regex:"(?:caflou).{0,40}\\b([a-bA-Z0-9\\S]{155})\\b"},{name:"Calendarific",regex:"(?:calendarific).{0,40}\\b([a-z0-9]{40})\\b"},{name:"Calendlyapikey",regex:"(?:calendly).{0,40}\\b([a-zA-Z-0-9]{20}.[a-zA-Z-0-9]{171}.[a-zA-Z-0-9_]{43})\\b"},{name:"Calorieninja",regex:"(?:calorieninja).{0,40}\\b([0-9A-Za-z]{40})\\b"},{name:"Campayn",regex:"(?:campayn).{0,40}\\b([a-z0-9]{64})\\b"},{name:"Cannyio",regex:"(?:canny).{0,40}\\b([a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[0-9]{4}-[a-z0-9]{12})\\b"},{name:"Capsulecrm",regex:"(?:capsulecrm).{0,40}\\b([a-zA-Z0-9-._+=]{64})\\b"},{name:"Captaindata - 1",regex:"(?:captaindata).{0,40}\\b([0-9a-f]{8}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{12})\\b"},{name:"Captaindata - 2",regex:"(?:captaindata).{0,40}\\b([0-9a-f]{64})\\b"},{name:"Carboninterface",regex:"(?:carboninterface).{0,40}\\b([a-zA-Z0-9]{21})\\b"},{name:"Cashboard - 1",regex:"(?:cashboard).{0,40}\\b([0-9A-Z]{3}-[0-9A-Z]{3}-[0-9A-Z]{3}-[0-9A-Z]{3})\\b"},{name:"Cashboard - 2",regex:"(?:cashboard).{0,40}\\b([0-9a-z]{1,})\\b"},{name:"Caspio - 1",regex:"(?:caspio).{0,40}\\b([a-z0-9]{8})\\b"},{name:"Caspio - 2",regex:"(?:caspio).{0,40}\\b([a-z0-9]{50})\\b"},{name:"Censys - 1",regex:"(?:censys).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Censys - 2",regex:"(?:censys).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Centralstationcrm",regex:"(?:centralstation).{0,40}\\b([a-z0-9]{30})\\b"},{name:"Cexio - 1",regex:"(?:cexio|cex.io).{0,40}\\b([a-z]{2}[0-9]{9})\\b"},{name:"Cexio - 2",regex:"(?:cexio|cex.io).{0,40}\\b([0-9A-Za-z]{24,27})\\b"},{name:"Chatbot",regex:"(?:chatbot).{0,40}\\b([a-zA-Z0-9_]{32})\\b"},{name:"Chatfule",regex:"(?:chatfuel).{0,40}\\b([a-zA-Z0-9]{128})\\b"},{name:"Checio",regex:"(?:checio).{0,40}\\b(pk_[a-z0-9]{45})\\b"},{name:"Checklyhq",regex:"(?:checklyhq).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Checkout - 1",regex:"(?:checkout).{0,40}\\b((sk_|sk_test_)[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})\\b"},{name:"Checkout - 2",regex:"(?:checkout).{0,40}\\b(cus_[0-9a-zA-Z]{26})\\b"},{name:"Checkvist - 1",regex:"(?:checkvist).{0,40}\\b([\\w\\.-]+@[\\w-]+\\.[\\w\\.-]{2,5})\\b"},{name:"Checkvist - 2",regex:"(?:checkvist).{0,40}\\b([0-9a-zA-Z]{14})\\b"},{name:"Cicero",regex:"(?:cicero).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Circleci",regex:"(?:circle).{0,40}([a-fA-F0-9]{40})"},{name:"Clearbit",regex:"(?:clearbit).{0,40}\\b([0-9a-z_]{35})\\b"},{name:"Clickhelp - 1",regex:"\\b([0-9A-Za-z]{3,20}.try.clickhelp.co)\\b"},{name:"Clickhelp - 2",regex:"(?:clickhelp).{0,40}\\b([0-9A-Za-z]{24})\\b"},{name:"Clicksendsms - 2",regex:"(?:sms).{0,40}\\b([a-zA-Z0-9]{3,20}@[a-zA-Z0-9]{2,12}.[a-zA-Z0-9]{2,5})\\b"},{name:"Clickuppersonaltoken",regex:"(?:clickup).{0,40}\\b(pk_[0-9]{8}_[0-9A-Z]{32})\\b"},{name:"Cliengo",regex:"(?:cliengo).{0,40}\\b([0-9a-f]{8}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{12})\\b"},{name:"Clinchpad",regex:"(?:clinchpad).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Clockify",regex:"(?:clockify).{0,40}\\b([a-zA-Z0-9]{48})\\b"},{name:"Clockworksms - 1",regex:"(?:clockwork|textanywhere).{0,40}\\b([0-9a-zA-Z]{24})\\b"},{name:"Clockworksms - 2",regex:"(?:clockwork|textanywhere).{0,40}\\b([0-9]{5})\\b"},{name:"Closecrm",regex:"\\b(api_[a-z0-9A-Z.]{45})\\b"},{name:"Cloudelements - 1",regex:"(?:cloudelements).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Cloudelements - 2",regex:"(?:cloudelements).{0,40}\\b([a-zA-Z0-9]{43})\\b"},{name:"Cloudflareapitoken",regex:"(?:cloudflare).{0,40}\\b([A-Za-z0-9_-]{40})\\b"},{name:"Cloudflarecakey",regex:"(?:cloudflare).{0,40}\\b(v[A-Za-z0-9._-]{173,})\\b"},{name:"Cloudimage",regex:"(?:cloudimage).{0,40}\\b([a-z0-9_]{30})\\b"},{name:"Cloudinary Credentials",regex:"cloudinary://[0-9]+:[A-Za-z0-9\\-_\\.]+@[A-Za-z0-9\\-_\\.]+"},{name:"Cloudmersive",regex:"(?:cloudmersive).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Cloudplan",regex:"(?:cloudplan).{0,40}\\b([A-Z0-9-]{32})\\b"},{name:"Cloverly",regex:"(?:cloverly).{0,40}\\b([a-z0-9:_]{28})\\b"},{name:"Cloze - 1",regex:"(?:cloze).{0,40}\\b([0-9a-f]{32})\\b"},{name:"Cloze - 2",regex:"(?:cloze).{0,40}\\b([\\w\\.-]+@[\\w-]+\\.[\\w\\.-]{2,5})\\b"},{name:"Clustdoc",regex:"(?:clustdoc).{0,40}\\b([0-9a-zA-Z]{60})\\b"},{name:"Codacy",regex:"(?:codacy).{0,40}\\b([0-9A-Za-z]{20})\\b"},{name:"Coinapi",regex:"(?:coinapi).{0,40}\\b([A-Z0-9-]{36})\\b"},{name:"Coinbase",regex:"(?:coinbase).{0,40}\\b([a-zA-Z-0-9]{64})\\b"},{name:"Coinlayer",regex:"(?:coinlayer).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Coinlib",regex:"(?:coinlib).{0,40}\\b([a-z0-9]{16})\\b"},{name:"Column",regex:"(?:column).{0,40}\\b((?:test|live)_[a-zA-Z0-9]{27})\\b"},{name:"Commercejs",regex:"(?:commercejs).{0,40}\\b([a-z0-9_]{48})\\b"},{name:"Commodities",regex:"(?:commodities).{0,40}\\b([a-zA-Z0-9]{60})\\b"},{name:"Companyhub - 1",regex:"(?:companyhub).{0,40}\\b([0-9a-zA-Z]{20})\\b"},{name:"Companyhub - 2",regex:"(?:companyhub).{0,40}\\b([a-zA-Z0-9$%^=-]{4,32})\\b"},{name:"Confluent - 1",regex:"(?:confluent).{0,40}\\b([a-zA-Z-0-9]{16})\\b"},{name:"Confluent - 2",regex:"(?:confluent).{0,40}\\b([a-zA-Z-0-9]{64})\\b"},{name:"Convertkit",regex:"(?:convertkit).{0,40}\\b([a-z0-9A-Z_]{22})\\b"},{name:"Convier",regex:"(?:convier).{0,40}\\b([0-9]{2}\\|[a-zA-Z0-9]{40})\\b"},{name:"Copper - 2",regex:"(?:copper).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Countrylayer",regex:"(?:countrylayer).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Courier",regex:"(?:courier).{0,40}\\b(pk\\_[a-zA-Z0-9]{1,}\\_[a-zA-Z0-9]{28})\\b"},{name:"Coveralls",regex:"(?:coveralls).{0,40}\\b([a-zA-Z0-9-]{37})\\b"},{name:"Crowdin",regex:"(?:crowdin).{0,40}\\b([0-9A-Za-z]{80})\\b"},{name:"Cryptocompare",regex:"(?:cryptocompare).{0,40}\\b([a-z-0-9]{64})\\b"},{name:"Currencycloud - 1",regex:"(?:currencycloud).{0,40}\\b([0-9a-z]{64})\\b"},{name:"Currencyfreaks",regex:"(?:currencyfreaks).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Currencylayer",regex:"(?:currencylayer).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Currencyscoop",regex:"(?:currencyscoop).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Currentsapi",regex:"(?:currentsapi).{0,40}\\b([a-zA-Z0-9\\S]{48})\\b"},{name:"Customerguru - 1",regex:"(?:guru).{0,40}\\b([a-z0-9A-Z]{50})\\b"},{name:"Customerguru - 2",regex:"(?:guru).{0,40}\\b([a-z0-9A-Z]{30})\\b"},{name:"Customerio",regex:"(?:customer).{0,40}\\b([a-z0-9A-Z]{20})\\b"},{name:"D7network",regex:"(?:d7network).{0,40}\\b([a-zA-Z0-9\\W\\S]{23}\\=)"},{name:"Dailyco",regex:"(?:daily).{0,40}\\b([0-9a-f]{64})\\b"},{name:"Dandelion",regex:"(?:dandelion).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Databricks",regex:"dapi[a-f0-9]{32}\\b"},{name:"Datadogtoken - 1",regex:"(?:datadog).{0,40}\\b([a-zA-Z-0-9]{32})\\b"},{name:"Datadogtoken - 2",regex:"(?:datadog).{0,40}\\b([a-zA-Z-0-9]{40})\\b"},{name:"Datafire",regex:"(?:datafire).{0,40}\\b([a-z0-9\\S]{175,190})\\b"},{name:"Datagov",regex:"(?:data.gov).{0,40}\\b([a-zA-Z0-9]{40})\\b"},{name:"Debounce",regex:"(?:debounce).{0,40}\\b([a-zA-Z0-9]{13})\\b"},{name:"Deepai",regex:"(?:deepai).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Deepgram",regex:"(?:deepgram).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Delighted",regex:"(?:delighted).{0,40}\\b([a-z0-9A-Z]{32})\\b"},{name:"Deputy - 1",regex:"\\b([0-9a-z]{1,}.as.deputy.com)\\b"},{name:"Deputy - 2",regex:"(?:deputy).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Detectlanguage",regex:"(?:detectlanguage).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Dfuse",regex:"\\b(web\\_[0-9a-z]{32})\\b"},{name:"Diffbot",regex:"(?:diffbot).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Digitaloceantoken",regex:"(?:digitalocean).{0,40}\\b([A-Za-z0-9_-]{64})\\b"},{name:"Discordbottoken - 1",regex:"(?:discord).{0,40}\\b([A-Za-z0-9_-]{24}\\.[A-Za-z0-9_-]{6}\\.[A-Za-z0-9_-]{27})\\b"},{name:"Discordbottoken - 2",regex:"(?:discord).{0,40}\\b([0-9]{17})\\b"},{name:"Discordwebhook",regex:"(https:\\/\\/discord.com\\/api\\/webhooks\\/[0-9]{18}\\/[0-9a-zA-Z-]{68})"},{name:"Ditto",regex:"(?:ditto).{0,40}\\b([a-z0-9]{8}\\-[a-z0-9]{4}\\-[a-z0-9]{4}\\-[a-z0-9]{4}\\-[a-z0-9]{12}\\.[a-z0-9]{40})\\b"},{name:"Dnscheck - 1",regex:"(?:dnscheck).{0,40}\\b([a-z0-9A-Z-]{36})\\b"},{name:"Dnscheck - 2",regex:"(?:dnscheck).{0,40}\\b([a-z0-9A-Z]{32})\\b"},{name:"Documo",regex:"\\b(ey[a-zA-Z0-9]{34}.ey[a-zA-Z0-9]{154}.[a-zA-Z0-9_-]{43})\\b"},{name:"Doppler",regex:"\\b(dp\\.pt\\.[a-zA-Z0-9]{43})\\b"},{name:"Dotmailer - 1",regex:"(?:dotmailer).{0,40}\\b(apiuser-[a-z0-9]{12}@apiconnector.com)\\b"},{name:"Dotmailer - 2",regex:"(?:dotmailer).{0,40}\\b([a-zA-Z0-9\\S]{8,24})\\b"},{name:"Dovico",regex:"(?:dovico).{0,40}\\b([0-9a-z]{32}\\.[0-9a-z]{1,}\\b)"},{name:"Dronahq",regex:"(?:dronahq).{0,40}\\b([a-z0-9]{50})\\b"},{name:"Droneci",regex:"(?:droneci).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Dropbox",regex:"\\b(sl\\.[A-Za-z0-9\\-\\_]{130,140})\\b"},{name:"Dwolla",regex:"(?:dwolla).{0,40}\\b([a-zA-Z-0-9]{50})\\b"},{name:"Dynalist",regex:"(?:dynalist).{0,40}\\b([a-zA-Z0-9-_]{128})\\b"},{name:"Dynatrace token",regex:"dt0[a-zA-Z]{1}[0-9]{2}\\.[A-Z0-9]{24}\\.[A-Z0-9]{64}"},{name:"Dyspatch",regex:"(?:dyspatch).{0,40}\\b([A-Z0-9]{52})\\b"},{name:"EC",regex:"-----BEGIN EC PRIVATE KEY-----"},{name:"Eagleeyenetworks - 1",regex:"(?:eagleeyenetworks).{0,40}\\b([a-zA-Z0-9]{3,20}@[a-zA-Z0-9]{2,12}.[a-zA-Z0-9]{2,5})\\b"},{name:"Eagleeyenetworks - 2",regex:"(?:eagleeyenetworks).{0,40}\\b([a-zA-Z0-9]{15})\\b"},{name:"Easyinsight - 1",regex:"(?:easyinsight|easy-insight).{0,40}\\b([a-zA-Z0-9]{20})\\b"},{name:"Easyinsight - 2",regex:"(?:easyinsight|easy-insight).{0,40}\\b([0-9Aa-zA-Z]{20})\\b"},{name:"Edamam - 1",regex:"(?:edamam).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Edamam - 2",regex:"(?:edamam).{0,40}\\b([0-9a-z]{8})\\b"},{name:"Edenai",regex:"(?:edenai).{0,40}\\b([a-zA-Z0-9]{36}.[a-zA-Z0-9]{92}.[a-zA-Z0-9_]{43})\\b"},{name:"Eightxeight - 1",regex:"(?:8x8).{0,40}\\b([a-zA-Z0-9_]{18,30})\\b"},{name:"Eightxeight - 2",regex:"(?:8x8).{0,40}\\b([a-zA-Z0-9]{43})\\b"},{name:"Elasticemail",regex:"(?:elastic).{0,40}\\b([A-Za-z0-9_-]{96})\\b"},{name:"Enablex - 1",regex:"(?:enablex).{0,40}\\b([a-zA-Z0-9]{36})\\b"},{name:"Enablex - 2",regex:"(?:enablex).{0,40}\\b([a-z0-9]{24})\\b"},{name:"Enigma",regex:"(?:enigma).{0,40}\\b([a-zA-Z0-9]{40})\\b"},{name:"Ethplorer",regex:"(?:ethplorer).{0,40}\\b([a-z0-9A-Z-]{22})\\b"},{name:"Etsyapikey",regex:"(?:etsy).{0,40}\\b([a-zA-Z-0-9]{24})\\b"},{name:"Everhour",regex:"(?:everhour).{0,40}\\b([0-9Aa-f]{4}-[0-9a-f]{4}-[0-9a-f]{6}-[0-9a-f]{6}-[0-9a-f]{8})\\b"},{name:"Exchangerateapi",regex:"(?:exchangerate).{0,40}\\b([a-z0-9]{24})\\b"},{name:"Exchangeratesapi",regex:"(?:exchangerates).{0,40}\\b([a-z0-9]{32})\\b"},{name:"FCM Server Key",regex:"AAAA[a-zA-Z0-9_-]{7}:[a-zA-Z0-9_-]{140}"},{name:"FCM_server_key",regex:"(AAAA[a-zA-Z0-9_-]{7}:[a-zA-Z0-9_-]{140})"},{name:"Facebook Access Token",regex:"EAACEdEose0cBA[0-9A-Za-z]+"},{name:"Facebook OAuth",regex:`[fF][aA][cC][eE][bB][oO][oO][kK].*['|"][0-9a-f]{32}['|"]`},{name:"Facebookoauth",regex:"(?:facebook).{0,40}\\b([A-Za-z0-9]{32})\\b"},{name:"Faceplusplus",regex:"(?:faceplusplus).{0,40}\\b([0-9a-zA-Z_-]{32})\\b"},{name:"Fakejson",regex:"(?:fakejson).{0,40}\\b([a-zA-Z0-9]{22})\\b"},{name:"Fastforex",regex:"(?:fastforex).{0,40}\\b([a-z0-9-]{28})\\b"},{name:"Fastlypersonaltoken",regex:"(?:fastly).{0,40}\\b([A-Za-z0-9_-]{32})\\b"},{name:"Feedier",regex:"(?:feedier).{0,40}\\b([a-z0-9A-Z]{32})\\b"},{name:"Fetchrss",regex:"(?:fetchrss).{0,40}\\b([0-9A-Za-z.]{40})\\b"},{name:"Figmapersonalaccesstoken",regex:"(?:figma).{0,40}\\b([0-9]{6}-[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12})\\b"},{name:"Fileio",regex:"(?:fileio).{0,40}\\b([A-Z0-9.-]{39})\\b"},{name:"Finage",regex:"\\b(API_KEY[0-9A-Z]{32})\\b"},{name:"Financialmodelingprep",regex:"(?:financialmodelingprep).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Findl",regex:"(?:findl).{0,40}\\b([a-z0-9]{8}\\-[a-z0-9]{4}\\-[a-z0-9]{4}\\-[a-z0-9]{4}\\-[a-z0-9]{12})\\b"},{name:"Finnhub",regex:"(?:finnhub).{0,40}\\b([0-9a-z]{20})\\b"},{name:"Firebase Database Detect - 1",regex:"[a-z0-9.-]+\\.firebaseio\\.com"},{name:"Firebase Database Detect - 2",regex:"[a-z0-9.-]+\\.firebaseapp\\.com"},{name:"Fixerio",regex:"(?:fixer).{0,40}\\b([A-Za-z0-9]{32})\\b"},{name:"Flatio",regex:"(?:flat).{0,40}\\b([0-9a-z]{128})\\b"},{name:"Fleetbase",regex:"\\b(flb_live_[0-9a-zA-Z]{20})\\b"},{name:"Flickr",regex:"(?:flickr).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Flightapi",regex:"(?:flightapi).{0,40}\\b([a-z0-9]{24})\\b"},{name:"Flightstats - 1",regex:"(?:flightstats).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Flightstats - 2",regex:"(?:flightstats).{0,40}\\b([0-9a-z]{8})\\b"},{name:"Float",regex:"(?:float).{0,40}\\b([a-zA-Z0-9-._+=]{59,60})\\b"},{name:"Flowflu - 2",regex:"(?:flowflu).{0,40}\\b([a-zA-Z0-9]{51})\\b"},{name:"Flutterwave",regex:"\\b(FLWSECK-[0-9a-z]{32}-X)\\b"},{name:"Fmfw - 1",regex:"(?:fmfw).{0,40}\\b([a-zA-Z0-9-]{32})\\b"},{name:"Fmfw - 2",regex:"(?:fmfw).{0,40}\\b([a-zA-Z0-9_-]{32})\\b"},{name:"Formbucket",regex:"(?:formbucket).{0,40}\\b([0-9A-Za-z]{1,}.[0-9A-Za-z]{1,}\\.[0-9A-Z-a-z\\-_]{1,})"},{name:"Formio",regex:"(?:formio).{0,40}\\b(eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9\\.[0-9A-Za-z]{310}\\.[0-9A-Z-a-z\\-_]{43}[ \\r\\n]{1})"},{name:"Foursquare",regex:"(?:foursquare).{0,40}\\b([0-9A-Z]{48})\\b"},{name:"Frameio",regex:"\\b(fio-u-[0-9a-zA-Z_-]{64})\\b"},{name:"Freshbooks - 1",regex:"(?:freshbooks).{0,40}\\b([0-9a-z]{64})\\b"},{name:"Freshbooks - 2",regex:"(?:freshbooks).{0,40}\\b(https://www.[0-9A-Za-z_-]{1,}.com)\\b"},{name:"Freshdesk - 1",regex:"(?:freshdesk).{0,40}\\b([0-9A-Za-z]{20})\\b"},{name:"Freshdesk - 2",regex:"\\b([0-9a-z-]{1,}.freshdesk.com)\\b"},{name:"Front",regex:"(?:front).{0,40}\\b([0-9a-zA-Z]{36}.[0-9a-zA-Z\\.\\-\\_]{188,244})\\b"},{name:"Fulcrum",regex:"(?:fulcrum).{0,40}\\b([a-z0-9]{80})\\b"},{name:"Fullstory",regex:"(?:fullstory).{0,40}\\b([a-zA-Z-0-9/+]{88})\\b"},{name:"Fusebill",regex:"(?:fusebill).{0,40}\\b([a-zA-Z0-9]{88})\\b"},{name:"Fxmarket",regex:"(?:fxmarket).{0,40}\\b([0-9Aa-zA-Z-_=]{20})\\b"},{name:"Gcp",regex:"\\{[^{]+auth_provider_x509_cert_url[^}]+\\}"},{name:"Geckoboard",regex:"(?:geckoboard).{0,40}\\b([a-zA-Z0-9]{44})\\b"},{name:"Generic - 1376",regex:"jdbc:mysql(=| =|:| :)"},{name:"Generic - 1688",regex:"TOKEN[\\\\-|_|A-Z0-9]*(\\'|\\\")?(:|=)(\\'|\\\")?[\\\\-|_|A-Z0-9]{10}"},{name:"Generic - 1689",regex:"API[\\\\-|_|A-Z0-9]*(\\'|\\\")?(:|=)(\\'|\\\")?[\\\\-|_|A-Z0-9]{10}"},{name:"Generic - 1691",regex:"SECRET[\\\\-|_|A-Z0-9]*(\\'|\\\")?(:|=)(\\'|\\\")?[\\\\-|_|A-Z0-9]{10}"},{name:"Generic - 1692",regex:"AUTHORIZATION[\\\\-|_|A-Z0-9]*(\\'|\\\")?(:|=)(\\'|\\\")?[\\\\-|_|A-Z0-9]{10}"},{name:"Generic - 1693",regex:"PASSWORD[\\\\-|_|A-Z0-9]*(\\'|\\\")?(:|=)(\\'|\\\")?[\\\\-|_|A-Z0-9]{10}"},{name:"Generic - 1695",regex:`(A|a)(P|p)(Ii)[\\-|_|A-Za-z0-9]*(\\''|")?( )*(:|=)( )*(\\''|")?[0-9A-Za-z\\-_]+(\\''|")?`},{name:"Generic - 1700",regex:"BEGIN OPENSSH PRIVATE KEY"},{name:"Generic - 1701",regex:"BEGIN PRIVATE KEY"},{name:"Generic - 1702",regex:"BEGIN RSA PRIVATE KEY"},{name:"Generic - 1703",regex:"BEGIN DSA PRIVATE KEY"},{name:"Generic - 1704",regex:"BEGIN EC PRIVATE KEY"},{name:"Generic - 1705",regex:"BEGIN PGP PRIVATE KEY BLOCK"},{name:"Generic - 1707",regex:"[a-z0-9.-]+\\.s3-[a-z0-9-]\\.amazonaws\\.com"},{name:"Generic - 1708",regex:"[a-z0-9.-]+\\.s3-website[.-](eu|ap|us|ca|sa|cn)"},{name:"Generic - 1710",regex:"algolia_api_key"},{name:"Generic - 1711",regex:"asana_access_token"},{name:"Generic - 1713",regex:"azure_tenant"},{name:"Generic - 1714",regex:"bitly_access_token"},{name:"Generic - 1715",regex:"branchio_secret"},{name:"Generic - 1716",regex:"browserstack_access_key"},{name:"Generic - 1717",regex:"buildkite_access_token"},{name:"Generic - 1718",regex:"comcast_access_token"},{name:"Generic - 1719",regex:"datadog_api_key"},{name:"Generic - 1720",regex:"deviantart_secret"},{name:"Generic - 1721",regex:"deviantart_access_token"},{name:"Generic - 1722",regex:"dropbox_api_token"},{name:"Generic - 1723",regex:"facebook_appsecret"},{name:"Generic - 1724",regex:"facebook_access_token"},{name:"Generic - 1725",regex:"firebase_custom_token"},{name:"Generic - 1726",regex:"firebase_id_token"},{name:"Generic - 1727",regex:"github_client"},{name:"Generic - 1728",regex:"github_ssh_key"},{name:"Generic - 1730",regex:"gitlab_private_token"},{name:"Generic - 1731",regex:"google_cm"},{name:"Generic - 1732",regex:"google_maps_key"},{name:"Generic - 1733",regex:"heroku_api_key"},{name:"Generic - 1734",regex:"instagram_access_token"},{name:"Generic - 1735",regex:"mailchimp_api_key"},{name:"Generic - 1736",regex:"mailgun_api_key"},{name:"Generic - 1737",regex:"mailjet"},{name:"Generic - 1738",regex:"mapbox_access_token"},{name:"Generic - 1739",regex:"pagerduty_api_token"},{name:"Generic - 1740",regex:"paypal_key_sb"},{name:"Generic - 1741",regex:"paypal_key_live"},{name:"Generic - 1742",regex:"paypal_token_sb"},{name:"Generic - 1743",regex:"paypal_token_live"},{name:"Generic - 1744",regex:"pendo_integration_key"},{name:"Generic - 1745",regex:"salesforce_access_token"},{name:"Generic - 1746",regex:"saucelabs_ukey"},{name:"Generic - 1747",regex:"sendgrid_api_key"},{name:"Generic - 1748",regex:"slack_api_token"},{name:"Generic - 1749",regex:"slack_webhook"},{name:"Generic - 1750",regex:"square_secret"},{name:"Generic - 1751",regex:"square_auth_token"},{name:"Generic - 1752",regex:"travisci_api_token"},{name:"Generic - 1753",regex:"twilio_sid_token"},{name:"Generic - 1754",regex:"twitter_api_secret"},{name:"Generic - 1755",regex:"twitter_bearer_token"},{name:"Generic - 1756",regex:"spotify_access_token"},{name:"Generic - 1757",regex:"stripe_key_live"},{name:"Generic - 1758",regex:"wakatime_api_key"},{name:"Generic - 1759",regex:"wompi_auth_bearer_sb"},{name:"Generic - 1760",regex:"wompi_auth_bearer_live"},{name:"Generic - 1761",regex:"wpengine_api_key"},{name:"Generic - 1762",regex:"zapier_webhook"},{name:"Generic - 1763",regex:"zendesk_access_token"},{name:"Generic - 1764",regex:"ssh-rsa"},{name:"Generic - 1765",regex:"s3-[a-z0-9-]+\\.amazonaws\\.com/[a-z0-9._-]+"},{name:"Generic webhook secret",regex:"(webhook).+(secret|token|key).+"},{name:"Gengo",regex:"(?:gengo).{0,40}([ ]{0,1}[0-9a-zA-Z\\[\\]\\-\\(\\)\\{\\}|_^@$=~]{64}[ \\r\\n]{1})"},{name:"Geoapify",regex:"(?:geoapify).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Geocode",regex:"(?:geocode).{0,40}\\b([a-z0-9]{28})\\b"},{name:"Geocodify",regex:"(?:geocodify).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Geocodio - 2",regex:"(?:geocod).{0,40}\\b([a-z0-9]{39})\\b"},{name:"Geoipifi",regex:"(?:ipifi).{0,40}\\b([a-z0-9A-Z_]{32})\\b"},{name:"Getemail",regex:"(?:getemail).{0,40}\\b([a-zA-Z0-9-]{20})\\b"},{name:"Getemails - 1",regex:"(?:getemails).{0,40}\\b([a-z0-9-]{26})\\b"},{name:"Getemails - 2",regex:"(?:getemails).{0,40}\\b([a-z0-9-]{18})\\b"},{name:"Getgeoapi",regex:"(?:getgeoapi).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Getgist",regex:"(?:getgist).{0,40}\\b([a-z0-9A-Z+=]{68})"},{name:"Getsandbox - 1",regex:"(?:getsandbox).{0,40}\\b([a-z0-9-]{40})\\b"},{name:"Getsandbox - 2",regex:"(?:getsandbox).{0,40}\\b([a-z0-9-]{15,30})\\b"},{name:"GitHub",regex:`[gG][iI][tT][hH][uU][bB].*['|"][0-9a-zA-Z]{35,40}['|"]`},{name:"Github - 2",regex:"\\b((?:ghp|gho|ghu|ghs|ghr)_[a-zA-Z0-9]{36,255}\\b)"},{name:"Github App Token",regex:"(ghu|ghs)_[0-9a-zA-Z]{36}"},{name:"Github OAuth Access Token",regex:"gho_[0-9a-zA-Z]{36}"},{name:"Github Personal Access Token",regex:"ghp_[0-9a-zA-Z]{36}"},{name:"Github Refresh Token",regex:"ghr_[0-9a-zA-Z]{76}"},{name:"Github_old",regex:`(?:github)[^\\.].{0,40}[ =:'"]+([a-f0-9]{40})\\b`},{name:"Githubapp - 1",regex:"(?:github).{0,40}\\b([0-9]{6})\\b"},{name:"Githubapp - 2",regex:"(?:github).{0,40}(-----BEGIN RSA PRIVATE KEY-----\\s[A-Za-z0-9+\\/\\s]*\\s-----END RSA PRIVATE KEY-----)"},{name:"Gitlab",regex:"(?:gitlab).{0,40}\\b([a-zA-Z0-9\\-=_]{20,22})\\b"},{name:"Gitlabv2",regex:"\\b(glpat-[a-zA-Z0-9\\-=_]{20,22})\\b"},{name:"Gitter",regex:"(?:gitter).{0,40}\\b([a-z0-9-]{40})\\b"},{name:"Glassnode",regex:"(?:glassnode).{0,40}\\b([0-9A-Za-z]{27})\\b"},{name:"Gocanvas - 1",regex:"(?:gocanvas).{0,40}\\b([0-9A-Za-z/+]{43}=[ \\r\\n]{1})"},{name:"Gocanvas - 2",regex:"(?:gocanvas).{0,40}\\b([\\w\\.-]+@[\\w-]+\\.[\\w\\.-]{2,5})\\b"},{name:"Gocardless",regex:`\\b(live_[0-9A-Za-z\\_\\-]{40}[ "'\\r\\n]{1})`},{name:"Goodday",regex:"(?:goodday).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Google (GCP) Service Account",regex:'"type": "service_account"'},{name:"Google API Key",regex:"AIza[0-9a-z-_]{35}"},{name:"Google Calendar URI",regex:"https://www\\.google\\.com/calendar/embed\\?src=[A-Za-z0-9%@&;=\\-_\\./]+"},{name:"Graphcms - 1",regex:"(?:graph).{0,40}\\b([a-z0-9]{25})\\b"},{name:"Graphcms - 2",regex:"\\b(ey[a-zA-Z0-9]{73}.ey[a-zA-Z0-9]{365}.[a-zA-Z0-9_-]{683})\\b"},{name:"Graphhopper",regex:"(?:graphhopper).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Groovehq",regex:"(?:groove).{0,40}\\b([a-z0-9A-Z]{64})"},{name:"Guru - 1",regex:"(?:guru).{0,40}\\b([a-zA-Z0-9]{3,20}@[a-zA-Z0-9]{2,12}.[a-zA-Z0-9]{2,5})\\b"},{name:"Guru - 2",regex:"(?:guru).{0,40}\\b([a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})\\b"},{name:"Gyazo",regex:"(?:gyazo).{0,40}\\b([0-9A-Za-z-]{43})\\b"},{name:"Happi",regex:"(?:happi).{0,40}\\b([a-zA-Z0-9]{56})"},{name:"Happyscribe",regex:"(?:happyscribe).{0,40}\\b([0-9a-zA-Z]{24})\\b"},{name:"Harvest - 1",regex:"(?:harvest).{0,40}\\b([a-z0-9A-Z._]{97})\\b"},{name:"Harvest - 2",regex:"(?:harvest).{0,40}\\b([0-9]{4,9})\\b"},{name:"Hellosign",regex:"(?:hellosign).{0,40}\\b([a-zA-Z-0-9/+]{64})\\b"},{name:"Helpcrunch",regex:"(?:helpcrunch).{0,40}\\b([a-zA-Z-0-9+/=]{328})"},{name:"Helpscout",regex:"(?:helpscout).{0,40}\\b([A-Za-z0-9]{56})\\b"},{name:"Hereapi",regex:"(?:hereapi).{0,40}\\b([a-zA-Z0-9\\S]{43})\\b"},{name:"Heroku",regex:"(?:heroku).{0,40}\\b([0-9Aa-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\\b"},{name:"Hive - 1",regex:"(?:hive).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Hive - 2",regex:"(?:hive).{0,40}\\b([0-9A-Za-z]{17})\\b"},{name:"Hiveage",regex:"(?:hiveage).{0,40}\\b([0-9A-Za-z\\_\\-]{20})\\b"},{name:"Holidayapi",regex:"(?:holidayapi).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Host",regex:"(?:host).{0,40}\\b([a-z0-9]{14})\\b"},{name:"Html2pdf",regex:"(?:html2pdf).{0,40}\\b([a-zA-Z0-9]{64})\\b"},{name:"Hubspotapikey",regex:"(?:hubspot).{0,40}\\b([A-Za-z0-9]{8}\\-[A-Za-z0-9]{4}\\-[A-Za-z0-9]{4}\\-[A-Za-z0-9]{4}\\-[A-Za-z0-9]{12})\\b"},{name:"Humanity",regex:"(?:humanity).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Hunter",regex:"(?:hunter).{0,40}\\b([a-z0-9_-]{40})\\b"},{name:"Hypertrack - 1",regex:"(?:hypertrack).{0,40}\\b([0-9a-zA-Z\\_\\-]{54})\\b"},{name:"Hypertrack - 2",regex:"(?:hypertrack).{0,40}\\b([0-9a-zA-Z\\_\\-]{27})\\b"},{name:"Ibmclouduserkey",regex:"(?:ibm).{0,40}\\b([A-Za-z0-9_-]{44})\\b"},{name:"Iconfinder",regex:"(?:iconfinder).{0,40}\\b([a-zA-Z0-9]{64})\\b"},{name:"Iexcloud",regex:"(?:iexcloud).{0,40}\\b([a-z0-9_]{35})\\b"},{name:"Imagekit",regex:"(?:imagekit).{0,40}\\b([a-zA-Z0-9_=]{36})"},{name:"Imagga",regex:"(?:imagga).{0,40}\\b([a-z0-9A-Z=]{72})"},{name:"Impala",regex:"(?:impala).{0,40}\\b([0-9A-Za-z_]{46})\\b"},{name:"Insightly",regex:"(?:insightly).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Integromat",regex:"(?:integromat).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Intercom",regex:"(?:intercom).{0,40}\\b([a-zA-Z0-9\\W\\S]{59}\\=)"},{name:"Intrinio",regex:"(?:intrinio).{0,40}\\b([a-zA-Z0-9]{44})\\b"},{name:"Invoiceocean - 1",regex:"(?:invoiceocean).{0,40}\\b([0-9A-Za-z]{20})\\b"},{name:"Invoiceocean - 2",regex:"\\b([0-9a-z]{1,}.invoiceocean.com)\\b"},{name:"Ipapi",regex:"(?:ipapi).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Ipgeolocation",regex:"(?:ipgeolocation).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Ipify",regex:"(?:ipify).{0,40}\\b([a-zA-Z0-9_-]{32})\\b"},{name:"Ipinfodb",regex:"(?:ipinfodb).{0,40}\\b([a-z0-9]{64})\\b"},{name:"Ipquality",regex:"(?:ipquality).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Ipstack",regex:"(?:ipstack).{0,40}\\b([a-fA-f0-9]{32})\\b"},{name:"JDBC Connection String",regex:"jdbc:[a-z:]+://[A-Za-z0-9\\.\\-_:;=/@?,&]+"},{name:"Jiratoken - 1",regex:"(?:jira).{0,40}\\b([a-zA-Z-0-9]{24})\\b"},{name:"Jiratoken - 2",regex:"(?:jira).{0,40}\\b([a-zA-Z-0-9]{5,24}\\@[a-zA-Z-0-9]{3,16}\\.com)\\b"},{name:"Jiratoken - 3",regex:"(?:jira).{0,40}\\b([a-zA-Z-0-9]{5,24}\\.[a-zA-Z-0-9]{3,16}\\.[a-zA-Z-0-9]{3,16})\\b"},{name:"Jotform",regex:"(?:jotform).{0,40}\\b([0-9Aa-z]{32})\\b"},{name:"Jumpcloud",regex:"(?:jumpcloud).{0,40}\\b([a-zA-Z0-9]{40})\\b"},{name:"Juro",regex:"(?:juro).{0,40}\\b([a-zA-Z0-9]{40})\\b"},{name:"Kanban - 1",regex:"(?:kanban).{0,40}\\b([0-9A-Z]{12})\\b"},{name:"Kanban - 2",regex:"\\b([0-9a-z]{1,}.kanbantool.com)\\b"},{name:"Karmacrm",regex:"(?:karma).{0,40}\\b([a-zA-Z0-9]{20})\\b"},{name:"Keenio - 1",regex:"(?:keen).{0,40}\\b([0-9a-z]{24})\\b"},{name:"Keenio - 2",regex:"(?:keen).{0,40}\\b([0-9A-Z]{64})\\b"},{name:"Kickbox",regex:"(?:kickbox).{0,40}\\b([a-zA-Z0-9_]+[a-zA-Z0-9]{64})\\b"},{name:"Klipfolio",regex:"(?:klipfolio).{0,40}\\b([0-9a-f]{40})\\b"},{name:"Kontent",regex:"(?:kontent).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Kraken - 1",regex:`(?:kraken).{0,40}\\b([0-9A-Za-z\\/\\+=]{56}[ "'\\r\\n]{1})`},{name:"Kraken - 2",regex:`(?:kraken).{0,40}\\b([0-9A-Za-z\\/\\+=]{86,88}[ "'\\r\\n]{1})`},{name:"Kucoin - 1",regex:"(?:kucoin).{0,40}([ \\r\\n]{1}[!-~]{7,32}[ \\r\\n]{1})"},{name:"Kucoin - 2",regex:"(?:kucoin).{0,40}\\b([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\\b"},{name:"Kucoin - 3",regex:"(?:kucoin).{0,40}\\b([0-9a-f]{24})\\b"},{name:"Kylas",regex:"(?:kylas).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Languagelayer",regex:"(?:languagelayer).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Lastfm",regex:"(?:lastfm).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Launchdarkly",regex:"(?:launchdarkly).{0,40}\\b([a-z0-9-]{40})\\b"},{name:"Leadfeeder",regex:"(?:leadfeeder).{0,40}\\b([a-zA-Z0-9-]{43})\\b"},{name:"Lendflow",regex:"(?:lendflow).{0,40}\\b([a-zA-Z0-9]{36}\\.[a-zA-Z0-9]{235}\\.[a-zA-Z0-9]{32}\\-[a-zA-Z0-9]{47}\\-[a-zA-Z0-9_]{162}\\-[a-zA-Z0-9]{42}\\-[a-zA-Z0-9_]{40}\\-[a-zA-Z0-9_]{66}\\-[a-zA-Z0-9_]{59}\\-[a-zA-Z0-9]{7}\\-[a-zA-Z0-9_]{220})\\b"},{name:"Lessannoyingcrm",regex:"(?:less).{0,40}\\b([a-zA-Z0-9-]{57})\\b"},{name:"Lexigram",regex:"(?:lexigram).{0,40}\\b([a-zA-Z0-9\\S]{301})\\b"},{name:"Linearapi",regex:"\\b(lin_api_[0-9A-Za-z]{40})\\b"},{name:"Linemessaging",regex:"(?:line).{0,40}\\b([A-Za-z0-9+/]{171,172})\\b"},{name:"Linenotify",regex:"(?:linenotify).{0,40}\\b([0-9A-Za-z]{43})\\b"},{name:"Linkpreview",regex:"(?:linkpreview).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Liveagent",regex:"(?:liveagent).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Livestorm",regex:"(?:livestorm).{0,40}\\b(eyJhbGciOiJIUzI1NiJ9\\.eyJhdWQiOiJhcGkubGl2ZXN0b3JtLmNvIiwianRpIjoi[0-9A-Z-a-z]{134}\\.[0-9A-Za-z\\-\\_]{43}[ \\r\\n]{1})"},{name:"Locationiq",regex:"\\b(pk\\.[a-zA-Z-0-9]{32})\\b"},{name:"Loginradius",regex:"(?:loginradius).{0,40}\\b([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\\b"},{name:"Lokalisetoken",regex:"(?:lokalise).{0,40}\\b([a-z0-9]{40})\\b"},{name:"Loyverse",regex:"(?:loyverse).{0,40}\\b([0-9-a-z]{32})\\b"},{name:"Luno - 1",regex:"(?:luno).{0,40}\\b([a-z0-9]{13})\\b"},{name:"Luno - 2",regex:"(?:luno).{0,40}\\b([a-zA-Z0-9_-]{43})\\b"},{name:"M3o",regex:"(?:m3o).{0,40}\\b([0-9A-Za-z]{48})\\b"},{name:"Macaddress",regex:"(?:macaddress).{0,40}\\b([a-zA-Z0-9_]{32})\\b"},{name:"Madkudu",regex:"(?:madkudu).{0,40}\\b([0-9a-f]{32})\\b"},{name:"Magnetic",regex:"(?:magnetic).{0,40}\\b([0-9Aa-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12})\\b"},{name:"Mailboxlayer",regex:"(?:mailboxlayer).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Mailerlite",regex:"(?:mailerlite).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Mailgun - 2",regex:"(?:mailgun).{0,40}\\b([a-zA-Z-0-9]{72})\\b"},{name:"Mailgun API Key - 1",regex:"key-[0-9a-zA-Z]{32}"},{name:"Mailgun API key - 2",regex:"(mailgun|mg)[0-9a-z]{32}"},{name:"Mailjetbasicauth",regex:"(?:mailjet).{0,40}\\b([A-Za-z0-9]{87}\\=)"},{name:"Mailjetsms",regex:"(?:mailjet).{0,40}\\b([A-Za-z0-9]{32})\\b"},{name:"Mailmodo",regex:"(?:mailmodo).{0,40}\\b([A-Z0-9]{7}-[A-Z0-9]{7}-[A-Z0-9]{7}-[A-Z0-9]{7})\\b"},{name:"Mailsac",regex:"(?:mailsac).{0,40}\\b(k_[0-9A-Za-z]{36,})\\b"},{name:"Mandrill",regex:"(?:mandrill).{0,40}\\b([A-Za-z0-9_-]{22})\\b"},{name:"Manifest",regex:"(?:manifest).{0,40}\\b([a-zA-z0-9]{32})\\b"},{name:"Mapbox - 2",regex:"\\b(sk\\.[a-zA-Z-0-9\\.]{80,240})\\b"},{name:"Mapquest",regex:"(?:mapquest).{0,40}\\b([0-9A-Za-z]{32})\\b"},{name:"Marketstack",regex:"(?:marketstack).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Mattermostpersonaltoken - 1",regex:"(?:mattermost).{0,40}\\b([A-Za-z0-9-_]{1,}.cloud.mattermost.com)\\b"},{name:"Mattermostpersonaltoken - 2",regex:"(?:mattermost).{0,40}\\b([a-z0-9]{26})\\b"},{name:"Mavenlink",regex:"(?:mavenlink).{0,40}\\b([0-9a-z]{64})\\b"},{name:"Maxmindlicense - 1",regex:"(?:maxmind|geoip).{0,40}\\b([0-9A-Za-z]{16})\\b"},{name:"Maxmindlicense - 2",regex:"(?:maxmind|geoip).{0,40}\\b([0-9]{2,7})\\b"},{name:"Meaningcloud",regex:"(?:meaningcloud).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Mediastack",regex:"(?:mediastack).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Meistertask",regex:"(?:meistertask).{0,40}\\b([a-zA-Z0-9]{43})\\b"},{name:"Mesibo",regex:"(?:mesibo).{0,40}\\b([0-9A-Za-z]{64})\\b"},{name:"Messagebird",regex:"(?:messagebird).{0,40}\\b([A-Za-z0-9_-]{25})\\b"},{name:"Metaapi - 1",regex:"(?:metaapi|meta-api).{0,40}\\b([0-9a-f]{64})\\b"},{name:"Metaapi - 2",regex:"(?:metaapi|meta-api).{0,40}\\b([0-9a-f]{24})\\b"},{name:"Metrilo",regex:"(?:metrilo).{0,40}\\b([a-z0-9]{16})\\b"},{name:"Microsoftteamswebhook",regex:"(https:\\/\\/[a-zA-Z-0-9]+\\.webhook\\.office\\.com\\/webhookb2\\/[a-zA-Z-0-9]{8}-[a-zA-Z-0-9]{4}-[a-zA-Z-0-9]{4}-[a-zA-Z-0-9]{4}-[a-zA-Z-0-9]{12}\\@[a-zA-Z-0-9]{8}-[a-zA-Z-0-9]{4}-[a-zA-Z-0-9]{4}-[a-zA-Z-0-9]{4}-[a-zA-Z-0-9]{12}\\/IncomingWebhook\\/[a-zA-Z-0-9]{32}\\/[a-zA-Z-0-9]{8}-[a-zA-Z-0-9]{4}-[a-zA-Z-0-9]{4}-[a-zA-Z-0-9]{4}-[a-zA-Z-0-9]{12})"},{name:"Midise",regex:"midi-662b69edd2[a-zA-Z0-9]{54}"},{name:"Mindmeister",regex:"(?:mindmeister).{0,40}\\b([a-zA-Z0-9]{43})\\b"},{name:"Mite - 1",regex:"(?:mite).{0,40}\\b([0-9a-z]{16})\\b"},{name:"Mite - 2",regex:"\\b([0-9a-z-]{1,}.mite.yo.lk)\\b"},{name:"Mixmax",regex:"(?:mixmax).{0,40}\\b([a-zA-Z0-9_-]{36})\\b"},{name:"Mixpanel - 1",regex:"(?:mixpanel).{0,40}\\b([a-zA-Z0-9.-]{30,40})\\b"},{name:"Mixpanel - 2",regex:"(?:mixpanel).{0,40}\\b([a-zA-Z0-9-]{32})\\b"},{name:"Moderation",regex:"(?:moderation).{0,40}\\b([a-zA-Z0-9]{36}\\.[a-zA-Z0-9]{115}\\.[a-zA-Z0-9_]{43})\\b"},{name:"Monday",regex:"(?:monday).{0,40}\\b(ey[a-zA-Z0-9_.]{210,225})\\b"},{name:"Moonclerck",regex:"(?:moonclerck).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Moonclerk",regex:"(?:moonclerk).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Moosend",regex:"(?:moosend).{0,40}\\b([0-9Aa-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\\b"},{name:"Mrticktock - 1",regex:"(?:mrticktock).{0,40}\\b([a-zA-Z0-9!=@#$%()_^]{1,50})"},{name:"Myfreshworks - 2",regex:"(?:freshworks).{0,40}\\b([a-z0-9A-Z-]{22})\\b"},{name:"Myintervals",regex:"(?:myintervals).{0,40}\\b([0-9a-z]{11})\\b"},{name:"Nasdaqdatalink",regex:"(?:nasdaq).{0,40}\\b([a-zA-Z0-9_-]{20})\\b"},{name:"Nethunt - 1",regex:"(?:nethunt).{0,40}\\b([a-zA-Z0-9.-@]{25,30})\\b"},{name:"Nethunt - 2",regex:"(?:nethunt).{0,40}\\b([a-z0-9-\\S]{36})\\b"},{name:"Netlify",regex:"(?:netlify).{0,40}\\b([A-Za-z0-9_-]{43,45})\\b"},{name:"Neutrinoapi - 1",regex:"(?:neutrinoapi).{0,40}\\b([a-zA-Z0-9]{48})\\b"},{name:"Neutrinoapi - 2",regex:"(?:neutrinoapi).{0,40}\\b([a-zA-Z0-9]{6,24})\\b"},{name:"Newrelic Admin API Key",regex:"NRAA-[a-f0-9]{27}"},{name:"Newrelic Insights API Key",regex:"NRI(?:I|Q)-[A-Za-z0-9\\-_]{32}"},{name:"Newrelic REST API Key",regex:"NRRA-[a-f0-9]{42}"},{name:"Newrelic Synthetics Location Key",regex:"NRSP-[a-z]{2}[0-9]{2}[a-f0-9]{31}"},{name:"Newrelicpersonalapikey",regex:"(?:newrelic).{0,40}\\b([A-Za-z0-9_\\.]{4}-[A-Za-z0-9_\\.]{42})\\b"},{name:"Newsapi",regex:"(?:newsapi).{0,40}\\b([a-z0-9]{32})"},{name:"Newscatcher",regex:"(?:newscatcher).{0,40}\\b([0-9A-Za-z_]{43})\\b"},{name:"Nexmoapikey - 1",regex:"(?:nexmo).{0,40}\\b([A-Za-z0-9_-]{8})\\b"},{name:"Nexmoapikey - 2",regex:"(?:nexmo).{0,40}\\b([A-Za-z0-9_-]{16})\\b"},{name:"Nftport",regex:"(?:nftport).{0,40}\\b([a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})\\b"},{name:"Nicereply",regex:"(?:nicereply).{0,40}\\b([0-9a-f]{40})\\b"},{name:"Nimble",regex:"(?:nimble).{0,40}\\b([a-zA-Z0-9]{30})\\b"},{name:"Nitro",regex:"(?:nitro).{0,40}\\b([0-9a-f]{32})\\b"},{name:"Noticeable",regex:"(?:noticeable).{0,40}\\b([0-9a-zA-Z]{20})\\b"},{name:"Notion",regex:"\\b(secret_[A-Za-z0-9]{43})\\b"},{name:"Nozbeteams",regex:"(?:nozbe|nozbeteams).{0,40}\\b([0-9A-Za-z]{16}_[0-9A-Za-z\\-_]{64}[ \\r\\n]{1})"},{name:"Numverify",regex:"(?:numverify).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Nutritionix - 1",regex:"(?:nutritionix).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Nutritionix - 2",regex:"(?:nutritionix).{0,40}\\b([a-z0-9]{8})\\b"},{name:"Nylas",regex:"(?:nylas).{0,40}\\b([0-9A-Za-z]{30})\\b"},{name:"Nytimes",regex:"(?:nytimes).{0,40}\\b([a-z0-9A-Z-]{32})\\b"},{name:"Oanda",regex:"(?:oanda).{0,40}\\b([a-zA-Z0-9]{24})\\b"},{name:"Omnisend",regex:"(?:omnisend).{0,40}\\b([a-z0-9A-Z-]{75})\\b"},{name:"Onedesk - 1",regex:"(?:onedesk).{0,40}\\b([a-zA-Z0-9!=@#$%^]{8,64})"},{name:"Onelogin - 2",regex:`secret[a-zA-Z0-9_' "=]{0,20}([a-z0-9]{64})`},{name:"Onepagecrm - 1",regex:"(?:onepagecrm).{0,40}\\b([a-zA-Z0-9=]{44})"},{name:"Onepagecrm - 2",regex:"(?:onepagecrm).{0,40}\\b([a-z0-9]{24})\\b"},{name:"Onwaterio",regex:"(?:onwater).{0,40}\\b([a-zA-Z0-9_-]{20})\\b"},{name:"Oopspam",regex:"(?:oopspam).{0,40}\\b([a-zA-Z0-9]{40})\\b"},{name:"Opencagedata",regex:"(?:opencagedata).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Opengraphr",regex:"(?:opengraphr).{0,40}\\b([0-9Aa-zA-Z]{80})\\b"},{name:"Openuv",regex:"(?:openuv).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Openweather",regex:"(?:openweather).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Optimizely",regex:"(?:optimizely).{0,40}\\b([0-9A-Za-z-:]{54})\\b"},{name:"Owlbot",regex:"(?:owlbot).{0,40}\\b([a-z0-9]{40})\\b"},{name:"PGP private key block",regex:"-----BEGIN PGP PRIVATE KEY BLOCK-----"},{name:"Pagerdutyapikey",regex:"(?:pagerduty).{0,40}\\b([a-z]{1}\\+[a-zA-Z]{9}\\-[a-z]{2}\\-[a-z0-9]{5})\\b"},{name:"Pandadoc",regex:"(?:pandadoc).{0,40}\\b([a-zA-Z0-9]{40})\\b"},{name:"Pandascore",regex:"(?:pandascore).{0,40}([ \\r\\n]{0,1}[0-9A-Za-z\\-\\_]{51}[ \\r\\n]{1})"},{name:"Paralleldots",regex:"(?:paralleldots).{0,40}\\b([0-9A-Za-z]{43})\\b"},{name:"Partnerstack",regex:"(?:partnerstack).{0,40}\\b([0-9A-Za-z]{64})\\b"},{name:"Passbase",regex:"(?:passbase).{0,40}\\b([a-zA-Z0-9]{128})\\b"},{name:"Pastebin",regex:"(?:pastebin).{0,40}\\b([a-zA-Z0-9_]{32})\\b"},{name:"PayPal Braintree access token",regex:"access_token\\$production\\$[0-9a-z]{16}\\$[0-9a-f]{32}"},{name:"Paymoapp",regex:"(?:paymoapp).{0,40}\\b([a-zA-Z0-9]{44})\\b"},{name:"Paymongo",regex:"(?:paymongo).{0,40}\\b([a-zA-Z0-9_]{32})\\b"},{name:"Paypaloauth - 1",regex:"\\b([A-Za-z0-9_\\.]{7}-[A-Za-z0-9_\\.]{72})\\b"},{name:"Paypaloauth - 2",regex:"\\b([A-Za-z0-9_\\.]{69}-[A-Za-z0-9_\\.]{10})\\b"},{name:"Paystack",regex:"\\b(sk\\_[a-z]{1,}\\_[A-Za-z0-9]{40})\\b"},{name:"Pdflayer",regex:"(?:pdflayer).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Pdfshift",regex:"(?:pdfshift).{0,40}\\b([0-9a-f]{32})\\b"},{name:"Peopledatalabs",regex:"(?:peopledatalabs).{0,40}\\b([a-z0-9]{64})\\b"},{name:"Pepipost",regex:"(?:pepipost|netcore).{0,40}\\b([a-zA-Z-0-9]{32})\\b"},{name:"Picatic API key",regex:"sk_live_[0-9a-z]{32}"},{name:"Pipedream",regex:"(?:pipedream).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Pipedrive",regex:"(?:pipedrive).{0,40}\\b([a-zA-Z0-9]{40})\\b"},{name:"Pivotaltracker",regex:"(?:pivotal).{0,40}([a-z0-9]{32})"},{name:"Pixabay",regex:"(?:pixabay).{0,40}\\b([a-z0-9-]{34})\\b"},{name:"Plaidkey - 1",regex:"(?:plaid).{0,40}\\b([a-z0-9]{24})\\b"},{name:"Plaidkey - 2",regex:"(?:plaid).{0,40}\\b([a-z0-9]{30})\\b"},{name:"Planviewleankit - 1",regex:"(?:planviewleankit|planview).{0,40}\\b([0-9a-f]{128})\\b"},{name:"Planviewleankit - 2",regex:"(?:planviewleankit|planview).{0,40}(?:subdomain).\\b([a-zA-Z][a-zA-Z0-9.-]{1,23}[a-zA-Z0-9])\\b"},{name:"Planyo",regex:"(?:planyo).{0,40}\\b([0-9a-z]{62})\\b"},{name:"Plivo - 1",regex:"(?:plivo).{0,40}\\b([A-Za-z0-9_-]{40})\\b"},{name:"Plivo - 2",regex:"(?:plivo).{0,40}\\b([A-Z]{20})\\b"},{name:"Poloniex - 1",regex:"(?:poloniex).{0,40}\\b([0-9a-f]{128})\\b"},{name:"Poloniex - 2",regex:"(?:poloniex).{0,40}\\b([0-9A-Z]{8}-[0-9A-Z]{8}-[0-9A-Z]{8}-[0-9A-Z]{8})\\b"},{name:"Polygon",regex:"(?:polygon).{0,40}\\b([a-z0-9A-Z]{32})\\b"},{name:"Positionstack",regex:"(?:positionstack).{0,40}\\b([a-zA-Z0-9_]{32})\\b"},{name:"Postageapp",regex:"(?:postageapp).{0,40}\\b([0-9A-Za-z]{32})\\b"},{name:"Posthog",regex:"\\b(phc_[a-zA-Z0-9_]{43})\\b"},{name:"Postman",regex:"\\b(PMAK-[a-zA-Z-0-9]{59})\\b"},{name:"Postmark",regex:"(?:postmark).{0,40}\\b([0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12})\\b"},{name:"Powrbot",regex:"(?:powrbot).{0,40}\\b([a-z0-9A-Z]{40})\\b"},{name:"Privatekey",regex:"-----\\s*?BEGIN[ A-Z0-9_-]*?PRIVATE KEY\\s*?-----[\\s\\S]*?----\\s*?END[ A-Z0-9_-]*? PRIVATE KEY\\s*?-----"},{name:"Prospectcrm",regex:"(?:prospect).{0,40}\\b([a-z0-9-]{32})\\b"},{name:"Prospectio",regex:"(?:prospect).{0,40}\\b([a-z0-9A-Z-]{50})\\b"},{name:"Protocolsio",regex:"(?:protocols).{0,40}\\b([a-z0-9]{64})\\b"},{name:"Proxycrawl",regex:"(?:proxycrawl).{0,40}\\b([a-zA-Z0-9_]{22})\\b"},{name:"Pubnubpublishkey - 1",regex:"\\b(sub-c-[0-9a-z]{8}-[a-z]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})\\b"},{name:"Pubnubpublishkey - 2",regex:"\\b(pub-c-[0-9a-z]{8}-[0-9a-z]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})\\b"},{name:"Purestake",regex:"(?:purestake).{0,40}\\b([a-zA-Z0-9]{40})\\b"},{name:"Pushbulletapikey",regex:"(?:pushbullet).{0,40}\\b([A-Za-z0-9_\\.]{34})\\b"},{name:"Pusherchannelkey - 1",regex:"(?:key).{0,40}\\b([a-z0-9]{20})\\b"},{name:"Pusherchannelkey - 2",regex:"(?:pusher).{0,40}\\b([a-z0-9]{20})\\b"},{name:"Pusherchannelkey - 3",regex:"(?:pusher).{0,40}\\b([0-9]{7})\\b"},{name:"PyPI upload token",regex:"pypi-AgEIcHlwaS5vcmc[A-Za-z0-9-_]{50,1000}"},{name:"Qualaroo",regex:"(?:qualaroo).{0,40}\\b([a-z0-9A-Z=]{64})"},{name:"Qubole",regex:"(?:qubole).{0,40}\\b([0-9a-z]{64})\\b"},{name:"Quickmetrics",regex:"(?:quickmetrics).{0,40}\\b([a-zA-Z0-9_-]{22})\\b"},{name:"REDIS_URL",regex:"(REDIS_URL).+"},{name:"RKCS8",regex:"-----BEGIN PRIVATE KEY-----"},{name:"RSA private key",regex:"-----BEGIN RSA PRIVATE KEY-----"},{name:"Rapidapi",regex:"(?:rapidapi).{0,40}\\b([A-Za-z0-9_-]{50})\\b"},{name:"Raven",regex:"(?:raven).{0,40}\\b([A-Z0-9-]{16})\\b"},{name:"Rawg",regex:"(?:rawg).{0,40}\\b([0-9Aa-z]{32})\\b"},{name:"Razorpay - 1",regex:"\\brzp_\\w{2,6}_\\w{10,20}\\b"},{name:"Readme",regex:"(?:readme).{0,40}\\b([a-zA-Z0-9_]{32})\\b"},{name:"Reallysimplesystems",regex:"\\b(ey[a-zA-Z0-9-._]{153}.ey[a-zA-Z0-9-._]{916,1000})\\b"},{name:"Rebrandly",regex:"(?:rebrandly).{0,40}\\b([a-zA-Z0-9_]{32})\\b"},{name:"Refiner",regex:"(?:refiner).{0,40}\\b([0-9Aa-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\\b"},{name:"Repairshopr - 1",regex:"(?:repairshopr).{0,40}\\b([a-zA-Z0-9_.!+$#^*]{3,32})\\b"},{name:"Repairshopr - 2",regex:"(?:repairshopr).{0,40}\\b([a-zA-Z0-9-]{51})\\b"},{name:"Restpack",regex:"(?:restpack).{0,40}\\b([a-zA-Z0-9]{48})\\b"},{name:"Restpackhtmltopdfapi",regex:"(?:restpack).{0,40}\\b([0-9A-Za-z]{48})\\b"},{name:"Rev - 1",regex:"(?:rev).{0,40}\\b([0-9a-zA-Z\\/\\+]{27}\\=[ \\r\\n]{1})"},{name:"Rev - 2",regex:"(?:rev).{0,40}\\b([0-9a-zA-Z\\-]{27}[ \\r\\n]{1})"},{name:"Revampcrm - 1",regex:"(?:revamp).{0,40}\\b([a-zA-Z0-9]{40}\\b)"},{name:"Revampcrm - 2",regex:"(?:revamp).{0,40}\\b([a-zA-Z0-9.-@]{25,30})\\b"},{name:"Ringcentral - 1",regex:"(?:ringcentral).{0,40}\\b(https://www.[0-9A-Za-z_-]{1,}.com)\\b"},{name:"Ringcentral - 2",regex:"(?:ringcentral).{0,40}\\b([0-9A-Za-z_-]{22})\\b"},{name:"Ritekit",regex:"(?:ritekit).{0,40}\\b([0-9a-f]{44})\\b"},{name:"Roaring",regex:"(?:roaring).{0,40}\\b([0-9A-Za-z_-]{28})\\b"},{name:"Rocketreach",regex:"(?:rocketreach).{0,40}\\b([a-z0-9-]{39})\\b"},{name:"Roninapp - 1",regex:"(?:ronin).{0,40}\\b([0-9Aa-zA-Z]{3,32})\\b"},{name:"Roninapp - 2",regex:"(?:ronin).{0,40}\\b([0-9a-zA-Z]{26})\\b"},{name:"Route4me",regex:"(?:route4me).{0,40}\\b([0-9A-Z]{32})\\b"},{name:"Rownd - 1",regex:"(?:rownd).{0,40}\\b([a-z0-9]{8}\\-[a-z0-9]{4}\\-[a-z0-9]{4}\\-[a-z0-9]{4}\\-[a-z0-9]{12})\\b"},{name:"Rownd - 2",regex:"(?:rownd).{0,40}\\b([a-z0-9]{48})\\b"},{name:"Rownd - 3",regex:"(?:rownd).{0,40}\\b([0-9]{18})\\b"},{name:"Rubygems",regex:"\\b(rubygems_[a-zA0-9]{48})\\b"},{name:"Runrunit - 1",regex:"(?:runrunit).{0,40}\\b([0-9a-f]{32})\\b"},{name:"Runrunit - 2",regex:"(?:runrunit).{0,40}\\b([0-9A-Za-z]{18,20})\\b"},{name:"SSH",regex:"-----BEGIN OPENSSH PRIVATE KEY-----"},{name:"SSH (DSA) private key",regex:"-----BEGIN DSA PRIVATE KEY-----"},{name:"Salesblink",regex:"(?:salesblink).{0,40}\\b([a-zA-Z]{16})\\b"},{name:"Salescookie",regex:"(?:salescookie).{0,40}\\b([a-zA-z0-9]{32})\\b"},{name:"Salesflare",regex:"(?:salesflare).{0,40}\\b([a-zA-Z0-9_]{45})\\b"},{name:"Satismeterprojectkey - 1",regex:"(?:satismeter).{0,40}\\b([a-zA-Z0-9]{4,20}@[a-zA-Z0-9]{2,12}.[a-zA-Z0-9]{2,12})\\b"},{name:"Satismeterprojectkey - 2",regex:"(?:satismeter).{0,40}\\b([a-zA-Z0-9]{24})\\b"},{name:"Satismeterprojectkey - 3",regex:"(?:satismeter).{0,40}\\b([a-zA-Z0-9!=@#$%^]{6,32})"},{name:"Satismeterwritekey",regex:"(?:satismeter).{0,40}\\b([a-z0-9A-Z]{16})\\b"},{name:"Saucelabs - 1",regex:"\\b(oauth\\-[a-z0-9]{8,}\\-[a-z0-9]{5})\\b"},{name:"Saucelabs - 2",regex:"(?:saucelabs).{0,40}\\b([a-z0-9]{8}\\-[a-z0-9]{4}\\-[a-z0-9]{4}\\-[a-z0-9]{4}\\-[a-z0-9]{12})\\b"},{name:"Scalewaykey",regex:"(?:scaleway).{0,40}\\b([0-9a-z]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[0-9a-z]{4}-[0-9a-z]{12})\\b"},{name:"Scrapeowl",regex:"(?:scrapeowl).{0,40}\\b([0-9a-z]{30})\\b"},{name:"Scraperapi",regex:"(?:scraperapi).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Scraperbox",regex:"(?:scraperbox).{0,40}\\b([A-Z0-9]{32})\\b"},{name:"Scrapersite",regex:"(?:scrapersite).{0,40}\\b([a-zA-Z0-9]{45})\\b"},{name:"Scrapestack",regex:"(?:scrapestack).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Scrapfly",regex:"(?:scrapfly).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Scrapingant",regex:"(?:scrapingant).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Scrapingbee",regex:"(?:scrapingbee).{0,40}\\b([A-Z0-9]{80})\\b"},{name:"Screenshotapi",regex:"(?:screenshotapi).{0,40}\\b([0-9A-Z]{7}\\-[0-9A-Z]{7}\\-[0-9A-Z]{7}\\-[0-9A-Z]{7})\\b"},{name:"Screenshotlayer",regex:"(?:screenshotlayer).{0,40}\\b([a-zA-Z0-9_]{32})\\b"},{name:"Securitytrails",regex:"(?:securitytrails).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Segmentapikey",regex:"(?:segment).{0,40}\\b([A-Za-z0-9_\\-a-zA-Z]{43}\\.[A-Za-z0-9_\\-a-zA-Z]{43})\\b"},{name:"Selectpdf",regex:"(?:selectpdf).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Semaphore",regex:"(?:semaphore).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Sendbird - 1",regex:"(?:sendbird).{0,40}\\b([0-9a-f]{40})\\b"},{name:"Sendbird - 2",regex:"(?:sendbird).{0,40}\\b([0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})\\b"},{name:"Sendbirdorganizationapi",regex:"(?:sendbird).{0,40}\\b([0-9a-f]{24})\\b"},{name:"Sendgrid",regex:"(SG\\.[\\w\\-_]{20,24}\\.[\\w\\-_]{39,50})\\b"},{name:"Sendinbluev2",regex:"\\b(xkeysib\\-[A-Za-z0-9_-]{81})\\b"},{name:"Sentiment - 1",regex:"(?:sentiment).{0,40}\\b([0-9]{17})\\b"},{name:"Sentiment - 2",regex:"(?:sentiment).{0,40}\\b([a-zA-Z0-9]{20})\\b"},{name:"Sentrytoken",regex:"(?:sentry).{0,40}\\b([a-f0-9]{64})\\b"},{name:"Serphouse",regex:"(?:serphouse).{0,40}\\b([0-9A-Za-z]{60})\\b"},{name:"Serpstack",regex:"(?:serpstack).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Sheety - 1",regex:"(?:sheety).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Sheety - 2",regex:"(?:sheety).{0,40}\\b([0-9a-z]{64})\\b"},{name:"Sherpadesk",regex:"(?:sherpadesk).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Shipday",regex:"(?:shipday).{0,40}\\b([a-zA-Z0-9.]{11}[a-zA-Z0-9]{20})\\b"},{name:"Shodankey",regex:"(?:shodan).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Shopify custom app access token",regex:"shpca_[a-fA-F0-9]{32}"},{name:"Shopify private app access token",regex:"shppa_[a-fA-F0-9]{32}"},{name:"Shopify shared secret",regex:"shpss_[a-fA-F0-9]{32}"},{name:"Shoppable Service Auth",regex:"data-shoppable-auth-token.+"},{name:"Shortcut",regex:"(?:shortcut).{0,40}\\b([0-9a-f-]{36})\\b"},{name:"Shotstack",regex:"(?:shotstack).{0,40}\\b([a-zA-Z0-9]{40})\\b"},{name:"Shutterstock - 1",regex:"(?:shutterstock).{0,40}\\b([0-9a-zA-Z]{32})\\b"},{name:"Shutterstock - 2",regex:"(?:shutterstock).{0,40}\\b([0-9a-zA-Z]{16})\\b"},{name:"Shutterstockoauth",regex:"(?:shutterstock).{0,40}\\b(v2/[0-9A-Za-z]{388})\\b"},{name:"Signalwire - 1",regex:"\\b([0-9a-z-]{3,64}.signalwire.com)\\b"},{name:"Signalwire - 2",regex:"(?:signalwire).{0,40}\\b([0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12})\\b"},{name:"Signalwire - 3",regex:"(?:signalwire).{0,40}\\b([0-9A-Za-z]{50})\\b"},{name:"Signaturit",regex:"(?:signaturit).{0,40}\\b([0-9A-Za-z]{86})\\b"},{name:"Signupgenius",regex:"(?:signupgenius).{0,40}\\b([0-9A-Za-z]{32})\\b"},{name:"Sigopt",regex:"(?:sigopt).{0,40}\\b([A-Z0-9]{48})\\b"},{name:"Simplesat",regex:"(?:simplesat).{0,40}\\b([a-z0-9]{40})"},{name:"Simplynoted",regex:"(?:simplynoted).{0,40}\\b([a-zA-Z0-9\\S]{340,360})\\b"},{name:"Simvoly",regex:"(?:simvoly).{0,40}\\b([a-z0-9]{33})\\b"},{name:"Sinchmessage",regex:"(?:sinch).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Sirv - 1",regex:"(?:sirv).{0,40}\\b([a-zA-Z0-9\\S]{88})"},{name:"Sirv - 2",regex:"(?:sirv).{0,40}\\b([a-zA-Z0-9]{26})\\b"},{name:"Siteleaf",regex:"(?:siteleaf).{0,40}\\b([0-9Aa-z]{32})\\b"},{name:"Skrappio",regex:"(?:skrapp).{0,40}\\b([a-z0-9A-Z]{42})\\b"},{name:"Skybiometry",regex:"(?:skybiometry).{0,40}\\b([0-9a-z]{25,26})\\b"},{name:"Slack",regex:"xox[baprs]-[0-9a-zA-Z-]{10,72}"},{name:"Slack Token",regex:"(xox[pborsa]-[0-9]{12}-[0-9]{12}-[0-9]{12}-[a-z0-9]{32})"},{name:"Slack User token",regex:"xoxp-[0-9A-Za-z\\-]{72}"},{name:"Slack Webhook",regex:"https://hooks.slack.com/services/T[a-zA-Z0-9_]{8,10}/B[a-zA-Z0-9_]{8,12}/[a-zA-Z0-9_]{23,24}"},{name:"Slack access token",regex:"xoxb-[0-9A-Za-z\\-]{51}"},{name:"Slackwebhook",regex:"(https:\\/\\/hooks.slack.com\\/services\\/[A-Za-z0-9+\\/]{44,46})"},{name:"Smartsheets",regex:"(?:smartsheets).{0,40}\\b([a-zA-Z0-9]{37})\\b"},{name:"Smartystreets - 1",regex:"(?:smartystreets).{0,40}\\b([a-zA-Z0-9]{20})\\b"},{name:"Smartystreets - 2",regex:"(?:smartystreets).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Smooch - 1",regex:"(?:smooch).{0,40}\\b(act_[0-9a-z]{24})\\b"},{name:"Smooch - 2",regex:"(?:smooch).{0,40}\\b([0-9a-zA-Z_-]{86})\\b"},{name:"Snipcart",regex:"(?:snipcart).{0,40}\\b([0-9A-Za-z_]{75})\\b"},{name:"Snykkey",regex:"(?:snyk).{0,40}\\b([0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12})\\b"},{name:"SonarQube Token",regex:"sonar.{0,50}(?:\"|'|`)?[0-9a-f]{40}(?:\"|'|`)?"},{name:"Splunkobservabilitytoken",regex:"(?:splunk).{0,40}\\b([a-z0-9A-Z]{22})\\b"},{name:"Spoonacular",regex:"(?:spoonacular).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Sportsmonk",regex:"(?:sportsmonk).{0,40}\\b([0-9a-zA-Z]{60})\\b"},{name:"Square",regex:"(?:square).{0,40}(EAAA[a-zA-Z0-9\\-\\+\\=]{60})"},{name:"Square API Key",regex:"sq0(atp|csp)-[0-9a-z-_]{22,43}"},{name:"Squareapp - 1",regex:"[\\w\\-]*sq0i[a-z]{2}-[0-9A-Za-z\\-_]{22,43}"},{name:"Squareapp - 2",regex:"[\\w\\-]*sq0c[a-z]{2}-[0-9A-Za-z\\-_]{40,50}"},{name:"Squarespace",regex:"(?:squarespace).{0,40}\\b([0-9Aa-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\\b"},{name:"Squareup",regex:"\\b(sq0idp-[0-9A-Za-z]{22})\\b"},{name:"Sslmate",regex:"(?:sslmate).{0,40}\\b([a-zA-Z0-9]{36})\\b"},{name:"Stitchdata",regex:"(?:stitchdata).{0,40}\\b([0-9a-z_]{35})\\b"},{name:"Stockdata",regex:"(?:stockdata).{0,40}\\b([0-9A-Za-z]{40})\\b"},{name:"Storecove",regex:"(?:storecove).{0,40}\\b([a-zA-Z0-9_-]{43})\\b"},{name:"Stormglass",regex:"(?:stormglass).{0,40}\\b([0-9Aa-z-]{73})\\b"},{name:"Storyblok",regex:"(?:storyblok).{0,40}\\b([0-9A-Za-z]{22}t{2})\\b"},{name:"Storychief",regex:"(?:storychief).{0,40}\\b([a-zA-Z0-9_\\-.]{940,1000})"},{name:"Strava - 1",regex:"(?:strava).{0,40}\\b([0-9]{5})\\b"},{name:"Strava - 2",regex:"(?:strava).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Streak",regex:"(?:streak).{0,40}\\b([0-9Aa-f]{32})\\b"},{name:"Stripe",regex:"[rs]k_live_[a-zA-Z0-9]{20,30}"},{name:"Stripe API Key - 1",regex:"sk_live_[0-9a-zA-Z]{24}"},{name:"Stripe API key - 2",regex:"stripe[sr]k_live_[0-9a-zA-Z]{24}"},{name:"Stripe API key - 3",regex:"stripe[sk|rk]_live_[0-9a-zA-Z]{24}"},{name:"Stripe Public Live Key",regex:"pk_live_[0-9a-z]{24}"},{name:"Stripe Public Test Key",regex:"pk_test_[0-9a-z]{24}"},{name:"Stripe Restriced Key",regex:"rk_(?:live|test)_[0-9a-zA-Z]{24}"},{name:"Stripe Restricted API Key",regex:"rk_live_[0-9a-zA-Z]{24}"},{name:"Stripe Secret Key",regex:"sk_(?:live|test)_[0-9a-zA-Z]{24}"},{name:"Stripe Secret Live Key",regex:"(sk|rk)_live_[0-9a-z]{24}"},{name:"Stripe Secret Test Key",regex:"(sk|rk)_test_[0-9a-z]{24}"},{name:"Stytch - 1",regex:"(?:stytch).{0,40}\\b([a-zA-Z0-9-_]{47}=)"},{name:"Stytch - 2",regex:"(?:stytch).{0,40}\\b([a-z0-9-]{49})\\b"},{name:"Sugester - 1",regex:"(?:sugester).{0,40}\\b([a-zA-Z0-9_.!+$#^*%]{3,32})\\b"},{name:"Sugester - 2",regex:"(?:sugester).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Sumologickey - 1",regex:"(?:sumo).{0,40}\\b([A-Za-z0-9]{14})\\b"},{name:"Sumologickey - 2",regex:"(?:sumo).{0,40}\\b([A-Za-z0-9]{64})\\b"},{name:"Supernotesapi",regex:"(?:supernotes).{0,40}([ \\r\\n]{0,1}[0-9A-Za-z\\-_]{43}[ \\r\\n]{1})"},{name:"Surveyanyplace - 1",regex:"(?:survey).{0,40}\\b([a-z0-9A-Z-]{36})\\b"},{name:"Surveyanyplace - 2",regex:"(?:survey).{0,40}\\b([a-z0-9A-Z]{32})\\b"},{name:"Surveybot",regex:"(?:surveybot).{0,40}\\b([A-Za-z0-9-]{80})\\b"},{name:"Surveysparrow",regex:"(?:surveysparrow).{0,40}\\b([a-zA-Z0-9-_]{88})\\b"},{name:"Survicate",regex:"(?:survicate).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Swell - 1",regex:"(?:swell).{0,40}\\b([a-zA-Z0-9]{6,24})\\b"},{name:"Swell - 2",regex:"(?:swell).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Swiftype",regex:"(?:swiftype).{0,40}\\b([a-zA-z-0-9]{6}\\_[a-zA-z-0-9]{6}\\-[a-zA-z-0-9]{6})\\b"},{name:"Tallyfy",regex:"(?:tallyfy).{0,40}\\b([0-9A-Za-z]{36}\\.[0-9A-Za-z]{264}\\.[0-9A-Za-z\\-\\_]{683})\\b"},{name:"Tatumio",regex:"(?:tatum).{0,40}\\b([0-9a-z-]{36})\\b"},{name:"Taxjar",regex:"(?:taxjar).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Teamgate - 1",regex:"(?:teamgate).{0,40}\\b([a-z0-9]{40})\\b"},{name:"Teamgate - 2",regex:"(?:teamgate).{0,40}\\b([a-zA-Z0-9]{80})\\b"},{name:"Teamworkcrm",regex:"(?:teamwork|teamworkcrm).{0,40}\\b(tkn\\.v1_[0-9A-Za-z]{71}=[ \\r\\n]{1})"},{name:"Teamworkdesk",regex:"(?:teamwork|teamworkdesk).{0,40}\\b(tkn\\.v1_[0-9A-Za-z]{71}=[ \\r\\n]{1})"},{name:"Teamworkspaces",regex:"(?:teamwork|teamworkspaces).{0,40}\\b(tkn\\.v1_[0-9A-Za-z]{71}=[ \\r\\n]{1})"},{name:"Technicalanalysisapi",regex:"(?:technicalanalysisapi).{0,40}\\b([A-Z0-9]{48})\\b"},{name:"Telegram Bot API Key",regex:"[0-9]+:AA[0-9A-Za-z\\-_]{33}"},{name:"Telegram Secret",regex:"d{5,}:A[0-9a-z_-]{34,34}"},{name:"Telegrambottoken",regex:"(?:telegram).{0,40}\\b([0-9]{8,10}:[a-zA-Z0-9_-]{35})\\b"},{name:"Telnyx",regex:"(?:telnyx).{0,40}\\b(KEY[0-9A-Za-z_-]{55})\\b"},{name:"Terraformcloudpersonaltoken",regex:"\\b([A-Za-z0-9]{14}.atlasv1.[A-Za-z0-9]{67})\\b"},{name:"Text2data",regex:"(?:text2data).{0,40}\\b([0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})\\b"},{name:"Textmagic - 1",regex:"(?:textmagic).{0,40}\\b([0-9A-Za-z]{30})\\b"},{name:"Textmagic - 2",regex:"(?:textmagic).{0,40}\\b([0-9A-Za-z]{1,25})\\b"},{name:"Theoddsapi",regex:"(?:theoddsapi|the-odds-api).{0,40}\\b([0-9a-f]{32})\\b"},{name:"Thinkific - 1",regex:"(?:thinkific).{0,40}\\b([0-9a-f]{32})\\b"},{name:"Thinkific - 2",regex:"(?:thinkific).{0,40}\\b([0-9A-Za-z]{4,40})\\b"},{name:"Thousandeyes - 1",regex:"(?:thousandeyes).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Thousandeyes - 2",regex:"(?:thousandeyes).{0,40}\\b([a-zA-Z0-9]{3,20}@[a-zA-Z0-9]{2,12}.[a-zA-Z0-9]{2,5})\\b"},{name:"Ticketmaster",regex:"(?:ticketmaster).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Tiingo",regex:"(?:tiingo).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Timezoneapi",regex:"(?:timezoneapi).{0,40}\\b([a-zA-Z0-9]{20})\\b"},{name:"Tly",regex:"(?:tly).{0,40}\\b([0-9A-Za-z]{60})\\b"},{name:"Tmetric",regex:"(?:tmetric).{0,40}\\b([0-9A-Z]{64})\\b"},{name:"Todoist",regex:"(?:todoist).{0,40}\\b([0-9a-z]{40})\\b"},{name:"Toggltrack",regex:"(?:toggl).{0,40}\\b([0-9Aa-z]{32})\\b"},{name:"Tomorrowio",regex:"(?:tomorrow).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Tomtom",regex:"(?:tomtom).{0,40}\\b([0-9Aa-zA-Z]{32})\\b"},{name:"Tradier",regex:"(?:tradier).{0,40}\\b([a-zA-Z0-9]{28})\\b"},{name:"Travelpayouts",regex:"(?:travelpayouts).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Travisci",regex:"(?:travis).{0,40}\\b([a-zA-Z0-9A-Z_]{22})\\b"},{name:"Trello URL",regex:"https://trello.com/b/[0-9a-z]/[0-9a-z_-]+"},{name:"Trelloapikey - 2",regex:"(?:trello).{0,40}\\b([a-zA-Z-0-9]{32})\\b"},{name:"Twelvedata",regex:"(?:twelvedata).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Twilio - 1",regex:"\\bAC[0-9a-f]{32}\\b"},{name:"Twilio API Key",regex:"SK[0-9a-fA-F]{32}"},{name:"Twitter Access Token",regex:"[tT][wW][iI][tT][tT][eE][rR].*[1-9][0-9]+-[0-9a-zA-Z]{40}"},{name:"Twitter Client ID",regex:"twitter[0-9a-z]{18,25}"},{name:"Twitter OAuth",regex:`[tT][wW][iI][tT][tT][eE][rR].*['|"][0-9a-zA-Z]{35,44}['|"]`},{name:"Twitter Secret Key",regex:"twitter[0-9a-z]{35,44}"},{name:"Tyntec",regex:"(?:tyntec).{0,40}\\b([a-zA-Z0-9]{32})\\b"},{name:"Typeform",regex:"(?:typeform).{0,40}\\b([0-9A-Za-z]{44})\\b"},{name:"Ubidots",regex:"\\b(BBFF-[0-9a-zA-Z]{30})\\b"},{name:"Unifyid",regex:"(?:unify).{0,40}\\b([0-9A-Za-z_=-]{44})"},{name:"Unplugg",regex:"(?:unplu).{0,40}\\b([a-z0-9]{64})\\b"},{name:"Unsplash",regex:"(?:unsplash).{0,40}\\b([0-9A-Za-z_]{43})\\b"},{name:"Upcdatabase",regex:"(?:upcdatabase).{0,40}\\b([A-Z0-9]{32})\\b"},{name:"Uplead",regex:"(?:uplead).{0,40}\\b([a-z0-9-]{32})\\b"},{name:"Uploadcare",regex:"(?:uploadcare).{0,40}\\b([a-z0-9]{20})\\b"},{name:"Upwave",regex:"(?:upwave).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Uri",regex:"\\b[a-zA-Z]{1,10}:?\\/\\/[-.%\\w{}]{1,50}:([-.%\\S]{3,50})@[-.%\\w\\/:]+\\b"},{name:"Urlscan",regex:"(?:urlscan).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Userstack",regex:"(?:userstack).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Vatlayer",regex:"(?:vatlayer).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Vercel",regex:"(?:vercel).{0,40}\\b([a-zA-Z0-9]{24})\\b"},{name:"Verifier - 1",regex:"(?:verifier).{0,40}\\b([a-zA-Z-0-9-]{5,16}\\@[a-zA-Z-0-9]{4,16}\\.[a-zA-Z-0-9]{3,6})\\b"},{name:"Verifier - 2",regex:"(?:verifier).{0,40}\\b([a-z0-9]{96})\\b"},{name:"Verimail",regex:"(?:verimail).{0,40}\\b([A-Z0-9]{32})\\b"},{name:"Veriphone",regex:"(?:veriphone).{0,40}\\b([0-9A-Z]{32})\\b"},{name:"Versioneye",regex:"(?:versioneye).{0,40}\\b([a-zA-Z0-9-]{40})\\b"},{name:"Viewneo",regex:"(?:viewneo).{0,40}\\b([a-z0-9A-Z]{120,300}.[a-z0-9A-Z]{150,300}.[a-z0-9A-Z-_]{600,800})"},{name:"Virustotal",regex:"(?:virustotal).{0,40}\\b([a-f0-9]{64})\\b"},{name:"Visualcrossing",regex:"(?:visualcrossing).{0,40}\\b([0-9A-Z]{25})\\b"},{name:"Voicegain",regex:"(?:voicegain).{0,40}\\b(ey[0-9a-zA-Z_-]{34}.ey[0-9a-zA-Z_-]{108}.[0-9a-zA-Z_-]{43})\\b"},{name:"Vouchery - 1",regex:"(?:vouchery).{0,40}\\b([a-z0-9-]{36})\\b"},{name:"Vouchery - 2",regex:"(?:vouchery).{0,40}\\b([a-zA-Z0-9-\\S]{2,20})\\b"},{name:"Vpnapi",regex:"(?:vpnapi).{0,40}\\b([a-z0-9A-Z]{32})\\b"},{name:"Vultrapikey",regex:"(?:vultr).{0,40} \\b([A-Z0-9]{36})\\b"},{name:"Vyte",regex:"(?:vyte).{0,40}\\b([0-9a-z]{50})\\b"},{name:"Walkscore",regex:"(?:walkscore).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Weatherbit",regex:"(?:weatherbit).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Weatherstack",regex:"(?:weatherstack).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Webex - 1",regex:"(?:error).{0,40}(redirect_uri_mismatch)"},{name:"Webex - 2",regex:"(?:webex).{0,40}\\b([A-Za-z0-9_-]{65})\\b"},{name:"Webex - 3",regex:"(?:webex).{0,40}\\b([A-Za-z0-9_-]{64})\\b"},{name:"Webflow",regex:"(?:webflow).{0,40}\\b([a-zA0-9]{64})\\b"},{name:"Webscraper",regex:"(?:webscraper).{0,40}\\b([a-zA-Z0-9]{60})\\b"},{name:"Webscraping",regex:"(?:webscraping).{0,40}\\b([0-9A-Za-z]{32})\\b"},{name:"Wepay - 2",regex:"(?:wepay).{0,40}\\b([a-zA-Z0-9_?]{62})\\b"},{name:"Whoxy",regex:"(?:whoxy).{0,40}\\b([0-9a-z]{33})\\b"},{name:"Worksnaps",regex:"(?:worksnaps).{0,40}\\b([0-9A-Za-z]{40})\\b"},{name:"Workstack",regex:"(?:workstack).{0,40}\\b([0-9Aa-zA-Z]{60})\\b"},{name:"Worldcoinindex",regex:"(?:worldcoinindex).{0,40}\\b([a-zA-Z0-9]{35})\\b"},{name:"Worldweather",regex:"(?:worldweather).{0,40}\\b([0-9a-z]{31})\\b"},{name:"Wrike",regex:"(?:wrike).{0,40}\\b(ey[a-zA-Z0-9-._]{333})\\b"},{name:"Yandex",regex:"(?:yandex).{0,40}\\b([a-z0-9A-Z.]{83})\\b"},{name:"Youneedabudget",regex:"(?:youneedabudget).{0,40}\\b([0-9a-f]{64})\\b"},{name:"Yousign",regex:"(?:yousign).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Youtubeapikey - 1",regex:"(?:youtube).{0,40}\\b([a-zA-Z-0-9_]{39})\\b"},{name:"Zapier Webhook",regex:"https://(?:www.)?hooks\\.zapier\\.com/hooks/catch/[A-Za-z0-9]+/[A-Za-z0-9]+/"},{name:"Zapierwebhook",regex:"(https:\\/\\/hooks.zapier.com\\/hooks\\/catch\\/[A-Za-z0-9\\/]{16})"},{name:"Zendeskapi - 3",regex:"(?:zendesk).{0,40}([A-Za-z0-9_-]{40})"},{name:"Zenkitapi",regex:"(?:zenkit).{0,40}\\b([0-9a-z]{8}\\-[0-9A-Za-z]{32})\\b"},{name:"Zenscrape",regex:"(?:zenscrape).{0,40}\\b([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\\b"},{name:"Zenserp",regex:"(?:zenserp).{0,40}\\b([0-9a-z-]{36})\\b"},{name:"Zeplin",regex:"(?:zeplin).{0,40}\\b([a-zA-Z0-9-.]{350,400})\\b"},{name:"Zerobounce",regex:"(?:zerobounce).{0,40}\\b([a-z0-9]{32})\\b"},{name:"Zipapi - 1",regex:"(?:zipapi).{0,40}\\b([a-zA-Z0-9!=@#$%^]{7,})"},{name:"Zipapi - 3",regex:"(?:zipapi).{0,40}\\b([0-9a-z]{32})\\b"},{name:"Zipcodeapi",regex:"(?:zipcodeapi).{0,40}\\b([a-zA-Z0-9]{64})\\b"},{name:"Zoho Webhook",regex:"https://creator\\.zoho\\.com/api/[A-Za-z0-9/\\-_\\.]+\\?authtoken=[A-Za-z0-9]+"},{name:"Zonkafeedback",regex:"(?:zonka).{0,40}\\b([A-Za-z0-9]{36})\\b"},{name:"access_key_secret",regex:"access[_-]?key[_-]?secret(=| =|:| :)"},{name:"access_secret",regex:"access[_-]?secret(=| =|:| :)"},{name:"access_token",regex:"access[_-]?token(=| =|:| :)"},{name:"account_sid",regex:"account[_-]?sid(=| =|:| :)"},{name:"admin_email",regex:"admin[_-]?email(=| =|:| :)"},{name:"adzerk_api_key",regex:"adzerk[_-]?api[_-]?key(=| =|:| :)"},{name:"algolia_admin_key_1",regex:"algolia[_-]?admin[_-]?key[_-]?1(=| =|:| :)"},{name:"algolia_admin_key_2",regex:"algolia[_-]?admin[_-]?key[_-]?2(=| =|:| :)"},{name:"algolia_admin_key_mcm",regex:"algolia[_-]?admin[_-]?key[_-]?mcm(=| =|:| :)"},{name:"algolia_api_key",regex:"algolia[_-]?api[_-]?key(=| =|:| :)"},{name:"algolia_api_key_mcm",regex:"algolia[_-]?api[_-]?key[_-]?mcm(=| =|:| :)"},{name:"algolia_api_key_search",regex:"algolia[_-]?api[_-]?key[_-]?search(=| =|:| :)"},{name:"algolia_search_api_key",regex:"algolia[_-]?search[_-]?api[_-]?key(=| =|:| :)"},{name:"algolia_search_key",regex:"algolia[_-]?search[_-]?key(=| =|:| :)"},{name:"algolia_search_key_1",regex:"algolia[_-]?search[_-]?key[_-]?1(=| =|:| :)"},{name:"alias_pass",regex:"alias[_-]?pass(=| =|:| :)"},{name:"alicloud_access_key",regex:"alicloud[_-]?access[_-]?key(=| =|:| :)"},{name:"alicloud_secret_key",regex:"alicloud[_-]?secret[_-]?key(=| =|:| :)"},{name:"amazon_bucket_name",regex:"amazon[_-]?bucket[_-]?name(=| =|:| :)"},{name:"amazon_secret_access_key",regex:"amazon[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"anaconda_token",regex:"anaconda[_-]?token(=| =|:| :)"},{name:"android_docs_deploy_token",regex:"android[_-]?docs[_-]?deploy[_-]?token(=| =|:| :)"},{name:"ansible_vault_password",regex:"ansible[_-]?vault[_-]?password(=| =|:| :)"},{name:"aos_key",regex:"aos[_-]?key(=| =|:| :)"},{name:"aos_sec",regex:"aos[_-]?sec(=| =|:| :)"},{name:"api_key",regex:"api[_-]?key(=| =|:| :)"},{name:"api_key_secret",regex:"api[_-]?key[_-]?secret(=| =|:| :)"},{name:"api_key_sid",regex:"api[_-]?key[_-]?sid(=| =|:| :)"},{name:"api_secret",regex:"api[_-]?secret(=| =|:| :)"},{name:"apiary_api_key",regex:"apiary[_-]?api[_-]?key(=| =|:| :)"},{name:"apigw_access_token",regex:"apigw[_-]?access[_-]?token(=| =|:| :)"},{name:"apikey_patterns",regex:`apikey[:](?:['"]?[a-zA-Z0-9-_|]+['"]?)`},{name:"app_bucket_perm",regex:"app[_-]?bucket[_-]?perm(=| =|:| :)"},{name:"app_report_token_key",regex:"app[_-]?report[_-]?token[_-]?key(=| =|:| :)"},{name:"app_secrete",regex:"app[_-]?secrete(=| =|:| :)"},{name:"app_token",regex:"app[_-]?token(=| =|:| :)"},{name:"appclientsecret",regex:"appclientsecret(=| =|:| :)"},{name:"apple_id_password",regex:"apple[_-]?id[_-]?password(=| =|:| :)"},{name:"argos_token",regex:"argos[_-]?token(=| =|:| :)"},{name:"artifactory",regex:`(artifactory.{0,50}("|')?[a-zA-Z0-9=]{112}("|')?)`},{name:"artifactory_key",regex:"artifactory[_-]?key(=| =|:| :)"},{name:"artifacts_aws_access_key_id",regex:"artifacts[_-]?aws[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"artifacts_aws_secret_access_key",regex:"artifacts[_-]?aws[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"artifacts_bucket",regex:"artifacts[_-]?bucket(=| =|:| :)"},{name:"artifacts_key",regex:"artifacts[_-]?key(=| =|:| :)"},{name:"artifacts_secret",regex:"artifacts[_-]?secret(=| =|:| :)"},{name:"assistant_iam_apikey",regex:"assistant[_-]?iam[_-]?apikey(=| =|:| :)"},{name:"auth0_api_clientsecret",regex:"auth0[_-]?api[_-]?clientsecret(=| =|:| :)"},{name:"auth0_client_secret",regex:"auth0[_-]?client[_-]?secret(=| =|:| :)"},{name:"auth_token",regex:"auth[_-]?token(=| =|:| :)"},{name:"author_email_addr",regex:"author[_-]?email[_-]?addr(=| =|:| :)"},{name:"author_npm_api_key",regex:"author[_-]?npm[_-]?api[_-]?key(=| =|:| :)"},{name:"aws_access",regex:"aws[_-]?access(=| =|:| :)"},{name:"aws_access_key",regex:"aws[_-]?access[_-]?key(=| =|:| :)"},{name:"aws_access_key_id - 1",regex:"aws[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"aws_config_accesskeyid",regex:"aws[_-]?config[_-]?accesskeyid(=| =|:| :)"},{name:"aws_config_secretaccesskey",regex:"aws[_-]?config[_-]?secretaccesskey(=| =|:| :)"},{name:"aws_key",regex:"aws[_-]?key(=| =|:| :)"},{name:"aws_patterns",regex:"(?:accesskeyid|secretaccesskey|aws_access_key_id|aws_secret_access_key)"},{name:"aws_secret",regex:"aws[_-]?secret(=| =|:| :)"},{name:"aws_secret_access_key",regex:"aws[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"aws_secret_key",regex:"aws[_-]?secret[_-]?key(=| =|:| :)"},{name:"aws_secrets",regex:"aws[_-]?secrets(=| =|:| :)"},{name:"aws_ses_access_key_id",regex:"aws[_-]?ses[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"aws_ses_secret_access_key",regex:"aws[_-]?ses[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"awsaccesskeyid",regex:"awsaccesskeyid(=| =|:| :)"},{name:"awscn_access_key_id",regex:"awscn[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"awscn_secret_access_key",regex:"awscn[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"awssecretkey",regex:"awssecretkey(=| =|:| :)"},{name:"b2_app_key",regex:"b2[_-]?app[_-]?key(=| =|:| :)"},{name:"b2_bucket",regex:"b2[_-]?bucket(=| =|:| :)"},{name:"bintray_api_key",regex:"bintray[_-]?api[_-]?key(=| =|:| :)"},{name:"bintray_apikey",regex:"bintray[_-]?apikey(=| =|:| :)"},{name:"bintray_gpg_password",regex:"bintray[_-]?gpg[_-]?password(=| =|:| :)"},{name:"bintray_key",regex:"bintray[_-]?key(=| =|:| :)"},{name:"bintray_token",regex:"bintray[_-]?token(=| =|:| :)"},{name:"bintraykey",regex:"bintraykey(=| =|:| :)"},{name:"bluemix_api_key",regex:"bluemix[_-]?api[_-]?key(=| =|:| :)"},{name:"bluemix_auth",regex:"bluemix[_-]?auth(=| =|:| :)"},{name:"bluemix_pass",regex:"bluemix[_-]?pass(=| =|:| :)"},{name:"bluemix_pass_prod",regex:"bluemix[_-]?pass[_-]?prod(=| =|:| :)"},{name:"bluemix_password",regex:"bluemix[_-]?password(=| =|:| :)"},{name:"bluemix_pwd",regex:"bluemix[_-]?pwd(=| =|:| :)"},{name:"bluemix_username",regex:"bluemix[_-]?username(=| =|:| :)"},{name:"brackets_repo_oauth_token",regex:"brackets[_-]?repo[_-]?oauth[_-]?token(=| =|:| :)"},{name:"browser_stack_access_key",regex:"browser[_-]?stack[_-]?access[_-]?key(=| =|:| :)"},{name:"browserstack_access_key",regex:"browserstack[_-]?access[_-]?key(=| =|:| :)"},{name:"bucketeer_aws_access_key_id",regex:"bucketeer[_-]?aws[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"bucketeer_aws_secret_access_key",regex:"bucketeer[_-]?aws[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"built_branch_deploy_key",regex:"built[_-]?branch[_-]?deploy[_-]?key(=| =|:| :)"},{name:"bundlesize_github_token",regex:"bundlesize[_-]?github[_-]?token(=| =|:| :)"},{name:"bx_password",regex:"bx[_-]?password(=| =|:| :)"},{name:"bx_username",regex:"bx[_-]?username(=| =|:| :)"},{name:"cache_s3_secret_key",regex:"cache[_-]?s3[_-]?secret[_-]?key(=| =|:| :)"},{name:"cargo_token",regex:"cargo[_-]?token(=| =|:| :)"},{name:"cattle_access_key",regex:"cattle[_-]?access[_-]?key(=| =|:| :)"},{name:"cattle_agent_instance_auth",regex:"cattle[_-]?agent[_-]?instance[_-]?auth(=| =|:| :)"},{name:"cattle_secret_key",regex:"cattle[_-]?secret[_-]?key(=| =|:| :)"},{name:"censys_secret",regex:"censys[_-]?secret(=| =|:| :)"},{name:"certificate_password",regex:"certificate[_-]?password(=| =|:| :)"},{name:"cf_password",regex:"cf[_-]?password(=| =|:| :)"},{name:"cheverny_token",regex:"cheverny[_-]?token(=| =|:| :)"},{name:"chrome_client_secret",regex:"chrome[_-]?client[_-]?secret(=| =|:| :)"},{name:"chrome_refresh_token",regex:"chrome[_-]?refresh[_-]?token(=| =|:| :)"},{name:"ci_deploy_password",regex:"ci[_-]?deploy[_-]?password(=| =|:| :)"},{name:"ci_project_url",regex:"ci[_-]?project[_-]?url(=| =|:| :)"},{name:"ci_registry_user",regex:"ci[_-]?registry[_-]?user(=| =|:| :)"},{name:"ci_server_name",regex:"ci[_-]?server[_-]?name(=| =|:| :)"},{name:"ci_user_token",regex:"ci[_-]?user[_-]?token(=| =|:| :)"},{name:"claimr_database",regex:"claimr[_-]?database(=| =|:| :)"},{name:"claimr_db",regex:"claimr[_-]?db(=| =|:| :)"},{name:"claimr_superuser",regex:"claimr[_-]?superuser(=| =|:| :)"},{name:"claimr_token",regex:"claimr[_-]?token(=| =|:| :)"},{name:"cli_e2e_cma_token",regex:"cli[_-]?e2e[_-]?cma[_-]?token(=| =|:| :)"},{name:"client_secret",regex:"client[_-]?secret(=| =|:| :)"},{name:"clojars_password",regex:"clojars[_-]?password(=| =|:| :)"},{name:"cloud_api_key",regex:"cloud[_-]?api[_-]?key(=| =|:| :)"},{name:"cloudant_archived_database",regex:"cloudant[_-]?archived[_-]?database(=| =|:| :)"},{name:"cloudant_audited_database",regex:"cloudant[_-]?audited[_-]?database(=| =|:| :)"},{name:"cloudant_database",regex:"cloudant[_-]?database(=| =|:| :)"},{name:"cloudant_instance",regex:"cloudant[_-]?instance(=| =|:| :)"},{name:"cloudant_order_database",regex:"cloudant[_-]?order[_-]?database(=| =|:| :)"},{name:"cloudant_parsed_database",regex:"cloudant[_-]?parsed[_-]?database(=| =|:| :)"},{name:"cloudant_password",regex:"cloudant[_-]?password(=| =|:| :)"},{name:"cloudant_processed_database",regex:"cloudant[_-]?processed[_-]?database(=| =|:| :)"},{name:"cloudant_service_database",regex:"cloudant[_-]?service[_-]?database(=| =|:| :)"},{name:"cloudflare_api_key",regex:"cloudflare[_-]?api[_-]?key(=| =|:| :)"},{name:"cloudflare_auth_email",regex:"cloudflare[_-]?auth[_-]?email(=| =|:| :)"},{name:"cloudflare_auth_key",regex:"cloudflare[_-]?auth[_-]?key(=| =|:| :)"},{name:"cloudflare_email",regex:"cloudflare[_-]?email(=| =|:| :)"},{name:"cloudinary_url",regex:"cloudinary[_-]?url(=| =|:| :)"},{name:"cloudinary_url_staging",regex:"cloudinary[_-]?url[_-]?staging(=| =|:| :)"},{name:"clu_repo_url",regex:"clu[_-]?repo[_-]?url(=| =|:| :)"},{name:"clu_ssh_private_key_base64",regex:"clu[_-]?ssh[_-]?private[_-]?key[_-]?base64(=| =|:| :)"},{name:"cn_access_key_id",regex:"cn[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"cn_secret_access_key",regex:"cn[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"cocoapods_trunk_email",regex:"cocoapods[_-]?trunk[_-]?email(=| =|:| :)"},{name:"cocoapods_trunk_token",regex:"cocoapods[_-]?trunk[_-]?token(=| =|:| :)"},{name:"codacy_project_token",regex:"codacy[_-]?project[_-]?token(=| =|:| :)"},{name:"codeclimate",regex:`(codeclima.{0,50}("|')?[0-9a-f]{64}("|')?)`},{name:"codeclimate_repo_token",regex:"codeclimate[_-]?repo[_-]?token(=| =|:| :)"},{name:"codecov_token",regex:"codecov[_-]?token(=| =|:| :)"},{name:"coding_token",regex:"coding[_-]?token(=| =|:| :)"},{name:"conekta_apikey",regex:"conekta[_-]?apikey(=| =|:| :)"},{name:"consumer_key",regex:"consumer[_-]?key(=| =|:| :)"},{name:"consumerkey",regex:"consumerkey(=| =|:| :)"},{name:"contentful_access_token",regex:"contentful[_-]?access[_-]?token(=| =|:| :)"},{name:"contentful_cma_test_token",regex:"contentful[_-]?cma[_-]?test[_-]?token(=| =|:| :)"},{name:"contentful_integration_management_token",regex:"contentful[_-]?integration[_-]?management[_-]?token(=| =|:| :)"},{name:"contentful_php_management_test_token",regex:"contentful[_-]?php[_-]?management[_-]?test[_-]?token(=| =|:| :)"},{name:"contentful_test_org_cma_token",regex:"contentful[_-]?test[_-]?org[_-]?cma[_-]?token(=| =|:| :)"},{name:"contentful_v2_access_token",regex:"contentful[_-]?v2[_-]?access[_-]?token(=| =|:| :)"},{name:"conversation_password",regex:"conversation[_-]?password(=| =|:| :)"},{name:"conversation_username",regex:"conversation[_-]?username(=| =|:| :)"},{name:"cos_secrets",regex:"cos[_-]?secrets(=| =|:| :)"},{name:"coveralls_api_token",regex:"coveralls[_-]?api[_-]?token(=| =|:| :)"},{name:"coveralls_repo_token",regex:"coveralls[_-]?repo[_-]?token(=| =|:| :)"},{name:"coveralls_token",regex:"coveralls[_-]?token(=| =|:| :)"},{name:"coverity_scan_token",regex:"coverity[_-]?scan[_-]?token(=| =|:| :)"},{name:"cypress_record_key",regex:"cypress[_-]?record[_-]?key(=| =|:| :)"},{name:"danger_github_api_token",regex:"danger[_-]?github[_-]?api[_-]?token(=| =|:| :)"},{name:"database_host",regex:"database[_-]?host(=| =|:| :)"},{name:"database_name",regex:"database[_-]?name(=| =|:| :)"},{name:"database_password",regex:"database[_-]?password(=| =|:| :)"},{name:"database_port",regex:"database[_-]?port(=| =|:| :)"},{name:"database_user",regex:"database[_-]?user(=| =|:| :)"},{name:"database_username",regex:"database[_-]?username(=| =|:| :)"},{name:"datadog_api_key",regex:"datadog[_-]?api[_-]?key(=| =|:| :)"},{name:"datadog_app_key",regex:"datadog[_-]?app[_-]?key(=| =|:| :)"},{name:"db_connection",regex:"db[_-]?connection(=| =|:| :)"},{name:"db_database",regex:"db[_-]?database(=| =|:| :)"},{name:"db_host",regex:"db[_-]?host(=| =|:| :)"},{name:"db_password",regex:"db[_-]?password(=| =|:| :)"},{name:"db_pw",regex:"db[_-]?pw(=| =|:| :)"},{name:"db_user",regex:"db[_-]?user(=| =|:| :)"},{name:"db_username",regex:"db[_-]?username(=| =|:| :)"},{name:"ddg_test_email",regex:"ddg[_-]?test[_-]?email(=| =|:| :)"},{name:"ddg_test_email_pw",regex:"ddg[_-]?test[_-]?email[_-]?pw(=| =|:| :)"},{name:"ddgc_github_token",regex:"ddgc[_-]?github[_-]?token(=| =|:| :)"},{name:"deploy_password",regex:"deploy[_-]?password(=| =|:| :)"},{name:"deploy_secure",regex:"deploy[_-]?secure(=| =|:| :)"},{name:"deploy_token",regex:"deploy[_-]?token(=| =|:| :)"},{name:"deploy_user",regex:"deploy[_-]?user(=| =|:| :)"},{name:"dgpg_passphrase",regex:"dgpg[_-]?passphrase(=| =|:| :)"},{name:"digitalocean_access_token",regex:"digitalocean[_-]?access[_-]?token(=| =|:| :)"},{name:"digitalocean_ssh_key_body",regex:"digitalocean[_-]?ssh[_-]?key[_-]?body(=| =|:| :)"},{name:"digitalocean_ssh_key_ids",regex:"digitalocean[_-]?ssh[_-]?key[_-]?ids(=| =|:| :)"},{name:"docker_hub_password",regex:"docker[_-]?hub[_-]?password(=| =|:| :)"},{name:"docker_key",regex:"docker[_-]?key(=| =|:| :)"},{name:"docker_pass",regex:"docker[_-]?pass(=| =|:| :)"},{name:"docker_passwd",regex:"docker[_-]?passwd(=| =|:| :)"},{name:"docker_password",regex:"docker[_-]?password(=| =|:| :)"},{name:"docker_postgres_url",regex:"docker[_-]?postgres[_-]?url(=| =|:| :)"},{name:"docker_token",regex:"docker[_-]?token(=| =|:| :)"},{name:"dockerhub_password",regex:"dockerhub[_-]?password(=| =|:| :)"},{name:"dockerhubpassword",regex:"dockerhubpassword(=| =|:| :)"},{name:"doordash_auth_token",regex:"doordash[_-]?auth[_-]?token(=| =|:| :)"},{name:"dropbox_oauth_bearer",regex:"dropbox[_-]?oauth[_-]?bearer(=| =|:| :)"},{name:"droplet_travis_password",regex:"droplet[_-]?travis[_-]?password(=| =|:| :)"},{name:"dsonar_login",regex:"dsonar[_-]?login(=| =|:| :)"},{name:"dsonar_projectkey",regex:"dsonar[_-]?projectkey(=| =|:| :)"},{name:"elastic_cloud_auth",regex:"elastic[_-]?cloud[_-]?auth(=| =|:| :)"},{name:"elasticsearch_password",regex:"elasticsearch[_-]?password(=| =|:| :)"},{name:"encryption_password",regex:"encryption[_-]?password(=| =|:| :)"},{name:"end_user_password",regex:"end[_-]?user[_-]?password(=| =|:| :)"},{name:"env_github_oauth_token",regex:"env[_-]?github[_-]?oauth[_-]?token(=| =|:| :)"},{name:"env_heroku_api_key",regex:"env[_-]?heroku[_-]?api[_-]?key(=| =|:| :)"},{name:"env_key",regex:"env[_-]?key(=| =|:| :)"},{name:"env_secret",regex:"env[_-]?secret(=| =|:| :)"},{name:"env_secret_access_key",regex:"env[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"env_sonatype_password",regex:"env[_-]?sonatype[_-]?password(=| =|:| :)"},{name:"eureka_awssecretkey",regex:"eureka[_-]?awssecretkey(=| =|:| :)"},{name:"exp_password",regex:"exp[_-]?password(=| =|:| :)"},{name:"facebook_access_token",regex:"(EAACEdEose0cBA[0-9A-Za-z]+)"},{name:"facebook_oauth",regex:`[f|F][a|A][c|C][e|E][b|B][o|O][o|O][k|K].*['|"][0-9a-f]{32}['|"]`},{name:"file_password",regex:"file[_-]?password(=| =|:| :)"},{name:"firebase_api_json",regex:"firebase[_-]?api[_-]?json(=| =|:| :)"},{name:"firebase_api_token",regex:"firebase[_-]?api[_-]?token(=| =|:| :)"},{name:"firebase_key",regex:"firebase[_-]?key(=| =|:| :)"},{name:"firebase_project_develop",regex:"firebase[_-]?project[_-]?develop(=| =|:| :)"},{name:"firebase_token",regex:"firebase[_-]?token(=| =|:| :)"},{name:"firefox_secret",regex:"firefox[_-]?secret(=| =|:| :)"},{name:"flask_secret_key",regex:"flask[_-]?secret[_-]?key(=| =|:| :)"},{name:"flickr_api_key",regex:"flickr[_-]?api[_-]?key(=| =|:| :)"},{name:"flickr_api_secret",regex:"flickr[_-]?api[_-]?secret(=| =|:| :)"},{name:"fossa_api_key",regex:"fossa[_-]?api[_-]?key(=| =|:| :)"},{name:"ftp_host",regex:"ftp[_-]?host(=| =|:| :)"},{name:"ftp_login",regex:"ftp[_-]?login(=| =|:| :)"},{name:"ftp_password",regex:"ftp[_-]?password(=| =|:| :)"},{name:"ftp_pw",regex:"ftp[_-]?pw(=| =|:| :)"},{name:"ftp_user",regex:"ftp[_-]?user(=| =|:| :)"},{name:"ftp_username",regex:"ftp[_-]?username(=| =|:| :)"},{name:"gcloud_bucket",regex:"gcloud[_-]?bucket(=| =|:| :)"},{name:"gcloud_project",regex:"gcloud[_-]?project(=| =|:| :)"},{name:"gcloud_service_key",regex:"gcloud[_-]?service[_-]?key(=| =|:| :)"},{name:"gcr_password",regex:"gcr[_-]?password(=| =|:| :)"},{name:"gcs_bucket",regex:"gcs[_-]?bucket(=| =|:| :)"},{name:"gh_api_key",regex:"gh[_-]?api[_-]?key(=| =|:| :)"},{name:"gh_email",regex:"gh[_-]?email(=| =|:| :)"},{name:"gh_next_oauth_client_secret",regex:"gh[_-]?next[_-]?oauth[_-]?client[_-]?secret(=| =|:| :)"},{name:"gh_next_unstable_oauth_client_id",regex:"gh[_-]?next[_-]?unstable[_-]?oauth[_-]?client[_-]?id(=| =|:| :)"},{name:"gh_next_unstable_oauth_client_secret",regex:"gh[_-]?next[_-]?unstable[_-]?oauth[_-]?client[_-]?secret(=| =|:| :)"},{name:"gh_oauth_client_secret",regex:"gh[_-]?oauth[_-]?client[_-]?secret(=| =|:| :)"},{name:"gh_oauth_token",regex:"gh[_-]?oauth[_-]?token(=| =|:| :)"},{name:"gh_repo_token",regex:"gh[_-]?repo[_-]?token(=| =|:| :)"},{name:"gh_token",regex:"gh[_-]?token(=| =|:| :)"},{name:"gh_unstable_oauth_client_secret",regex:"gh[_-]?unstable[_-]?oauth[_-]?client[_-]?secret(=| =|:| :)"},{name:"ghb_token",regex:"ghb[_-]?token(=| =|:| :)"},{name:"ghost_api_key",regex:"ghost[_-]?api[_-]?key(=| =|:| :)"},{name:"git_author_email",regex:"git[_-]?author[_-]?email(=| =|:| :)"},{name:"git_author_name",regex:"git[_-]?author[_-]?name(=| =|:| :)"},{name:"git_committer_email",regex:"git[_-]?committer[_-]?email(=| =|:| :)"},{name:"git_committer_name",regex:"git[_-]?committer[_-]?name(=| =|:| :)"},{name:"git_email",regex:"git[_-]?email(=| =|:| :)"},{name:"git_name",regex:"git[_-]?name(=| =|:| :)"},{name:"git_token",regex:"git[_-]?token(=| =|:| :)"},{name:"github_access_token - 1",regex:"github[_-]?access[_-]?token(=| =|:| :)"},{name:"github_access_token - 2",regex:"[a-zA-Z0-9_-]*:[a-zA-Z0-9_-]+@github.com*"},{name:"github_api_key",regex:"github[_-]?api[_-]?key(=| =|:| :)"},{name:"github_api_token",regex:"github[_-]?api[_-]?token(=| =|:| :)"},{name:"github_auth",regex:"github[_-]?auth(=| =|:| :)"},{name:"github_auth_token",regex:"github[_-]?auth[_-]?token(=| =|:| :)"},{name:"github_client_secret",regex:"github[_-]?client[_-]?secret(=| =|:| :)"},{name:"github_deploy_hb_doc_pass",regex:"github[_-]?deploy[_-]?hb[_-]?doc[_-]?pass(=| =|:| :)"},{name:"github_deployment_token",regex:"github[_-]?deployment[_-]?token(=| =|:| :)"},{name:"github_hunter_token",regex:"github[_-]?hunter[_-]?token(=| =|:| :)"},{name:"github_hunter_username",regex:"github[_-]?hunter[_-]?username(=| =|:| :)"},{name:"github_key",regex:"github[_-]?key(=| =|:| :)"},{name:"github_oauth",regex:"github[_-]?oauth(=| =|:| :)"},{name:"github_oauth_token",regex:"github[_-]?oauth[_-]?token(=| =|:| :)"},{name:"github_password",regex:"github[_-]?password(=| =|:| :)"},{name:"github_pwd",regex:"github[_-]?pwd(=| =|:| :)"},{name:"github_release_token",regex:"github[_-]?release[_-]?token(=| =|:| :)"},{name:"github_repo",regex:"github[_-]?repo(=| =|:| :)"},{name:"github_token",regex:"github[_-]?token(=| =|:| :)"},{name:"github_tokens",regex:"github[_-]?tokens(=| =|:| :)"},{name:"gitlab_user_email",regex:"gitlab[_-]?user[_-]?email(=| =|:| :)"},{name:"gogs_password",regex:"gogs[_-]?password(=| =|:| :)"},{name:"google_account_type",regex:"google[_-]?account[_-]?type(=| =|:| :)"},{name:"google_client_email",regex:"google[_-]?client[_-]?email(=| =|:| :)"},{name:"google_client_id",regex:"google[_-]?client[_-]?id(=| =|:| :)"},{name:"google_client_secret",regex:"google[_-]?client[_-]?secret(=| =|:| :)"},{name:"google_maps_api_key",regex:"google[_-]?maps[_-]?api[_-]?key(=| =|:| :)"},{name:"google_oauth",regex:"(ya29.[0-9A-Za-z-_]+)"},{name:"google_patterns",regex:"(?:google_client_id|google_client_secret|google_client_token)"},{name:"google_private_key",regex:"google[_-]?private[_-]?key(=| =|:| :)"},{name:"google_url",regex:"([0-9]{12}-[a-z0-9]{32}.apps.googleusercontent.com)"},{name:"gpg_key_name",regex:"gpg[_-]?key[_-]?name(=| =|:| :)"},{name:"gpg_keyname",regex:"gpg[_-]?keyname(=| =|:| :)"},{name:"gpg_ownertrust",regex:"gpg[_-]?ownertrust(=| =|:| :)"},{name:"gpg_passphrase",regex:"gpg[_-]?passphrase(=| =|:| :)"},{name:"gpg_private_key",regex:"gpg[_-]?private[_-]?key(=| =|:| :)"},{name:"gpg_secret_keys",regex:"gpg[_-]?secret[_-]?keys(=| =|:| :)"},{name:"gradle_publish_key",regex:"gradle[_-]?publish[_-]?key(=| =|:| :)"},{name:"gradle_publish_secret",regex:"gradle[_-]?publish[_-]?secret(=| =|:| :)"},{name:"gradle_signing_key_id",regex:"gradle[_-]?signing[_-]?key[_-]?id(=| =|:| :)"},{name:"gradle_signing_password",regex:"gradle[_-]?signing[_-]?password(=| =|:| :)"},{name:"gren_github_token",regex:"gren[_-]?github[_-]?token(=| =|:| :)"},{name:"grgit_user",regex:"grgit[_-]?user(=| =|:| :)"},{name:"hab_auth_token",regex:"hab[_-]?auth[_-]?token(=| =|:| :)"},{name:"hab_key",regex:"hab[_-]?key(=| =|:| :)"},{name:"hb_codesign_gpg_pass",regex:"hb[_-]?codesign[_-]?gpg[_-]?pass(=| =|:| :)"},{name:"hb_codesign_key_pass",regex:"hb[_-]?codesign[_-]?key[_-]?pass(=| =|:| :)"},{name:"heroku_api_key",regex:"heroku[_-]?api[_-]?key(=| =|:| :)"},{name:"heroku_api_key_api_key",regex:"([h|H][e|E][r|R][o|O][k|K][u|U].{0,30}[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})"},{name:"heroku_email",regex:"heroku[_-]?email(=| =|:| :)"},{name:"heroku_token",regex:"heroku[_-]?token(=| =|:| :)"},{name:"hockeyapp",regex:`hockey.{0,50}("|')?[0-9a-f]{32}("|')?`},{name:"hockeyapp_token",regex:"hockeyapp[_-]?token(=| =|:| :)"},{name:"homebrew_github_api_token",regex:"homebrew[_-]?github[_-]?api[_-]?token(=| =|:| :)"},{name:"hub_dxia2_password",regex:"hub[_-]?dxia2[_-]?password(=| =|:| :)"},{name:"ij_repo_password",regex:"ij[_-]?repo[_-]?password(=| =|:| :)"},{name:"ij_repo_username",regex:"ij[_-]?repo[_-]?username(=| =|:| :)"},{name:"index_name",regex:"index[_-]?name(=| =|:| :)"},{name:"integration_test_api_key",regex:"integration[_-]?test[_-]?api[_-]?key(=| =|:| :)"},{name:"integration_test_appid",regex:"integration[_-]?test[_-]?appid(=| =|:| :)"},{name:"internal_secrets",regex:"internal[_-]?secrets(=| =|:| :)"},{name:"ios_docs_deploy_token",regex:"ios[_-]?docs[_-]?deploy[_-]?token(=| =|:| :)"},{name:"itest_gh_token",regex:"itest[_-]?gh[_-]?token(=| =|:| :)"},{name:"jdbc",regex:"mysql: jdbc:mysql(=| =|:| :)"},{name:"jdbc_databaseurl",regex:"jdbc[_-]?databaseurl(=| =|:| :)"},{name:"jdbc_host",regex:"jdbc[_-]?host(=| =|:| :)"},{name:"jwt_secret",regex:"jwt[_-]?secret(=| =|:| :)"},{name:"kafka_admin_url",regex:"kafka[_-]?admin[_-]?url(=| =|:| :)"},{name:"kafka_instance_name",regex:"kafka[_-]?instance[_-]?name(=| =|:| :)"},{name:"kafka_rest_url",regex:"kafka[_-]?rest[_-]?url(=| =|:| :)"},{name:"keystore_pass",regex:"keystore[_-]?pass(=| =|:| :)"},{name:"kovan_private_key",regex:"kovan[_-]?private[_-]?key(=| =|:| :)"},{name:"kubecfg_s3_path",regex:"kubecfg[_-]?s3[_-]?path(=| =|:| :)"},{name:"kubeconfig",regex:"kubeconfig(=| =|:| :)"},{name:"kxoltsn3vogdop92m",regex:"kxoltsn3vogdop92m(=| =|:| :)"},{name:"leanplum_key",regex:"leanplum[_-]?key(=| =|:| :)"},{name:"lektor_deploy_password",regex:"lektor[_-]?deploy[_-]?password(=| =|:| :)"},{name:"lektor_deploy_username",regex:"lektor[_-]?deploy[_-]?username(=| =|:| :)"},{name:"lighthouse_api_key",regex:"lighthouse[_-]?api[_-]?key(=| =|:| :)"},{name:"linux_signing_key",regex:"linux[_-]?signing[_-]?key(=| =|:| :)"},{name:"ll_publish_url",regex:"ll[_-]?publish[_-]?url(=| =|:| :)"},{name:"ll_shared_key",regex:"ll[_-]?shared[_-]?key(=| =|:| :)"},{name:"looker_test_runner_client_secret",regex:"looker[_-]?test[_-]?runner[_-]?client[_-]?secret(=| =|:| :)"},{name:"lottie_happo_api_key",regex:"lottie[_-]?happo[_-]?api[_-]?key(=| =|:| :)"},{name:"lottie_happo_secret_key",regex:"lottie[_-]?happo[_-]?secret[_-]?key(=| =|:| :)"},{name:"lottie_s3_secret_key",regex:"lottie[_-]?s3[_-]?secret[_-]?key(=| =|:| :)"},{name:"lottie_upload_cert_key_password",regex:"lottie[_-]?upload[_-]?cert[_-]?key[_-]?password(=| =|:| :)"},{name:"lottie_upload_cert_key_store_password",regex:"lottie[_-]?upload[_-]?cert[_-]?key[_-]?store[_-]?password(=| =|:| :)"},{name:"magento_auth_password",regex:"magento[_-]?auth[_-]?password(=| =|:| :)"},{name:"magento_auth_username",regex:"magento[_-]?auth[_-]?username (=| =|:| :)"},{name:"magento_password",regex:"magento[_-]?password(=| =|:| :)"},{name:"mail_password",regex:"mail[_-]?password(=| =|:| :)"},{name:"mailchimp",regex:"(W(?:[a-f0-9]{32}(-us[0-9]{1,2}))a-zA-Z0-9)"},{name:"mailchimp_api_key",regex:"mailchimp[_-]?api[_-]?key(=| =|:| :)"},{name:"mailchimp_key",regex:"mailchimp[_-]?key(=| =|:| :)"},{name:"mailer_password",regex:"mailer[_-]?password(=| =|:| :)"},{name:"mailgun",regex:"(key-[0-9a-f]{32})"},{name:"mailgun_api_key",regex:"mailgun[_-]?api[_-]?key(=| =|:| :)"},{name:"mailgun_apikey",regex:"mailgun[_-]?apikey(=| =|:| :)"},{name:"mailgun_password",regex:"mailgun[_-]?password(=| =|:| :)"},{name:"mailgun_priv_key",regex:"mailgun[_-]?priv[_-]?key(=| =|:| :)"},{name:"mailgun_pub_apikey",regex:"mailgun[_-]?pub[_-]?apikey(=| =|:| :)"},{name:"mailgun_pub_key",regex:"mailgun[_-]?pub[_-]?key(=| =|:| :)"},{name:"mailgun_secret_api_key",regex:"mailgun[_-]?secret[_-]?api[_-]?key(=| =|:| :)"},{name:"manage_key",regex:"manage[_-]?key(=| =|:| :)"},{name:"manage_secret",regex:"manage[_-]?secret(=| =|:| :)"},{name:"management_token",regex:"management[_-]?token(=| =|:| :)"},{name:"managementapiaccesstoken",regex:"managementapiaccesstoken(=| =|:| :)"},{name:"mandrill_api_key",regex:"mandrill[_-]?api[_-]?key(=| =|:| :)"},{name:"manifest_app_token",regex:"manifest[_-]?app[_-]?token(=| =|:| :)"},{name:"manifest_app_url",regex:"manifest[_-]?app[_-]?url(=| =|:| :)"},{name:"mapbox_access_token",regex:"mapbox[_-]?access[_-]?token(=| =|:| :)"},{name:"mapbox_api_token",regex:"mapbox[_-]?api[_-]?token(=| =|:| :)"},{name:"mapbox_aws_access_key_id",regex:"mapbox[_-]?aws[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"mapbox_aws_secret_access_key",regex:"mapbox[_-]?aws[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"mapboxaccesstoken",regex:"mapboxaccesstoken(=| =|:| :)"},{name:"master_password",regex:"(master_password).+"},{name:"mg_api_key",regex:"mg[_-]?api[_-]?key(=| =|:| :)"},{name:"mg_public_api_key",regex:"mg[_-]?public[_-]?api[_-]?key(=| =|:| :)"},{name:"mh_apikey",regex:"mh[_-]?apikey(=| =|:| :)"},{name:"mh_password",regex:"mh[_-]?password(=| =|:| :)"},{name:"mile_zero_key",regex:"mile[_-]?zero[_-]?key(=| =|:| :)"},{name:"minio_access_key",regex:"minio[_-]?access[_-]?key(=| =|:| :)"},{name:"minio_secret_key",regex:"minio[_-]?secret[_-]?key(=| =|:| :)"},{name:"multi_bob_sid",regex:"multi[_-]?bob[_-]?sid(=| =|:| :)"},{name:"multi_connect_sid",regex:"multi[_-]?connect[_-]?sid(=| =|:| :)"},{name:"multi_disconnect_sid",regex:"multi[_-]?disconnect[_-]?sid(=| =|:| :)"},{name:"multi_workflow_sid",regex:"multi[_-]?workflow[_-]?sid(=| =|:| :)"},{name:"multi_workspace_sid",regex:"multi[_-]?workspace[_-]?sid(=| =|:| :)"},{name:"my_secret_env",regex:"my[_-]?secret[_-]?env(=| =|:| :)"},{name:"mysql_database",regex:"mysql[_-]?database(=| =|:| :)"},{name:"mysql_hostname",regex:"mysql[_-]?hostname(=| =|:| :)"},{name:"mysql_password",regex:"mysql[_-]?password(=| =|:| :)"},{name:"mysql_root_password",regex:"mysql[_-]?root[_-]?password(=| =|:| :)"},{name:"mysql_user",regex:"mysql[_-]?user(=| =|:| :)"},{name:"mysql_username",regex:"mysql[_-]?username(=| =|:| :)"},{name:"mysqlmasteruser",regex:"mysqlmasteruser(=| =|:| :)"},{name:"mysqlsecret",regex:"mysqlsecret(=| =|:| :)"},{name:"nativeevents",regex:"nativeevents(=| =|:| :)"},{name:"netlify_api_key",regex:"netlify[_-]?api[_-]?key(=| =|:| :)"},{name:"new_relic_beta_token",regex:"new[_-]?relic[_-]?beta[_-]?token(=| =|:| :)"},{name:"nexus_password",regex:"nexus[_-]?password(=| =|:| :)"},{name:"nexuspassword",regex:"nexuspassword(=| =|:| :)"},{name:"ngrok_auth_token",regex:"ngrok[_-]?auth[_-]?token(=| =|:| :)"},{name:"ngrok_token",regex:"ngrok[_-]?token(=| =|:| :)"},{name:"node_env",regex:"node[_-]?env(=| =|:| :)"},{name:"node_pre_gyp_accesskeyid",regex:"node[_-]?pre[_-]?gyp[_-]?accesskeyid(=| =|:| :)"},{name:"node_pre_gyp_github_token",regex:"node[_-]?pre[_-]?gyp[_-]?github[_-]?token(=| =|:| :)"},{name:"node_pre_gyp_secretaccesskey",regex:"node[_-]?pre[_-]?gyp[_-]?secretaccesskey(=| =|:| :)"},{name:"non_token",regex:"non[_-]?token(=| =|:| :)"},{name:"now_token",regex:"now[_-]?token(=| =|:| :)"},{name:"npm_api_key",regex:"npm[_-]?api[_-]?key(=| =|:| :)"},{name:"npm_api_token",regex:"npm[_-]?api[_-]?token(=| =|:| :)"},{name:"npm_auth_token",regex:"npm[_-]?auth[_-]?token(=| =|:| :)"},{name:"npm_email",regex:"npm[_-]?email(=| =|:| :)"},{name:"npm_password",regex:"npm[_-]?password(=| =|:| :)"},{name:"npm_secret_key",regex:"npm[_-]?secret[_-]?key(=| =|:| :)"},{name:"npm_token - 1",regex:"npm[_-]?token(=| =|:| :)"},{name:"nuget_api_key - 1",regex:"(oy2[a-z0-9]{43})"},{name:"nuget_api_key - 2",regex:"nuget[_-]?api[_-]?key(=| =|:| :)"},{name:"numbers_service_pass",regex:"numbers[_-]?service[_-]?pass(=| =|:| :)"},{name:"oauth_token",regex:"oauth[_-]?token(=| =|:| :)"},{name:"object_storage_password",regex:"object[_-]?storage[_-]?password(=| =|:| :)"},{name:"object_storage_region_name",regex:"object[_-]?storage[_-]?region[_-]?name(=| =|:| :)"},{name:"object_store_bucket",regex:"object[_-]?store[_-]?bucket(=| =|:| :)"},{name:"object_store_creds",regex:"object[_-]?store[_-]?creds(=| =|:| :)"},{name:"oc_pass",regex:"oc[_-]?pass(=| =|:| :)"},{name:"octest_app_password",regex:"octest[_-]?app[_-]?password(=| =|:| :)"},{name:"octest_app_username",regex:"octest[_-]?app[_-]?username(=| =|:| :)"},{name:"octest_password",regex:"octest[_-]?password(=| =|:| :)"},{name:"ofta_key",regex:"ofta[_-]?key(=| =|:| :)"},{name:"ofta_region",regex:"ofta[_-]?region(=| =|:| :)"},{name:"ofta_secret",regex:"ofta[_-]?secret(=| =|:| :)"},{name:"okta_client_token",regex:"okta[_-]?client[_-]?token(=| =|:| :)"},{name:"okta_oauth2_client_secret",regex:"okta[_-]?oauth2[_-]?client[_-]?secret(=| =|:| :)"},{name:"okta_oauth2_clientsecret",regex:"okta[_-]?oauth2[_-]?clientsecret(=| =|:| :)"},{name:"omise_key",regex:"omise[_-]?key(=| =|:| :)"},{name:"omise_pkey",regex:"omise[_-]?pkey(=| =|:| :)"},{name:"omise_pubkey",regex:"omise[_-]?pubkey(=| =|:| :)"},{name:"omise_skey",regex:"omise[_-]?skey(=| =|:| :)"},{name:"onesignal_api_key",regex:"onesignal[_-]?api[_-]?key(=| =|:| :)"},{name:"onesignal_user_auth_key",regex:"onesignal[_-]?user[_-]?auth[_-]?key(=| =|:| :)"},{name:"open_whisk_key",regex:"open[_-]?whisk[_-]?key(=| =|:| :)"},{name:"openwhisk_key",regex:"openwhisk[_-]?key(=| =|:| :)"},{name:"os_auth_url",regex:"os[_-]?auth[_-]?url(=| =|:| :)"},{name:"os_password",regex:"os[_-]?password(=| =|:| :)"},{name:"ossrh_jira_password",regex:"ossrh[_-]?jira[_-]?password(=| =|:| :)"},{name:"ossrh_pass",regex:"ossrh[_-]?pass(=| =|:| :)"},{name:"ossrh_password",regex:"ossrh[_-]?password(=| =|:| :)"},{name:"ossrh_secret",regex:"ossrh[_-]?secret(=| =|:| :)"},{name:"ossrh_username",regex:"ossrh[_-]?username(=| =|:| :)"},{name:"outlook_team",regex:"(https://outlook.office.com/webhook/[0-9a-f-]{36}@)"},{name:"packagecloud_token",regex:"packagecloud[_-]?token(=| =|:| :)"},{name:"pagerduty_apikey",regex:"pagerduty[_-]?apikey(=| =|:| :)"},{name:"parse_js_key",regex:"parse[_-]?js[_-]?key(=| =|:| :)"},{name:"passwordtravis",regex:"passwordtravis(=| =|:| :)"},{name:"paypal_braintree_access_token",regex:"(access_token$production$[0-9a-z]{16}$[0-9a-f]{32})"},{name:"paypal_client_secret",regex:"paypal[_-]?client[_-]?secret(=| =|:| :)"},{name:"percy_project",regex:"percy[_-]?project(=| =|:| :)"},{name:"percy_token",regex:"percy[_-]?token(=| =|:| :)"},{name:"personal_key",regex:"personal[_-]?key(=| =|:| :)"},{name:"personal_secret",regex:"personal[_-]?secret(=| =|:| :)"},{name:"pg_database",regex:"pg[_-]?database(=| =|:| :)"},{name:"pg_host",regex:"pg[_-]?host(=| =|:| :)"},{name:"places_api_key",regex:"places[_-]?api[_-]?key(=| =|:| :)"},{name:"places_apikey",regex:"places[_-]?apikey(=| =|:| :)"},{name:"plotly_apikey",regex:"plotly[_-]?apikey(=| =|:| :)"},{name:"plugin_password",regex:"plugin[_-]?password(=| =|:| :)"},{name:"postgres_env_postgres_db",regex:"postgres[_-]?env[_-]?postgres[_-]?db(=| =|:| :)"},{name:"postgres_env_postgres_password",regex:"postgres[_-]?env[_-]?postgres[_-]?password(=| =|:| :)"},{name:"postgresql_db",regex:"postgresql[_-]?db(=| =|:| :)"},{name:"postgresql_pass",regex:"postgresql[_-]?pass(=| =|:| :)"},{name:"prebuild_auth",regex:"prebuild[_-]?auth(=| =|:| :)"},{name:"preferred_username",regex:"preferred[_-]?username(=| =|:| :)"},{name:"pring_mail_username",regex:"pring[_-]?mail[_-]?username(=| =|:| :)"},{name:"private_key",regex:"-----(?:(?:BEGIN|END) )(?:(?:EC|PGP|DSA|RSA|OPENSSH).)?PRIVATE.KEY(.BLOCK)?-----"},{name:"private_signing_password",regex:"private[_-]?signing[_-]?password(=| =|:| :)"},{name:"prod_access_key_id",regex:"prod[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"prod_password",regex:"prod[_-]?password(=| =|:| :)"},{name:"prod_secret_key",regex:"prod[_-]?secret[_-]?key(=| =|:| :)"},{name:"project_config",regex:"project[_-]?config(=| =|:| :)"},{name:"publish_access",regex:"publish[_-]?access(=| =|:| :)"},{name:"publish_key",regex:"publish[_-]?key(=| =|:| :)"},{name:"publish_secret",regex:"publish[_-]?secret(=| =|:| :)"},{name:"pushover_token",regex:"pushover[_-]?token(=| =|:| :)"},{name:"pypi_passowrd",regex:"pypi[_-]?passowrd(=| =|:| :)"},{name:"qiita_token",regex:"qiita[_-]?token(=| =|:| :)"},{name:"quip_token",regex:"quip[_-]?token(=| =|:| :)"},{name:"rabbitmq_password",regex:"rabbitmq[_-]?password(=| =|:| :)"},{name:"randrmusicapiaccesstoken",regex:"randrmusicapiaccesstoken(=| =|:| :)"},{name:"redis_stunnel_urls",regex:"redis[_-]?stunnel[_-]?urls(=| =|:| :)"},{name:"rediscloud_url",regex:"rediscloud[_-]?url(=| =|:| :)"},{name:"refresh_token",regex:"refresh[_-]?token(=| =|:| :)"},{name:"registry_pass",regex:"registry[_-]?pass(=| =|:| :)"},{name:"registry_secure",regex:"registry[_-]?secure(=| =|:| :)"},{name:"release_gh_token",regex:"release[_-]?gh[_-]?token(=| =|:| :)"},{name:"release_token",regex:"release[_-]?token(=| =|:| :)"},{name:"reporting_webdav_pwd",regex:"reporting[_-]?webdav[_-]?pwd(=| =|:| :)"},{name:"reporting_webdav_url",regex:"reporting[_-]?webdav[_-]?url(=| =|:| :)"},{name:"repotoken",regex:"repotoken(=| =|:| :)"},{name:"rest_api_key",regex:"rest[_-]?api[_-]?key(=| =|:| :)"},{name:"rinkeby_private_key",regex:"rinkeby[_-]?private[_-]?key(=| =|:| :)"},{name:"ropsten_private_key",regex:"ropsten[_-]?private[_-]?key(=| =|:| :)"},{name:"route53_access_key_id",regex:"route53[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"rtd_key_pass",regex:"rtd[_-]?key[_-]?pass(=| =|:| :)"},{name:"rtd_store_pass",regex:"rtd[_-]?store[_-]?pass(=| =|:| :)"},{name:"rubygems_auth_token",regex:"rubygems[_-]?auth[_-]?token(=| =|:| :)"},{name:"s3_access_key",regex:"s3[_-]?access[_-]?key(=| =|:| :)"},{name:"s3_access_key_id",regex:"s3[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"s3_bucket_name_app_logs",regex:"s3[_-]?bucket[_-]?name[_-]?app[_-]?logs(=| =|:| :)"},{name:"s3_bucket_name_assets",regex:"s3[_-]?bucket[_-]?name[_-]?assets(=| =|:| :)"},{name:"s3_external_3_amazonaws_com",regex:"s3[_-]?external[_-]?3[_-]?amazonaws[_-]?com(=| =|:| :)"},{name:"s3_key",regex:"s3[_-]?key(=| =|:| :)"},{name:"s3_key_app_logs",regex:"s3[_-]?key[_-]?app[_-]?logs(=| =|:| :)"},{name:"s3_key_assets",regex:"s3[_-]?key[_-]?assets(=| =|:| :)"},{name:"s3_secret_app_logs",regex:"s3[_-]?secret[_-]?app[_-]?logs(=| =|:| :)"},{name:"s3_secret_assets",regex:"s3[_-]?secret[_-]?assets(=| =|:| :)"},{name:"s3_secret_key",regex:"s3[_-]?secret[_-]?key(=| =|:| :)"},{name:"s3_user_secret",regex:"s3[_-]?user[_-]?secret(=| =|:| :)"},{name:"sacloud_access_token",regex:"sacloud[_-]?access[_-]?token(=| =|:| :)"},{name:"sacloud_access_token_secret",regex:"sacloud[_-]?access[_-]?token[_-]?secret(=| =|:| :)"},{name:"sacloud_api",regex:"sacloud[_-]?api(=| =|:| :)"},{name:"salesforce_bulk_test_password",regex:"salesforce[_-]?bulk[_-]?test[_-]?password(=| =|:| :)"},{name:"salesforce_bulk_test_security_token",regex:"salesforce[_-]?bulk[_-]?test[_-]?security[_-]?token(=| =|:| :)"},{name:"sandbox_access_token",regex:"sandbox[_-]?access[_-]?token(=| =|:| :)"},{name:"sandbox_aws_access_key_id",regex:"sandbox[_-]?aws[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"sandbox_aws_secret_access_key",regex:"sandbox[_-]?aws[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"sauce_access_key",regex:"sauce[_-]?access[_-]?key(=| =|:| :)"},{name:"sauce_token",regex:`(sauce.{0,50}("|')?[0-9a-f-]{36}("|')?)`},{name:"scrutinizer_token",regex:"scrutinizer[_-]?token(=| =|:| :)"},{name:"sdr_token",regex:"sdr[_-]?token(=| =|:| :)"},{name:"secret_0",regex:"secret[_-]?0(=| =|:| :)"},{name:"secret_1",regex:"secret[_-]?1(=| =|:| :)"},{name:"secret_10",regex:"secret[_-]?10(=| =|:| :)"},{name:"secret_11",regex:"secret[_-]?11(=| =|:| :)"},{name:"secret_2",regex:"secret[_-]?2(=| =|:| :)"},{name:"secret_3",regex:"secret[_-]?3(=| =|:| :)"},{name:"secret_4",regex:"secret[_-]?4(=| =|:| :)"},{name:"secret_5",regex:"secret[_-]?5(=| =|:| :)"},{name:"secret_6",regex:"secret[_-]?6(=| =|:| :)"},{name:"secret_7",regex:"secret[_-]?7(=| =|:| :)"},{name:"secret_8",regex:"secret[_-]?8(=| =|:| :)"},{name:"secret_9",regex:"secret[_-]?9(=| =|:| :)"},{name:"secret_key_base",regex:"secret[_-]?key[_-]?base(=| =|:| :)"},{name:"secretaccesskey",regex:"secretaccesskey(=| =|:| :)"},{name:"secretkey",regex:"secretkey(=| =|:| :)"},{name:"segment_api_key",regex:"segment[_-]?api[_-]?key(=| =|:| :)"},{name:"selion_log_level_dev",regex:"selion[_-]?log[_-]?level[_-]?dev(=| =|:| :)"},{name:"selion_selenium_host",regex:"selion[_-]?selenium[_-]?host(=| =|:| :)"},{name:"sendgrid - 2",regex:"sendgrid(=| =|:| :)"},{name:"sendgrid_api_key - 1",regex:"sendgrid[_-]?api[_-]?key(=| =|:| :)"},{name:"sendgrid_key",regex:"sendgrid[_-]?key(=| =|:| :)"},{name:"sendgrid_password",regex:"sendgrid[_-]?password(=| =|:| :)"},{name:"sendgrid_user",regex:"sendgrid[_-]?user(=| =|:| :)"},{name:"sendgrid_username",regex:"sendgrid[_-]?username(=| =|:| :)"},{name:"sendwithus_key",regex:"sendwithus[_-]?key(=| =|:| :)"},{name:"sentry_auth_token",regex:"sentry[_-]?auth[_-]?token(=| =|:| :)"},{name:"sentry_default_org",regex:"sentry[_-]?default[_-]?org(=| =|:| :)"},{name:"sentry_endpoint",regex:"sentry[_-]?endpoint(=| =|:| :)"},{name:"sentry_key",regex:"sentry[_-]?key(=| =|:| :)"},{name:"service_account_secret",regex:"service[_-]?account[_-]?secret(=| =|:| :)"},{name:"ses_access_key",regex:"ses[_-]?access[_-]?key(=| =|:| :)"},{name:"ses_secret_key",regex:"ses[_-]?secret[_-]?key(=| =|:| :)"},{name:"setdstaccesskey",regex:"setdstaccesskey(=| =|:| :)"},{name:"setdstsecretkey",regex:"setdstsecretkey(=| =|:| :)"},{name:"setsecretkey",regex:"setsecretkey(=| =|:| :)"},{name:"signing_key",regex:"signing[_-]?key(=| =|:| :)"},{name:"signing_key_password",regex:"signing[_-]?key[_-]?password(=| =|:| :)"},{name:"signing_key_secret",regex:"signing[_-]?key[_-]?secret(=| =|:| :)"},{name:"signing_key_sid",regex:"signing[_-]?key[_-]?sid(=| =|:| :)"},{name:"slack_webhook_url",regex:"(hooks.slack.com/services/T[A-Z0-9]{8}/B[A-Z0-9]{8}/[a-zA-Z0-9]{1,})"},{name:"slash_developer_space",regex:"slash[_-]?developer[_-]?space(=| =|:| :)"},{name:"slash_developer_space_key",regex:"slash[_-]?developer[_-]?space[_-]?key(=| =|:| :)"},{name:"slate_user_email",regex:"slate[_-]?user[_-]?email(=| =|:| :)"},{name:"snoowrap_client_secret",regex:"snoowrap[_-]?client[_-]?secret(=| =|:| :)"},{name:"snoowrap_password",regex:"snoowrap[_-]?password(=| =|:| :)"},{name:"snoowrap_refresh_token",regex:"snoowrap[_-]?refresh[_-]?token(=| =|:| :)"},{name:"snyk_api_token",regex:"snyk[_-]?api[_-]?token(=| =|:| :)"},{name:"snyk_token",regex:"snyk[_-]?token(=| =|:| :)"},{name:"socrata_app_token",regex:"socrata[_-]?app[_-]?token(=| =|:| :)"},{name:"socrata_password",regex:"socrata[_-]?password(=| =|:| :)"},{name:"sonar_organization_key",regex:"sonar[_-]?organization[_-]?key(=| =|:| :)"},{name:"sonar_project_key",regex:"sonar[_-]?project[_-]?key(=| =|:| :)"},{name:"sonar_token",regex:"sonar[_-]?token(=| =|:| :)"},{name:"sonarqube_docs_api_key",regex:`(sonar.{0,50}("|')?[0-9a-f]{40}("|')?)`},{name:"sonatype_gpg_key_name",regex:"sonatype[_-]?gpg[_-]?key[_-]?name(=| =|:| :)"},{name:"sonatype_gpg_passphrase",regex:"sonatype[_-]?gpg[_-]?passphrase(=| =|:| :)"},{name:"sonatype_nexus_password",regex:"sonatype[_-]?nexus[_-]?password(=| =|:| :)"},{name:"sonatype_pass",regex:"sonatype[_-]?pass(=| =|:| :)"},{name:"sonatype_password",regex:"sonatype[_-]?password(=| =|:| :)"},{name:"sonatype_token_password",regex:"sonatype[_-]?token[_-]?password(=| =|:| :)"},{name:"sonatype_token_user",regex:"sonatype[_-]?token[_-]?user(=| =|:| :)"},{name:"sonatypepassword",regex:"sonatypepassword(=| =|:| :)"},{name:"soundcloud_client_secret",regex:"soundcloud[_-]?client[_-]?secret(=| =|:| :)"},{name:"soundcloud_password",regex:"soundcloud[_-]?password(=| =|:| :)"},{name:"spaces_access_key_id",regex:"spaces[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"spaces_secret_access_key",regex:"spaces[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"spotify_api_access_token",regex:"spotify[_-]?api[_-]?access[_-]?token(=| =|:| :)"},{name:"spotify_api_client_secret",regex:"spotify[_-]?api[_-]?client[_-]?secret(=| =|:| :)"},{name:"spring_mail_password",regex:"spring[_-]?mail[_-]?password(=| =|:| :)"},{name:"sqsaccesskey",regex:"sqsaccesskey(=| =|:| :)"},{name:"sqssecretkey",regex:"sqssecretkey(=| =|:| :)"},{name:"square_app_secret",regex:"(sq0[a-z]{3}-[0-9A-Za-z-_]{20,50})"},{name:"square_reader_sdk_repository_password",regex:"square[_-]?reader[_-]?sdk[_-]?repository[_-]?password(=| =|:| :)"},{name:"srcclr_api_token",regex:"srcclr[_-]?api[_-]?token(=| =|:| :)"},{name:"ssh_password",regex:`(sshpass -p.*['|"])`},{name:"sshpass",regex:"sshpass(=| =|:| :)"},{name:"ssmtp_config",regex:"ssmtp[_-]?config(=| =|:| :)"},{name:"staging_base_url_runscope",regex:"staging[_-]?base[_-]?url[_-]?runscope(=| =|:| :)"},{name:"star_test_aws_access_key_id",regex:"star[_-]?test[_-]?aws[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"star_test_bucket",regex:"star[_-]?test[_-]?bucket(=| =|:| :)"},{name:"star_test_location",regex:"star[_-]?test[_-]?location(=| =|:| :)"},{name:"star_test_secret_access_key",regex:"star[_-]?test[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"starship_account_sid",regex:"starship[_-]?account[_-]?sid(=| =|:| :)"},{name:"starship_auth_token",regex:"starship[_-]?auth[_-]?token(=| =|:| :)"},{name:"stormpath_api_key_id",regex:"stormpath[_-]?api[_-]?key[_-]?id(=| =|:| :)"},{name:"stormpath_api_key_secret",regex:"stormpath[_-]?api[_-]?key[_-]?secret(=| =|:| :)"},{name:"strip_publishable_key",regex:"strip[_-]?publishable[_-]?key(=| =|:| :)"},{name:"strip_secret_key",regex:"strip[_-]?secret[_-]?key(=| =|:| :)"},{name:"stripe_private",regex:"stripe[_-]?private(=| =|:| :)"},{name:"stripe_public",regex:"stripe[_-]?public(=| =|:| :)"},{name:"stripe_restricted_api",regex:"(rk_live_[0-9a-zA-Z]{24,34})"},{name:"stripe_standard_api",regex:"(sk_live_[0-9a-zA-Z]{24,34})"},{name:"surge_login",regex:"surge[_-]?login(=| =|:| :)"},{name:"surge_token",regex:"surge[_-]?token(=| =|:| :)"},{name:"svn_pass",regex:"svn[_-]?pass(=| =|:| :)"},{name:"tesco_api_key",regex:"tesco[_-]?api[_-]?key(=| =|:| :)"},{name:"test_github_token",regex:"test[_-]?github[_-]?token(=| =|:| :)"},{name:"test_test",regex:"test[_-]?test(=| =|:| :)"},{name:"tester_keys_password",regex:"tester[_-]?keys[_-]?password(=| =|:| :)"},{name:"thera_oss_access_key",regex:"thera[_-]?oss[_-]?access[_-]?key(=| =|:| :)"},{name:"token_core_java",regex:"token[_-]?core[_-]?java(=| =|:| :)"},{name:"travis_access_token",regex:"travis[_-]?access[_-]?token(=| =|:| :)"},{name:"travis_api_token",regex:"travis[_-]?api[_-]?token(=| =|:| :)"},{name:"travis_branch",regex:"travis[_-]?branch(=| =|:| :)"},{name:"travis_com_token",regex:"travis[_-]?com[_-]?token(=| =|:| :)"},{name:"travis_e2e_token",regex:"travis[_-]?e2e[_-]?token(=| =|:| :)"},{name:"travis_gh_token",regex:"travis[_-]?gh[_-]?token(=| =|:| :)"},{name:"travis_pull_request",regex:"travis[_-]?pull[_-]?request(=| =|:| :)"},{name:"travis_secure_env_vars",regex:"travis[_-]?secure[_-]?env[_-]?vars(=| =|:| :)"},{name:"travis_token",regex:"travis[_-]?token(=| =|:| :)"},{name:"trex_client_token",regex:"trex[_-]?client[_-]?token(=| =|:| :)"},{name:"trex_okta_client_token",regex:"trex[_-]?okta[_-]?client[_-]?token(=| =|:| :)"},{name:"twilio_api_key",regex:"twilio[_-]?api[_-]?key(=| =|:| :)"},{name:"twilio_api_secret",regex:"twilio[_-]?api[_-]?secret(=| =|:| :)"},{name:"twilio_chat_account_api_service",regex:"twilio[_-]?chat[_-]?account[_-]?api[_-]?service(=| =|:| :)"},{name:"twilio_configuration_sid",regex:"twilio[_-]?configuration[_-]?sid(=| =|:| :)"},{name:"twilio_sid",regex:"twilio[_-]?sid(=| =|:| :)"},{name:"twilio_token",regex:"twilio[_-]?token(=| =|:| :)"},{name:"twine_password",regex:"twine[_-]?password(=| =|:| :)"},{name:"twitter_consumer_key",regex:"twitter[_-]?consumer[_-]?key(=| =|:| :)"},{name:"twitter_consumer_secret",regex:"twitter[_-]?consumer[_-]?secret(=| =|:| :)"},{name:"twitteroauthaccesssecret",regex:"twitteroauthaccesssecret(=| =|:| :)"},{name:"twitteroauthaccesstoken",regex:"twitteroauthaccesstoken(=| =|:| :)"},{name:"unity_password",regex:"unity[_-]?password(=| =|:| :)"},{name:"unity_serial",regex:"unity[_-]?serial(=| =|:| :)"},{name:"urban_key",regex:"urban[_-]?key(=| =|:| :)"},{name:"urban_master_secret",regex:"urban[_-]?master[_-]?secret(=| =|:| :)"},{name:"urban_secret",regex:"urban[_-]?secret(=| =|:| :)"},{name:"us_east_1_elb_amazonaws_com",regex:"us[_-]?east[_-]?1[_-]?elb[_-]?amazonaws[_-]?com(=| =|:| :)"},{name:"use_ssh",regex:"use[_-]?ssh(=| =|:| :)"},{name:"user_assets_access_key_id",regex:"user[_-]?assets[_-]?access[_-]?key[_-]?id(=| =|:| :)"},{name:"user_assets_secret_access_key",regex:"user[_-]?assets[_-]?secret[_-]?access[_-]?key(=| =|:| :)"},{name:"usertravis",regex:"usertravis(=| =|:| :)"},{name:"v_sfdc_client_secret",regex:"v[_-]?sfdc[_-]?client[_-]?secret(=| =|:| :)"},{name:"v_sfdc_password",regex:"v[_-]?sfdc[_-]?password(=| =|:| :)"},{name:"vip_github_build_repo_deploy_key",regex:"vip[_-]?github[_-]?build[_-]?repo[_-]?deploy[_-]?key(=| =|:| :)"},{name:"vip_github_deploy_key",regex:"vip[_-]?github[_-]?deploy[_-]?key(=| =|:| :)"},{name:"vip_github_deploy_key_pass",regex:"vip[_-]?github[_-]?deploy[_-]?key[_-]?pass(=| =|:| :)"},{name:"virustotal_apikey",regex:"virustotal[_-]?apikey(=| =|:| :)"},{name:"visual_recognition_api_key",regex:"visual[_-]?recognition[_-]?api[_-]?key(=| =|:| :)"},{name:"vscetoken",regex:"vscetoken(=| =|:| :)"},{name:"wakatime_api_key",regex:"wakatime[_-]?api[_-]?key(=| =|:| :)"},{name:"watson_conversation_password",regex:"watson[_-]?conversation[_-]?password(=| =|:| :)"},{name:"watson_device_password",regex:"watson[_-]?device[_-]?password(=| =|:| :)"},{name:"watson_password",regex:"watson[_-]?password(=| =|:| :)"},{name:"widget_basic_password",regex:"widget[_-]?basic[_-]?password(=| =|:| :)"},{name:"widget_basic_password_2",regex:"widget[_-]?basic[_-]?password[_-]?2(=| =|:| :)"},{name:"widget_basic_password_3",regex:"widget[_-]?basic[_-]?password[_-]?3(=| =|:| :)"},{name:"widget_basic_password_4",regex:"widget[_-]?basic[_-]?password[_-]?4(=| =|:| :)"},{name:"widget_basic_password_5",regex:"widget[_-]?basic[_-]?password[_-]?5(=| =|:| :)"},{name:"widget_fb_password",regex:"widget[_-]?fb[_-]?password(=| =|:| :)"},{name:"widget_fb_password_2",regex:"widget[_-]?fb[_-]?password[_-]?2(=| =|:| :)"},{name:"widget_fb_password_3",regex:"widget[_-]?fb[_-]?password[_-]?3(=| =|:| :)"},{name:"widget_test_server",regex:"widget[_-]?test[_-]?server(=| =|:| :)"},{name:"wincert_password",regex:"wincert[_-]?password(=| =|:| :)"},{name:"wordpress_db_password",regex:"wordpress[_-]?db[_-]?password(=| =|:| :)"},{name:"wordpress_db_user",regex:"wordpress[_-]?db[_-]?user(=| =|:| :)"},{name:"wpjm_phpunit_google_geocode_api_key",regex:"wpjm[_-]?phpunit[_-]?google[_-]?geocode[_-]?api[_-]?key(=| =|:| :)"},{name:"wporg_password",regex:"wporg[_-]?password(=| =|:| :)"},{name:"wpt_db_password",regex:"wpt[_-]?db[_-]?password(=| =|:| :)"},{name:"wpt_db_user",regex:"wpt[_-]?db[_-]?user(=| =|:| :)"},{name:"wpt_prepare_dir",regex:"wpt[_-]?prepare[_-]?dir(=| =|:| :)"},{name:"wpt_report_api_key",regex:"wpt[_-]?report[_-]?api[_-]?key(=| =|:| :)"},{name:"wpt_ssh_connect",regex:"wpt[_-]?ssh[_-]?connect(=| =|:| :)"},{name:"wpt_ssh_private_key_base64",regex:"wpt[_-]?ssh[_-]?private[_-]?key[_-]?base64(=| =|:| :)"},{name:"www_googleapis_com",regex:"www[_-]?googleapis[_-]?com(=| =|:| :)"},{name:"yangshun_gh_password",regex:"yangshun[_-]?gh[_-]?password(=| =|:| :)"},{name:"yangshun_gh_token",regex:"yangshun[_-]?gh[_-]?token(=| =|:| :)"},{name:"yt_account_client_secret",regex:"yt[_-]?account[_-]?client[_-]?secret(=| =|:| :)"},{name:"yt_account_refresh_token",regex:"yt[_-]?account[_-]?refresh[_-]?token(=| =|:| :)"},{name:"yt_api_key",regex:"yt[_-]?api[_-]?key(=| =|:| :)"},{name:"yt_client_secret",regex:"yt[_-]?client[_-]?secret(=| =|:| :)"},{name:"yt_partner_client_secret",regex:"yt[_-]?partner[_-]?client[_-]?secret(=| =|:| :)"},{name:"yt_partner_refresh_token",regex:"yt[_-]?partner[_-]?refresh[_-]?token(=| =|:| :)"},{name:"yt_server_api_key",regex:"yt[_-]?server[_-]?api[_-]?key(=| =|:| :)"},{name:"zendesk_travis_github",regex:"zendesk[_-]?travis[_-]?github(=| =|:| :)"},{name:"zensonatypepassword",regex:"zensonatypepassword(=| =|:| :)"},{name:"zhuliang_gh_token",regex:"zhuliang[_-]?gh[_-]?token(=| =|:| :)"},{name:"zopim_account_key",regex:"zopim[_-]?account[_-]?key(=| =|:| :)"},{name:"docker_registry_auth",regex:'auth":.*"(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{4}|[A-Za-z0-9+\\/]{3}=|[A-Za-z0-9+\\/]{2}={2})'}];var XQ="*",mw=new Set([`
122
+ `,"\r","\t",'"',"'",":",",","{","}","[","]","\\"]),QQ=[];for(let{regex:_}of YQ)try{let $=_,b="g";if($.startsWith("(?i)"))$=$.slice(4),b="gi";QQ.push(new RegExp($,b))}catch{}function uw(_,$=XQ){let b=$.length>0?$[0]:XQ,Z=_;for(let z of QQ)Z=Z.replace(z,(A)=>Array.from(A,(J)=>mw.has(J)?J:b).join(""));return Z}function w6(_){if(typeof _==="string")return uw(_);if(Array.isArray(_))return _.map(($)=>w6($));if(_ instanceof Date)return _;if(_!==null&&typeof _==="object"){let $={};for(let[b,Z]of Object.entries(_))$[b]=w6(Z);return $}return _}var cw=[".env",".env.local",".env.development",".env.production",".env.test",".env.staging",/\.env\.(dev|prod|stage|preview|ci|build|docker)$/i,".zshrc",".bashrc",".bash_profile",".profile",".zprofile",".zshenv",".zsh_history",".bash_history","id_rsa","id_ed25519","id_ecdsa","id_dsa",/^id_[a-z0-9]+$/i,/\.pem$/i,/\.key$/i,".aws/credentials",".aws/config",".docker/config.json",".npmrc",".yarnrc",".yarnrc.yml",".git-credentials",".netrc",".kube/config","kubeconfig","database.yml","secrets.yml","secrets.yaml","master.key","credentials.yml.enc",".gcloud/credentials","service-account.json","service_account.json",/gcp.*credentials.*\.json$/i,/firebase.*\.json$/i];function hw(_){let $=_.replace(/\\/g,"/"),b=$.split("/").pop()||"";for(let Z of cw)if(typeof Z==="string"){if(b===Z||$.endsWith(`/${Z}`)||$===Z)return!0}else if(Z.test(b)||Z.test($))return!0;return!1}function wJ(_){return _.replace(/[^\s]/g,"*")}function KQ(_){let $=_.messages.map((b)=>rw(b));return{..._,messages:$}}function rw(_){if(_.type!=="tool-call")return _;let $=_.toolName;if($!=="Read"&&$!=="Write")return _;let b=_.input,Z=b?.file_path;if(typeof Z!=="string"||!hw(Z))return _;let z={..._};if($==="Write"&&b){let A=b.content;if(typeof A==="string")z.input={...b,content:wJ(A)}}if($==="Read"){let A=_.output;if(typeof A==="string")z.output=wJ(A);else if(A&&typeof A==="object"){let J=A,U=J.file;if(U&&typeof U.content==="string")z.output={...J,file:{...U,content:wJ(U.content)}}}}return z}import{spawn as nw}from"child_process";import{promises as i0}from"fs";import{homedir as B6}from"os";import{basename as lw,extname as pw,join as Z_,resolve as FQ}from"path";var f9=100,vQ=80,dw=new Set(["[request interrupted by user]","[request aborted by user]","[request cancelled by user]"]),iw=/^<\/?(?:command|local)-[a-z-]+>/i,ow=/^[α-ωΑ-Ω]\s/i,aw=/<system-reminder>[\s\S]*?<\/system-reminder>/g,ew=["npm ","npm:","npm error","node:","node.js","error:","fatal:","warning:","traceback (most recent call last):","usage:","hint:","note:","code:","requirestack"],tw=Z_(B6(),".claude"),sw=Z_(B6(),".cline"),_B=Z_(B6(),".codex"),$B=Z_(B6(),".pi","agent","sessions");async function zB(_){let $=_?.limit??f9,b=process.env.CLAUDE_HOME??tw,Z=Z_(b,"projects");if(!await x6(Z))return[];let z=[];try{let U=await i0.readdir(Z,{withFileTypes:!0});for(let G of U){if(!G.isDirectory())continue;let Y=Z_(Z,G.name);try{let X=await i0.readdir(Y,{withFileTypes:!0});for(let Q of X){if(!Q.isFile()||pw(Q.name)!==".jsonl")continue;let K=Z_(Y,Q.name),v=lw(Q.name,".jsonl");try{let D=await i0.stat(K);z.push({path:K,id:v,mtime:D.mtime})}catch{}}}catch{}}}catch{}z.sort((U,G)=>G.mtime.getTime()-U.mtime.getTime());let A=z.slice(0,$*2),J=[];for(let U of A)try{let G=await YB(U.path);J.push({id:U.id,source:"claude-code",path:U.path,timestamp:G.timestamp,preview:G.preview,cwd:G.cwd,repoId:null,stats:G.stats})}catch{}return J.sort((U,G)=>G.timestamp.getTime()-U.timestamp.getTime()).slice(0,$)}async function bB(_){let $=_?.limit??f9,b=process.env.CODEX_HOME??_B,Z=Z_(b,"sessions");if(!await x6(Z))return[];let z=[],J=(await KB(Z)).slice(0,$*2);for(let U of J)try{let G=await FB(U);if(!G)continue;z.push({id:G.sessionId,source:"codex",path:U,timestamp:G.timestamp,preview:G.preview,cwd:G.cwd,repoId:null,stats:G.stats})}catch{}return z.sort((U,G)=>G.timestamp.getTime()-U.timestamp.getTime()).slice(0,$)}async function ZB(_){let $=_?.limit??f9;try{let b=await AB($*2);if(!b)return[];let Z=JSON.parse(b),z=[];for(let A of Z){if(A.parentId)continue;let J=A.updated?new Date(A.updated):A.created?new Date(A.created):new Date(0);z.push({id:A.id,source:"opencode",path:A.id,timestamp:J,preview:A.title?i4(A.title):null,cwd:A.directory??null,repoId:null,stats:null})}return z.sort((A,J)=>J.timestamp.getTime()-A.timestamp.getTime()).slice(0,$)}catch{return[]}}function AB(_){return new Promise(($)=>{let b=!1,Z=(U)=>{if(!b)b=!0,clearTimeout(J),$(U)},z=nw("opencode",["session","list","--format","json","-n",String(_)],{stdio:["pipe","pipe","pipe"]}),A="",J=setTimeout(()=>{z.kill(),Z(null)},30000);z.stdout.on("data",(U)=>{A+=U.toString()}),z.on("close",(U)=>{Z(U===0?A.trim()||null:null)}),z.on("error",()=>{Z(null)})})}async function JB(_){let $=_?.limit??f9,b=process.env.PI_SESSIONS??$B;if(!await x6(b))return[];let Z=[];try{let z=await i0.readdir(b,{withFileTypes:!0});for(let A of z){if(!A.isDirectory())continue;let J=Z_(b,A.name);try{let U=await i0.readdir(J,{withFileTypes:!0});for(let G of U){if(!G.isFile()||!G.name.endsWith(".jsonl"))continue;let Y=Z_(J,G.name);try{let X=await HB(Y);if(!X)continue;Z.push({id:X.sessionId,source:"pi",path:Y,timestamp:X.timestamp,preview:X.preview,cwd:X.cwd,repoId:null,stats:null})}catch{}}}catch{}}}catch{}return Z.sort((z,A)=>A.timestamp.getTime()-z.timestamp.getTime()).slice(0,$)}async function UB(_){let $=_?.limit??f9,b=process.env.CLINE_HOME??sw,Z=Z_(b,"data","tasks");if(!await x6(Z))return[];let z=[];try{let A=await i0.readdir(Z,{withFileTypes:!0}),J=[];for(let G of A){if(!G.isDirectory())continue;let Y=Z_(Z,G.name,"api_conversation_history.json");try{let X=await i0.stat(Y);J.push({path:Y,id:G.name,mtime:X.mtime})}catch{}}J.sort((G,Y)=>Y.mtime.getTime()-G.mtime.getTime());let U=J.slice(0,$*2);for(let G of U)try{let Y=await vB(G.path);if(!Y)continue;z.push({id:G.id,source:"cline",path:G.path,timestamp:Y.timestamp,preview:Y.preview,cwd:Y.cwd,repoId:null,stats:null})}catch{}}catch{}return z.sort((A,J)=>J.timestamp.getTime()-A.timestamp.getTime()).slice(0,$)}async function qQ(_){let $=_?.sources??["claude-code","cline","codex","opencode","pi"],b=_?.limit??f9,Z=_?.cwd?FQ(_.cwd):null,z=b*3,A=await Promise.all([$.includes("claude-code")?zB({limit:z}):[],$.includes("cline")?UB({limit:z}):[],$.includes("codex")?bB({limit:z}):[],$.includes("opencode")?ZB({limit:z}):[],$.includes("pi")?JB({limit:z}):[]]),J=[];for(let U of A)J.push(...U);if(J=J.filter((U)=>U.preview&&U.preview.trim().length>0),Z)J=J.filter((U)=>{if(!U.cwd)return!1;let G=FQ(U.cwd);return G.startsWith(Z)||Z.startsWith(G)});return J.sort((U,G)=>G.timestamp.getTime()-U.timestamp.getTime()).slice(0,b)}async function x6(_){try{return(await i0.stat(_)).isDirectory()}catch{return!1}}function i4(_){let $=_.replace(/\s+/g," ").trim();if($.length<=vQ)return $;return $.slice(0,vQ-1)+"…"}var o4=51200,GB=524288,C9=20480;async function YB(_){let $=await i0.open(_,"r");try{let Z=(await $.stat()).size,z=null,A=null,J=null,U=Buffer.alloc(Math.min(o4,Z));await $.read(U,0,U.length,0);let G=U.toString("utf8");for(let Y of G.split(/\r?\n/)){if(!Y.trim())continue;if(!Y.endsWith("}"))break;try{let X=JSON.parse(Y);if(!z&&typeof X.cwd==="string")z=X.cwd;if(typeof X.timestamp==="string"){let Q=new Date(X.timestamp);if(!Number.isNaN(Q.getTime())){if(!J||Q>J)J=Q}}if(X.isSidechain||X.isMeta)continue;if(!A&&X.type==="user"){let K=X.message?.content;if(X.toolUseResult||X.tool_use_result)continue;let v=DQ(K);if(v){let D=XB(v);if(D)A=i4(D)}}if(z&&A)break}catch{continue}}if(Z>o4){let Y=Math.max(0,Z-C9),X=Buffer.alloc(Math.min(C9,Z-Y));await $.read(X,0,X.length,Y);let K=X.toString("utf8").split(/\r?\n/);if(Y>0&&K.length>0)K.shift();for(let v of K){if(!v.trim())continue;try{let D=JSON.parse(v);if(typeof D.timestamp==="string"){let w=new Date(D.timestamp);if(!Number.isNaN(w.getTime())){if(!J||w>J)J=w}}}catch{continue}}}return{timestamp:J??new Date(0),cwd:z,preview:A,stats:null}}finally{await $.close()}}function DQ(_){if(typeof _==="string")return _;if(Array.isArray(_))for(let $ of _){if(typeof $==="string")return $;if($&&typeof $==="object"){let b=$;if(b.type==="tool_result")continue;if(b.type==="text"&&typeof b.text==="string")return b.text}}return null}function XB(_){let $=_.replace(aw,""),b=[];for(let Z of $.split(/\r?\n/)){let z=Z.trim();if(!z)continue;let A=z.toLowerCase();if(dw.has(A))continue;if(iw.test(z))continue;if(ow.test(z))continue;if(ew.some((J)=>A.startsWith(J))){if(!z.includes("?")&&!QB(A))continue}if(!/[a-z]/i.test(z)&&!/\d/.test(z))continue;b.push(z)}if(b.length===0)return null;return b.slice(0,3).join(" ").replace(/\s+/g," ").trim()||null}function QB(_){return["can you","could you","please","help","how do","what is","why","fix","add","create","update"].some((b)=>_.includes(b))}async function KB(_){let $=[];async function b(Z,z){if(z>4)return;try{let A=await i0.readdir(Z,{withFileTypes:!0});for(let J of A){let U=Z_(Z,J.name);if(J.isDirectory())await b(U,z+1);else if(J.isFile()&&J.name.endsWith(".jsonl")){let G=await i0.stat(U);$.push({path:U,mtime:G.mtime})}}}catch{}}return await b(_,0),$.sort((Z,z)=>z.mtime.getTime()-Z.mtime.getTime()),$.map((Z)=>Z.path)}async function FB(_){let $=await i0.open(_,"r");try{let Z=(await $.stat()).size,z=null,A=null,J=null,U=null,G=Math.min(Z,GB),Y=Math.min(o4,G);while(Y>0){let X=Buffer.alloc(Y);await $.read(X,0,X.length,0);let Q=X.toString("utf8"),K=!1;for(let v of Q.split(/\r?\n/)){if(!v.trim())continue;if(!v.endsWith("}")){K=!0;break}try{let D=JSON.parse(v),w=D.timestamp,P=D.type,E=D.payload;if(w){let B=new Date(w);if(!Number.isNaN(B.getTime())){if(!A||B>A)A=B}}if(!E)continue;if(P==="session_meta")z=E.id??null,J=E.cwd??null;if(P==="event_msg"&&E.type==="user_message"&&!U){let B=E.message;if(B)U=i4(B)}if(P==="response_item"&&E.type==="message"&&E.role==="user"&&!U&&Array.isArray(E.content)){let B=DQ(E.content);if(B)U=i4(B)}if(z&&J&&U)break}catch{continue}}if(z&&J&&U)break;if(Y>=G||!K&&U)break;Y=Math.min(G,Y*4)}if(Z>o4){let X=Math.max(0,Z-C9),Q=Buffer.alloc(Math.min(C9,Z-X));await $.read(Q,0,Q.length,X);let v=Q.toString("utf8").split(/\r?\n/);if(X>0&&v.length>0)v.shift();for(let D of v){if(!D.trim())continue;try{let P=JSON.parse(D).timestamp;if(P){let E=new Date(P);if(!Number.isNaN(E.getTime())){if(!A||E>A)A=E}}}catch{continue}}}if(!z)return null;return{sessionId:z,timestamp:A??new Date(0),cwd:J,preview:U,stats:null}}finally{await $.close()}}var HQ=/<environment_details|task|feedback>[\s\S]*?<\/environment_details|task|feedback>/g;async function vB(_){let $=await i0.open(_,"r");try{let b=await $.stat(),Z=b.size,z=Buffer.alloc(Math.min(o4,Z));await $.read(z,0,z.length,0);let A=z.toString("utf8"),J=null,U=null,G=A.match(/<task>\n?([\s\S]*?)\n?<\/task>/);if(G?.[1]){let X=G[1].trim();if(X)J=i4(X)}if(!J){let Q=A.match(/"role"\s*:\s*"user"[\s\S]*?"type"\s*:\s*"text"\s*,\s*"text"\s*:\s*"([^"]{1,200})/)?.[1]?.trim();if(Q){let K=Q.replace(HQ,"").replace(HQ,"").replace(/\\n/g," ").trim();if(K&&!K.startsWith("[")&&!K.startsWith("#"))J=i4(K)}}return{timestamp:b.mtime,cwd:U,preview:J}}finally{await $.close()}}async function HB(_){let $=await i0.open(_,"r");try{let Z=(await $.stat()).size,z=null,A=null,J=null,U=null,G=null,Y=Buffer.alloc(Math.min(o4,Z));await $.read(Y,0,Y.length,0);let Q=Y.toString("utf8").split(/\r?\n/);for(let K=0;K<Q.length;K++){let v=Q[K];if(!v.trim())continue;if(!v.endsWith("}"))break;try{let D=JSON.parse(v);if(K===0&&D.id&&D.timestamp){z=D.id,J=D.cwd??null,A=new Date(D.timestamp),G=A;continue}if(D.timestamp){let w=new Date(D.timestamp);if(!Number.isNaN(w.getTime())){if(!G||w>G)G=w}}if(!U&&D.type==="message"){let w=D.message;if(w?.role==="user"){let P=w.content;if(Array.isArray(P)){for(let E of P)if(E&&typeof E==="object"&&E.type==="text"){let B=E.text;if(B){U=i4(B);break}}}}}if(z&&J&&U)break}catch{}}if(Z>o4){let K=Math.max(0,Z-C9),v=Buffer.alloc(Math.min(C9,Z-K));await $.read(v,0,v.length,K);let w=v.toString("utf8").split(/\r?\n/);if(K>0&&w.length>0)w.shift();for(let P of w){if(!P.trim())continue;try{let E=JSON.parse(P);if(E.timestamp){let B=new Date(E.timestamp);if(!Number.isNaN(B.getTime())){if(!G||B>G)G=B}}}catch{}}}if(!z)return null;return{sessionId:z,timestamp:G??A??new Date(0),cwd:J,preview:U}}finally{await $.close()}}function gQ(_){return _===161||_===164||_===167||_===168||_===170||_===173||_===174||_>=176&&_<=180||_>=182&&_<=186||_>=188&&_<=191||_===198||_===208||_===215||_===216||_>=222&&_<=225||_===230||_>=232&&_<=234||_===236||_===237||_===240||_===242||_===243||_>=247&&_<=250||_===252||_===254||_===257||_===273||_===275||_===283||_===294||_===295||_===299||_>=305&&_<=307||_===312||_>=319&&_<=322||_===324||_>=328&&_<=331||_===333||_===338||_===339||_===358||_===359||_===363||_===462||_===464||_===466||_===468||_===470||_===472||_===474||_===476||_===593||_===609||_===708||_===711||_>=713&&_<=715||_===717||_===720||_>=728&&_<=731||_===733||_===735||_>=768&&_<=879||_>=913&&_<=929||_>=931&&_<=937||_>=945&&_<=961||_>=963&&_<=969||_===1025||_>=1040&&_<=1103||_===1105||_===8208||_>=8211&&_<=8214||_===8216||_===8217||_===8220||_===8221||_>=8224&&_<=8226||_>=8228&&_<=8231||_===8240||_===8242||_===8243||_===8245||_===8251||_===8254||_===8308||_===8319||_>=8321&&_<=8324||_===8364||_===8451||_===8453||_===8457||_===8467||_===8470||_===8481||_===8482||_===8486||_===8491||_===8531||_===8532||_>=8539&&_<=8542||_>=8544&&_<=8555||_>=8560&&_<=8569||_===8585||_>=8592&&_<=8601||_===8632||_===8633||_===8658||_===8660||_===8679||_===8704||_===8706||_===8707||_===8711||_===8712||_===8715||_===8719||_===8721||_===8725||_===8730||_>=8733&&_<=8736||_===8739||_===8741||_>=8743&&_<=8748||_===8750||_>=8756&&_<=8759||_===8764||_===8765||_===8776||_===8780||_===8786||_===8800||_===8801||_>=8804&&_<=8807||_===8810||_===8811||_===8814||_===8815||_===8834||_===8835||_===8838||_===8839||_===8853||_===8857||_===8869||_===8895||_===8978||_>=9312&&_<=9449||_>=9451&&_<=9547||_>=9552&&_<=9587||_>=9600&&_<=9615||_>=9618&&_<=9621||_===9632||_===9633||_>=9635&&_<=9641||_===9650||_===9651||_===9654||_===9655||_===9660||_===9661||_===9664||_===9665||_>=9670&&_<=9672||_===9675||_>=9678&&_<=9681||_>=9698&&_<=9701||_===9711||_===9733||_===9734||_===9737||_===9742||_===9743||_===9756||_===9758||_===9792||_===9794||_===9824||_===9825||_>=9827&&_<=9829||_>=9831&&_<=9834||_===9836||_===9837||_===9839||_===9886||_===9887||_===9919||_>=9926&&_<=9933||_>=9935&&_<=9939||_>=9941&&_<=9953||_===9955||_===9960||_===9961||_>=9963&&_<=9969||_===9972||_>=9974&&_<=9977||_===9979||_===9980||_===9982||_===9983||_===10045||_>=10102&&_<=10111||_>=11094&&_<=11097||_>=12872&&_<=12879||_>=57344&&_<=63743||_>=65024&&_<=65039||_===65533||_>=127232&&_<=127242||_>=127248&&_<=127277||_>=127280&&_<=127337||_>=127344&&_<=127373||_===127375||_===127376||_>=127387&&_<=127404||_>=917760&&_<=917999||_>=983040&&_<=1048573||_>=1048576&&_<=1114109}function kQ(_){return _===12288||_>=65281&&_<=65376||_>=65504&&_<=65510}function WQ(_){return _>=4352&&_<=4447||_===8986||_===8987||_===9001||_===9002||_>=9193&&_<=9196||_===9200||_===9203||_===9725||_===9726||_===9748||_===9749||_>=9776&&_<=9783||_>=9800&&_<=9811||_===9855||_>=9866&&_<=9871||_===9875||_===9889||_===9898||_===9899||_===9917||_===9918||_===9924||_===9925||_===9934||_===9940||_===9962||_===9970||_===9971||_===9973||_===9978||_===9981||_===9989||_===9994||_===9995||_===10024||_===10060||_===10062||_>=10067&&_<=10069||_===10071||_>=10133&&_<=10135||_===10160||_===10175||_===11035||_===11036||_===11088||_===11093||_>=11904&&_<=11929||_>=11931&&_<=12019||_>=12032&&_<=12245||_>=12272&&_<=12287||_>=12289&&_<=12350||_>=12353&&_<=12438||_>=12441&&_<=12543||_>=12549&&_<=12591||_>=12593&&_<=12686||_>=12688&&_<=12773||_>=12783&&_<=12830||_>=12832&&_<=12871||_>=12880&&_<=42124||_>=42128&&_<=42182||_>=43360&&_<=43388||_>=44032&&_<=55203||_>=63744&&_<=64255||_>=65040&&_<=65049||_>=65072&&_<=65106||_>=65108&&_<=65126||_>=65128&&_<=65131||_>=94176&&_<=94180||_>=94192&&_<=94198||_>=94208&&_<=101589||_>=101631&&_<=101662||_>=101760&&_<=101874||_>=110576&&_<=110579||_>=110581&&_<=110587||_===110589||_===110590||_>=110592&&_<=110882||_===110898||_>=110928&&_<=110930||_===110933||_>=110948&&_<=110951||_>=110960&&_<=111355||_>=119552&&_<=119638||_>=119648&&_<=119670||_===126980||_===127183||_===127374||_>=127377&&_<=127386||_>=127488&&_<=127490||_>=127504&&_<=127547||_>=127552&&_<=127560||_===127568||_===127569||_>=127584&&_<=127589||_>=127744&&_<=127776||_>=127789&&_<=127797||_>=127799&&_<=127868||_>=127870&&_<=127891||_>=127904&&_<=127946||_>=127951&&_<=127955||_>=127968&&_<=127984||_===127988||_>=127992&&_<=128062||_===128064||_>=128066&&_<=128252||_>=128255&&_<=128317||_>=128331&&_<=128334||_>=128336&&_<=128359||_===128378||_===128405||_===128406||_===128420||_>=128507&&_<=128591||_>=128640&&_<=128709||_===128716||_>=128720&&_<=128722||_>=128725&&_<=128728||_>=128732&&_<=128735||_===128747||_===128748||_>=128756&&_<=128764||_>=128992&&_<=129003||_===129008||_>=129292&&_<=129338||_>=129340&&_<=129349||_>=129351&&_<=129535||_>=129648&&_<=129660||_>=129664&&_<=129674||_>=129678&&_<=129734||_===129736||_>=129741&&_<=129756||_>=129759&&_<=129770||_>=129775&&_<=129784||_>=131072&&_<=196605||_>=196608&&_<=262141}function qB(_){if(!Number.isSafeInteger(_))throw TypeError(`Expected a code point, got \`${typeof _}\`.`)}function BJ(_,{ambiguousAsWide:$=!1}={}){if(qB(_),kQ(_)||WQ(_)||$&&gQ(_))return 2;return 1}var m9=new Intl.Segmenter(void 0,{granularity:"grapheme"});function N6(){return m9}function DB(_){let $=_.codePointAt(0);return $>=126976&&$<=130047||$>=8960&&$<=9215||$>=9728&&$<=10175||$>=11088&&$<=11093||_.includes("️")||_.length>2}var VB=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Mark}|\p{Surrogate})+$/v,gB=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,kB=/^\p{RGI_Emoji}$/v,WB=512,o$=new Map;function NJ(_){if(VB.test(_))return 0;if(DB(_)&&kB.test(_))return 2;let b=_.replace(gB,"").codePointAt(0);if(b===void 0)return 0;if(b>=127462&&b<=127487)return 2;let Z=BJ(b);if(_.length>1)for(let z of _.slice(1)){let A=z.codePointAt(0);if(A>=65280&&A<=65519)Z+=BJ(A)}return Z}function _0(_){if(_.length===0)return 0;let $=!0;for(let A=0;A<_.length;A++){let J=_.charCodeAt(A);if(J<32||J>126){$=!1;break}}if($)return _.length;let b=o$.get(_);if(b!==void 0)return b;let Z=_;if(_.includes("\t"))Z=Z.replace(/\t/g," ");if(Z.includes("\x1B")){let A="",J=0;while(J<Z.length){let U=w_(Z,J);if(U){J+=U.length;continue}A+=Z[J],J++}Z=A}let z=0;for(let{segment:A}of m9.segment(Z))z+=NJ(A);if(o$.size>=WB){let A=o$.keys().next().value;if(A!==void 0)o$.delete(A)}return o$.set(_,z),z}function w_(_,$){if($>=_.length||_[$]!=="\x1B")return null;let b=_[$+1];if(b==="["){let Z=$+2;while(Z<_.length&&!/[mGKHJ]/.test(_[Z]))Z++;if(Z<_.length)return{code:_.substring($,Z+1),length:Z+1-$};return null}if(b==="]"){let Z=$+2;while(Z<_.length){if(_[Z]==="\x07")return{code:_.substring($,Z+1),length:Z+1-$};if(_[Z]==="\x1B"&&_[Z+1]==="\\")return{code:_.substring($,Z+2),length:Z+2-$};Z++}return null}if(b==="_"){let Z=$+2;while(Z<_.length){if(_[Z]==="\x07")return{code:_.substring($,Z+1),length:Z+1-$};if(_[Z]==="\x1B"&&_[Z+1]==="\\")return{code:_.substring($,Z+2),length:Z+2-$};Z++}return null}return null}class I6{bold=!1;dim=!1;italic=!1;underline=!1;blink=!1;inverse=!1;hidden=!1;strikethrough=!1;fgColor=null;bgColor=null;process(_){if(!_.endsWith("m"))return;let $=_.match(/\x1b\[([\d;]*)m/);if(!$)return;let b=$[1];if(b===""||b==="0"){this.reset();return}let Z=b.split(";"),z=0;while(z<Z.length){let A=Number.parseInt(Z[z],10);if(A===38||A===48){if(Z[z+1]==="5"&&Z[z+2]!==void 0){let J=`${Z[z]};${Z[z+1]};${Z[z+2]}`;if(A===38)this.fgColor=J;else this.bgColor=J;z+=3;continue}else if(Z[z+1]==="2"&&Z[z+4]!==void 0){let J=`${Z[z]};${Z[z+1]};${Z[z+2]};${Z[z+3]};${Z[z+4]}`;if(A===38)this.fgColor=J;else this.bgColor=J;z+=5;continue}}switch(A){case 0:this.reset();break;case 1:this.bold=!0;break;case 2:this.dim=!0;break;case 3:this.italic=!0;break;case 4:this.underline=!0;break;case 5:this.blink=!0;break;case 7:this.inverse=!0;break;case 8:this.hidden=!0;break;case 9:this.strikethrough=!0;break;case 21:this.bold=!1;break;case 22:this.bold=!1,this.dim=!1;break;case 23:this.italic=!1;break;case 24:this.underline=!1;break;case 25:this.blink=!1;break;case 27:this.inverse=!1;break;case 28:this.hidden=!1;break;case 29:this.strikethrough=!1;break;case 39:this.fgColor=null;break;case 49:this.bgColor=null;break;default:if(A>=30&&A<=37||A>=90&&A<=97)this.fgColor=String(A);else if(A>=40&&A<=47||A>=100&&A<=107)this.bgColor=String(A);break}z++}}reset(){this.bold=!1,this.dim=!1,this.italic=!1,this.underline=!1,this.blink=!1,this.inverse=!1,this.hidden=!1,this.strikethrough=!1,this.fgColor=null,this.bgColor=null}clear(){this.reset()}getActiveCodes(){let _=[];if(this.bold)_.push("1");if(this.dim)_.push("2");if(this.italic)_.push("3");if(this.underline)_.push("4");if(this.blink)_.push("5");if(this.inverse)_.push("7");if(this.hidden)_.push("8");if(this.strikethrough)_.push("9");if(this.fgColor)_.push(this.fgColor);if(this.bgColor)_.push(this.bgColor);if(_.length===0)return"";return`\x1B[${_.join(";")}m`}hasActiveCodes(){return this.bold||this.dim||this.italic||this.underline||this.blink||this.inverse||this.hidden||this.strikethrough||this.fgColor!==null||this.bgColor!==null}getLineEndReset(){if(this.underline)return"\x1B[24m";return""}}function wQ(_,$){let b=0;while(b<_.length){let Z=w_(_,b);if(Z)$.process(Z.code),b+=Z.length;else b++}}function wB(_){let $=[],b="",Z="",z=!1,A=0;while(A<_.length){let J=w_(_,A);if(J){Z+=J.code,A+=J.length;continue}let U=_[A],G=U===" ";if(G!==z&&b)$.push(b),b="";if(Z)b+=Z,Z="";z=G,b+=U,A++}if(Z)b+=Z;if(b)$.push(b);return $}function a$(_,$){if(!_)return[""];let b=_.split(`
123
+ `),Z=[],z=new I6;for(let A of b){let J=Z.length>0?z.getActiveCodes():"";Z.push(...BB(J+A,$)),wQ(A,z)}return Z.length>0?Z:[""]}function BB(_,$){if(!_)return[""];if(_0(_)<=$)return[_];let Z=[],z=new I6,A=wB(_),J="",U=0;for(let G of A){let Y=_0(G),X=G.trim()==="";if(Y>$&&!X){if(J){let v=z.getLineEndReset();if(v)J+=v;Z.push(J),J="",U=0}let K=NB(G,$,z);Z.push(...K.slice(0,-1)),J=K[K.length-1],U=_0(J);continue}if(U+Y>$&&U>0){let K=J.trimEnd(),v=z.getLineEndReset();if(v)K+=v;if(Z.push(K),X)J=z.getActiveCodes(),U=0;else J=z.getActiveCodes()+G,U=Y}else J+=G,U+=Y;wQ(G,z)}if(J)Z.push(J);return Z.length>0?Z.map((G)=>G.trimEnd()):[""]}var xB=/[(){}[\]<>.,;:'"!?+\-=*/\\|&%^$#@~`]/;function o0(_){return/\s/.test(_)}function a0(_){return xB.test(_)}function NB(_,$,b){let Z=[],z=b.getActiveCodes(),A=0,J=0,U=[];while(J<_.length){let G=w_(_,J);if(G)U.push({type:"ansi",value:G.code}),J+=G.length;else{let Y=J;while(Y<_.length){if(w_(_,Y))break;Y++}let X=_.slice(J,Y);for(let Q of m9.segment(X))U.push({type:"grapheme",value:Q.segment});J=Y}}for(let G of U){if(G.type==="ansi"){z+=G.value,b.process(G.value);continue}let Y=G.value;if(!Y)continue;let X=_0(Y);if(A+X>$){let Q=b.getLineEndReset();if(Q)z+=Q;Z.push(z),z=b.getActiveCodes(),A=0}z+=Y,A+=X}if(z)Z.push(z);return Z.length>0?Z:[""]}function e$(_,$,b){let Z=_0(_),z=Math.max(0,$-Z),A=" ".repeat(z),J=_+A;return b(J)}function R0(_,$,b="...",Z=!1){let z=_0(_);if(z<=$)return Z?_+" ".repeat($-z):_;let A=_0(b),J=$-A;if(J<=0)return b.substring(0,$);let U=0,G=[];while(U<_.length){let K=w_(_,U);if(K)G.push({type:"ansi",value:K.code}),U+=K.length;else{let v=U;while(v<_.length){if(w_(_,v))break;v++}let D=_.slice(U,v);for(let w of m9.segment(D))G.push({type:"grapheme",value:w.segment});U=v}}let Y="",X=0;for(let K of G){if(K.type==="ansi"){Y+=K.value;continue}let v=K.value;if(!v)continue;let D=_0(v);if(X+D>J)break;Y+=v,X+=D}let Q=`${Y}\x1B[0m${b}`;if(Z){let K=_0(Q);return Q+" ".repeat(Math.max(0,$-K))}return Q}function IJ(_,$,b,Z=!1){return MJ(_,$,b,Z).text}function MJ(_,$,b,Z=!1){if(b<=0)return{text:"",width:0};let z=$+b,A="",J=0,U=0,G=0,Y="";while(G<_.length){let X=w_(_,G);if(X){if(U>=$&&U<z)A+=X.code;else if(U<$)Y+=X.code;G+=X.length;continue}let Q=G;while(Q<_.length&&!w_(_,Q))Q++;for(let{segment:K}of m9.segment(_.slice(G,Q))){let v=NJ(K),D=U>=$&&U<z,w=!Z||U+v<=z;if(D&&w){if(Y)A+=Y,Y="";A+=K,J+=v}if(U+=v,U>=z)break}if(G=Q,U>=z)break}return{text:A,width:J}}var xJ=new I6;function BQ(_,$,b,Z,z=!1){let A="",J=0,U="",G=0,Y=0,X=0,Q="",K=!1,v=b+Z;xJ.clear();while(X<_.length){let D=w_(_,X);if(D){if(xJ.process(D.code),Y<$)Q+=D.code;else if(Y>=b&&Y<v&&K)U+=D.code;X+=D.length;continue}let w=X;while(w<_.length&&!w_(_,w))w++;for(let{segment:P}of m9.segment(_.slice(X,w))){let E=NJ(P);if(Y<$){if(Q)A+=Q,Q="";A+=P,J+=E}else if(Y>=b&&Y<v){if(!z||Y+E<=v){if(!K)U+=xJ.getActiveCodes(),K=!0;U+=P,G+=E}}if(Y+=E,Z<=0?Y>=$:Y>=v)break}if(X=w,Z<=0?Y>=$:Y>=v)break}return{before:A,beforeWidth:J,after:U,afterWidth:G}}var A4=!1;function t$(_){A4=_}var NQ=new Set(["`","-","=","[","]","\\",";","'",",",".","/","!","@","#","$","%","^","&","*","(",")","_","+","|","~","{","}",":","<",">","?"]),z0={shift:1,alt:2,ctrl:4},EJ=192,w0={escape:27,tab:9,enter:13,space:32,backspace:127,kpEnter:57414},e0={up:-1,down:-2,right:-3,left:-4},B0={delete:-10,insert:-11,pageUp:-12,pageDown:-13,home:-14,end:-15},F_={up:["\x1B[A","\x1BOA"],down:["\x1B[B","\x1BOB"],right:["\x1B[C","\x1BOC"],left:["\x1B[D","\x1BOD"],home:["\x1B[H","\x1BOH","\x1B[1~","\x1B[7~"],end:["\x1B[F","\x1BOF","\x1B[4~","\x1B[8~"],insert:["\x1B[2~"],delete:["\x1B[3~"],pageUp:["\x1B[5~","\x1B[[5~"],pageDown:["\x1B[6~","\x1B[[6~"],clear:["\x1B[E","\x1BOE"],f1:["\x1BOP","\x1B[11~","\x1B[[A"],f2:["\x1BOQ","\x1B[12~","\x1B[[B"],f3:["\x1BOR","\x1B[13~","\x1B[[C"],f4:["\x1BOS","\x1B[14~","\x1B[[D"],f5:["\x1B[15~","\x1B[[E"],f6:["\x1B[17~"],f7:["\x1B[18~"],f8:["\x1B[19~"],f9:["\x1B[20~"],f10:["\x1B[21~"],f11:["\x1B[23~"],f12:["\x1B[24~"]},IB={up:["\x1B[a"],down:["\x1B[b"],right:["\x1B[c"],left:["\x1B[d"],clear:["\x1B[e"],insert:["\x1B[2$"],delete:["\x1B[3$"],pageUp:["\x1B[5$"],pageDown:["\x1B[6$"],home:["\x1B[7$"],end:["\x1B[8$"]},MB={up:["\x1BOa"],down:["\x1BOb"],right:["\x1BOc"],left:["\x1BOd"],clear:["\x1BOe"],insert:["\x1B[2^"],delete:["\x1B[3^"],pageUp:["\x1B[5^"],pageDown:["\x1B[6^"],home:["\x1B[7^"],end:["\x1B[8^"]};var t0=(_,$)=>$.includes(_),A_=(_,$,b)=>{if(b===z0.shift)return t0(_,IB[$]);if(b===z0.ctrl)return t0(_,MB[$]);return!1},M6="press";function OJ(_){if(_.includes("\x1B[200~"))return!1;if(_.includes(":3u")||_.includes(":3~")||_.includes(":3A")||_.includes(":3B")||_.includes(":3C")||_.includes(":3D")||_.includes(":3H")||_.includes(":3F"))return!0;return!1}function E6(_){if(!_)return"press";let $=parseInt(_,10);if($===2)return"repeat";if($===3)return"release";return"press"}function EB(_){let $=_.match(/^\x1b\[(\d+)(?::(\d*))?(?::(\d+))?(?:;(\d+))?(?::(\d+))?u$/);if($){let A=parseInt($[1],10),J=$[2]&&$[2].length>0?parseInt($[2],10):void 0,U=$[3]?parseInt($[3],10):void 0,G=$[4]?parseInt($[4],10):1,Y=E6($[5]);return M6=Y,{codepoint:A,shiftedKey:J,baseLayoutKey:U,modifier:G-1,eventType:Y}}let b=_.match(/^\x1b\[1;(\d+)(?::(\d+))?([ABCD])$/);if(b){let A=parseInt(b[1],10),J=E6(b[2]),U={A:-1,B:-2,C:-3,D:-4};return M6=J,{codepoint:U[b[3]],modifier:A-1,eventType:J}}let Z=_.match(/^\x1b\[(\d+)(?:;(\d+))?(?::(\d+))?~$/);if(Z){let A=parseInt(Z[1],10),J=Z[2]?parseInt(Z[2],10):1,U=E6(Z[3]),Y={2:B0.insert,3:B0.delete,5:B0.pageUp,6:B0.pageDown,7:B0.home,8:B0.end}[A];if(Y!==void 0)return M6=U,{codepoint:Y,modifier:J-1,eventType:U}}let z=_.match(/^\x1b\[1;(\d+)(?::(\d+))?([HF])$/);if(z){let A=parseInt(z[1],10),J=E6(z[2]),U=z[3]==="H"?B0.home:B0.end;return M6=J,{codepoint:U,modifier:A-1,eventType:J}}return null}function d(_,$,b){let Z=EB(_);if(!Z)return!1;let z=Z.modifier&~EJ,A=b&~EJ;if(z!==A)return!1;if(Z.codepoint===$)return!0;if(Z.baseLayoutKey!==void 0&&Z.baseLayoutKey===$){let J=Z.codepoint,U=J>=97&&J<=122,G=NQ.has(String.fromCharCode(J));if(!U&&!G)return!0}return!1}function OB(_){let $=_.match(/^\x1b\[27;(\d+);(\d+)~$/);if(!$)return null;let b=parseInt($[1],10);return{codepoint:parseInt($[2],10),modifier:b-1}}function P6(_,$,b){let Z=OB(_);if(!Z)return!1;return Z.codepoint===$&&Z.modifier===b}function PB(_){let $=_.toLowerCase(),b=$.charCodeAt(0);if(b>=97&&b<=122||$==="["||$==="\\"||$==="]"||$==="_")return String.fromCharCode(b&31);if($==="-")return String.fromCharCode(31);return null}function xQ(_){return _>="0"&&_<="9"}function O6(_,$,b){if(b===0)return!1;return P6(_,$,b)}function jB(_){let $=_.toLowerCase().split("+"),b=$[$.length-1];if(!b)return null;return{key:b,ctrl:$.includes("ctrl"),shift:$.includes("shift"),alt:$.includes("alt")}}function f_(_,$){let b=jB($);if(!b)return!1;let{key:Z,ctrl:z,shift:A,alt:J}=b,U=0;if(A)U|=z0.shift;if(J)U|=z0.alt;if(z)U|=z0.ctrl;switch(Z){case"escape":case"esc":if(U!==0)return!1;return _==="\x1B"||d(_,w0.escape,0);case"space":if(!A4){if(z&&!J&&!A&&_==="\x00")return!0;if(J&&!z&&!A&&_==="\x1B ")return!0}if(U===0)return _===" "||d(_,w0.space,0);return d(_,w0.space,U);case"tab":if(A&&!z&&!J)return _==="\x1B[Z"||d(_,w0.tab,z0.shift);if(U===0)return _==="\t"||d(_,w0.tab,0);return d(_,w0.tab,U);case"enter":case"return":if(A&&!z&&!J){if(d(_,w0.enter,z0.shift)||d(_,w0.kpEnter,z0.shift))return!0;if(P6(_,w0.enter,z0.shift))return!0;if(A4)return _==="\x1B\r"||_===`
124
+ `;return!1}if(J&&!z&&!A){if(d(_,w0.enter,z0.alt)||d(_,w0.kpEnter,z0.alt))return!0;if(P6(_,w0.enter,z0.alt))return!0;if(!A4)return _==="\x1B\r";return!1}if(U===0)return _==="\r"||!A4&&_===`
125
+ `||_==="\x1BOM"||d(_,w0.enter,0)||d(_,w0.kpEnter,0);return d(_,w0.enter,U)||d(_,w0.kpEnter,U)||P6(_,w0.enter,U);case"backspace":if(J&&!z&&!A){if(_==="\x1B"||_==="\x1B\b")return!0;return d(_,w0.backspace,z0.alt)}if(U===0)return _===""||_==="\b"||d(_,w0.backspace,0);return d(_,w0.backspace,U);case"insert":if(U===0)return t0(_,F_.insert)||d(_,B0.insert,0);if(A_(_,"insert",U))return!0;return d(_,B0.insert,U);case"delete":if(U===0)return t0(_,F_.delete)||d(_,B0.delete,0);if(A_(_,"delete",U))return!0;return d(_,B0.delete,U);case"clear":if(U===0)return t0(_,F_.clear);return A_(_,"clear",U);case"home":if(U===0)return t0(_,F_.home)||d(_,B0.home,0);if(A_(_,"home",U))return!0;return d(_,B0.home,U);case"end":if(U===0)return t0(_,F_.end)||d(_,B0.end,0);if(A_(_,"end",U))return!0;return d(_,B0.end,U);case"pageup":if(U===0)return t0(_,F_.pageUp)||d(_,B0.pageUp,0);if(A_(_,"pageUp",U))return!0;return d(_,B0.pageUp,U);case"pagedown":if(U===0)return t0(_,F_.pageDown)||d(_,B0.pageDown,0);if(A_(_,"pageDown",U))return!0;return d(_,B0.pageDown,U);case"up":if(J&&!z&&!A)return _==="\x1Bp"||d(_,e0.up,z0.alt);if(U===0)return t0(_,F_.up)||d(_,e0.up,0);if(A_(_,"up",U))return!0;return d(_,e0.up,U);case"down":if(J&&!z&&!A)return _==="\x1Bn"||d(_,e0.down,z0.alt);if(U===0)return t0(_,F_.down)||d(_,e0.down,0);if(A_(_,"down",U))return!0;return d(_,e0.down,U);case"left":if(J&&!z&&!A)return _==="\x1B[1;3D"||!A4&&_==="\x1BB"||_==="\x1Bb"||d(_,e0.left,z0.alt);if(z&&!J&&!A)return _==="\x1B[1;5D"||A_(_,"left",z0.ctrl)||d(_,e0.left,z0.ctrl);if(U===0)return t0(_,F_.left)||d(_,e0.left,0);if(A_(_,"left",U))return!0;return d(_,e0.left,U);case"right":if(J&&!z&&!A)return _==="\x1B[1;3C"||!A4&&_==="\x1BF"||_==="\x1Bf"||d(_,e0.right,z0.alt);if(z&&!J&&!A)return _==="\x1B[1;5C"||A_(_,"right",z0.ctrl)||d(_,e0.right,z0.ctrl);if(U===0)return t0(_,F_.right)||d(_,e0.right,0);if(A_(_,"right",U))return!0;return d(_,e0.right,U);case"f1":case"f2":case"f3":case"f4":case"f5":case"f6":case"f7":case"f8":case"f9":case"f10":case"f11":case"f12":{if(U!==0)return!1;return t0(_,F_[Z])}}if(Z.length===1&&(Z>="a"&&Z<="z"||xQ(Z)||NQ.has(Z))){let G=Z.charCodeAt(0),Y=PB(Z),X=Z>="a"&&Z<="z",Q=xQ(Z);if(z&&J&&!A&&!A4&&Y)return _===`\x1B${Y}`;if(J&&!z&&!A&&!A4&&(X||Q)){if(_===`\x1B${Z}`)return!0}if(z&&!A&&!J){if(Y&&_===Y)return!0;return d(_,G,z0.ctrl)||O6(_,G,z0.ctrl)}if(z&&A&&!J)return d(_,G,z0.shift+z0.ctrl)||O6(_,G,z0.shift+z0.ctrl);if(A&&!z&&!J){if(X&&_===Z.toUpperCase())return!0;return d(_,G,z0.shift)||O6(_,G,z0.shift)}if(U!==0)return d(_,G,U)||O6(_,G,U);return _===Z||d(_,G,0)}return!1}var SB=/^\x1b\[(\d+)(?::(\d*))?(?::(\d+))?(?:;(\d+))?(?::(\d+))?u$/,RB=z0.shift|EJ;function s$(_){let $=_.match(SB);if(!$)return;let b=Number.parseInt($[1]??"",10);if(!Number.isFinite(b))return;let Z=$[2]&&$[2].length>0?Number.parseInt($[2],10):void 0,z=$[4]?Number.parseInt($[4],10):1,A=Number.isFinite(z)?z-1:0;if((A&~RB)!==0)return;if(A&(z0.alt|z0.ctrl))return;let J=b;if(A&z0.shift&&typeof Z==="number")J=Z;if(!Number.isFinite(J)||J<32)return;try{return String.fromCodePoint(J)}catch{return}}var IQ={cursorUp:"up",cursorDown:"down",cursorLeft:["left","ctrl+b"],cursorRight:["right","ctrl+f"],cursorWordLeft:["alt+left","ctrl+left","alt+b"],cursorWordRight:["alt+right","ctrl+right","alt+f"],cursorLineStart:["home","ctrl+a"],cursorLineEnd:["end","ctrl+e"],jumpForward:"ctrl+]",jumpBackward:"ctrl+alt+]",pageUp:"pageUp",pageDown:"pageDown",deleteCharBackward:"backspace",deleteCharForward:["delete","ctrl+d"],deleteWordBackward:["ctrl+w","alt+backspace"],deleteWordForward:["alt+d","alt+delete"],deleteToLineStart:"ctrl+u",deleteToLineEnd:"ctrl+k",newLine:"shift+enter",submit:"enter",tab:"tab",selectUp:"up",selectDown:"down",selectPageUp:"pageUp",selectPageDown:"pageDown",selectConfirm:"enter",selectCancel:["escape","ctrl+c"],copy:"ctrl+c",yank:"ctrl+y",yankPop:"alt+y",undo:"ctrl+-",expandTools:"ctrl+o",treeFoldOrUp:["ctrl+left","alt+left"],treeUnfoldOrDown:["ctrl+right","alt+right"],toggleSessionPath:"ctrl+p",toggleSessionSort:"ctrl+s",renameSession:"ctrl+r",deleteSession:"ctrl+d",deleteSessionNoninvasive:"ctrl+backspace"};class jJ{actionToKeys;constructor(_={}){this.actionToKeys=new Map,this.buildMaps(_)}buildMaps(_){this.actionToKeys.clear();for(let[$,b]of Object.entries(IQ)){let Z=Array.isArray(b)?b:[b];this.actionToKeys.set($,[...Z])}for(let[$,b]of Object.entries(_)){if(b===void 0)continue;let Z=Array.isArray(b)?b:[b];this.actionToKeys.set($,Z)}}matches(_,$){let b=this.actionToKeys.get($);if(!b)return!1;for(let Z of b)if(f_(_,Z))return!0;return!1}getKeys(_){return this.actionToKeys.get(_)??[]}setConfig(_){this.buildMaps(_)}}var PJ=null;function m_(){if(!PJ)PJ=new jJ;return PJ}class u9{text;paddingX;paddingY;customBgFn;cachedText;cachedWidth;cachedLines;constructor(_="",$=1,b=1,Z){this.text=_,this.paddingX=$,this.paddingY=b,this.customBgFn=Z}setText(_){this.text=_,this.cachedText=void 0,this.cachedWidth=void 0,this.cachedLines=void 0}setCustomBgFn(_){this.customBgFn=_,this.cachedText=void 0,this.cachedWidth=void 0,this.cachedLines=void 0}invalidate(){this.cachedText=void 0,this.cachedWidth=void 0,this.cachedLines=void 0}render(_){if(this.cachedLines&&this.cachedText===this.text&&this.cachedWidth===_)return this.cachedLines;if(!this.text||this.text.trim()===""){let X=[];return this.cachedText=this.text,this.cachedWidth=_,this.cachedLines=X,X}let $=this.text.replace(/\t/g," "),b=Math.max(1,_-this.paddingX*2),Z=a$($,b),z=" ".repeat(this.paddingX),A=" ".repeat(this.paddingX),J=[];for(let X of Z){let Q=z+X+A;if(this.customBgFn)J.push(e$(Q,_,this.customBgFn));else{let K=_0(Q),v=Math.max(0,_-K);J.push(Q+" ".repeat(v))}}let U=" ".repeat(_),G=[];for(let X=0;X<this.paddingY;X++){let Q=this.customBgFn?e$(U,_,this.customBgFn):U;G.push(Q)}let Y=[...G,...J,...G];return this.cachedText=this.text,this.cachedWidth=_,this.cachedLines=Y,Y.length>0?Y:[""]}}class j6 extends u9{spinnerColorFn;messageColorFn;message;frames=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];currentFrame=0;intervalId=null;ui=null;constructor(_,$,b,Z="Loading..."){super("",1,0);this.spinnerColorFn=$,this.messageColorFn=b,this.message=Z,this.ui=_,this.start()}render(_){return["",...super.render(_)]}start(){this.updateDisplay(),this.intervalId=setInterval(()=>{this.currentFrame=(this.currentFrame+1)%this.frames.length,this.updateDisplay()},80)}stop(){if(this.intervalId)clearInterval(this.intervalId),this.intervalId=null}setMessage(_){this.message=_,this.updateDisplay()}updateDisplay(){let _=this.frames[this.currentFrame];if(this.setText(`${this.spinnerColorFn(_)} ${this.messageColorFn(this.message)}`),this.ui)this.ui.requestRender()}}class MQ extends j6{abortController=new AbortController;onAbort;get signal(){return this.abortController.signal}get aborted(){return this.abortController.signal.aborted}handleInput(_){if(m_().matches(_,"selectCancel"))this.abortController.abort(),this.onAbort?.()}dispose(){this.stop()}}class _2{ring=[];push(_,$){if(!_)return;if($.accumulate&&this.ring.length>0){let b=this.ring.pop();this.ring.push($.prepend?_+b:b+_)}else this.ring.push(_)}peek(){return this.ring.length>0?this.ring[this.ring.length-1]:void 0}rotate(){if(this.ring.length>1){let _=this.ring.pop();this.ring.unshift(_)}}get length(){return this.ring.length}}import*as N4 from"node:fs";import*as LJ from"node:os";import*as c9 from"node:path";var SJ=null,LB={widthPx:9,heightPx:18};function RJ(_){LB=_}function PQ(){let _=process.env.TERM_PROGRAM?.toLowerCase()||"",$=process.env.TERM?.toLowerCase()||"",b=process.env.COLORTERM?.toLowerCase()||"";if(process.env.KITTY_WINDOW_ID||_==="kitty")return{images:"kitty",trueColor:!0,hyperlinks:!0};if(_==="ghostty"||$.includes("ghostty")||process.env.GHOSTTY_RESOURCES_DIR)return{images:"kitty",trueColor:!0,hyperlinks:!0};if(process.env.WEZTERM_PANE||_==="wezterm")return{images:"kitty",trueColor:!0,hyperlinks:!0};if(process.env.ITERM_SESSION_ID||_==="iterm.app")return{images:"iterm2",trueColor:!0,hyperlinks:!0};if(_==="vscode")return{images:null,trueColor:!0,hyperlinks:!0};if(_==="alacritty")return{images:null,trueColor:!0,hyperlinks:!0};return{images:null,trueColor:b==="truecolor"||b==="24bit",hyperlinks:!0}}function S6(){if(!SJ)SJ=PQ();return SJ}var EQ="\x1B_G",OQ="\x1B]1337;File=";function $2(_){if(_.startsWith(EQ)||_.startsWith(OQ))return!0;return _.includes(EQ)||_.includes(OQ)}function TJ(_){return _!==null&&"focused"in _}var a4="\x1B_pi:c\x07";function jQ(_,$){if(_===void 0)return;if(typeof _==="number")return _;let b=_.match(/^(\d+(?:\.\d+)?)%$/);if(b)return Math.floor($*parseFloat(b[1])/100);return}class yJ{children=[];addChild(_){this.children.push(_)}removeChild(_){let $=this.children.indexOf(_);if($!==-1)this.children.splice($,1)}clear(){this.children=[]}invalidate(){for(let _ of this.children)_.invalidate?.()}render(_){let $=[];for(let b of this.children)$.push(...b.render(_));return $}}class h9 extends yJ{terminal;previousLines=[];previousWidth=0;previousHeight=0;focusedComponent=null;inputListeners=new Set;onDebug;renderRequested=!1;cursorRow=0;hardwareCursorRow=0;inputBuffer="";cellSizeQueryPending=!1;showHardwareCursor=process.env.PI_HARDWARE_CURSOR==="1";clearOnShrink=process.env.PI_CLEAR_ON_SHRINK==="1";maxLinesRendered=0;previousViewportTop=0;fullRedrawCount=0;stopped=!1;focusOrderCounter=0;overlayStack=[];constructor(_,$){super();if(this.terminal=_,$!==void 0)this.showHardwareCursor=$}get fullRedraws(){return this.fullRedrawCount}getShowHardwareCursor(){return this.showHardwareCursor}setShowHardwareCursor(_){if(this.showHardwareCursor===_)return;if(this.showHardwareCursor=_,!_)this.terminal.hideCursor();this.requestRender()}getClearOnShrink(){return this.clearOnShrink}setClearOnShrink(_){this.clearOnShrink=_}setFocus(_){if(TJ(this.focusedComponent))this.focusedComponent.focused=!1;if(this.focusedComponent=_,TJ(_))_.focused=!0}showOverlay(_,$){let b={component:_,options:$,preFocus:this.focusedComponent,hidden:!1,focusOrder:++this.focusOrderCounter};if(this.overlayStack.push(b),!$?.nonCapturing&&this.isOverlayVisible(b))this.setFocus(_);return this.terminal.hideCursor(),this.requestRender(),{hide:()=>{let Z=this.overlayStack.indexOf(b);if(Z!==-1){if(this.overlayStack.splice(Z,1),this.focusedComponent===_){let z=this.getTopmostVisibleOverlay();this.setFocus(z?.component??b.preFocus)}if(this.overlayStack.length===0)this.terminal.hideCursor();this.requestRender()}},setHidden:(Z)=>{if(b.hidden===Z)return;if(b.hidden=Z,Z){if(this.focusedComponent===_){let z=this.getTopmostVisibleOverlay();this.setFocus(z?.component??b.preFocus)}}else if(!$?.nonCapturing&&this.isOverlayVisible(b))b.focusOrder=++this.focusOrderCounter,this.setFocus(_);this.requestRender()},isHidden:()=>b.hidden,focus:()=>{if(!this.overlayStack.includes(b)||!this.isOverlayVisible(b))return;if(this.focusedComponent!==_)this.setFocus(_);b.focusOrder=++this.focusOrderCounter,this.requestRender()},unfocus:()=>{if(this.focusedComponent!==_)return;let Z=this.getTopmostVisibleOverlay();this.setFocus(Z&&Z!==b?Z.component:b.preFocus),this.requestRender()},isFocused:()=>this.focusedComponent===_}}hideOverlay(){let _=this.overlayStack.pop();if(!_)return;if(this.focusedComponent===_.component){let $=this.getTopmostVisibleOverlay();this.setFocus($?.component??_.preFocus)}if(this.overlayStack.length===0)this.terminal.hideCursor();this.requestRender()}hasOverlay(){return this.overlayStack.some((_)=>this.isOverlayVisible(_))}isOverlayVisible(_){if(_.hidden)return!1;if(_.options?.visible)return _.options.visible(this.terminal.columns,this.terminal.rows);return!0}getTopmostVisibleOverlay(){for(let _=this.overlayStack.length-1;_>=0;_--){if(this.overlayStack[_].options?.nonCapturing)continue;if(this.isOverlayVisible(this.overlayStack[_]))return this.overlayStack[_]}return}invalidate(){super.invalidate();for(let _ of this.overlayStack)_.component.invalidate?.()}start(){this.stopped=!1,this.terminal.start((_)=>this.handleInput(_),()=>this.requestRender()),this.terminal.hideCursor(),this.queryCellSize(),this.requestRender()}addInputListener(_){return this.inputListeners.add(_),()=>{this.inputListeners.delete(_)}}removeInputListener(_){this.inputListeners.delete(_)}queryCellSize(){if(!S6().images)return;this.cellSizeQueryPending=!0,this.terminal.write("\x1B[16t")}stop(){if(this.stopped=!0,this.previousLines.length>0){let $=this.previousLines.length-this.hardwareCursorRow;if($>0)this.terminal.write(`\x1B[${$}B`);else if($<0)this.terminal.write(`\x1B[${-$}A`);this.terminal.write(`\r
126
+ `)}this.terminal.showCursor(),this.terminal.stop()}requestRender(_=!1){if(_)this.previousLines=[],this.previousWidth=-1,this.previousHeight=-1,this.cursorRow=0,this.hardwareCursorRow=0,this.maxLinesRendered=0,this.previousViewportTop=0;if(this.renderRequested)return;this.renderRequested=!0,process.nextTick(()=>{this.renderRequested=!1,this.doRender()})}handleInput(_){if(this.inputListeners.size>0){let b=_;for(let Z of this.inputListeners){let z=Z(b);if(z?.consume)return;if(z?.data!==void 0)b=z.data}if(b.length===0)return;_=b}if(this.cellSizeQueryPending){this.inputBuffer+=_;let b=this.parseCellSizeResponse();if(b.length===0)return;_=b}if(f_(_,"shift+ctrl+d")&&this.onDebug){this.onDebug();return}let $=this.overlayStack.find((b)=>b.component===this.focusedComponent);if($&&!this.isOverlayVisible($)){let b=this.getTopmostVisibleOverlay();if(b)this.setFocus(b.component);else this.setFocus($.preFocus)}if(this.focusedComponent?.handleInput){if(OJ(_)&&!this.focusedComponent.wantsKeyRelease)return;this.focusedComponent.handleInput(_),this.requestRender()}}parseCellSizeResponse(){let _=/\x1b\[6;(\d+);(\d+)t/,$=this.inputBuffer.match(_);if($){let z=parseInt($[1],10),A=parseInt($[2],10);if(z>0&&A>0)RJ({widthPx:A,heightPx:z}),this.invalidate(),this.requestRender();this.inputBuffer=this.inputBuffer.replace(_,""),this.cellSizeQueryPending=!1}if(/\x1b(\[6?;?[\d;]*)?$/.test(this.inputBuffer)){let z=this.inputBuffer[this.inputBuffer.length-1];if(!/[a-zA-Z~]/.test(z))return""}let Z=this.inputBuffer;return this.inputBuffer="",this.cellSizeQueryPending=!1,Z}resolveOverlayLayout(_,$,b,Z){let z=_??{},A=typeof z.margin==="number"?{top:z.margin,right:z.margin,bottom:z.margin,left:z.margin}:z.margin??{},J=Math.max(0,A.top??0),U=Math.max(0,A.right??0),G=Math.max(0,A.bottom??0),Y=Math.max(0,A.left??0),X=Math.max(1,b-Y-U),Q=Math.max(1,Z-J-G),K=jQ(z.width,b)??Math.min(80,X);if(z.minWidth!==void 0)K=Math.max(K,z.minWidth);K=Math.max(1,Math.min(K,X));let v=jQ(z.maxHeight,Z);if(v!==void 0)v=Math.max(1,Math.min(v,Q));let D=v!==void 0?Math.min($,v):$,w,P;if(z.row!==void 0)if(typeof z.row==="string"){let E=z.row.match(/^(\d+(?:\.\d+)?)%$/);if(E){let B=Math.max(0,Q-D),C=parseFloat(E[1])/100;w=J+Math.floor(B*C)}else w=this.resolveAnchorRow("center",D,Q,J)}else w=z.row;else{let E=z.anchor??"center";w=this.resolveAnchorRow(E,D,Q,J)}if(z.col!==void 0)if(typeof z.col==="string"){let E=z.col.match(/^(\d+(?:\.\d+)?)%$/);if(E){let B=Math.max(0,X-K),C=parseFloat(E[1])/100;P=Y+Math.floor(B*C)}else P=this.resolveAnchorCol("center",K,X,Y)}else P=z.col;else{let E=z.anchor??"center";P=this.resolveAnchorCol(E,K,X,Y)}if(z.offsetY!==void 0)w+=z.offsetY;if(z.offsetX!==void 0)P+=z.offsetX;return w=Math.max(J,Math.min(w,Z-G-D)),P=Math.max(Y,Math.min(P,b-U-K)),{width:K,row:w,col:P,maxHeight:v}}resolveAnchorRow(_,$,b,Z){switch(_){case"top-left":case"top-center":case"top-right":return Z;case"bottom-left":case"bottom-center":case"bottom-right":return Z+b-$;case"left-center":case"center":case"right-center":return Z+Math.floor((b-$)/2)}}resolveAnchorCol(_,$,b,Z){switch(_){case"top-left":case"left-center":case"bottom-left":return Z;case"top-right":case"right-center":case"bottom-right":return Z+b-$;case"top-center":case"center":case"bottom-center":return Z+Math.floor((b-$)/2)}}compositeOverlays(_,$,b){if(this.overlayStack.length===0)return _;let Z=[..._],z=[],A=Z.length,J=this.overlayStack.filter((Y)=>this.isOverlayVisible(Y));J.sort((Y,X)=>Y.focusOrder-X.focusOrder);for(let Y of J){let{component:X,options:Q}=Y,{width:K,maxHeight:v}=this.resolveOverlayLayout(Q,0,$,b),D=X.render(K);if(v!==void 0&&D.length>v)D=D.slice(0,v);let{row:w,col:P}=this.resolveOverlayLayout(Q,D.length,$,b);z.push({overlayLines:D,row:w,col:P,w:K}),A=Math.max(A,w+D.length)}let U=Math.max(this.maxLinesRendered,A);while(Z.length<U)Z.push("");let G=Math.max(0,U-b);for(let{overlayLines:Y,row:X,col:Q,w:K}of z)for(let v=0;v<Y.length;v++){let D=G+X+v;if(D>=0&&D<Z.length){let w=_0(Y[v])>K?IJ(Y[v],0,K,!0):Y[v];Z[D]=this.compositeLineAt(Z[D],w,Q,K,$)}}return Z}static SEGMENT_RESET="\x1B[0m\x1B]8;;\x07";applyLineResets(_){let $=h9.SEGMENT_RESET;for(let b=0;b<_.length;b++){let Z=_[b];if(!$2(Z))_[b]=Z+$}return _}compositeLineAt(_,$,b,Z,z){if($2(_))return _;let A=b+Z,J=BQ(_,b,A,z-A,!0),U=MJ($,0,Z,!0),G=Math.max(0,b-J.beforeWidth),Y=Math.max(0,Z-U.width),X=Math.max(b,J.beforeWidth),Q=Math.max(Z,U.width),K=Math.max(0,z-X-Q),v=Math.max(0,K-J.afterWidth),D=h9.SEGMENT_RESET,w=J.before+" ".repeat(G)+D+U.text+" ".repeat(Y)+D+J.after+" ".repeat(v);if(_0(w)<=z)return w;return IJ(w,0,z,!0)}extractCursorPosition(_,$){let b=Math.max(0,_.length-$);for(let Z=_.length-1;Z>=b;Z--){let z=_[Z],A=z.indexOf(a4);if(A!==-1){let J=z.slice(0,A),U=_0(J);return _[Z]=z.slice(0,A)+z.slice(A+a4.length),{row:Z,col:U}}}return null}doRender(){if(this.stopped)return;let _=this.terminal.columns,$=this.terminal.rows,b=Math.max(0,this.maxLinesRendered-$),Z=this.previousViewportTop,z=this.hardwareCursorRow,A=(H)=>{let q=z-Z;return H-b-q},J=this.render(_);if(this.overlayStack.length>0)J=this.compositeOverlays(J,_,$);let U=this.extractCursorPosition(J,$);J=this.applyLineResets(J);let G=this.previousWidth!==0&&this.previousWidth!==_,Y=this.previousHeight!==0&&this.previousHeight!==$,X=(H)=>{this.fullRedrawCount+=1;let q="\x1B[?2026h";if(H)q+="\x1B[3J\x1B[2J\x1B[H";for(let W=0;W<J.length;W++){if(W>0)q+=`\r
127
+ `;q+=J[W]}if(q+="\x1B[?2026l",this.terminal.write(q),this.cursorRow=Math.max(0,J.length-1),this.hardwareCursorRow=this.cursorRow,H)this.maxLinesRendered=J.length;else this.maxLinesRendered=Math.max(this.maxLinesRendered,J.length);this.previousViewportTop=Math.max(0,this.maxLinesRendered-$),this.positionHardwareCursor(U,J.length),this.previousLines=J,this.previousWidth=_,this.previousHeight=$},Q=process.env.PI_DEBUG_REDRAW==="1",K=(H)=>{if(!Q)return;let q=c9.join(LJ.homedir(),".pi","agent","pi-debug.log"),W=`[${new Date().toISOString()}] fullRender: ${H} (prev=${this.previousLines.length}, new=${J.length}, height=${$})
128
+ `;N4.appendFileSync(q,W)};if(this.previousLines.length===0&&!G&&!Y){K("first render"),X(!1);return}if(G||Y){K(`terminal size changed (${this.previousWidth}x${this.previousHeight} -> ${_}x${$})`),X(!0);return}if(this.clearOnShrink&&J.length<this.maxLinesRendered&&this.overlayStack.length===0){K(`clearOnShrink (maxLinesRendered=${this.maxLinesRendered})`),X(!0);return}let v=-1,D=-1,w=Math.max(J.length,this.previousLines.length);for(let H=0;H<w;H++){let q=H<this.previousLines.length?this.previousLines[H]:"",W=H<J.length?J[H]:"";if(q!==W){if(v===-1)v=H;D=H}}let P=J.length>this.previousLines.length;if(P){if(v===-1)v=this.previousLines.length;D=J.length-1}let E=P&&v===this.previousLines.length&&v>0;if(v===-1){this.positionHardwareCursor(U,J.length),this.previousViewportTop=Math.max(0,this.maxLinesRendered-$),this.previousHeight=$;return}if(v>=J.length){if(this.previousLines.length>J.length){let H="\x1B[?2026h",q=Math.max(0,J.length-1),W=A(q);if(W>0)H+=`\x1B[${W}B`;else if(W<0)H+=`\x1B[${-W}A`;H+="\r";let V=this.previousLines.length-J.length;if(V>$){K(`extraLines > height (${V} > ${$})`),X(!0);return}if(V>0)H+="\x1B[1B";for(let k=0;k<V;k++)if(H+="\r\x1B[2K",k<V-1)H+="\x1B[1B";if(V>0)H+=`\x1B[${V}A`;H+="\x1B[?2026l",this.terminal.write(H),this.cursorRow=q,this.hardwareCursorRow=q}this.positionHardwareCursor(U,J.length),this.previousLines=J,this.previousWidth=_,this.previousHeight=$,this.previousViewportTop=Math.max(0,this.maxLinesRendered-$);return}let B=Math.max(0,this.previousLines.length-$);if(v<B){K(`firstChanged < viewportTop (${v} < ${B})`),X(!0);return}let C="\x1B[?2026h",f=Z+$-1,u=E?v-1:v;if(u>f){let H=Math.max(0,Math.min($-1,z-Z)),q=$-1-H;if(q>0)C+=`\x1B[${q}B`;let W=u-f;C+=`\r
129
+ `.repeat(W),Z+=W,b+=W,z=u}let O=A(u);if(O>0)C+=`\x1B[${O}B`;else if(O<0)C+=`\x1B[${-O}A`;C+=E?`\r
130
+ `:"\r";let T=Math.min(D,J.length-1);for(let H=v;H<=T;H++){if(H>v)C+=`\r
131
+ `;C+="\x1B[2K";let q=J[H];if(!$2(q)&&_0(q)>_){let V=c9.join(LJ.homedir(),".pi","agent","pi-crash.log"),k=[`Crash at ${new Date().toISOString()}`,`Terminal width: ${_}`,`Line ${H} visible width: ${_0(q)}`,"","=== All rendered lines ===",...J.map((g,x)=>`[${x}] (w=${_0(g)}) ${g}`),""].join(`
132
+ `);N4.mkdirSync(c9.dirname(V),{recursive:!0}),N4.writeFileSync(V,k),this.stop();let N=[`Rendered line ${H} exceeds terminal width (${_0(q)} > ${_}).`,"","This is likely caused by a custom TUI component not truncating its output.","Use visibleWidth() to measure and truncateToWidth() to truncate lines.","",`Debug log written to: ${V}`].join(`
133
+ `);throw Error(N)}C+=q}let F=T;if(this.previousLines.length>J.length){if(T<J.length-1){let q=J.length-1-T;C+=`\x1B[${q}B`,F=J.length-1}let H=this.previousLines.length-J.length;for(let q=J.length;q<this.previousLines.length;q++)C+=`\r
134
+ \x1B[2K`;C+=`\x1B[${H}A`}if(C+="\x1B[?2026l",process.env.PI_TUI_DEBUG==="1"){N4.mkdirSync("/tmp/tui",{recursive:!0});let q=c9.join("/tmp/tui",`render-${Date.now()}-${Math.random().toString(36).slice(2)}.log`),W=[`firstChanged: ${v}`,`viewportTop: ${b}`,`cursorRow: ${this.cursorRow}`,`height: ${$}`,`lineDiff: ${O}`,`hardwareCursorRow: ${z}`,`renderEnd: ${T}`,`finalCursorRow: ${F}`,`cursorPos: ${JSON.stringify(U)}`,`newLines.length: ${J.length}`,`previousLines.length: ${this.previousLines.length}`,"","=== newLines ===",JSON.stringify(J,null,2),"","=== previousLines ===",JSON.stringify(this.previousLines,null,2),"","=== buffer ===",JSON.stringify(C)].join(`
135
+ `);N4.writeFileSync(q,W)}this.terminal.write(C),this.cursorRow=Math.max(0,J.length-1),this.hardwareCursorRow=F,this.maxLinesRendered=Math.max(this.maxLinesRendered,J.length),this.previousViewportTop=Math.max(0,this.maxLinesRendered-$),this.positionHardwareCursor(U,J.length),this.previousLines=J,this.previousWidth=_,this.previousHeight=$}positionHardwareCursor(_,$){if(!_||$<=0){this.terminal.hideCursor();return}let b=Math.max(0,Math.min(_.row,$-1)),Z=Math.max(0,_.col),z=b-this.hardwareCursorRow,A="";if(z>0)A+=`\x1B[${z}B`;else if(z<0)A+=`\x1B[${-z}A`;if(A+=`\x1B[${Z+1}G`,A)this.terminal.write(A);if(this.hardwareCursorRow=b,this.showHardwareCursor)this.terminal.showCursor();else this.terminal.hideCursor()}}class z2{stack=[];push(_){this.stack.push(structuredClone(_))}pop(){return this.stack.pop()}clear(){this.stack.length=0}get length(){return this.stack.length}}var TB=(_)=>_.replace(/[\r\n]+/g," ").trim();class I4{items=[];filteredItems=[];selectedIndex=0;maxVisible=5;theme;onSelect;onCancel;onSelectionChange;constructor(_,$,b){this.items=_,this.filteredItems=_,this.maxVisible=$,this.theme=b}setFilter(_){this.filteredItems=this.items.filter(($)=>$.value.toLowerCase().startsWith(_.toLowerCase())),this.selectedIndex=0}setSelectedIndex(_){this.selectedIndex=Math.max(0,Math.min(_,this.filteredItems.length-1))}invalidate(){}render(_){let $=[];if(this.filteredItems.length===0)return $.push(this.theme.noMatch(" No matching commands")),$;let b=Math.max(0,Math.min(this.selectedIndex-Math.floor(this.maxVisible/2),this.filteredItems.length-this.maxVisible)),Z=Math.min(b+this.maxVisible,this.filteredItems.length);for(let z=b;z<Z;z++){let A=this.filteredItems[z];if(!A)continue;let J=z===this.selectedIndex,U=A.description?TB(A.description):void 0,G="";if(J){let X=A.label||A.value;if(U&&_>40){let Q=Math.min(30,_-2-4),K=R0(X,Q,""),v=" ".repeat(Math.max(1,32-K.length)),D=2+K.length+v.length,w=_-D-2;if(w>10){let P=R0(U,w,"");G=this.theme.selectedText(`→ ${K}${v}${P}`)}else{let P=_-2-2;G=this.theme.selectedText(`→ ${R0(X,P,"")}`)}}else{let Q=_-2-2;G=this.theme.selectedText(`→ ${R0(X,Q,"")}`)}}else{let Y=A.label||A.value,X=" ";if(U&&_>40){let Q=Math.min(30,_-2-4),K=R0(Y,Q,""),v=" ".repeat(Math.max(1,32-K.length)),D=2+K.length+v.length,w=_-D-2;if(w>10){let P=R0(U,w,""),E=this.theme.description(v+P);G=" "+K+E}else{let P=_-2-2;G=" "+R0(Y,P,"")}}else{let Q=_-2-2;G=" "+R0(Y,Q,"")}}$.push(G)}if(b>0||Z<this.filteredItems.length){let z=` (${this.selectedIndex+1}/${this.filteredItems.length})`;$.push(this.theme.scrollInfo(R0(z,_-2,"")))}return $}handleInput(_){let $=m_();if($.matches(_,"selectUp"))this.selectedIndex=this.selectedIndex===0?this.filteredItems.length-1:this.selectedIndex-1,this.notifySelectionChange();else if($.matches(_,"selectDown"))this.selectedIndex=this.selectedIndex===this.filteredItems.length-1?0:this.selectedIndex+1,this.notifySelectionChange();else if($.matches(_,"selectConfirm")){let b=this.filteredItems[this.selectedIndex];if(b&&this.onSelect)this.onSelect(b)}else if($.matches(_,"selectCancel")){if(this.onCancel)this.onCancel()}}notifySelectionChange(){let _=this.filteredItems[this.selectedIndex];if(_&&this.onSelectionChange)this.onSelectionChange(_)}getSelectedItem(){return this.filteredItems[this.selectedIndex]||null}}var M4=N6();function SQ(_,$){if(!_||$<=0)return[{text:"",startIndex:0,endIndex:0}];if(_0(_)<=$)return[{text:_,startIndex:0,endIndex:_.length}];let Z=[],z=[...M4.segment(_)],A=0,J=0,U=-1,G=0;for(let Y=0;Y<z.length;Y++){let X=z[Y],Q=X.segment,K=_0(Q),v=X.index,D=o0(Q);if(A+K>$){if(U>=0)Z.push({text:_.slice(J,U),startIndex:J,endIndex:U}),J=U,A-=G;else if(J<v)Z.push({text:_.slice(J,v),startIndex:J,endIndex:v}),J=v,A=0;U=-1}A+=K;let w=z[Y+1];if(D&&w&&!o0(w.segment))U=w.index,G=A}return Z.push({text:_.slice(J),startIndex:J,endIndex:_.length}),Z}class RQ{state={lines:[""],cursorLine:0,cursorCol:0};focused=!1;tui;theme;paddingX=0;lastWidth=80;scrollOffset=0;borderColor;autocompleteProvider;autocompleteList;autocompleteState=null;autocompletePrefix="";autocompleteMaxVisible=5;pastes=new Map;pasteCounter=0;pasteBuffer="";isInPaste=!1;history=[];historyIndex=-1;killRing=new _2;lastAction=null;jumpMode=null;preferredVisualCol=null;undoStack=new z2;onSubmit;onChange;disableSubmit=!1;constructor(_,$,b={}){this.tui=_,this.theme=$,this.borderColor=$.borderColor;let Z=b.paddingX??0;this.paddingX=Number.isFinite(Z)?Math.max(0,Math.floor(Z)):0;let z=b.autocompleteMaxVisible??5;this.autocompleteMaxVisible=Number.isFinite(z)?Math.max(3,Math.min(20,Math.floor(z))):5}getPaddingX(){return this.paddingX}setPaddingX(_){let $=Number.isFinite(_)?Math.max(0,Math.floor(_)):0;if(this.paddingX!==$)this.paddingX=$,this.tui.requestRender()}getAutocompleteMaxVisible(){return this.autocompleteMaxVisible}setAutocompleteMaxVisible(_){let $=Number.isFinite(_)?Math.max(3,Math.min(20,Math.floor(_))):5;if(this.autocompleteMaxVisible!==$)this.autocompleteMaxVisible=$,this.tui.requestRender()}setAutocompleteProvider(_){this.autocompleteProvider=_}addToHistory(_){let $=_.trim();if(!$)return;if(this.history.length>0&&this.history[0]===$)return;if(this.history.unshift($),this.history.length>100)this.history.pop()}isEditorEmpty(){return this.state.lines.length===1&&this.state.lines[0]===""}isOnFirstVisualLine(){let _=this.buildVisualLineMap(this.lastWidth);return this.findCurrentVisualLine(_)===0}isOnLastVisualLine(){let _=this.buildVisualLineMap(this.lastWidth);return this.findCurrentVisualLine(_)===_.length-1}navigateHistory(_){if(this.lastAction=null,this.history.length===0)return;let $=this.historyIndex-_;if($<-1||$>=this.history.length)return;if(this.historyIndex===-1&&$>=0)this.pushUndoSnapshot();if(this.historyIndex=$,this.historyIndex===-1)this.setTextInternal("");else this.setTextInternal(this.history[this.historyIndex]||"")}setTextInternal(_){let $=_.replace(/\r\n/g,`
136
136
  `).replace(/\r/g,`
137
137
  `).split(`
138
- `);if(this.state.lines=$.length===0?[""]:$,this.state.cursorLine=this.state.lines.length-1,this.setCursorCol(this.state.lines[this.state.cursorLine]?.length||0),this.scrollOffset=0,this.onChange)this.onChange(this.getText())}invalidate(){}render(_){let $=Math.max(0,Math.floor((_-1)/2)),b=Math.min(this.paddingX,$),Z=Math.max(1,_-b*2),z=Math.max(1,Z-(b?0:1));this.lastWidth=z;let A=this.borderColor("─"),J=this.layoutText(z),U=this.tui.terminal.rows,G=Math.max(5,Math.floor(U*0.3)),Y=J.findIndex((O)=>O.hasCursor);if(Y===-1)Y=0;if(Y<this.scrollOffset)this.scrollOffset=Y;else if(Y>=this.scrollOffset+G)this.scrollOffset=Y-G+1;let X=Math.max(0,J.length-G);this.scrollOffset=Math.max(0,Math.min(this.scrollOffset,X));let Q=J.slice(this.scrollOffset,this.scrollOffset+G),K=[],v=" ".repeat(b),V=v;if(this.scrollOffset>0){let O=`─── ↑ ${this.scrollOffset} more `,B=_-_0(O);K.push(this.borderColor(O+"─".repeat(Math.max(0,B))))}else K.push(A.repeat(_));let w=this.focused&&!this.autocompleteState;for(let O of Q){let B=O.text,T=_0(O.text),y=!1;if(O.hasCursor&&O.cursorPos!==void 0){let C=B.slice(0,O.cursorPos),F=B.slice(O.cursorPos),H=w?a4:"";if(F.length>0){let g=[...B4.segment(F)][0]?.segment||"",D=F.slice(g.length),W=`\x1B[7m${g}\x1B[0m`;B=C+H+W+D}else if(B=C+H+"\x1B[7m \x1B[0m",T=T+1,T>Z&&b>0)y=!0}let u=" ".repeat(Math.max(0,Z-T)),E=y?V.slice(1):V;K.push(`${v}${B}${u}${E}`)}let P=J.length-(this.scrollOffset+Q.length);if(P>0){let O=`─── ↓ ${P} more `,B=_-_0(O);K.push(this.borderColor(O+"─".repeat(Math.max(0,B))))}else K.push(A.repeat(_));if(this.autocompleteState&&this.autocompleteList){let O=this.autocompleteList.render(Z);for(let B of O){let T=_0(B),y=" ".repeat(Math.max(0,Z-T));K.push(`${v}${B}${y}${V}`)}}return K}handleInput(_){let $=f_();if(this.jumpMode!==null){if($.matches(_,"jumpForward")||$.matches(_,"jumpBackward")){this.jumpMode=null;return}if(_.charCodeAt(0)>=32){let Z=this.jumpMode;this.jumpMode=null,this.jumpToChar(_,Z);return}this.jumpMode=null}if(_.includes("\x1B[200~"))this.isInPaste=!0,this.pasteBuffer="",_=_.replace("\x1B[200~","");if(this.isInPaste){this.pasteBuffer+=_;let Z=this.pasteBuffer.indexOf("\x1B[201~");if(Z!==-1){let z=this.pasteBuffer.substring(0,Z);if(z.length>0)this.handlePaste(z);this.isInPaste=!1;let A=this.pasteBuffer.substring(Z+6);if(this.pasteBuffer="",A.length>0)this.handleInput(A);return}return}if($.matches(_,"copy"))return;if($.matches(_,"undo")){this.undo();return}if(this.autocompleteState&&this.autocompleteList){if($.matches(_,"selectCancel")){this.cancelAutocomplete();return}if($.matches(_,"selectUp")||$.matches(_,"selectDown")){this.autocompleteList.handleInput(_);return}if($.matches(_,"tab")){let Z=this.autocompleteList.getSelectedItem();if(Z&&this.autocompleteProvider){let z=this.shouldChainSlashArgumentAutocompleteOnTabSelection();this.pushUndoSnapshot(),this.lastAction=null;let A=this.autocompleteProvider.applyCompletion(this.state.lines,this.state.cursorLine,this.state.cursorCol,Z,this.autocompletePrefix);if(this.state.lines=A.lines,this.state.cursorLine=A.cursorLine,this.setCursorCol(A.cursorCol),this.cancelAutocomplete(),this.onChange)this.onChange(this.getText());if(z&&this.isBareCompletedSlashCommandAtCursor())this.tryTriggerAutocomplete()}return}if($.matches(_,"selectConfirm")){let Z=this.autocompleteList.getSelectedItem();if(Z&&this.autocompleteProvider){this.pushUndoSnapshot(),this.lastAction=null;let z=this.autocompleteProvider.applyCompletion(this.state.lines,this.state.cursorLine,this.state.cursorCol,Z,this.autocompletePrefix);if(this.state.lines=z.lines,this.state.cursorLine=z.cursorLine,this.setCursorCol(z.cursorCol),this.autocompletePrefix.startsWith("/"))this.cancelAutocomplete();else{if(this.cancelAutocomplete(),this.onChange)this.onChange(this.getText());return}}}}if($.matches(_,"tab")&&!this.autocompleteState){this.handleTabCompletion();return}if($.matches(_,"deleteToLineEnd")){this.deleteToEndOfLine();return}if($.matches(_,"deleteToLineStart")){this.deleteToStartOfLine();return}if($.matches(_,"deleteWordBackward")){this.deleteWordBackwards();return}if($.matches(_,"deleteWordForward")){this.deleteWordForward();return}if($.matches(_,"deleteCharBackward")||C_(_,"shift+backspace")){this.handleBackspace();return}if($.matches(_,"deleteCharForward")||C_(_,"shift+delete")){this.handleForwardDelete();return}if($.matches(_,"yank")){this.yank();return}if($.matches(_,"yankPop")){this.yankPop();return}if($.matches(_,"cursorLineStart")){this.moveToLineStart();return}if($.matches(_,"cursorLineEnd")){this.moveToLineEnd();return}if($.matches(_,"cursorWordLeft")){this.moveWordBackwards();return}if($.matches(_,"cursorWordRight")){this.moveWordForwards();return}if($.matches(_,"newLine")||_.charCodeAt(0)===10&&_.length>1||_==="\x1B\r"||_==="\x1B[13;2~"||_.length>1&&_.includes("\x1B")&&_.includes("\r")||_===`
139
- `&&_.length===1){if(this.shouldSubmitOnBackslashEnter(_,$)){this.handleBackspace(),this.submitValue();return}this.addNewLine();return}if($.matches(_,"submit")){if(this.disableSubmit)return;let Z=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol>0&&Z[this.state.cursorCol-1]==="\\"){this.handleBackspace(),this.addNewLine();return}this.submitValue();return}if($.matches(_,"cursorUp")){if(this.isEditorEmpty())this.navigateHistory(-1);else if(this.historyIndex>-1&&this.isOnFirstVisualLine())this.navigateHistory(-1);else if(this.isOnFirstVisualLine())this.moveToLineStart();else this.moveCursor(-1,0);return}if($.matches(_,"cursorDown")){if(this.historyIndex>-1&&this.isOnLastVisualLine())this.navigateHistory(1);else if(this.isOnLastVisualLine())this.moveToLineEnd();else this.moveCursor(1,0);return}if($.matches(_,"cursorRight")){this.moveCursor(0,1);return}if($.matches(_,"cursorLeft")){this.moveCursor(0,-1);return}if($.matches(_,"pageUp")){this.pageScroll(-1);return}if($.matches(_,"pageDown")){this.pageScroll(1);return}if($.matches(_,"jumpForward")){this.jumpMode="forward";return}if($.matches(_,"jumpBackward")){this.jumpMode="backward";return}if(C_(_,"shift+space")){this.insertCharacter(" ");return}let b=_2(_);if(b!==void 0){this.insertCharacter(b);return}if(_.charCodeAt(0)>=32)this.insertCharacter(_)}layoutText(_){let $=[];if(this.state.lines.length===0||this.state.lines.length===1&&this.state.lines[0]==="")return $.push({text:"",hasCursor:!0,cursorPos:0}),$;for(let b=0;b<this.state.lines.length;b++){let Z=this.state.lines[b]||"",z=b===this.state.cursorLine;if(_0(Z)<=_)if(z)$.push({text:Z,hasCursor:!0,cursorPos:this.state.cursorCol});else $.push({text:Z,hasCursor:!1});else{let J=MQ(Z,_);for(let U=0;U<J.length;U++){let G=J[U];if(!G)continue;let Y=this.state.cursorCol,X=U===J.length-1,Q=!1,K=0;if(z){if(X)Q=Y>=G.startIndex,K=Y-G.startIndex;else if(Q=Y>=G.startIndex&&Y<G.endIndex,Q){if(K=Y-G.startIndex,K>G.text.length)K=G.text.length}}if(Q)$.push({text:G.text,hasCursor:!0,cursorPos:K});else $.push({text:G.text,hasCursor:!1})}}}return $}getText(){return this.state.lines.join(`
138
+ `);if(this.state.lines=$.length===0?[""]:$,this.state.cursorLine=this.state.lines.length-1,this.setCursorCol(this.state.lines[this.state.cursorLine]?.length||0),this.scrollOffset=0,this.onChange)this.onChange(this.getText())}invalidate(){}render(_){let $=Math.max(0,Math.floor((_-1)/2)),b=Math.min(this.paddingX,$),Z=Math.max(1,_-b*2),z=Math.max(1,Z-(b?0:1));this.lastWidth=z;let A=this.borderColor("─"),J=this.layoutText(z),U=this.tui.terminal.rows,G=Math.max(5,Math.floor(U*0.3)),Y=J.findIndex((E)=>E.hasCursor);if(Y===-1)Y=0;if(Y<this.scrollOffset)this.scrollOffset=Y;else if(Y>=this.scrollOffset+G)this.scrollOffset=Y-G+1;let X=Math.max(0,J.length-G);this.scrollOffset=Math.max(0,Math.min(this.scrollOffset,X));let Q=J.slice(this.scrollOffset,this.scrollOffset+G),K=[],v=" ".repeat(b),D=v;if(this.scrollOffset>0){let E=`─── ↑ ${this.scrollOffset} more `,B=_-_0(E);K.push(this.borderColor(E+"─".repeat(Math.max(0,B))))}else K.push(A.repeat(_));let w=this.focused&&!this.autocompleteState;for(let E of Q){let B=E.text,C=_0(E.text),f=!1;if(E.hasCursor&&E.cursorPos!==void 0){let T=B.slice(0,E.cursorPos),F=B.slice(E.cursorPos),H=w?a4:"";if(F.length>0){let W=[...M4.segment(F)][0]?.segment||"",V=F.slice(W.length),k=`\x1B[7m${W}\x1B[0m`;B=T+H+k+V}else if(B=T+H+"\x1B[7m \x1B[0m",C=C+1,C>Z&&b>0)f=!0}let u=" ".repeat(Math.max(0,Z-C)),O=f?D.slice(1):D;K.push(`${v}${B}${u}${O}`)}let P=J.length-(this.scrollOffset+Q.length);if(P>0){let E=`─── ↓ ${P} more `,B=_-_0(E);K.push(this.borderColor(E+"─".repeat(Math.max(0,B))))}else K.push(A.repeat(_));if(this.autocompleteState&&this.autocompleteList){let E=this.autocompleteList.render(Z);for(let B of E){let C=_0(B),f=" ".repeat(Math.max(0,Z-C));K.push(`${v}${B}${f}${D}`)}}return K}handleInput(_){let $=m_();if(this.jumpMode!==null){if($.matches(_,"jumpForward")||$.matches(_,"jumpBackward")){this.jumpMode=null;return}if(_.charCodeAt(0)>=32){let Z=this.jumpMode;this.jumpMode=null,this.jumpToChar(_,Z);return}this.jumpMode=null}if(_.includes("\x1B[200~"))this.isInPaste=!0,this.pasteBuffer="",_=_.replace("\x1B[200~","");if(this.isInPaste){this.pasteBuffer+=_;let Z=this.pasteBuffer.indexOf("\x1B[201~");if(Z!==-1){let z=this.pasteBuffer.substring(0,Z);if(z.length>0)this.handlePaste(z);this.isInPaste=!1;let A=this.pasteBuffer.substring(Z+6);if(this.pasteBuffer="",A.length>0)this.handleInput(A);return}return}if($.matches(_,"copy"))return;if($.matches(_,"undo")){this.undo();return}if(this.autocompleteState&&this.autocompleteList){if($.matches(_,"selectCancel")){this.cancelAutocomplete();return}if($.matches(_,"selectUp")||$.matches(_,"selectDown")){this.autocompleteList.handleInput(_);return}if($.matches(_,"tab")){let Z=this.autocompleteList.getSelectedItem();if(Z&&this.autocompleteProvider){let z=this.shouldChainSlashArgumentAutocompleteOnTabSelection();this.pushUndoSnapshot(),this.lastAction=null;let A=this.autocompleteProvider.applyCompletion(this.state.lines,this.state.cursorLine,this.state.cursorCol,Z,this.autocompletePrefix);if(this.state.lines=A.lines,this.state.cursorLine=A.cursorLine,this.setCursorCol(A.cursorCol),this.cancelAutocomplete(),this.onChange)this.onChange(this.getText());if(z&&this.isBareCompletedSlashCommandAtCursor())this.tryTriggerAutocomplete()}return}if($.matches(_,"selectConfirm")){let Z=this.autocompleteList.getSelectedItem();if(Z&&this.autocompleteProvider){this.pushUndoSnapshot(),this.lastAction=null;let z=this.autocompleteProvider.applyCompletion(this.state.lines,this.state.cursorLine,this.state.cursorCol,Z,this.autocompletePrefix);if(this.state.lines=z.lines,this.state.cursorLine=z.cursorLine,this.setCursorCol(z.cursorCol),this.autocompletePrefix.startsWith("/"))this.cancelAutocomplete();else{if(this.cancelAutocomplete(),this.onChange)this.onChange(this.getText());return}}}}if($.matches(_,"tab")&&!this.autocompleteState){this.handleTabCompletion();return}if($.matches(_,"deleteToLineEnd")){this.deleteToEndOfLine();return}if($.matches(_,"deleteToLineStart")){this.deleteToStartOfLine();return}if($.matches(_,"deleteWordBackward")){this.deleteWordBackwards();return}if($.matches(_,"deleteWordForward")){this.deleteWordForward();return}if($.matches(_,"deleteCharBackward")||f_(_,"shift+backspace")){this.handleBackspace();return}if($.matches(_,"deleteCharForward")||f_(_,"shift+delete")){this.handleForwardDelete();return}if($.matches(_,"yank")){this.yank();return}if($.matches(_,"yankPop")){this.yankPop();return}if($.matches(_,"cursorLineStart")){this.moveToLineStart();return}if($.matches(_,"cursorLineEnd")){this.moveToLineEnd();return}if($.matches(_,"cursorWordLeft")){this.moveWordBackwards();return}if($.matches(_,"cursorWordRight")){this.moveWordForwards();return}if($.matches(_,"newLine")||_.charCodeAt(0)===10&&_.length>1||_==="\x1B\r"||_==="\x1B[13;2~"||_.length>1&&_.includes("\x1B")&&_.includes("\r")||_===`
139
+ `&&_.length===1){if(this.shouldSubmitOnBackslashEnter(_,$)){this.handleBackspace(),this.submitValue();return}this.addNewLine();return}if($.matches(_,"submit")){if(this.disableSubmit)return;let Z=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol>0&&Z[this.state.cursorCol-1]==="\\"){this.handleBackspace(),this.addNewLine();return}this.submitValue();return}if($.matches(_,"cursorUp")){if(this.isEditorEmpty())this.navigateHistory(-1);else if(this.historyIndex>-1&&this.isOnFirstVisualLine())this.navigateHistory(-1);else if(this.isOnFirstVisualLine())this.moveToLineStart();else this.moveCursor(-1,0);return}if($.matches(_,"cursorDown")){if(this.historyIndex>-1&&this.isOnLastVisualLine())this.navigateHistory(1);else if(this.isOnLastVisualLine())this.moveToLineEnd();else this.moveCursor(1,0);return}if($.matches(_,"cursorRight")){this.moveCursor(0,1);return}if($.matches(_,"cursorLeft")){this.moveCursor(0,-1);return}if($.matches(_,"pageUp")){this.pageScroll(-1);return}if($.matches(_,"pageDown")){this.pageScroll(1);return}if($.matches(_,"jumpForward")){this.jumpMode="forward";return}if($.matches(_,"jumpBackward")){this.jumpMode="backward";return}if(f_(_,"shift+space")){this.insertCharacter(" ");return}let b=s$(_);if(b!==void 0){this.insertCharacter(b);return}if(_.charCodeAt(0)>=32)this.insertCharacter(_)}layoutText(_){let $=[];if(this.state.lines.length===0||this.state.lines.length===1&&this.state.lines[0]==="")return $.push({text:"",hasCursor:!0,cursorPos:0}),$;for(let b=0;b<this.state.lines.length;b++){let Z=this.state.lines[b]||"",z=b===this.state.cursorLine;if(_0(Z)<=_)if(z)$.push({text:Z,hasCursor:!0,cursorPos:this.state.cursorCol});else $.push({text:Z,hasCursor:!1});else{let J=SQ(Z,_);for(let U=0;U<J.length;U++){let G=J[U];if(!G)continue;let Y=this.state.cursorCol,X=U===J.length-1,Q=!1,K=0;if(z){if(X)Q=Y>=G.startIndex,K=Y-G.startIndex;else if(Q=Y>=G.startIndex&&Y<G.endIndex,Q){if(K=Y-G.startIndex,K>G.text.length)K=G.text.length}}if(Q)$.push({text:G.text,hasCursor:!0,cursorPos:K});else $.push({text:G.text,hasCursor:!1})}}}return $}getText(){return this.state.lines.join(`
140
140
  `)}getExpandedText(){let _=this.state.lines.join(`
141
141
  `);for(let[$,b]of this.pastes){let Z=new RegExp(`\\[paste #${$}( (\\+\\d+ lines|\\d+ chars))?\\]`,"g");_=_.replace(Z,b)}return _}getLines(){return[...this.state.lines]}getCursor(){return{line:this.state.cursorLine,col:this.state.cursorCol}}setText(_){if(this.lastAction=null,this.historyIndex=-1,this.getText()!==_)this.pushUndoSnapshot();this.setTextInternal(_)}insertTextAtCursor(_){if(!_)return;this.pushUndoSnapshot(),this.lastAction=null,this.historyIndex=-1,this.insertTextAtCursorInternal(_)}insertTextAtCursorInternal(_){if(!_)return;let $=_.replace(/\r\n/g,`
142
142
  `).replace(/\r/g,`
143
143
  `),b=$.split(`
144
- `),Z=this.state.lines[this.state.cursorLine]||"",z=Z.slice(0,this.state.cursorCol),A=Z.slice(this.state.cursorCol);if(b.length===1)this.state.lines[this.state.cursorLine]=z+$+A,this.setCursorCol(this.state.cursorCol+$.length);else this.state.lines=[...this.state.lines.slice(0,this.state.cursorLine),z+b[0],...b.slice(1,-1),b[b.length-1]+A,...this.state.lines.slice(this.state.cursorLine+1)],this.state.cursorLine+=b.length-1,this.setCursorCol((b[b.length-1]||"").length);if(this.onChange)this.onChange(this.getText())}insertCharacter(_,$){if(this.historyIndex=-1,!$){if(i0(_)||this.lastAction!=="type-word")this.pushUndoSnapshot();this.lastAction="type-word"}let b=this.state.lines[this.state.cursorLine]||"",Z=b.slice(0,this.state.cursorCol),z=b.slice(this.state.cursorCol);if(this.state.lines[this.state.cursorLine]=Z+_+z,this.setCursorCol(this.state.cursorCol+_.length),this.onChange)this.onChange(this.getText());if(!this.autocompleteState){if(_==="/"&&this.isAtStartOfMessage())this.tryTriggerAutocomplete();else if(_==="@"){let J=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol),U=J[J.length-2];if(J.length===1||U===" "||U==="\t")this.tryTriggerAutocomplete()}else if(/[a-zA-Z0-9.\-_]/.test(_)){let J=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);if(this.isInSlashCommandContext(J))this.tryTriggerAutocomplete();else if(J.match(/(?:^|[\s])@[^\s]*$/))this.tryTriggerAutocomplete()}}else this.updateAutocomplete()}handlePaste(_){this.historyIndex=-1,this.lastAction=null,this.pushUndoSnapshot();let Z=_.replace(/\r\n/g,`
144
+ `),Z=this.state.lines[this.state.cursorLine]||"",z=Z.slice(0,this.state.cursorCol),A=Z.slice(this.state.cursorCol);if(b.length===1)this.state.lines[this.state.cursorLine]=z+$+A,this.setCursorCol(this.state.cursorCol+$.length);else this.state.lines=[...this.state.lines.slice(0,this.state.cursorLine),z+b[0],...b.slice(1,-1),b[b.length-1]+A,...this.state.lines.slice(this.state.cursorLine+1)],this.state.cursorLine+=b.length-1,this.setCursorCol((b[b.length-1]||"").length);if(this.onChange)this.onChange(this.getText())}insertCharacter(_,$){if(this.historyIndex=-1,!$){if(o0(_)||this.lastAction!=="type-word")this.pushUndoSnapshot();this.lastAction="type-word"}let b=this.state.lines[this.state.cursorLine]||"",Z=b.slice(0,this.state.cursorCol),z=b.slice(this.state.cursorCol);if(this.state.lines[this.state.cursorLine]=Z+_+z,this.setCursorCol(this.state.cursorCol+_.length),this.onChange)this.onChange(this.getText());if(!this.autocompleteState){if(_==="/"&&this.isAtStartOfMessage())this.tryTriggerAutocomplete();else if(_==="@"){let J=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol),U=J[J.length-2];if(J.length===1||U===" "||U==="\t")this.tryTriggerAutocomplete()}else if(/[a-zA-Z0-9.\-_]/.test(_)){let J=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);if(this.isInSlashCommandContext(J))this.tryTriggerAutocomplete();else if(J.match(/(?:^|[\s])@[^\s]*$/))this.tryTriggerAutocomplete()}}else this.updateAutocomplete()}handlePaste(_){this.historyIndex=-1,this.lastAction=null,this.pushUndoSnapshot();let Z=_.replace(/\r\n/g,`
145
145
  `).replace(/\r/g,`
146
146
  `).replace(/\t/g," ").split("").filter((J)=>J===`
147
147
  `||J.charCodeAt(0)>=32).join("");if(/^[/~.]/.test(Z)){let J=this.state.lines[this.state.cursorLine]||"",U=this.state.cursorCol>0?J[this.state.cursorCol-1]:"";if(U&&/\w/.test(U))Z=` ${Z}`}let z=Z.split(`
148
- `),A=Z.length;if(z.length>10||A>1000){this.pasteCounter++;let J=this.pasteCounter;this.pastes.set(J,Z);let U=z.length>10?`[paste #${J} +${z.length} lines]`:`[paste #${J} ${A} chars]`;this.insertTextAtCursorInternal(U);return}if(z.length===1){this.insertTextAtCursorInternal(Z);return}this.insertTextAtCursorInternal(Z)}addNewLine(){this.historyIndex=-1,this.lastAction=null,this.pushUndoSnapshot();let _=this.state.lines[this.state.cursorLine]||"",$=_.slice(0,this.state.cursorCol),b=_.slice(this.state.cursorCol);if(this.state.lines[this.state.cursorLine]=$,this.state.lines.splice(this.state.cursorLine+1,0,b),this.state.cursorLine++,this.setCursorCol(0),this.onChange)this.onChange(this.getText())}shouldSubmitOnBackslashEnter(_,$){if(this.disableSubmit)return!1;if(!C_(_,"enter"))return!1;let b=$.getKeys("submit");if(!(b.includes("shift+enter")||b.includes("shift+return")))return!1;let z=this.state.lines[this.state.cursorLine]||"";return this.state.cursorCol>0&&z[this.state.cursorCol-1]==="\\"}submitValue(){let _=this.state.lines.join(`
149
- `).trim();for(let[$,b]of this.pastes){let Z=new RegExp(`\\[paste #${$}( (\\+\\d+ lines|\\d+ chars))?\\]`,"g");_=_.replace(Z,b)}if(this.state={lines:[""],cursorLine:0,cursorCol:0},this.pastes.clear(),this.pasteCounter=0,this.historyIndex=-1,this.scrollOffset=0,this.undoStack.clear(),this.lastAction=null,this.onChange)this.onChange("");if(this.onSubmit)this.onSubmit(_)}handleBackspace(){if(this.historyIndex=-1,this.lastAction=null,this.state.cursorCol>0){this.pushUndoSnapshot();let _=this.state.lines[this.state.cursorLine]||"",$=_.slice(0,this.state.cursorCol),b=[...B4.segment($)],Z=b[b.length-1],z=Z?Z.segment.length:1,A=_.slice(0,this.state.cursorCol-z),J=_.slice(this.state.cursorCol);this.state.lines[this.state.cursorLine]=A+J,this.setCursorCol(this.state.cursorCol-z)}else if(this.state.cursorLine>0){this.pushUndoSnapshot();let _=this.state.lines[this.state.cursorLine]||"",$=this.state.lines[this.state.cursorLine-1]||"";this.state.lines[this.state.cursorLine-1]=$+_,this.state.lines.splice(this.state.cursorLine,1),this.state.cursorLine--,this.setCursorCol($.length)}if(this.onChange)this.onChange(this.getText());if(this.autocompleteState)this.updateAutocomplete();else{let $=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);if(this.isInSlashCommandContext($))this.tryTriggerAutocomplete();else if($.match(/(?:^|[\s])@[^\s]*$/))this.tryTriggerAutocomplete()}}setCursorCol(_){this.state.cursorCol=_,this.preferredVisualCol=null}moveToVisualLine(_,$,b){let Z=_[$],z=_[b];if(Z&&z){let A=this.state.cursorCol-Z.startCol,U=$===_.length-1||_[$+1]?.logicalLine!==Z.logicalLine?Z.length:Math.max(0,Z.length-1),Y=b===_.length-1||_[b+1]?.logicalLine!==z.logicalLine?z.length:Math.max(0,z.length-1),X=this.computeVerticalMoveColumn(A,U,Y);this.state.cursorLine=z.logicalLine;let Q=z.startCol+X,K=this.state.lines[z.logicalLine]||"";this.state.cursorCol=Math.min(Q,K.length)}}computeVerticalMoveColumn(_,$,b){let Z=this.preferredVisualCol!==null,z=_<$,A=b<_;if(!Z||z){if(A)return this.preferredVisualCol=_,b;return this.preferredVisualCol=null,_}let J=b<this.preferredVisualCol;if(A||J)return b;let U=this.preferredVisualCol;return this.preferredVisualCol=null,U}moveToLineStart(){this.lastAction=null,this.setCursorCol(0)}moveToLineEnd(){this.lastAction=null;let _=this.state.lines[this.state.cursorLine]||"";this.setCursorCol(_.length)}deleteToStartOfLine(){this.historyIndex=-1;let _=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol>0){this.pushUndoSnapshot();let $=_.slice(0,this.state.cursorCol);this.killRing.push($,{prepend:!0,accumulate:this.lastAction==="kill"}),this.lastAction="kill",this.state.lines[this.state.cursorLine]=_.slice(this.state.cursorCol),this.setCursorCol(0)}else if(this.state.cursorLine>0){this.pushUndoSnapshot(),this.killRing.push(`
148
+ `),A=Z.length;if(z.length>10||A>1000){this.pasteCounter++;let J=this.pasteCounter;this.pastes.set(J,Z);let U=z.length>10?`[paste #${J} +${z.length} lines]`:`[paste #${J} ${A} chars]`;this.insertTextAtCursorInternal(U);return}if(z.length===1){this.insertTextAtCursorInternal(Z);return}this.insertTextAtCursorInternal(Z)}addNewLine(){this.historyIndex=-1,this.lastAction=null,this.pushUndoSnapshot();let _=this.state.lines[this.state.cursorLine]||"",$=_.slice(0,this.state.cursorCol),b=_.slice(this.state.cursorCol);if(this.state.lines[this.state.cursorLine]=$,this.state.lines.splice(this.state.cursorLine+1,0,b),this.state.cursorLine++,this.setCursorCol(0),this.onChange)this.onChange(this.getText())}shouldSubmitOnBackslashEnter(_,$){if(this.disableSubmit)return!1;if(!f_(_,"enter"))return!1;let b=$.getKeys("submit");if(!(b.includes("shift+enter")||b.includes("shift+return")))return!1;let z=this.state.lines[this.state.cursorLine]||"";return this.state.cursorCol>0&&z[this.state.cursorCol-1]==="\\"}submitValue(){let _=this.state.lines.join(`
149
+ `).trim();for(let[$,b]of this.pastes){let Z=new RegExp(`\\[paste #${$}( (\\+\\d+ lines|\\d+ chars))?\\]`,"g");_=_.replace(Z,b)}if(this.state={lines:[""],cursorLine:0,cursorCol:0},this.pastes.clear(),this.pasteCounter=0,this.historyIndex=-1,this.scrollOffset=0,this.undoStack.clear(),this.lastAction=null,this.onChange)this.onChange("");if(this.onSubmit)this.onSubmit(_)}handleBackspace(){if(this.historyIndex=-1,this.lastAction=null,this.state.cursorCol>0){this.pushUndoSnapshot();let _=this.state.lines[this.state.cursorLine]||"",$=_.slice(0,this.state.cursorCol),b=[...M4.segment($)],Z=b[b.length-1],z=Z?Z.segment.length:1,A=_.slice(0,this.state.cursorCol-z),J=_.slice(this.state.cursorCol);this.state.lines[this.state.cursorLine]=A+J,this.setCursorCol(this.state.cursorCol-z)}else if(this.state.cursorLine>0){this.pushUndoSnapshot();let _=this.state.lines[this.state.cursorLine]||"",$=this.state.lines[this.state.cursorLine-1]||"";this.state.lines[this.state.cursorLine-1]=$+_,this.state.lines.splice(this.state.cursorLine,1),this.state.cursorLine--,this.setCursorCol($.length)}if(this.onChange)this.onChange(this.getText());if(this.autocompleteState)this.updateAutocomplete();else{let $=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);if(this.isInSlashCommandContext($))this.tryTriggerAutocomplete();else if($.match(/(?:^|[\s])@[^\s]*$/))this.tryTriggerAutocomplete()}}setCursorCol(_){this.state.cursorCol=_,this.preferredVisualCol=null}moveToVisualLine(_,$,b){let Z=_[$],z=_[b];if(Z&&z){let A=this.state.cursorCol-Z.startCol,U=$===_.length-1||_[$+1]?.logicalLine!==Z.logicalLine?Z.length:Math.max(0,Z.length-1),Y=b===_.length-1||_[b+1]?.logicalLine!==z.logicalLine?z.length:Math.max(0,z.length-1),X=this.computeVerticalMoveColumn(A,U,Y);this.state.cursorLine=z.logicalLine;let Q=z.startCol+X,K=this.state.lines[z.logicalLine]||"";this.state.cursorCol=Math.min(Q,K.length)}}computeVerticalMoveColumn(_,$,b){let Z=this.preferredVisualCol!==null,z=_<$,A=b<_;if(!Z||z){if(A)return this.preferredVisualCol=_,b;return this.preferredVisualCol=null,_}let J=b<this.preferredVisualCol;if(A||J)return b;let U=this.preferredVisualCol;return this.preferredVisualCol=null,U}moveToLineStart(){this.lastAction=null,this.setCursorCol(0)}moveToLineEnd(){this.lastAction=null;let _=this.state.lines[this.state.cursorLine]||"";this.setCursorCol(_.length)}deleteToStartOfLine(){this.historyIndex=-1;let _=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol>0){this.pushUndoSnapshot();let $=_.slice(0,this.state.cursorCol);this.killRing.push($,{prepend:!0,accumulate:this.lastAction==="kill"}),this.lastAction="kill",this.state.lines[this.state.cursorLine]=_.slice(this.state.cursorCol),this.setCursorCol(0)}else if(this.state.cursorLine>0){this.pushUndoSnapshot(),this.killRing.push(`
150
150
  `,{prepend:!0,accumulate:this.lastAction==="kill"}),this.lastAction="kill";let $=this.state.lines[this.state.cursorLine-1]||"";this.state.lines[this.state.cursorLine-1]=$+_,this.state.lines.splice(this.state.cursorLine,1),this.state.cursorLine--,this.setCursorCol($.length)}if(this.onChange)this.onChange(this.getText())}deleteToEndOfLine(){this.historyIndex=-1;let _=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol<_.length){this.pushUndoSnapshot();let $=_.slice(this.state.cursorCol);this.killRing.push($,{prepend:!1,accumulate:this.lastAction==="kill"}),this.lastAction="kill",this.state.lines[this.state.cursorLine]=_.slice(0,this.state.cursorCol)}else if(this.state.cursorLine<this.state.lines.length-1){this.pushUndoSnapshot(),this.killRing.push(`
151
151
  `,{prepend:!1,accumulate:this.lastAction==="kill"}),this.lastAction="kill";let $=this.state.lines[this.state.cursorLine+1]||"";this.state.lines[this.state.cursorLine]=_+$,this.state.lines.splice(this.state.cursorLine+1,1)}if(this.onChange)this.onChange(this.getText())}deleteWordBackwards(){this.historyIndex=-1;let _=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol===0){if(this.state.cursorLine>0){this.pushUndoSnapshot(),this.killRing.push(`
152
152
  `,{prepend:!0,accumulate:this.lastAction==="kill"}),this.lastAction="kill";let $=this.state.lines[this.state.cursorLine-1]||"";this.state.lines[this.state.cursorLine-1]=$+_,this.state.lines.splice(this.state.cursorLine,1),this.state.cursorLine--,this.setCursorCol($.length)}}else{this.pushUndoSnapshot();let $=this.lastAction==="kill",b=this.state.cursorCol;this.moveWordBackwards();let Z=this.state.cursorCol;this.setCursorCol(b);let z=_.slice(Z,this.state.cursorCol);this.killRing.push(z,{prepend:!0,accumulate:$}),this.lastAction="kill",this.state.lines[this.state.cursorLine]=_.slice(0,Z)+_.slice(this.state.cursorCol),this.setCursorCol(Z)}if(this.onChange)this.onChange(this.getText())}deleteWordForward(){this.historyIndex=-1;let _=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol>=_.length){if(this.state.cursorLine<this.state.lines.length-1){this.pushUndoSnapshot(),this.killRing.push(`
153
- `,{prepend:!1,accumulate:this.lastAction==="kill"}),this.lastAction="kill";let $=this.state.lines[this.state.cursorLine+1]||"";this.state.lines[this.state.cursorLine]=_+$,this.state.lines.splice(this.state.cursorLine+1,1)}}else{this.pushUndoSnapshot();let $=this.lastAction==="kill",b=this.state.cursorCol;this.moveWordForwards();let Z=this.state.cursorCol;this.setCursorCol(b);let z=_.slice(this.state.cursorCol,Z);this.killRing.push(z,{prepend:!1,accumulate:$}),this.lastAction="kill",this.state.lines[this.state.cursorLine]=_.slice(0,this.state.cursorCol)+_.slice(Z)}if(this.onChange)this.onChange(this.getText())}handleForwardDelete(){this.historyIndex=-1,this.lastAction=null;let _=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol<_.length){this.pushUndoSnapshot();let $=_.slice(this.state.cursorCol),Z=[...B4.segment($)][0],z=Z?Z.segment.length:1,A=_.slice(0,this.state.cursorCol),J=_.slice(this.state.cursorCol+z);this.state.lines[this.state.cursorLine]=A+J}else if(this.state.cursorLine<this.state.lines.length-1){this.pushUndoSnapshot();let $=this.state.lines[this.state.cursorLine+1]||"";this.state.lines[this.state.cursorLine]=_+$,this.state.lines.splice(this.state.cursorLine+1,1)}if(this.onChange)this.onChange(this.getText());if(this.autocompleteState)this.updateAutocomplete();else{let b=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);if(this.isInSlashCommandContext(b))this.tryTriggerAutocomplete();else if(b.match(/(?:^|[\s])@[^\s]*$/))this.tryTriggerAutocomplete()}}buildVisualLineMap(_){let $=[];for(let b=0;b<this.state.lines.length;b++){let Z=this.state.lines[b]||"",z=_0(Z);if(Z.length===0)$.push({logicalLine:b,startCol:0,length:0});else if(z<=_)$.push({logicalLine:b,startCol:0,length:Z.length});else{let A=MQ(Z,_);for(let J of A)$.push({logicalLine:b,startCol:J.startIndex,length:J.endIndex-J.startIndex})}}return $}findCurrentVisualLine(_){for(let $=0;$<_.length;$++){let b=_[$];if(!b)continue;if(b.logicalLine===this.state.cursorLine){let Z=this.state.cursorCol-b.startCol,z=$===_.length-1||_[$+1]?.logicalLine!==b.logicalLine;if(Z>=0&&(Z<b.length||z&&Z<=b.length))return $}}return _.length-1}moveCursor(_,$){this.lastAction=null;let b=this.buildVisualLineMap(this.lastWidth),Z=this.findCurrentVisualLine(b);if(_!==0){let z=Z+_;if(z>=0&&z<b.length)this.moveToVisualLine(b,Z,z)}if($!==0){let z=this.state.lines[this.state.cursorLine]||"";if($>0)if(this.state.cursorCol<z.length){let A=z.slice(this.state.cursorCol),U=[...B4.segment(A)][0];this.setCursorCol(this.state.cursorCol+(U?U.segment.length:1))}else if(this.state.cursorLine<this.state.lines.length-1)this.state.cursorLine++,this.setCursorCol(0);else{let A=b[Z];if(A)this.preferredVisualCol=this.state.cursorCol-A.startCol}else if(this.state.cursorCol>0){let A=z.slice(0,this.state.cursorCol),J=[...B4.segment(A)],U=J[J.length-1];this.setCursorCol(this.state.cursorCol-(U?U.segment.length:1))}else if(this.state.cursorLine>0){this.state.cursorLine--;let A=this.state.lines[this.state.cursorLine]||"";this.setCursorCol(A.length)}}}pageScroll(_){this.lastAction=null;let $=this.tui.terminal.rows,b=Math.max(5,Math.floor($*0.3)),Z=this.buildVisualLineMap(this.lastWidth),z=this.findCurrentVisualLine(Z),A=Math.max(0,Math.min(Z.length-1,z+_*b));this.moveToVisualLine(Z,z,A)}moveWordBackwards(){this.lastAction=null;let _=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol===0){if(this.state.cursorLine>0){this.state.cursorLine--;let z=this.state.lines[this.state.cursorLine]||"";this.setCursorCol(z.length)}return}let $=_.slice(0,this.state.cursorCol),b=[...B4.segment($)],Z=this.state.cursorCol;while(b.length>0&&i0(b[b.length-1]?.segment||""))Z-=b.pop()?.segment.length||0;if(b.length>0){let z=b[b.length-1]?.segment||"";if(o0(z))while(b.length>0&&o0(b[b.length-1]?.segment||""))Z-=b.pop()?.segment.length||0;else while(b.length>0&&!i0(b[b.length-1]?.segment||"")&&!o0(b[b.length-1]?.segment||""))Z-=b.pop()?.segment.length||0}this.setCursorCol(Z)}yank(){if(this.killRing.length===0)return;this.pushUndoSnapshot();let _=this.killRing.peek();this.insertYankedText(_),this.lastAction="yank"}yankPop(){if(this.lastAction!=="yank"||this.killRing.length<=1)return;this.pushUndoSnapshot(),this.deleteYankedText(),this.killRing.rotate();let _=this.killRing.peek();this.insertYankedText(_),this.lastAction="yank"}insertYankedText(_){this.historyIndex=-1;let $=_.split(`
153
+ `,{prepend:!1,accumulate:this.lastAction==="kill"}),this.lastAction="kill";let $=this.state.lines[this.state.cursorLine+1]||"";this.state.lines[this.state.cursorLine]=_+$,this.state.lines.splice(this.state.cursorLine+1,1)}}else{this.pushUndoSnapshot();let $=this.lastAction==="kill",b=this.state.cursorCol;this.moveWordForwards();let Z=this.state.cursorCol;this.setCursorCol(b);let z=_.slice(this.state.cursorCol,Z);this.killRing.push(z,{prepend:!1,accumulate:$}),this.lastAction="kill",this.state.lines[this.state.cursorLine]=_.slice(0,this.state.cursorCol)+_.slice(Z)}if(this.onChange)this.onChange(this.getText())}handleForwardDelete(){this.historyIndex=-1,this.lastAction=null;let _=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol<_.length){this.pushUndoSnapshot();let $=_.slice(this.state.cursorCol),Z=[...M4.segment($)][0],z=Z?Z.segment.length:1,A=_.slice(0,this.state.cursorCol),J=_.slice(this.state.cursorCol+z);this.state.lines[this.state.cursorLine]=A+J}else if(this.state.cursorLine<this.state.lines.length-1){this.pushUndoSnapshot();let $=this.state.lines[this.state.cursorLine+1]||"";this.state.lines[this.state.cursorLine]=_+$,this.state.lines.splice(this.state.cursorLine+1,1)}if(this.onChange)this.onChange(this.getText());if(this.autocompleteState)this.updateAutocomplete();else{let b=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);if(this.isInSlashCommandContext(b))this.tryTriggerAutocomplete();else if(b.match(/(?:^|[\s])@[^\s]*$/))this.tryTriggerAutocomplete()}}buildVisualLineMap(_){let $=[];for(let b=0;b<this.state.lines.length;b++){let Z=this.state.lines[b]||"",z=_0(Z);if(Z.length===0)$.push({logicalLine:b,startCol:0,length:0});else if(z<=_)$.push({logicalLine:b,startCol:0,length:Z.length});else{let A=SQ(Z,_);for(let J of A)$.push({logicalLine:b,startCol:J.startIndex,length:J.endIndex-J.startIndex})}}return $}findCurrentVisualLine(_){for(let $=0;$<_.length;$++){let b=_[$];if(!b)continue;if(b.logicalLine===this.state.cursorLine){let Z=this.state.cursorCol-b.startCol,z=$===_.length-1||_[$+1]?.logicalLine!==b.logicalLine;if(Z>=0&&(Z<b.length||z&&Z<=b.length))return $}}return _.length-1}moveCursor(_,$){this.lastAction=null;let b=this.buildVisualLineMap(this.lastWidth),Z=this.findCurrentVisualLine(b);if(_!==0){let z=Z+_;if(z>=0&&z<b.length)this.moveToVisualLine(b,Z,z)}if($!==0){let z=this.state.lines[this.state.cursorLine]||"";if($>0)if(this.state.cursorCol<z.length){let A=z.slice(this.state.cursorCol),U=[...M4.segment(A)][0];this.setCursorCol(this.state.cursorCol+(U?U.segment.length:1))}else if(this.state.cursorLine<this.state.lines.length-1)this.state.cursorLine++,this.setCursorCol(0);else{let A=b[Z];if(A)this.preferredVisualCol=this.state.cursorCol-A.startCol}else if(this.state.cursorCol>0){let A=z.slice(0,this.state.cursorCol),J=[...M4.segment(A)],U=J[J.length-1];this.setCursorCol(this.state.cursorCol-(U?U.segment.length:1))}else if(this.state.cursorLine>0){this.state.cursorLine--;let A=this.state.lines[this.state.cursorLine]||"";this.setCursorCol(A.length)}}}pageScroll(_){this.lastAction=null;let $=this.tui.terminal.rows,b=Math.max(5,Math.floor($*0.3)),Z=this.buildVisualLineMap(this.lastWidth),z=this.findCurrentVisualLine(Z),A=Math.max(0,Math.min(Z.length-1,z+_*b));this.moveToVisualLine(Z,z,A)}moveWordBackwards(){this.lastAction=null;let _=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol===0){if(this.state.cursorLine>0){this.state.cursorLine--;let z=this.state.lines[this.state.cursorLine]||"";this.setCursorCol(z.length)}return}let $=_.slice(0,this.state.cursorCol),b=[...M4.segment($)],Z=this.state.cursorCol;while(b.length>0&&o0(b[b.length-1]?.segment||""))Z-=b.pop()?.segment.length||0;if(b.length>0){let z=b[b.length-1]?.segment||"";if(a0(z))while(b.length>0&&a0(b[b.length-1]?.segment||""))Z-=b.pop()?.segment.length||0;else while(b.length>0&&!o0(b[b.length-1]?.segment||"")&&!a0(b[b.length-1]?.segment||""))Z-=b.pop()?.segment.length||0}this.setCursorCol(Z)}yank(){if(this.killRing.length===0)return;this.pushUndoSnapshot();let _=this.killRing.peek();this.insertYankedText(_),this.lastAction="yank"}yankPop(){if(this.lastAction!=="yank"||this.killRing.length<=1)return;this.pushUndoSnapshot(),this.deleteYankedText(),this.killRing.rotate();let _=this.killRing.peek();this.insertYankedText(_),this.lastAction="yank"}insertYankedText(_){this.historyIndex=-1;let $=_.split(`
154
154
  `);if($.length===1){let b=this.state.lines[this.state.cursorLine]||"",Z=b.slice(0,this.state.cursorCol),z=b.slice(this.state.cursorCol);this.state.lines[this.state.cursorLine]=Z+_+z,this.setCursorCol(this.state.cursorCol+_.length)}else{let b=this.state.lines[this.state.cursorLine]||"",Z=b.slice(0,this.state.cursorCol),z=b.slice(this.state.cursorCol);this.state.lines[this.state.cursorLine]=Z+($[0]||"");for(let J=1;J<$.length-1;J++)this.state.lines.splice(this.state.cursorLine+J,0,$[J]||"");let A=this.state.cursorLine+$.length-1;this.state.lines.splice(A,0,($[$.length-1]||"")+z),this.state.cursorLine=A,this.setCursorCol(($[$.length-1]||"").length)}if(this.onChange)this.onChange(this.getText())}deleteYankedText(){let _=this.killRing.peek();if(!_)return;let $=_.split(`
155
- `);if($.length===1){let b=this.state.lines[this.state.cursorLine]||"",Z=_.length,z=b.slice(0,this.state.cursorCol-Z),A=b.slice(this.state.cursorCol);this.state.lines[this.state.cursorLine]=z+A,this.setCursorCol(this.state.cursorCol-Z)}else{let b=this.state.cursorLine-($.length-1),Z=(this.state.lines[b]||"").length-($[0]||"").length,z=(this.state.lines[this.state.cursorLine]||"").slice(this.state.cursorCol),A=(this.state.lines[b]||"").slice(0,Z);this.state.lines.splice(b,$.length,A+z),this.state.cursorLine=b,this.setCursorCol(Z)}if(this.onChange)this.onChange(this.getText())}pushUndoSnapshot(){this.undoStack.push(this.state)}undo(){this.historyIndex=-1;let _=this.undoStack.pop();if(!_)return;if(Object.assign(this.state,_),this.lastAction=null,this.preferredVisualCol=null,this.onChange)this.onChange(this.getText())}jumpToChar(_,$){this.lastAction=null;let b=$==="forward",Z=this.state.lines,z=b?Z.length:-1,A=b?1:-1;for(let J=this.state.cursorLine;J!==z;J+=A){let U=Z[J]||"",Y=J===this.state.cursorLine?b?this.state.cursorCol+1:this.state.cursorCol-1:void 0,X=b?U.indexOf(_,Y):U.lastIndexOf(_,Y);if(X!==-1){this.state.cursorLine=J,this.setCursorCol(X);return}}}moveWordForwards(){this.lastAction=null;let _=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol>=_.length){if(this.state.cursorLine<this.state.lines.length-1)this.state.cursorLine++,this.setCursorCol(0);return}let $=_.slice(this.state.cursorCol),Z=B4.segment($)[Symbol.iterator](),z=Z.next(),A=this.state.cursorCol;while(!z.done&&i0(z.value.segment))A+=z.value.segment.length,z=Z.next();if(!z.done){let J=z.value.segment;if(o0(J))while(!z.done&&o0(z.value.segment))A+=z.value.segment.length,z=Z.next();else while(!z.done&&!i0(z.value.segment)&&!o0(z.value.segment))A+=z.value.segment.length,z=Z.next()}this.setCursorCol(A)}isSlashMenuAllowed(){return this.state.cursorLine===0}isAtStartOfMessage(){if(!this.isSlashMenuAllowed())return!1;let $=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);return $.trim()===""||$.trim()==="/"}isInSlashCommandContext(_){return this.isSlashMenuAllowed()&&_.trimStart().startsWith("/")}shouldChainSlashArgumentAutocompleteOnTabSelection(){if(this.autocompleteState!=="regular")return!1;let $=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);return this.isInSlashCommandContext($)&&!$.trimStart().includes(" ")}isBareCompletedSlashCommandAtCursor(){let _=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol!==_.length)return!1;let $=_.slice(0,this.state.cursorCol).trimStart();return/^\/\S+ $/.test($)}getBestAutocompleteMatchIndex(_,$){if(!$)return-1;let b=-1;for(let Z=0;Z<_.length;Z++){let z=_[Z].value;if(z===$)return Z;if(b===-1&&z.startsWith($))b=Z}return b}tryTriggerAutocomplete(_=!1){if(!this.autocompleteProvider)return;if(_){let b=this.autocompleteProvider;if(!(!b.shouldTriggerFileCompletion||b.shouldTriggerFileCompletion(this.state.lines,this.state.cursorLine,this.state.cursorCol)))return}let $=this.autocompleteProvider.getSuggestions(this.state.lines,this.state.cursorLine,this.state.cursorCol);if($&&$.items.length>0){this.autocompletePrefix=$.prefix,this.autocompleteList=new g4($.items,this.autocompleteMaxVisible,this.theme.selectList);let b=this.getBestAutocompleteMatchIndex($.items,$.prefix);if(b>=0)this.autocompleteList.setSelectedIndex(b);this.autocompleteState="regular"}else this.cancelAutocomplete()}handleTabCompletion(){if(!this.autocompleteProvider)return;let $=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);if(this.isInSlashCommandContext($)&&!$.trimStart().includes(" "))this.handleSlashCommandCompletion();else this.forceFileAutocomplete(!0)}handleSlashCommandCompletion(){this.tryTriggerAutocomplete(!0)}forceFileAutocomplete(_=!1){if(!this.autocompleteProvider)return;let $=this.autocompleteProvider;if(typeof $.getForceFileSuggestions!=="function"){this.tryTriggerAutocomplete(!0);return}let b=$.getForceFileSuggestions(this.state.lines,this.state.cursorLine,this.state.cursorCol);if(b&&b.items.length>0){if(_&&b.items.length===1){let z=b.items[0];this.pushUndoSnapshot(),this.lastAction=null;let A=this.autocompleteProvider.applyCompletion(this.state.lines,this.state.cursorLine,this.state.cursorCol,z,b.prefix);if(this.state.lines=A.lines,this.state.cursorLine=A.cursorLine,this.setCursorCol(A.cursorCol),this.onChange)this.onChange(this.getText());return}this.autocompletePrefix=b.prefix,this.autocompleteList=new g4(b.items,this.autocompleteMaxVisible,this.theme.selectList);let Z=this.getBestAutocompleteMatchIndex(b.items,b.prefix);if(Z>=0)this.autocompleteList.setSelectedIndex(Z);this.autocompleteState="force"}else this.cancelAutocomplete()}cancelAutocomplete(){this.autocompleteState=null,this.autocompleteList=void 0,this.autocompletePrefix=""}isShowingAutocomplete(){return this.autocompleteState!==null}updateAutocomplete(){if(!this.autocompleteState||!this.autocompleteProvider)return;if(this.autocompleteState==="force"){this.forceFileAutocomplete();return}let _=this.autocompleteProvider.getSuggestions(this.state.lines,this.state.cursorLine,this.state.cursorCol);if(_&&_.items.length>0){this.autocompletePrefix=_.prefix,this.autocompleteList=new g4(_.items,this.autocompleteMaxVisible,this.theme.selectList);let $=this.getBestAutocompleteMatchIndex(_.items,_.prefix);if($>=0)this.autocompleteList.setSelectedIndex($)}else this.cancelAutocomplete()}}var e4=I6();class LJ{value="";cursor=0;onSubmit;onEscape;focused=!1;pasteBuffer="";isInPaste=!1;killRing=new $2;lastAction=null;undoStack=new b2;getValue(){return this.value}setValue(_){this.value=_,this.cursor=Math.min(this.cursor,_.length)}handleInput(_){if(_.includes("\x1B[200~"))this.isInPaste=!0,this.pasteBuffer="",_=_.replace("\x1B[200~","");if(this.isInPaste){this.pasteBuffer+=_;let z=this.pasteBuffer.indexOf("\x1B[201~");if(z!==-1){let A=this.pasteBuffer.substring(0,z);this.handlePaste(A),this.isInPaste=!1;let J=this.pasteBuffer.substring(z+6);if(this.pasteBuffer="",J)this.handleInput(J)}return}let $=f_();if($.matches(_,"selectCancel")){if(this.onEscape)this.onEscape();return}if($.matches(_,"undo")){this.undo();return}if($.matches(_,"submit")||_===`
156
- `){if(this.onSubmit)this.onSubmit(this.value);return}if($.matches(_,"deleteCharBackward")){this.handleBackspace();return}if($.matches(_,"deleteCharForward")){this.handleForwardDelete();return}if($.matches(_,"deleteWordBackward")){this.deleteWordBackwards();return}if($.matches(_,"deleteWordForward")){this.deleteWordForward();return}if($.matches(_,"deleteToLineStart")){this.deleteToLineStart();return}if($.matches(_,"deleteToLineEnd")){this.deleteToLineEnd();return}if($.matches(_,"yank")){this.yank();return}if($.matches(_,"yankPop")){this.yankPop();return}if($.matches(_,"cursorLeft")){if(this.lastAction=null,this.cursor>0){let z=this.value.slice(0,this.cursor),A=[...e4.segment(z)],J=A[A.length-1];this.cursor-=J?J.segment.length:1}return}if($.matches(_,"cursorRight")){if(this.lastAction=null,this.cursor<this.value.length){let z=this.value.slice(this.cursor),J=[...e4.segment(z)][0];this.cursor+=J?J.segment.length:1}return}if($.matches(_,"cursorLineStart")){this.lastAction=null,this.cursor=0;return}if($.matches(_,"cursorLineEnd")){this.lastAction=null,this.cursor=this.value.length;return}if($.matches(_,"cursorWordLeft")){this.moveWordBackwards();return}if($.matches(_,"cursorWordRight")){this.moveWordForwards();return}let b=_2(_);if(b!==void 0){this.insertCharacter(b);return}if(![..._].some((z)=>{let A=z.charCodeAt(0);return A<32||A===127||A>=128&&A<=159}))this.insertCharacter(_)}insertCharacter(_){if(i0(_)||this.lastAction!=="type-word")this.pushUndo();this.lastAction="type-word",this.value=this.value.slice(0,this.cursor)+_+this.value.slice(this.cursor),this.cursor+=_.length}handleBackspace(){if(this.lastAction=null,this.cursor>0){this.pushUndo();let _=this.value.slice(0,this.cursor),$=[...e4.segment(_)],b=$[$.length-1],Z=b?b.segment.length:1;this.value=this.value.slice(0,this.cursor-Z)+this.value.slice(this.cursor),this.cursor-=Z}}handleForwardDelete(){if(this.lastAction=null,this.cursor<this.value.length){this.pushUndo();let _=this.value.slice(this.cursor),b=[...e4.segment(_)][0],Z=b?b.segment.length:1;this.value=this.value.slice(0,this.cursor)+this.value.slice(this.cursor+Z)}}deleteToLineStart(){if(this.cursor===0)return;this.pushUndo();let _=this.value.slice(0,this.cursor);this.killRing.push(_,{prepend:!0,accumulate:this.lastAction==="kill"}),this.lastAction="kill",this.value=this.value.slice(this.cursor),this.cursor=0}deleteToLineEnd(){if(this.cursor>=this.value.length)return;this.pushUndo();let _=this.value.slice(this.cursor);this.killRing.push(_,{prepend:!1,accumulate:this.lastAction==="kill"}),this.lastAction="kill",this.value=this.value.slice(0,this.cursor)}deleteWordBackwards(){if(this.cursor===0)return;let _=this.lastAction==="kill";this.pushUndo();let $=this.cursor;this.moveWordBackwards();let b=this.cursor;this.cursor=$;let Z=this.value.slice(b,this.cursor);this.killRing.push(Z,{prepend:!0,accumulate:_}),this.lastAction="kill",this.value=this.value.slice(0,b)+this.value.slice(this.cursor),this.cursor=b}deleteWordForward(){if(this.cursor>=this.value.length)return;let _=this.lastAction==="kill";this.pushUndo();let $=this.cursor;this.moveWordForwards();let b=this.cursor;this.cursor=$;let Z=this.value.slice(this.cursor,b);this.killRing.push(Z,{prepend:!1,accumulate:_}),this.lastAction="kill",this.value=this.value.slice(0,this.cursor)+this.value.slice(b)}yank(){let _=this.killRing.peek();if(!_)return;this.pushUndo(),this.value=this.value.slice(0,this.cursor)+_+this.value.slice(this.cursor),this.cursor+=_.length,this.lastAction="yank"}yankPop(){if(this.lastAction!=="yank"||this.killRing.length<=1)return;this.pushUndo();let _=this.killRing.peek()||"";this.value=this.value.slice(0,this.cursor-_.length)+this.value.slice(this.cursor),this.cursor-=_.length,this.killRing.rotate();let $=this.killRing.peek()||"";this.value=this.value.slice(0,this.cursor)+$+this.value.slice(this.cursor),this.cursor+=$.length,this.lastAction="yank"}pushUndo(){this.undoStack.push({value:this.value,cursor:this.cursor})}undo(){let _=this.undoStack.pop();if(!_)return;this.value=_.value,this.cursor=_.cursor,this.lastAction=null}moveWordBackwards(){if(this.cursor===0)return;this.lastAction=null;let _=this.value.slice(0,this.cursor),$=[...e4.segment(_)];while($.length>0&&i0($[$.length-1]?.segment||""))this.cursor-=$.pop()?.segment.length||0;if($.length>0){let b=$[$.length-1]?.segment||"";if(o0(b))while($.length>0&&o0($[$.length-1]?.segment||""))this.cursor-=$.pop()?.segment.length||0;else while($.length>0&&!i0($[$.length-1]?.segment||"")&&!o0($[$.length-1]?.segment||""))this.cursor-=$.pop()?.segment.length||0}}moveWordForwards(){if(this.cursor>=this.value.length)return;this.lastAction=null;let _=this.value.slice(this.cursor),b=e4.segment(_)[Symbol.iterator](),Z=b.next();while(!Z.done&&i0(Z.value.segment))this.cursor+=Z.value.segment.length,Z=b.next();if(!Z.done){let z=Z.value.segment;if(o0(z))while(!Z.done&&o0(Z.value.segment))this.cursor+=Z.value.segment.length,Z=b.next();else while(!Z.done&&!i0(Z.value.segment)&&!o0(Z.value.segment))this.cursor+=Z.value.segment.length,Z=b.next()}}handlePaste(_){this.lastAction=null,this.pushUndo();let $=_.replace(/\r\n/g,"").replace(/\r/g,"").replace(/\n/g,"");this.value=this.value.slice(0,this.cursor)+$+this.value.slice(this.cursor),this.cursor+=$.length}invalidate(){}render(_){let b=_-2;if(b<=0)return["> "];let Z="",z=this.cursor;if(this.value.length<b)Z=this.value;else{let P=this.cursor===this.value.length?b-1:b,O=Math.floor(P/2),B=(y)=>{while(y<this.value.length){let u=this.value.charCodeAt(y);if(u>=56320&&u<57344){y++;continue}break}return y},T=(y)=>{while(y>0){let u=this.value.charCodeAt(y-1);if(u>=55296&&u<56320){y--;continue}break}return y};if(this.cursor<O)Z=this.value.slice(0,T(P)),z=this.cursor;else if(this.cursor>this.value.length-O){let y=B(this.value.length-P);Z=this.value.slice(y),z=this.cursor-y}else{let y=B(this.cursor-O);Z=this.value.slice(y,T(y+P)),z=O}}let J=[...e4.segment(Z.slice(z))][0],U=Z.slice(0,z),G=J?.segment??" ",Y=Z.slice(z+G.length),X=this.focused?a4:"",Q=`\x1B[7m${G}\x1B[27m`,K=U+X+Q+Y,v=_0(K),V=" ".repeat(Math.max(0,b-v));return["> "+K+V]}}function yJ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var s4=yJ();function LQ(_){s4=_}var J2={exec:()=>null};function J0(_,$=""){let b=typeof _==="string"?_:_.source,Z={replace:(z,A)=>{let J=typeof A==="string"?A:A.source;return J=J.replace(u0.caret,"$1"),b=b.replace(z,J),Z},getRegex:()=>{return new RegExp(b,$)}};return Z}var u0={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:(_)=>new RegExp(`^( {0,3}${_})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:(_)=>new RegExp(`^ {0,${Math.min(3,_-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:(_)=>new RegExp(`^ {0,${Math.min(3,_-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:(_)=>new RegExp(`^ {0,${Math.min(3,_-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:(_)=>new RegExp(`^ {0,${Math.min(3,_-1)}}#`),htmlBeginRegex:(_)=>new RegExp(`^ {0,${Math.min(3,_-1)}}<(?:[a-z].*>|!--)`,"i")},Sw=/^(?:[ \t]*(?:\n|$))+/,Rw=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Lw=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,U2=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Tw=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,CJ=/(?:[*+-]|\d{1,9}[.)])/,TQ=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,yQ=J0(TQ).replace(/bull/g,CJ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),yw=J0(TQ).replace(/bull/g,CJ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),fJ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Cw=/^[^\n]+/,mJ=/(?!\s*\])(?:\\.|[^\[\]\\])+/,fw=J0(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",mJ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),mw=J0(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,CJ).getRegex(),m6="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",uJ=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,uw=J0("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",uJ).replace("tag",m6).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),CQ=J0(fJ).replace("hr",U2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",m6).getRegex(),hw=J0(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",CQ).getRegex(),hJ={blockquote:hw,code:Rw,def:fw,fences:Lw,heading:Tw,hr:U2,html:uw,lheading:yQ,list:mw,newline:Sw,paragraph:CQ,table:J2,text:Cw},OQ=J0("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",U2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",m6).getRegex(),cw={...hJ,lheading:yw,table:OQ,paragraph:J0(fJ).replace("hr",U2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",OQ).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",m6).getRegex()},rw={...hJ,html:J0(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",uJ).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:J2,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:J0(fJ).replace("hr",U2).replace("heading",` *#{1,6} *[^
157
- ]`).replace("lheading",yQ).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},nw=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,lw=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,fQ=/^( {2,}|\\)\n(?!\s*$)/,pw=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,u6=/[\p{P}\p{S}]/u,cJ=/[\s\p{P}\p{S}]/u,mQ=/[^\s\p{P}\p{S}]/u,dw=J0(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,cJ).getRegex(),uQ=/(?!~)[\p{P}\p{S}]/u,iw=/(?!~)[\s\p{P}\p{S}]/u,ow=/(?:[^\s\p{P}\p{S}]|~)/u,aw=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,hQ=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ew=J0(hQ,"u").replace(/punct/g,u6).getRegex(),tw=J0(hQ,"u").replace(/punct/g,uQ).getRegex(),cQ="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",sw=J0(cQ,"gu").replace(/notPunctSpace/g,mQ).replace(/punctSpace/g,cJ).replace(/punct/g,u6).getRegex(),_x=J0(cQ,"gu").replace(/notPunctSpace/g,ow).replace(/punctSpace/g,iw).replace(/punct/g,uQ).getRegex(),$x=J0("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,mQ).replace(/punctSpace/g,cJ).replace(/punct/g,u6).getRegex(),zx=J0(/\\(punct)/,"gu").replace(/punct/g,u6).getRegex(),bx=J0(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[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])?)+(?![-_])/).getRegex(),Zx=J0(uJ).replace("(?:-->|$)","-->").getRegex(),Ax=J0("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Zx).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),y6=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Jx=J0(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",y6).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),rQ=J0(/^!?\[(label)\]\[(ref)\]/).replace("label",y6).replace("ref",mJ).getRegex(),nQ=J0(/^!?\[(ref)\](?:\[\])?/).replace("ref",mJ).getRegex(),Ux=J0("reflink|nolink(?!\\()","g").replace("reflink",rQ).replace("nolink",nQ).getRegex(),rJ={_backpedal:J2,anyPunctuation:zx,autolink:bx,blockSkip:aw,br:fQ,code:lw,del:J2,emStrongLDelim:ew,emStrongRDelimAst:sw,emStrongRDelimUnd:$x,escape:nw,link:Jx,nolink:nQ,punctuation:dw,reflink:rQ,reflinkSearch:Ux,tag:Ax,text:pw,url:J2},Gx={...rJ,link:J0(/^!?\[(label)\]\((.*?)\)/).replace("label",y6).getRegex(),reflink:J0(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",y6).getRegex()},TJ={...rJ,emStrongRDelimAst:_x,emStrongLDelim:tw,url:J0(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Yx={...TJ,br:J0(fQ).replace("{2,}","*").getRegex(),text:J0(TJ.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},L6={normal:hJ,gfm:cw,pedantic:rw},Z2={normal:rJ,gfm:TJ,breaks:Yx,pedantic:Gx},Xx={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},PQ=(_)=>Xx[_];function m_(_,$){if($){if(u0.escapeTest.test(_))return _.replace(u0.escapeReplace,PQ)}else if(u0.escapeTestNoEncode.test(_))return _.replace(u0.escapeReplaceNoEncode,PQ);return _}function jQ(_){try{_=encodeURI(_).replace(u0.percentDecode,"%")}catch{return null}return _}function SQ(_,$){let b=_.replace(u0.findPipe,(A,J,U)=>{let G=!1,Y=J;while(--Y>=0&&U[Y]==="\\")G=!G;if(G)return"|";else return" |"}),Z=b.split(u0.splitPipe),z=0;if(!Z[0].trim())Z.shift();if(Z.length>0&&!Z.at(-1)?.trim())Z.pop();if($)if(Z.length>$)Z.splice($);else while(Z.length<$)Z.push("");for(;z<Z.length;z++)Z[z]=Z[z].trim().replace(u0.slashPipe,"|");return Z}function A2(_,$,b){let Z=_.length;if(Z===0)return"";let z=0;while(z<Z){let A=_.charAt(Z-z-1);if(A===$&&!b)z++;else if(A!==$&&b)z++;else break}return _.slice(0,Z-z)}function Qx(_,$){if(_.indexOf($[1])===-1)return-1;let b=0;for(let Z=0;Z<_.length;Z++)if(_[Z]==="\\")Z++;else if(_[Z]===$[0])b++;else if(_[Z]===$[1]){if(b--,b<0)return Z}if(b>0)return-2;return-1}function RQ(_,$,b,Z,z){let A=$.href,J=$.title||null,U=_[1].replace(z.other.outputLinkReplace,"$1");Z.state.inLink=!0;let G={type:_[0].charAt(0)==="!"?"image":"link",raw:b,href:A,title:J,text:U,tokens:Z.inlineTokens(U)};return Z.state.inLink=!1,G}function Kx(_,$,b){let Z=_.match(b.other.indentCodeCompensation);if(Z===null)return $;let z=Z[1];return $.split(`
155
+ `);if($.length===1){let b=this.state.lines[this.state.cursorLine]||"",Z=_.length,z=b.slice(0,this.state.cursorCol-Z),A=b.slice(this.state.cursorCol);this.state.lines[this.state.cursorLine]=z+A,this.setCursorCol(this.state.cursorCol-Z)}else{let b=this.state.cursorLine-($.length-1),Z=(this.state.lines[b]||"").length-($[0]||"").length,z=(this.state.lines[this.state.cursorLine]||"").slice(this.state.cursorCol),A=(this.state.lines[b]||"").slice(0,Z);this.state.lines.splice(b,$.length,A+z),this.state.cursorLine=b,this.setCursorCol(Z)}if(this.onChange)this.onChange(this.getText())}pushUndoSnapshot(){this.undoStack.push(this.state)}undo(){this.historyIndex=-1;let _=this.undoStack.pop();if(!_)return;if(Object.assign(this.state,_),this.lastAction=null,this.preferredVisualCol=null,this.onChange)this.onChange(this.getText())}jumpToChar(_,$){this.lastAction=null;let b=$==="forward",Z=this.state.lines,z=b?Z.length:-1,A=b?1:-1;for(let J=this.state.cursorLine;J!==z;J+=A){let U=Z[J]||"",Y=J===this.state.cursorLine?b?this.state.cursorCol+1:this.state.cursorCol-1:void 0,X=b?U.indexOf(_,Y):U.lastIndexOf(_,Y);if(X!==-1){this.state.cursorLine=J,this.setCursorCol(X);return}}}moveWordForwards(){this.lastAction=null;let _=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol>=_.length){if(this.state.cursorLine<this.state.lines.length-1)this.state.cursorLine++,this.setCursorCol(0);return}let $=_.slice(this.state.cursorCol),Z=M4.segment($)[Symbol.iterator](),z=Z.next(),A=this.state.cursorCol;while(!z.done&&o0(z.value.segment))A+=z.value.segment.length,z=Z.next();if(!z.done){let J=z.value.segment;if(a0(J))while(!z.done&&a0(z.value.segment))A+=z.value.segment.length,z=Z.next();else while(!z.done&&!o0(z.value.segment)&&!a0(z.value.segment))A+=z.value.segment.length,z=Z.next()}this.setCursorCol(A)}isSlashMenuAllowed(){return this.state.cursorLine===0}isAtStartOfMessage(){if(!this.isSlashMenuAllowed())return!1;let $=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);return $.trim()===""||$.trim()==="/"}isInSlashCommandContext(_){return this.isSlashMenuAllowed()&&_.trimStart().startsWith("/")}shouldChainSlashArgumentAutocompleteOnTabSelection(){if(this.autocompleteState!=="regular")return!1;let $=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);return this.isInSlashCommandContext($)&&!$.trimStart().includes(" ")}isBareCompletedSlashCommandAtCursor(){let _=this.state.lines[this.state.cursorLine]||"";if(this.state.cursorCol!==_.length)return!1;let $=_.slice(0,this.state.cursorCol).trimStart();return/^\/\S+ $/.test($)}getBestAutocompleteMatchIndex(_,$){if(!$)return-1;let b=-1;for(let Z=0;Z<_.length;Z++){let z=_[Z].value;if(z===$)return Z;if(b===-1&&z.startsWith($))b=Z}return b}tryTriggerAutocomplete(_=!1){if(!this.autocompleteProvider)return;if(_){let b=this.autocompleteProvider;if(!(!b.shouldTriggerFileCompletion||b.shouldTriggerFileCompletion(this.state.lines,this.state.cursorLine,this.state.cursorCol)))return}let $=this.autocompleteProvider.getSuggestions(this.state.lines,this.state.cursorLine,this.state.cursorCol);if($&&$.items.length>0){this.autocompletePrefix=$.prefix,this.autocompleteList=new I4($.items,this.autocompleteMaxVisible,this.theme.selectList);let b=this.getBestAutocompleteMatchIndex($.items,$.prefix);if(b>=0)this.autocompleteList.setSelectedIndex(b);this.autocompleteState="regular"}else this.cancelAutocomplete()}handleTabCompletion(){if(!this.autocompleteProvider)return;let $=(this.state.lines[this.state.cursorLine]||"").slice(0,this.state.cursorCol);if(this.isInSlashCommandContext($)&&!$.trimStart().includes(" "))this.handleSlashCommandCompletion();else this.forceFileAutocomplete(!0)}handleSlashCommandCompletion(){this.tryTriggerAutocomplete(!0)}forceFileAutocomplete(_=!1){if(!this.autocompleteProvider)return;let $=this.autocompleteProvider;if(typeof $.getForceFileSuggestions!=="function"){this.tryTriggerAutocomplete(!0);return}let b=$.getForceFileSuggestions(this.state.lines,this.state.cursorLine,this.state.cursorCol);if(b&&b.items.length>0){if(_&&b.items.length===1){let z=b.items[0];this.pushUndoSnapshot(),this.lastAction=null;let A=this.autocompleteProvider.applyCompletion(this.state.lines,this.state.cursorLine,this.state.cursorCol,z,b.prefix);if(this.state.lines=A.lines,this.state.cursorLine=A.cursorLine,this.setCursorCol(A.cursorCol),this.onChange)this.onChange(this.getText());return}this.autocompletePrefix=b.prefix,this.autocompleteList=new I4(b.items,this.autocompleteMaxVisible,this.theme.selectList);let Z=this.getBestAutocompleteMatchIndex(b.items,b.prefix);if(Z>=0)this.autocompleteList.setSelectedIndex(Z);this.autocompleteState="force"}else this.cancelAutocomplete()}cancelAutocomplete(){this.autocompleteState=null,this.autocompleteList=void 0,this.autocompletePrefix=""}isShowingAutocomplete(){return this.autocompleteState!==null}updateAutocomplete(){if(!this.autocompleteState||!this.autocompleteProvider)return;if(this.autocompleteState==="force"){this.forceFileAutocomplete();return}let _=this.autocompleteProvider.getSuggestions(this.state.lines,this.state.cursorLine,this.state.cursorCol);if(_&&_.items.length>0){this.autocompletePrefix=_.prefix,this.autocompleteList=new I4(_.items,this.autocompleteMaxVisible,this.theme.selectList);let $=this.getBestAutocompleteMatchIndex(_.items,_.prefix);if($>=0)this.autocompleteList.setSelectedIndex($)}else this.cancelAutocomplete()}}var e4=N6();class CJ{value="";cursor=0;onSubmit;onEscape;focused=!1;pasteBuffer="";isInPaste=!1;killRing=new _2;lastAction=null;undoStack=new z2;getValue(){return this.value}setValue(_){this.value=_,this.cursor=Math.min(this.cursor,_.length)}handleInput(_){if(_.includes("\x1B[200~"))this.isInPaste=!0,this.pasteBuffer="",_=_.replace("\x1B[200~","");if(this.isInPaste){this.pasteBuffer+=_;let z=this.pasteBuffer.indexOf("\x1B[201~");if(z!==-1){let A=this.pasteBuffer.substring(0,z);this.handlePaste(A),this.isInPaste=!1;let J=this.pasteBuffer.substring(z+6);if(this.pasteBuffer="",J)this.handleInput(J)}return}let $=m_();if($.matches(_,"selectCancel")){if(this.onEscape)this.onEscape();return}if($.matches(_,"undo")){this.undo();return}if($.matches(_,"submit")||_===`
156
+ `){if(this.onSubmit)this.onSubmit(this.value);return}if($.matches(_,"deleteCharBackward")){this.handleBackspace();return}if($.matches(_,"deleteCharForward")){this.handleForwardDelete();return}if($.matches(_,"deleteWordBackward")){this.deleteWordBackwards();return}if($.matches(_,"deleteWordForward")){this.deleteWordForward();return}if($.matches(_,"deleteToLineStart")){this.deleteToLineStart();return}if($.matches(_,"deleteToLineEnd")){this.deleteToLineEnd();return}if($.matches(_,"yank")){this.yank();return}if($.matches(_,"yankPop")){this.yankPop();return}if($.matches(_,"cursorLeft")){if(this.lastAction=null,this.cursor>0){let z=this.value.slice(0,this.cursor),A=[...e4.segment(z)],J=A[A.length-1];this.cursor-=J?J.segment.length:1}return}if($.matches(_,"cursorRight")){if(this.lastAction=null,this.cursor<this.value.length){let z=this.value.slice(this.cursor),J=[...e4.segment(z)][0];this.cursor+=J?J.segment.length:1}return}if($.matches(_,"cursorLineStart")){this.lastAction=null,this.cursor=0;return}if($.matches(_,"cursorLineEnd")){this.lastAction=null,this.cursor=this.value.length;return}if($.matches(_,"cursorWordLeft")){this.moveWordBackwards();return}if($.matches(_,"cursorWordRight")){this.moveWordForwards();return}let b=s$(_);if(b!==void 0){this.insertCharacter(b);return}if(![..._].some((z)=>{let A=z.charCodeAt(0);return A<32||A===127||A>=128&&A<=159}))this.insertCharacter(_)}insertCharacter(_){if(o0(_)||this.lastAction!=="type-word")this.pushUndo();this.lastAction="type-word",this.value=this.value.slice(0,this.cursor)+_+this.value.slice(this.cursor),this.cursor+=_.length}handleBackspace(){if(this.lastAction=null,this.cursor>0){this.pushUndo();let _=this.value.slice(0,this.cursor),$=[...e4.segment(_)],b=$[$.length-1],Z=b?b.segment.length:1;this.value=this.value.slice(0,this.cursor-Z)+this.value.slice(this.cursor),this.cursor-=Z}}handleForwardDelete(){if(this.lastAction=null,this.cursor<this.value.length){this.pushUndo();let _=this.value.slice(this.cursor),b=[...e4.segment(_)][0],Z=b?b.segment.length:1;this.value=this.value.slice(0,this.cursor)+this.value.slice(this.cursor+Z)}}deleteToLineStart(){if(this.cursor===0)return;this.pushUndo();let _=this.value.slice(0,this.cursor);this.killRing.push(_,{prepend:!0,accumulate:this.lastAction==="kill"}),this.lastAction="kill",this.value=this.value.slice(this.cursor),this.cursor=0}deleteToLineEnd(){if(this.cursor>=this.value.length)return;this.pushUndo();let _=this.value.slice(this.cursor);this.killRing.push(_,{prepend:!1,accumulate:this.lastAction==="kill"}),this.lastAction="kill",this.value=this.value.slice(0,this.cursor)}deleteWordBackwards(){if(this.cursor===0)return;let _=this.lastAction==="kill";this.pushUndo();let $=this.cursor;this.moveWordBackwards();let b=this.cursor;this.cursor=$;let Z=this.value.slice(b,this.cursor);this.killRing.push(Z,{prepend:!0,accumulate:_}),this.lastAction="kill",this.value=this.value.slice(0,b)+this.value.slice(this.cursor),this.cursor=b}deleteWordForward(){if(this.cursor>=this.value.length)return;let _=this.lastAction==="kill";this.pushUndo();let $=this.cursor;this.moveWordForwards();let b=this.cursor;this.cursor=$;let Z=this.value.slice(this.cursor,b);this.killRing.push(Z,{prepend:!1,accumulate:_}),this.lastAction="kill",this.value=this.value.slice(0,this.cursor)+this.value.slice(b)}yank(){let _=this.killRing.peek();if(!_)return;this.pushUndo(),this.value=this.value.slice(0,this.cursor)+_+this.value.slice(this.cursor),this.cursor+=_.length,this.lastAction="yank"}yankPop(){if(this.lastAction!=="yank"||this.killRing.length<=1)return;this.pushUndo();let _=this.killRing.peek()||"";this.value=this.value.slice(0,this.cursor-_.length)+this.value.slice(this.cursor),this.cursor-=_.length,this.killRing.rotate();let $=this.killRing.peek()||"";this.value=this.value.slice(0,this.cursor)+$+this.value.slice(this.cursor),this.cursor+=$.length,this.lastAction="yank"}pushUndo(){this.undoStack.push({value:this.value,cursor:this.cursor})}undo(){let _=this.undoStack.pop();if(!_)return;this.value=_.value,this.cursor=_.cursor,this.lastAction=null}moveWordBackwards(){if(this.cursor===0)return;this.lastAction=null;let _=this.value.slice(0,this.cursor),$=[...e4.segment(_)];while($.length>0&&o0($[$.length-1]?.segment||""))this.cursor-=$.pop()?.segment.length||0;if($.length>0){let b=$[$.length-1]?.segment||"";if(a0(b))while($.length>0&&a0($[$.length-1]?.segment||""))this.cursor-=$.pop()?.segment.length||0;else while($.length>0&&!o0($[$.length-1]?.segment||"")&&!a0($[$.length-1]?.segment||""))this.cursor-=$.pop()?.segment.length||0}}moveWordForwards(){if(this.cursor>=this.value.length)return;this.lastAction=null;let _=this.value.slice(this.cursor),b=e4.segment(_)[Symbol.iterator](),Z=b.next();while(!Z.done&&o0(Z.value.segment))this.cursor+=Z.value.segment.length,Z=b.next();if(!Z.done){let z=Z.value.segment;if(a0(z))while(!Z.done&&a0(Z.value.segment))this.cursor+=Z.value.segment.length,Z=b.next();else while(!Z.done&&!o0(Z.value.segment)&&!a0(Z.value.segment))this.cursor+=Z.value.segment.length,Z=b.next()}}handlePaste(_){this.lastAction=null,this.pushUndo();let $=_.replace(/\r\n/g,"").replace(/\r/g,"").replace(/\n/g,"");this.value=this.value.slice(0,this.cursor)+$+this.value.slice(this.cursor),this.cursor+=$.length}invalidate(){}render(_){let b=_-2;if(b<=0)return["> "];let Z="",z=this.cursor;if(this.value.length<b)Z=this.value;else{let P=this.cursor===this.value.length?b-1:b,E=Math.floor(P/2),B=(f)=>{while(f<this.value.length){let u=this.value.charCodeAt(f);if(u>=56320&&u<57344){f++;continue}break}return f},C=(f)=>{while(f>0){let u=this.value.charCodeAt(f-1);if(u>=55296&&u<56320){f--;continue}break}return f};if(this.cursor<E)Z=this.value.slice(0,C(P)),z=this.cursor;else if(this.cursor>this.value.length-E){let f=B(this.value.length-P);Z=this.value.slice(f),z=this.cursor-f}else{let f=B(this.cursor-E);Z=this.value.slice(f,C(f+P)),z=E}}let J=[...e4.segment(Z.slice(z))][0],U=Z.slice(0,z),G=J?.segment??" ",Y=Z.slice(z+G.length),X=this.focused?a4:"",Q=`\x1B[7m${G}\x1B[27m`,K=U+X+Q+Y,v=_0(K),D=" ".repeat(Math.max(0,b-v));return["> "+K+D]}}function mJ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var s4=mJ();function mQ(_){s4=_}var A2={exec:()=>null};function J0(_,$=""){let b=typeof _==="string"?_:_.source,Z={replace:(z,A)=>{let J=typeof A==="string"?A:A.source;return J=J.replace(u0.caret,"$1"),b=b.replace(z,J),Z},getRegex:()=>{return new RegExp(b,$)}};return Z}var u0={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:(_)=>new RegExp(`^( {0,3}${_})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:(_)=>new RegExp(`^ {0,${Math.min(3,_-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:(_)=>new RegExp(`^ {0,${Math.min(3,_-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:(_)=>new RegExp(`^ {0,${Math.min(3,_-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:(_)=>new RegExp(`^ {0,${Math.min(3,_-1)}}#`),htmlBeginRegex:(_)=>new RegExp(`^ {0,${Math.min(3,_-1)}}<(?:[a-z].*>|!--)`,"i")},mB=/^(?:[ \t]*(?:\n|$))+/,uB=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,cB=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,J2=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,hB=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,uJ=/(?:[*+-]|\d{1,9}[.)])/,uQ=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,cQ=J0(uQ).replace(/bull/g,uJ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),rB=J0(uQ).replace(/bull/g,uJ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),cJ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,nB=/^[^\n]+/,hJ=/(?!\s*\])(?:\\.|[^\[\]\\])+/,lB=J0(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",hJ).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),pB=J0(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,uJ).getRegex(),f6="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",rJ=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,dB=J0("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",rJ).replace("tag",f6).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),hQ=J0(cJ).replace("hr",J2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",f6).getRegex(),iB=J0(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",hQ).getRegex(),nJ={blockquote:iB,code:uB,def:lB,fences:cB,heading:hB,hr:J2,html:dB,lheading:cQ,list:pB,newline:mB,paragraph:hQ,table:A2,text:nB},LQ=J0("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",J2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",f6).getRegex(),oB={...nJ,lheading:rB,table:LQ,paragraph:J0(cJ).replace("hr",J2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",LQ).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",f6).getRegex()},aB={...nJ,html:J0(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",rJ).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:A2,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:J0(cJ).replace("hr",J2).replace("heading",` *#{1,6} *[^
157
+ ]`).replace("lheading",cQ).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},eB=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,tB=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,rQ=/^( {2,}|\\)\n(?!\s*$)/,sB=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,m6=/[\p{P}\p{S}]/u,lJ=/[\s\p{P}\p{S}]/u,nQ=/[^\s\p{P}\p{S}]/u,_x=J0(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,lJ).getRegex(),lQ=/(?!~)[\p{P}\p{S}]/u,$x=/(?!~)[\s\p{P}\p{S}]/u,zx=/(?:[^\s\p{P}\p{S}]|~)/u,bx=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,pQ=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Zx=J0(pQ,"u").replace(/punct/g,m6).getRegex(),Ax=J0(pQ,"u").replace(/punct/g,lQ).getRegex(),dQ="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Jx=J0(dQ,"gu").replace(/notPunctSpace/g,nQ).replace(/punctSpace/g,lJ).replace(/punct/g,m6).getRegex(),Ux=J0(dQ,"gu").replace(/notPunctSpace/g,zx).replace(/punctSpace/g,$x).replace(/punct/g,lQ).getRegex(),Gx=J0("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,nQ).replace(/punctSpace/g,lJ).replace(/punct/g,m6).getRegex(),Yx=J0(/\\(punct)/,"gu").replace(/punct/g,m6).getRegex(),Xx=J0(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[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])?)+(?![-_])/).getRegex(),Qx=J0(rJ).replace("(?:-->|$)","-->").getRegex(),Kx=J0("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Qx).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),T6=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Fx=J0(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",T6).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),iQ=J0(/^!?\[(label)\]\[(ref)\]/).replace("label",T6).replace("ref",hJ).getRegex(),oQ=J0(/^!?\[(ref)\](?:\[\])?/).replace("ref",hJ).getRegex(),vx=J0("reflink|nolink(?!\\()","g").replace("reflink",iQ).replace("nolink",oQ).getRegex(),pJ={_backpedal:A2,anyPunctuation:Yx,autolink:Xx,blockSkip:bx,br:rQ,code:tB,del:A2,emStrongLDelim:Zx,emStrongRDelimAst:Jx,emStrongRDelimUnd:Gx,escape:eB,link:Fx,nolink:oQ,punctuation:_x,reflink:iQ,reflinkSearch:vx,tag:Kx,text:sB,url:A2},Hx={...pJ,link:J0(/^!?\[(label)\]\((.*?)\)/).replace("label",T6).getRegex(),reflink:J0(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",T6).getRegex()},fJ={...pJ,emStrongRDelimAst:Ux,emStrongLDelim:Ax,url:J0(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},qx={...fJ,br:J0(rQ).replace("{2,}","*").getRegex(),text:J0(fJ.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},R6={normal:nJ,gfm:oB,pedantic:aB},b2={normal:pJ,gfm:fJ,breaks:qx,pedantic:Hx},Dx={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},TQ=(_)=>Dx[_];function u_(_,$){if($){if(u0.escapeTest.test(_))return _.replace(u0.escapeReplace,TQ)}else if(u0.escapeTestNoEncode.test(_))return _.replace(u0.escapeReplaceNoEncode,TQ);return _}function yQ(_){try{_=encodeURI(_).replace(u0.percentDecode,"%")}catch{return null}return _}function CQ(_,$){let b=_.replace(u0.findPipe,(A,J,U)=>{let G=!1,Y=J;while(--Y>=0&&U[Y]==="\\")G=!G;if(G)return"|";else return" |"}),Z=b.split(u0.splitPipe),z=0;if(!Z[0].trim())Z.shift();if(Z.length>0&&!Z.at(-1)?.trim())Z.pop();if($)if(Z.length>$)Z.splice($);else while(Z.length<$)Z.push("");for(;z<Z.length;z++)Z[z]=Z[z].trim().replace(u0.slashPipe,"|");return Z}function Z2(_,$,b){let Z=_.length;if(Z===0)return"";let z=0;while(z<Z){let A=_.charAt(Z-z-1);if(A===$&&!b)z++;else if(A!==$&&b)z++;else break}return _.slice(0,Z-z)}function Vx(_,$){if(_.indexOf($[1])===-1)return-1;let b=0;for(let Z=0;Z<_.length;Z++)if(_[Z]==="\\")Z++;else if(_[Z]===$[0])b++;else if(_[Z]===$[1]){if(b--,b<0)return Z}if(b>0)return-2;return-1}function fQ(_,$,b,Z,z){let A=$.href,J=$.title||null,U=_[1].replace(z.other.outputLinkReplace,"$1");Z.state.inLink=!0;let G={type:_[0].charAt(0)==="!"?"image":"link",raw:b,href:A,title:J,text:U,tokens:Z.inlineTokens(U)};return Z.state.inLink=!1,G}function gx(_,$,b){let Z=_.match(b.other.indentCodeCompensation);if(Z===null)return $;let z=Z[1];return $.split(`
158
158
  `).map((A)=>{let J=A.match(b.other.beginningSpace);if(J===null)return A;let[U]=J;if(U.length>=z.length)return A.slice(z.length);return A}).join(`
159
- `)}var C6=class{options;rules;lexer;constructor(_){this.options=_||s4}space(_){let $=this.rules.block.newline.exec(_);if($&&$[0].length>0)return{type:"space",raw:$[0]}}code(_){let $=this.rules.block.code.exec(_);if($){let b=$[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:$[0],codeBlockStyle:"indented",text:!this.options.pedantic?A2(b,`
160
- `):b}}}fences(_){let $=this.rules.block.fences.exec(_);if($){let b=$[0],Z=Kx(b,$[3]||"",this.rules);return{type:"code",raw:b,lang:$[2]?$[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):$[2],text:Z}}}heading(_){let $=this.rules.block.heading.exec(_);if($){let b=$[2].trim();if(this.rules.other.endingHash.test(b)){let Z=A2(b,"#");if(this.options.pedantic)b=Z.trim();else if(!Z||this.rules.other.endingSpaceChar.test(Z))b=Z.trim()}return{type:"heading",raw:$[0],depth:$[1].length,text:b,tokens:this.lexer.inline(b)}}}hr(_){let $=this.rules.block.hr.exec(_);if($)return{type:"hr",raw:A2($[0],`
161
- `)}}blockquote(_){let $=this.rules.block.blockquote.exec(_);if($){let b=A2($[0],`
159
+ `)}var y6=class{options;rules;lexer;constructor(_){this.options=_||s4}space(_){let $=this.rules.block.newline.exec(_);if($&&$[0].length>0)return{type:"space",raw:$[0]}}code(_){let $=this.rules.block.code.exec(_);if($){let b=$[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:$[0],codeBlockStyle:"indented",text:!this.options.pedantic?Z2(b,`
160
+ `):b}}}fences(_){let $=this.rules.block.fences.exec(_);if($){let b=$[0],Z=gx(b,$[3]||"",this.rules);return{type:"code",raw:b,lang:$[2]?$[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):$[2],text:Z}}}heading(_){let $=this.rules.block.heading.exec(_);if($){let b=$[2].trim();if(this.rules.other.endingHash.test(b)){let Z=Z2(b,"#");if(this.options.pedantic)b=Z.trim();else if(!Z||this.rules.other.endingSpaceChar.test(Z))b=Z.trim()}return{type:"heading",raw:$[0],depth:$[1].length,text:b,tokens:this.lexer.inline(b)}}}hr(_){let $=this.rules.block.hr.exec(_);if($)return{type:"hr",raw:Z2($[0],`
161
+ `)}}blockquote(_){let $=this.rules.block.blockquote.exec(_);if($){let b=Z2($[0],`
162
162
  `).split(`
163
163
  `),Z="",z="",A=[];while(b.length>0){let J=!1,U=[],G;for(G=0;G<b.length;G++)if(this.rules.other.blockquoteStart.test(b[G]))U.push(b[G]),J=!0;else if(!J)U.push(b[G]);else break;b=b.slice(G);let Y=U.join(`
164
164
  `),X=Y.replace(this.rules.other.blockquoteSetextReplace,`
165
165
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");Z=Z?`${Z}
166
166
  ${Y}`:Y,z=z?`${z}
167
- ${X}`:X;let Q=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(X,A,!0),this.lexer.state.top=Q,b.length===0)break;let K=A.at(-1);if(K?.type==="code")break;else if(K?.type==="blockquote"){let v=K,V=v.raw+`
167
+ ${X}`:X;let Q=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(X,A,!0),this.lexer.state.top=Q,b.length===0)break;let K=A.at(-1);if(K?.type==="code")break;else if(K?.type==="blockquote"){let v=K,D=v.raw+`
168
168
  `+b.join(`
169
- `),w=this.blockquote(V);A[A.length-1]=w,Z=Z.substring(0,Z.length-v.raw.length)+w.raw,z=z.substring(0,z.length-v.text.length)+w.text;break}else if(K?.type==="list"){let v=K,V=v.raw+`
169
+ `),w=this.blockquote(D);A[A.length-1]=w,Z=Z.substring(0,Z.length-v.raw.length)+w.raw,z=z.substring(0,z.length-v.text.length)+w.text;break}else if(K?.type==="list"){let v=K,D=v.raw+`
170
170
  `+b.join(`
171
- `),w=this.list(V);A[A.length-1]=w,Z=Z.substring(0,Z.length-K.raw.length)+w.raw,z=z.substring(0,z.length-v.raw.length)+w.raw,b=V.substring(A.at(-1).raw.length).split(`
171
+ `),w=this.list(D);A[A.length-1]=w,Z=Z.substring(0,Z.length-K.raw.length)+w.raw,z=z.substring(0,z.length-v.raw.length)+w.raw,b=D.substring(A.at(-1).raw.length).split(`
172
172
  `);continue}}return{type:"blockquote",raw:Z,tokens:A,text:z}}}list(_){let $=this.rules.block.list.exec(_);if($){let b=$[1].trim(),Z=b.length>1,z={type:"list",raw:"",ordered:Z,start:Z?+b.slice(0,-1):"",loose:!1,items:[]};if(b=Z?`\\d{1,9}\\${b.slice(-1)}`:`\\${b}`,this.options.pedantic)b=Z?b:"[*+-]";let A=this.rules.other.listItemRegex(b),J=!1;while(_){let G=!1,Y="",X="";if(!($=A.exec(_)))break;if(this.rules.block.hr.test(_))break;Y=$[0],_=_.substring(Y.length);let Q=$[2].split(`
173
- `,1)[0].replace(this.rules.other.listReplaceTabs,(O)=>" ".repeat(3*O.length)),K=_.split(`
174
- `,1)[0],v=!Q.trim(),V=0;if(this.options.pedantic)V=2,X=Q.trimStart();else if(v)V=$[1].length+1;else V=$[2].search(this.rules.other.nonSpaceChar),V=V>4?1:V,X=Q.slice(V),V+=$[1].length;if(v&&this.rules.other.blankLine.test(K))Y+=K+`
175
- `,_=_.substring(K.length+1),G=!0;if(!G){let O=this.rules.other.nextBulletRegex(V),B=this.rules.other.hrRegex(V),T=this.rules.other.fencesBeginRegex(V),y=this.rules.other.headingBeginRegex(V),u=this.rules.other.htmlBeginRegex(V);while(_){let E=_.split(`
176
- `,1)[0],C;if(K=E,this.options.pedantic)K=K.replace(this.rules.other.listReplaceNesting," "),C=K;else C=K.replace(this.rules.other.tabCharGlobal," ");if(T.test(K))break;if(y.test(K))break;if(u.test(K))break;if(O.test(K))break;if(B.test(K))break;if(C.search(this.rules.other.nonSpaceChar)>=V||!K.trim())X+=`
177
- `+C.slice(V);else{if(v)break;if(Q.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(T.test(Q))break;if(y.test(Q))break;if(B.test(Q))break;X+=`
178
- `+K}if(!v&&!K.trim())v=!0;Y+=E+`
179
- `,_=_.substring(E.length+1),Q=C.slice(V)}}if(!z.loose){if(J)z.loose=!0;else if(this.rules.other.doubleBlankLine.test(Y))J=!0}let w=null,P;if(this.options.gfm){if(w=this.rules.other.listIsTask.exec(X),w)P=w[0]!=="[ ] ",X=X.replace(this.rules.other.listReplaceTask,"")}z.items.push({type:"list_item",raw:Y,task:!!w,checked:P,loose:!1,text:X,tokens:[]}),z.raw+=Y}let U=z.items.at(-1);if(U)U.raw=U.raw.trimEnd(),U.text=U.text.trimEnd();else return;z.raw=z.raw.trimEnd();for(let G=0;G<z.items.length;G++)if(this.lexer.state.top=!1,z.items[G].tokens=this.lexer.blockTokens(z.items[G].text,[]),!z.loose){let Y=z.items[G].tokens.filter((Q)=>Q.type==="space"),X=Y.length>0&&Y.some((Q)=>this.rules.other.anyLine.test(Q.raw));z.loose=X}if(z.loose)for(let G=0;G<z.items.length;G++)z.items[G].loose=!0;return z}}html(_){let $=this.rules.block.html.exec(_);if($)return{type:"html",block:!0,raw:$[0],pre:$[1]==="pre"||$[1]==="script"||$[1]==="style",text:$[0]}}def(_){let $=this.rules.block.def.exec(_);if($){let b=$[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),Z=$[2]?$[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",z=$[3]?$[3].substring(1,$[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):$[3];return{type:"def",tag:b,raw:$[0],href:Z,title:z}}}table(_){let $=this.rules.block.table.exec(_);if(!$)return;if(!this.rules.other.tableDelimiter.test($[2]))return;let b=SQ($[1]),Z=$[2].replace(this.rules.other.tableAlignChars,"").split("|"),z=$[3]?.trim()?$[3].replace(this.rules.other.tableRowBlankLine,"").split(`
180
- `):[],A={type:"table",raw:$[0],header:[],align:[],rows:[]};if(b.length!==Z.length)return;for(let J of Z)if(this.rules.other.tableAlignRight.test(J))A.align.push("right");else if(this.rules.other.tableAlignCenter.test(J))A.align.push("center");else if(this.rules.other.tableAlignLeft.test(J))A.align.push("left");else A.align.push(null);for(let J=0;J<b.length;J++)A.header.push({text:b[J],tokens:this.lexer.inline(b[J]),header:!0,align:A.align[J]});for(let J of z)A.rows.push(SQ(J,A.header.length).map((U,G)=>{return{text:U,tokens:this.lexer.inline(U),header:!1,align:A.align[G]}}));return A}lheading(_){let $=this.rules.block.lheading.exec(_);if($)return{type:"heading",raw:$[0],depth:$[2].charAt(0)==="="?1:2,text:$[1],tokens:this.lexer.inline($[1])}}paragraph(_){let $=this.rules.block.paragraph.exec(_);if($){let b=$[1].charAt($[1].length-1)===`
181
- `?$[1].slice(0,-1):$[1];return{type:"paragraph",raw:$[0],text:b,tokens:this.lexer.inline(b)}}}text(_){let $=this.rules.block.text.exec(_);if($)return{type:"text",raw:$[0],text:$[0],tokens:this.lexer.inline($[0])}}escape(_){let $=this.rules.inline.escape.exec(_);if($)return{type:"escape",raw:$[0],text:$[1]}}tag(_){let $=this.rules.inline.tag.exec(_);if($){if(!this.lexer.state.inLink&&this.rules.other.startATag.test($[0]))this.lexer.state.inLink=!0;else if(this.lexer.state.inLink&&this.rules.other.endATag.test($[0]))this.lexer.state.inLink=!1;if(!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test($[0]))this.lexer.state.inRawBlock=!0;else if(this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test($[0]))this.lexer.state.inRawBlock=!1;return{type:"html",raw:$[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:$[0]}}}link(_){let $=this.rules.inline.link.exec(_);if($){let b=$[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(b)){if(!this.rules.other.endAngleBracket.test(b))return;let A=A2(b.slice(0,-1),"\\");if((b.length-A.length)%2===0)return}else{let A=Qx($[2],"()");if(A===-2)return;if(A>-1){let U=($[0].indexOf("!")===0?5:4)+$[1].length+A;$[2]=$[2].substring(0,A),$[0]=$[0].substring(0,U).trim(),$[3]=""}}let Z=$[2],z="";if(this.options.pedantic){let A=this.rules.other.pedanticHrefTitle.exec(Z);if(A)Z=A[1],z=A[3]}else z=$[3]?$[3].slice(1,-1):"";if(Z=Z.trim(),this.rules.other.startAngleBracket.test(Z))if(this.options.pedantic&&!this.rules.other.endAngleBracket.test(b))Z=Z.slice(1);else Z=Z.slice(1,-1);return RQ($,{href:Z?Z.replace(this.rules.inline.anyPunctuation,"$1"):Z,title:z?z.replace(this.rules.inline.anyPunctuation,"$1"):z},$[0],this.lexer,this.rules)}}reflink(_,$){let b;if((b=this.rules.inline.reflink.exec(_))||(b=this.rules.inline.nolink.exec(_))){let Z=(b[2]||b[1]).replace(this.rules.other.multipleSpaceGlobal," "),z=$[Z.toLowerCase()];if(!z){let A=b[0].charAt(0);return{type:"text",raw:A,text:A}}return RQ(b,z,b[0],this.lexer,this.rules)}}emStrong(_,$,b=""){let Z=this.rules.inline.emStrongLDelim.exec(_);if(!Z)return;if(Z[3]&&b.match(this.rules.other.unicodeAlphaNumeric))return;if(!(Z[1]||Z[2])||!b||this.rules.inline.punctuation.exec(b)){let A=[...Z[0]].length-1,J,U,G=A,Y=0,X=Z[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;X.lastIndex=0,$=$.slice(-1*_.length+A);while((Z=X.exec($))!=null){if(J=Z[1]||Z[2]||Z[3]||Z[4]||Z[5]||Z[6],!J)continue;if(U=[...J].length,Z[3]||Z[4]){G+=U;continue}else if(Z[5]||Z[6]){if(A%3&&!((A+U)%3)){Y+=U;continue}}if(G-=U,G>0)continue;U=Math.min(U,U+G+Y);let Q=[...Z[0]][0].length,K=_.slice(0,A+Z.index+Q+U);if(Math.min(A,U)%2){let V=K.slice(1,-1);return{type:"em",raw:K,text:V,tokens:this.lexer.inlineTokens(V)}}let v=K.slice(2,-2);return{type:"strong",raw:K,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(_){let $=this.rules.inline.code.exec(_);if($){let b=$[2].replace(this.rules.other.newLineCharGlobal," "),Z=this.rules.other.nonSpaceChar.test(b),z=this.rules.other.startingSpaceChar.test(b)&&this.rules.other.endingSpaceChar.test(b);if(Z&&z)b=b.substring(1,b.length-1);return{type:"codespan",raw:$[0],text:b}}}br(_){let $=this.rules.inline.br.exec(_);if($)return{type:"br",raw:$[0]}}del(_){let $=this.rules.inline.del.exec(_);if($)return{type:"del",raw:$[0],text:$[2],tokens:this.lexer.inlineTokens($[2])}}autolink(_){let $=this.rules.inline.autolink.exec(_);if($){let b,Z;if($[2]==="@")b=$[1],Z="mailto:"+b;else b=$[1],Z=b;return{type:"link",raw:$[0],text:b,href:Z,tokens:[{type:"text",raw:b,text:b}]}}}url(_){let $;if($=this.rules.inline.url.exec(_)){let b,Z;if($[2]==="@")b=$[0],Z="mailto:"+b;else{let z;do z=$[0],$[0]=this.rules.inline._backpedal.exec($[0])?.[0]??"";while(z!==$[0]);if(b=$[0],$[1]==="www.")Z="http://"+$[0];else Z=$[0]}return{type:"link",raw:$[0],text:b,href:Z,tokens:[{type:"text",raw:b,text:b}]}}}inlineText(_){let $=this.rules.inline.text.exec(_);if($){let b=this.lexer.state.inRawBlock;return{type:"text",raw:$[0],text:$[0],escaped:b}}}},$4=class _{tokens;options;state;tokenizer;inlineQueue;constructor($){this.tokens=[],this.tokens.links=Object.create(null),this.options=$||s4,this.options.tokenizer=this.options.tokenizer||new C6,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let b={other:u0,block:L6.normal,inline:Z2.normal};if(this.options.pedantic)b.block=L6.pedantic,b.inline=Z2.pedantic;else if(this.options.gfm)if(b.block=L6.gfm,this.options.breaks)b.inline=Z2.breaks;else b.inline=Z2.gfm;this.tokenizer.rules=b}static get rules(){return{block:L6,inline:Z2}}static lex($,b){return new _(b).lex($)}static lexInline($,b){return new _(b).inlineTokens($)}lex($){$=$.replace(u0.carriageReturn,`
173
+ `,1)[0].replace(this.rules.other.listReplaceTabs,(E)=>" ".repeat(3*E.length)),K=_.split(`
174
+ `,1)[0],v=!Q.trim(),D=0;if(this.options.pedantic)D=2,X=Q.trimStart();else if(v)D=$[1].length+1;else D=$[2].search(this.rules.other.nonSpaceChar),D=D>4?1:D,X=Q.slice(D),D+=$[1].length;if(v&&this.rules.other.blankLine.test(K))Y+=K+`
175
+ `,_=_.substring(K.length+1),G=!0;if(!G){let E=this.rules.other.nextBulletRegex(D),B=this.rules.other.hrRegex(D),C=this.rules.other.fencesBeginRegex(D),f=this.rules.other.headingBeginRegex(D),u=this.rules.other.htmlBeginRegex(D);while(_){let O=_.split(`
176
+ `,1)[0],T;if(K=O,this.options.pedantic)K=K.replace(this.rules.other.listReplaceNesting," "),T=K;else T=K.replace(this.rules.other.tabCharGlobal," ");if(C.test(K))break;if(f.test(K))break;if(u.test(K))break;if(E.test(K))break;if(B.test(K))break;if(T.search(this.rules.other.nonSpaceChar)>=D||!K.trim())X+=`
177
+ `+T.slice(D);else{if(v)break;if(Q.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(C.test(Q))break;if(f.test(Q))break;if(B.test(Q))break;X+=`
178
+ `+K}if(!v&&!K.trim())v=!0;Y+=O+`
179
+ `,_=_.substring(O.length+1),Q=T.slice(D)}}if(!z.loose){if(J)z.loose=!0;else if(this.rules.other.doubleBlankLine.test(Y))J=!0}let w=null,P;if(this.options.gfm){if(w=this.rules.other.listIsTask.exec(X),w)P=w[0]!=="[ ] ",X=X.replace(this.rules.other.listReplaceTask,"")}z.items.push({type:"list_item",raw:Y,task:!!w,checked:P,loose:!1,text:X,tokens:[]}),z.raw+=Y}let U=z.items.at(-1);if(U)U.raw=U.raw.trimEnd(),U.text=U.text.trimEnd();else return;z.raw=z.raw.trimEnd();for(let G=0;G<z.items.length;G++)if(this.lexer.state.top=!1,z.items[G].tokens=this.lexer.blockTokens(z.items[G].text,[]),!z.loose){let Y=z.items[G].tokens.filter((Q)=>Q.type==="space"),X=Y.length>0&&Y.some((Q)=>this.rules.other.anyLine.test(Q.raw));z.loose=X}if(z.loose)for(let G=0;G<z.items.length;G++)z.items[G].loose=!0;return z}}html(_){let $=this.rules.block.html.exec(_);if($)return{type:"html",block:!0,raw:$[0],pre:$[1]==="pre"||$[1]==="script"||$[1]==="style",text:$[0]}}def(_){let $=this.rules.block.def.exec(_);if($){let b=$[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),Z=$[2]?$[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",z=$[3]?$[3].substring(1,$[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):$[3];return{type:"def",tag:b,raw:$[0],href:Z,title:z}}}table(_){let $=this.rules.block.table.exec(_);if(!$)return;if(!this.rules.other.tableDelimiter.test($[2]))return;let b=CQ($[1]),Z=$[2].replace(this.rules.other.tableAlignChars,"").split("|"),z=$[3]?.trim()?$[3].replace(this.rules.other.tableRowBlankLine,"").split(`
180
+ `):[],A={type:"table",raw:$[0],header:[],align:[],rows:[]};if(b.length!==Z.length)return;for(let J of Z)if(this.rules.other.tableAlignRight.test(J))A.align.push("right");else if(this.rules.other.tableAlignCenter.test(J))A.align.push("center");else if(this.rules.other.tableAlignLeft.test(J))A.align.push("left");else A.align.push(null);for(let J=0;J<b.length;J++)A.header.push({text:b[J],tokens:this.lexer.inline(b[J]),header:!0,align:A.align[J]});for(let J of z)A.rows.push(CQ(J,A.header.length).map((U,G)=>{return{text:U,tokens:this.lexer.inline(U),header:!1,align:A.align[G]}}));return A}lheading(_){let $=this.rules.block.lheading.exec(_);if($)return{type:"heading",raw:$[0],depth:$[2].charAt(0)==="="?1:2,text:$[1],tokens:this.lexer.inline($[1])}}paragraph(_){let $=this.rules.block.paragraph.exec(_);if($){let b=$[1].charAt($[1].length-1)===`
181
+ `?$[1].slice(0,-1):$[1];return{type:"paragraph",raw:$[0],text:b,tokens:this.lexer.inline(b)}}}text(_){let $=this.rules.block.text.exec(_);if($)return{type:"text",raw:$[0],text:$[0],tokens:this.lexer.inline($[0])}}escape(_){let $=this.rules.inline.escape.exec(_);if($)return{type:"escape",raw:$[0],text:$[1]}}tag(_){let $=this.rules.inline.tag.exec(_);if($){if(!this.lexer.state.inLink&&this.rules.other.startATag.test($[0]))this.lexer.state.inLink=!0;else if(this.lexer.state.inLink&&this.rules.other.endATag.test($[0]))this.lexer.state.inLink=!1;if(!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test($[0]))this.lexer.state.inRawBlock=!0;else if(this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test($[0]))this.lexer.state.inRawBlock=!1;return{type:"html",raw:$[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:$[0]}}}link(_){let $=this.rules.inline.link.exec(_);if($){let b=$[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(b)){if(!this.rules.other.endAngleBracket.test(b))return;let A=Z2(b.slice(0,-1),"\\");if((b.length-A.length)%2===0)return}else{let A=Vx($[2],"()");if(A===-2)return;if(A>-1){let U=($[0].indexOf("!")===0?5:4)+$[1].length+A;$[2]=$[2].substring(0,A),$[0]=$[0].substring(0,U).trim(),$[3]=""}}let Z=$[2],z="";if(this.options.pedantic){let A=this.rules.other.pedanticHrefTitle.exec(Z);if(A)Z=A[1],z=A[3]}else z=$[3]?$[3].slice(1,-1):"";if(Z=Z.trim(),this.rules.other.startAngleBracket.test(Z))if(this.options.pedantic&&!this.rules.other.endAngleBracket.test(b))Z=Z.slice(1);else Z=Z.slice(1,-1);return fQ($,{href:Z?Z.replace(this.rules.inline.anyPunctuation,"$1"):Z,title:z?z.replace(this.rules.inline.anyPunctuation,"$1"):z},$[0],this.lexer,this.rules)}}reflink(_,$){let b;if((b=this.rules.inline.reflink.exec(_))||(b=this.rules.inline.nolink.exec(_))){let Z=(b[2]||b[1]).replace(this.rules.other.multipleSpaceGlobal," "),z=$[Z.toLowerCase()];if(!z){let A=b[0].charAt(0);return{type:"text",raw:A,text:A}}return fQ(b,z,b[0],this.lexer,this.rules)}}emStrong(_,$,b=""){let Z=this.rules.inline.emStrongLDelim.exec(_);if(!Z)return;if(Z[3]&&b.match(this.rules.other.unicodeAlphaNumeric))return;if(!(Z[1]||Z[2])||!b||this.rules.inline.punctuation.exec(b)){let A=[...Z[0]].length-1,J,U,G=A,Y=0,X=Z[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;X.lastIndex=0,$=$.slice(-1*_.length+A);while((Z=X.exec($))!=null){if(J=Z[1]||Z[2]||Z[3]||Z[4]||Z[5]||Z[6],!J)continue;if(U=[...J].length,Z[3]||Z[4]){G+=U;continue}else if(Z[5]||Z[6]){if(A%3&&!((A+U)%3)){Y+=U;continue}}if(G-=U,G>0)continue;U=Math.min(U,U+G+Y);let Q=[...Z[0]][0].length,K=_.slice(0,A+Z.index+Q+U);if(Math.min(A,U)%2){let D=K.slice(1,-1);return{type:"em",raw:K,text:D,tokens:this.lexer.inlineTokens(D)}}let v=K.slice(2,-2);return{type:"strong",raw:K,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(_){let $=this.rules.inline.code.exec(_);if($){let b=$[2].replace(this.rules.other.newLineCharGlobal," "),Z=this.rules.other.nonSpaceChar.test(b),z=this.rules.other.startingSpaceChar.test(b)&&this.rules.other.endingSpaceChar.test(b);if(Z&&z)b=b.substring(1,b.length-1);return{type:"codespan",raw:$[0],text:b}}}br(_){let $=this.rules.inline.br.exec(_);if($)return{type:"br",raw:$[0]}}del(_){let $=this.rules.inline.del.exec(_);if($)return{type:"del",raw:$[0],text:$[2],tokens:this.lexer.inlineTokens($[2])}}autolink(_){let $=this.rules.inline.autolink.exec(_);if($){let b,Z;if($[2]==="@")b=$[1],Z="mailto:"+b;else b=$[1],Z=b;return{type:"link",raw:$[0],text:b,href:Z,tokens:[{type:"text",raw:b,text:b}]}}}url(_){let $;if($=this.rules.inline.url.exec(_)){let b,Z;if($[2]==="@")b=$[0],Z="mailto:"+b;else{let z;do z=$[0],$[0]=this.rules.inline._backpedal.exec($[0])?.[0]??"";while(z!==$[0]);if(b=$[0],$[1]==="www.")Z="http://"+$[0];else Z=$[0]}return{type:"link",raw:$[0],text:b,href:Z,tokens:[{type:"text",raw:b,text:b}]}}}inlineText(_){let $=this.rules.inline.text.exec(_);if($){let b=this.lexer.state.inRawBlock;return{type:"text",raw:$[0],text:$[0],escaped:b}}}},J4=class _{tokens;options;state;tokenizer;inlineQueue;constructor($){this.tokens=[],this.tokens.links=Object.create(null),this.options=$||s4,this.options.tokenizer=this.options.tokenizer||new y6,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let b={other:u0,block:R6.normal,inline:b2.normal};if(this.options.pedantic)b.block=R6.pedantic,b.inline=b2.pedantic;else if(this.options.gfm)if(b.block=R6.gfm,this.options.breaks)b.inline=b2.breaks;else b.inline=b2.gfm;this.tokenizer.rules=b}static get rules(){return{block:R6,inline:b2}}static lex($,b){return new _(b).lex($)}static lexInline($,b){return new _(b).inlineTokens($)}lex($){$=$.replace(u0.carriageReturn,`
182
182
  `),this.blockTokens($,this.tokens);for(let b=0;b<this.inlineQueue.length;b++){let Z=this.inlineQueue[b];this.inlineTokens(Z.src,Z.tokens)}return this.inlineQueue=[],this.tokens}blockTokens($,b=[],Z=!1){if(this.options.pedantic)$=$.replace(u0.tabCharGlobal," ").replace(u0.spaceLine,"");while($){let z;if(this.options.extensions?.block?.some((J)=>{if(z=J.call({lexer:this},$,b))return $=$.substring(z.raw.length),b.push(z),!0;return!1}))continue;if(z=this.tokenizer.space($)){$=$.substring(z.raw.length);let J=b.at(-1);if(z.raw.length===1&&J!==void 0)J.raw+=`
183
183
  `;else b.push(z);continue}if(z=this.tokenizer.code($)){$=$.substring(z.raw.length);let J=b.at(-1);if(J?.type==="paragraph"||J?.type==="text")J.raw+=`
184
184
  `+z.raw,J.text+=`
@@ -188,16 +188,16 @@ ${X}`:X;let Q=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
188
188
  `+z.raw,J.text+=`
189
189
  `+z.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=J.text;else b.push(z);Z=A.length!==$.length,$=$.substring(z.raw.length);continue}if(z=this.tokenizer.text($)){$=$.substring(z.raw.length);let J=b.at(-1);if(J?.type==="text")J.raw+=`
190
190
  `+z.raw,J.text+=`
191
- `+z.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=J.text;else b.push(z);continue}if($){let J="Infinite loop on byte: "+$.charCodeAt(0);if(this.options.silent){console.error(J);break}else throw Error(J)}}return this.state.top=!0,b}inline($,b=[]){return this.inlineQueue.push({src:$,tokens:b}),b}inlineTokens($,b=[]){let Z=$,z=null;if(this.tokens.links){let U=Object.keys(this.tokens.links);if(U.length>0){while((z=this.tokenizer.rules.inline.reflinkSearch.exec(Z))!=null)if(U.includes(z[0].slice(z[0].lastIndexOf("[")+1,-1)))Z=Z.slice(0,z.index)+"["+"a".repeat(z[0].length-2)+"]"+Z.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex)}}while((z=this.tokenizer.rules.inline.anyPunctuation.exec(Z))!=null)Z=Z.slice(0,z.index)+"++"+Z.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);while((z=this.tokenizer.rules.inline.blockSkip.exec(Z))!=null)Z=Z.slice(0,z.index)+"["+"a".repeat(z[0].length-2)+"]"+Z.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let A=!1,J="";while($){if(!A)J="";A=!1;let U;if(this.options.extensions?.inline?.some((Y)=>{if(U=Y.call({lexer:this},$,b))return $=$.substring(U.raw.length),b.push(U),!0;return!1}))continue;if(U=this.tokenizer.escape($)){$=$.substring(U.raw.length),b.push(U);continue}if(U=this.tokenizer.tag($)){$=$.substring(U.raw.length),b.push(U);continue}if(U=this.tokenizer.link($)){$=$.substring(U.raw.length),b.push(U);continue}if(U=this.tokenizer.reflink($,this.tokens.links)){$=$.substring(U.raw.length);let Y=b.at(-1);if(U.type==="text"&&Y?.type==="text")Y.raw+=U.raw,Y.text+=U.text;else b.push(U);continue}if(U=this.tokenizer.emStrong($,Z,J)){$=$.substring(U.raw.length),b.push(U);continue}if(U=this.tokenizer.codespan($)){$=$.substring(U.raw.length),b.push(U);continue}if(U=this.tokenizer.br($)){$=$.substring(U.raw.length),b.push(U);continue}if(U=this.tokenizer.del($)){$=$.substring(U.raw.length),b.push(U);continue}if(U=this.tokenizer.autolink($)){$=$.substring(U.raw.length),b.push(U);continue}if(!this.state.inLink&&(U=this.tokenizer.url($))){$=$.substring(U.raw.length),b.push(U);continue}let G=$;if(this.options.extensions?.startInline){let Y=1/0,X=$.slice(1),Q;if(this.options.extensions.startInline.forEach((K)=>{if(Q=K.call({lexer:this},X),typeof Q==="number"&&Q>=0)Y=Math.min(Y,Q)}),Y<1/0&&Y>=0)G=$.substring(0,Y+1)}if(U=this.tokenizer.inlineText(G)){if($=$.substring(U.raw.length),U.raw.slice(-1)!=="_")J=U.raw.slice(-1);A=!0;let Y=b.at(-1);if(Y?.type==="text")Y.raw+=U.raw,Y.text+=U.text;else b.push(U);continue}if($){let Y="Infinite loop on byte: "+$.charCodeAt(0);if(this.options.silent){console.error(Y);break}else throw Error(Y)}}return b}},f6=class{options;parser;constructor(_){this.options=_||s4}space(_){return""}code({text:_,lang:$,escaped:b}){let Z=($||"").match(u0.notSpaceStart)?.[0],z=_.replace(u0.endingNewline,"")+`
192
- `;if(!Z)return"<pre><code>"+(b?z:m_(z,!0))+`</code></pre>
193
- `;return'<pre><code class="language-'+m_(Z)+'">'+(b?z:m_(z,!0))+`</code></pre>
191
+ `+z.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=J.text;else b.push(z);continue}if($){let J="Infinite loop on byte: "+$.charCodeAt(0);if(this.options.silent){console.error(J);break}else throw Error(J)}}return this.state.top=!0,b}inline($,b=[]){return this.inlineQueue.push({src:$,tokens:b}),b}inlineTokens($,b=[]){let Z=$,z=null;if(this.tokens.links){let U=Object.keys(this.tokens.links);if(U.length>0){while((z=this.tokenizer.rules.inline.reflinkSearch.exec(Z))!=null)if(U.includes(z[0].slice(z[0].lastIndexOf("[")+1,-1)))Z=Z.slice(0,z.index)+"["+"a".repeat(z[0].length-2)+"]"+Z.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex)}}while((z=this.tokenizer.rules.inline.anyPunctuation.exec(Z))!=null)Z=Z.slice(0,z.index)+"++"+Z.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);while((z=this.tokenizer.rules.inline.blockSkip.exec(Z))!=null)Z=Z.slice(0,z.index)+"["+"a".repeat(z[0].length-2)+"]"+Z.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let A=!1,J="";while($){if(!A)J="";A=!1;let U;if(this.options.extensions?.inline?.some((Y)=>{if(U=Y.call({lexer:this},$,b))return $=$.substring(U.raw.length),b.push(U),!0;return!1}))continue;if(U=this.tokenizer.escape($)){$=$.substring(U.raw.length),b.push(U);continue}if(U=this.tokenizer.tag($)){$=$.substring(U.raw.length),b.push(U);continue}if(U=this.tokenizer.link($)){$=$.substring(U.raw.length),b.push(U);continue}if(U=this.tokenizer.reflink($,this.tokens.links)){$=$.substring(U.raw.length);let Y=b.at(-1);if(U.type==="text"&&Y?.type==="text")Y.raw+=U.raw,Y.text+=U.text;else b.push(U);continue}if(U=this.tokenizer.emStrong($,Z,J)){$=$.substring(U.raw.length),b.push(U);continue}if(U=this.tokenizer.codespan($)){$=$.substring(U.raw.length),b.push(U);continue}if(U=this.tokenizer.br($)){$=$.substring(U.raw.length),b.push(U);continue}if(U=this.tokenizer.del($)){$=$.substring(U.raw.length),b.push(U);continue}if(U=this.tokenizer.autolink($)){$=$.substring(U.raw.length),b.push(U);continue}if(!this.state.inLink&&(U=this.tokenizer.url($))){$=$.substring(U.raw.length),b.push(U);continue}let G=$;if(this.options.extensions?.startInline){let Y=1/0,X=$.slice(1),Q;if(this.options.extensions.startInline.forEach((K)=>{if(Q=K.call({lexer:this},X),typeof Q==="number"&&Q>=0)Y=Math.min(Y,Q)}),Y<1/0&&Y>=0)G=$.substring(0,Y+1)}if(U=this.tokenizer.inlineText(G)){if($=$.substring(U.raw.length),U.raw.slice(-1)!=="_")J=U.raw.slice(-1);A=!0;let Y=b.at(-1);if(Y?.type==="text")Y.raw+=U.raw,Y.text+=U.text;else b.push(U);continue}if($){let Y="Infinite loop on byte: "+$.charCodeAt(0);if(this.options.silent){console.error(Y);break}else throw Error(Y)}}return b}},C6=class{options;parser;constructor(_){this.options=_||s4}space(_){return""}code({text:_,lang:$,escaped:b}){let Z=($||"").match(u0.notSpaceStart)?.[0],z=_.replace(u0.endingNewline,"")+`
192
+ `;if(!Z)return"<pre><code>"+(b?z:u_(z,!0))+`</code></pre>
193
+ `;return'<pre><code class="language-'+u_(Z)+'">'+(b?z:u_(z,!0))+`</code></pre>
194
194
  `}blockquote({tokens:_}){return`<blockquote>
195
195
  ${this.parser.parse(_)}</blockquote>
196
196
  `}html({text:_}){return _}heading({tokens:_,depth:$}){return`<h${$}>${this.parser.parseInline(_)}</h${$}>
197
197
  `}hr(_){return`<hr>
198
198
  `}list(_){let{ordered:$,start:b}=_,Z="";for(let J=0;J<_.items.length;J++){let U=_.items[J];Z+=this.listitem(U)}let z=$?"ol":"ul",A=$&&b!==1?' start="'+b+'"':"";return"<"+z+A+`>
199
199
  `+Z+"</"+z+`>
200
- `}listitem(_){let $="";if(_.task){let b=this.checkbox({checked:!!_.checked});if(_.loose)if(_.tokens[0]?.type==="paragraph"){if(_.tokens[0].text=b+" "+_.tokens[0].text,_.tokens[0].tokens&&_.tokens[0].tokens.length>0&&_.tokens[0].tokens[0].type==="text")_.tokens[0].tokens[0].text=b+" "+m_(_.tokens[0].tokens[0].text),_.tokens[0].tokens[0].escaped=!0}else _.tokens.unshift({type:"text",raw:b+" ",text:b+" ",escaped:!0});else $+=b+" "}return $+=this.parser.parse(_.tokens,!!_.loose),`<li>${$}</li>
200
+ `}listitem(_){let $="";if(_.task){let b=this.checkbox({checked:!!_.checked});if(_.loose)if(_.tokens[0]?.type==="paragraph"){if(_.tokens[0].text=b+" "+_.tokens[0].text,_.tokens[0].tokens&&_.tokens[0].tokens.length>0&&_.tokens[0].tokens[0].type==="text")_.tokens[0].tokens[0].text=b+" "+u_(_.tokens[0].tokens[0].text),_.tokens[0].tokens[0].escaped=!0}else _.tokens.unshift({type:"text",raw:b+" ",text:b+" ",escaped:!0});else $+=b+" "}return $+=this.parser.parse(_.tokens,!!_.loose),`<li>${$}</li>
201
201
  `}checkbox({checked:_}){return"<input "+(_?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:_}){return`<p>${this.parser.parseInline(_)}</p>
202
202
  `}table(_){let $="",b="";for(let z=0;z<_.header.length;z++)b+=this.tablecell(_.header[z]);$+=this.tablerow({text:b});let Z="";for(let z=0;z<_.rows.length;z++){let A=_.rows[z];b="";for(let J=0;J<A.length;J++)b+=this.tablecell(A[J]);Z+=this.tablerow({text:b})}if(Z)Z=`<tbody>${Z}</tbody>`;return`<table>
203
203
  <thead>
@@ -206,38 +206,38 @@ ${this.parser.parse(_)}</blockquote>
206
206
  `}tablerow({text:_}){return`<tr>
207
207
  ${_}</tr>
208
208
  `}tablecell(_){let $=this.parser.parseInline(_.tokens),b=_.header?"th":"td";return(_.align?`<${b} align="${_.align}">`:`<${b}>`)+$+`</${b}>
209
- `}strong({tokens:_}){return`<strong>${this.parser.parseInline(_)}</strong>`}em({tokens:_}){return`<em>${this.parser.parseInline(_)}</em>`}codespan({text:_}){return`<code>${m_(_,!0)}</code>`}br(_){return"<br>"}del({tokens:_}){return`<del>${this.parser.parseInline(_)}</del>`}link({href:_,title:$,tokens:b}){let Z=this.parser.parseInline(b),z=jQ(_);if(z===null)return Z;_=z;let A='<a href="'+_+'"';if($)A+=' title="'+m_($)+'"';return A+=">"+Z+"</a>",A}image({href:_,title:$,text:b,tokens:Z}){if(Z)b=this.parser.parseInline(Z,this.parser.textRenderer);let z=jQ(_);if(z===null)return m_(b);_=z;let A=`<img src="${_}" alt="${b}"`;if($)A+=` title="${m_($)}"`;return A+=">",A}text(_){return"tokens"in _&&_.tokens?this.parser.parseInline(_.tokens):("escaped"in _)&&_.escaped?_.text:m_(_.text)}},nJ=class{strong({text:_}){return _}em({text:_}){return _}codespan({text:_}){return _}del({text:_}){return _}html({text:_}){return _}text({text:_}){return _}link({text:_}){return""+_}image({text:_}){return""+_}br(){return""}},z4=class _{options;renderer;textRenderer;constructor($){this.options=$||s4,this.options.renderer=this.options.renderer||new f6,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new nJ}static parse($,b){return new _(b).parse($)}static parseInline($,b){return new _(b).parseInline($)}parse($,b=!0){let Z="";for(let z=0;z<$.length;z++){let A=$[z];if(this.options.extensions?.renderers?.[A.type]){let U=A,G=this.options.extensions.renderers[U.type].call({parser:this},U);if(G!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(U.type)){Z+=G||"";continue}}let J=A;switch(J.type){case"space":{Z+=this.renderer.space(J);continue}case"hr":{Z+=this.renderer.hr(J);continue}case"heading":{Z+=this.renderer.heading(J);continue}case"code":{Z+=this.renderer.code(J);continue}case"table":{Z+=this.renderer.table(J);continue}case"blockquote":{Z+=this.renderer.blockquote(J);continue}case"list":{Z+=this.renderer.list(J);continue}case"html":{Z+=this.renderer.html(J);continue}case"paragraph":{Z+=this.renderer.paragraph(J);continue}case"text":{let U=J,G=this.renderer.text(U);while(z+1<$.length&&$[z+1].type==="text")U=$[++z],G+=`
210
- `+this.renderer.text(U);if(b)Z+=this.renderer.paragraph({type:"paragraph",raw:G,text:G,tokens:[{type:"text",raw:G,text:G,escaped:!0}]});else Z+=G;continue}default:{let U='Token with "'+J.type+'" type was not found.';if(this.options.silent)return console.error(U),"";else throw Error(U)}}}return Z}parseInline($,b=this.renderer){let Z="";for(let z=0;z<$.length;z++){let A=$[z];if(this.options.extensions?.renderers?.[A.type]){let U=this.options.extensions.renderers[A.type].call({parser:this},A);if(U!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(A.type)){Z+=U||"";continue}}let J=A;switch(J.type){case"escape":{Z+=b.text(J);break}case"html":{Z+=b.html(J);break}case"link":{Z+=b.link(J);break}case"image":{Z+=b.image(J);break}case"strong":{Z+=b.strong(J);break}case"em":{Z+=b.em(J);break}case"codespan":{Z+=b.codespan(J);break}case"br":{Z+=b.br(J);break}case"del":{Z+=b.del(J);break}case"text":{Z+=b.text(J);break}default:{let U='Token with "'+J.type+'" type was not found.';if(this.options.silent)return console.error(U),"";else throw Error(U)}}}return Z}},T6=class{options;block;constructor(_){this.options=_||s4}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(_){return _}postprocess(_){return _}processAllTokens(_){return _}provideLexer(){return this.block?$4.lex:$4.lexInline}provideParser(){return this.block?z4.parse:z4.parseInline}},vx=class{defaults=yJ();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=z4;Renderer=f6;TextRenderer=nJ;Lexer=$4;Tokenizer=C6;Hooks=T6;constructor(..._){this.use(..._)}walkTokens(_,$){let b=[];for(let Z of _)switch(b=b.concat($.call(this,Z)),Z.type){case"table":{let z=Z;for(let A of z.header)b=b.concat(this.walkTokens(A.tokens,$));for(let A of z.rows)for(let J of A)b=b.concat(this.walkTokens(J.tokens,$));break}case"list":{let z=Z;b=b.concat(this.walkTokens(z.items,$));break}default:{let z=Z;if(this.defaults.extensions?.childTokens?.[z.type])this.defaults.extensions.childTokens[z.type].forEach((A)=>{let J=z[A].flat(1/0);b=b.concat(this.walkTokens(J,$))});else if(z.tokens)b=b.concat(this.walkTokens(z.tokens,$))}}return b}use(..._){let $=this.defaults.extensions||{renderers:{},childTokens:{}};return _.forEach((b)=>{let Z={...b};if(Z.async=this.defaults.async||Z.async||!1,b.extensions)b.extensions.forEach((z)=>{if(!z.name)throw Error("extension name required");if("renderer"in z){let A=$.renderers[z.name];if(A)$.renderers[z.name]=function(...J){let U=z.renderer.apply(this,J);if(U===!1)U=A.apply(this,J);return U};else $.renderers[z.name]=z.renderer}if("tokenizer"in z){if(!z.level||z.level!=="block"&&z.level!=="inline")throw Error("extension level must be 'block' or 'inline'");let A=$[z.level];if(A)A.unshift(z.tokenizer);else $[z.level]=[z.tokenizer];if(z.start){if(z.level==="block")if($.startBlock)$.startBlock.push(z.start);else $.startBlock=[z.start];else if(z.level==="inline")if($.startInline)$.startInline.push(z.start);else $.startInline=[z.start]}}if("childTokens"in z&&z.childTokens)$.childTokens[z.name]=z.childTokens}),Z.extensions=$;if(b.renderer){let z=this.defaults.renderer||new f6(this.defaults);for(let A in b.renderer){if(!(A in z))throw Error(`renderer '${A}' does not exist`);if(["options","parser"].includes(A))continue;let J=A,U=b.renderer[J],G=z[J];z[J]=(...Y)=>{let X=U.apply(z,Y);if(X===!1)X=G.apply(z,Y);return X||""}}Z.renderer=z}if(b.tokenizer){let z=this.defaults.tokenizer||new C6(this.defaults);for(let A in b.tokenizer){if(!(A in z))throw Error(`tokenizer '${A}' does not exist`);if(["options","rules","lexer"].includes(A))continue;let J=A,U=b.tokenizer[J],G=z[J];z[J]=(...Y)=>{let X=U.apply(z,Y);if(X===!1)X=G.apply(z,Y);return X}}Z.tokenizer=z}if(b.hooks){let z=this.defaults.hooks||new T6;for(let A in b.hooks){if(!(A in z))throw Error(`hook '${A}' does not exist`);if(["options","block"].includes(A))continue;let J=A,U=b.hooks[J],G=z[J];if(T6.passThroughHooks.has(A))z[J]=(Y)=>{if(this.defaults.async)return Promise.resolve(U.call(z,Y)).then((Q)=>{return G.call(z,Q)});let X=U.call(z,Y);return G.call(z,X)};else z[J]=(...Y)=>{let X=U.apply(z,Y);if(X===!1)X=G.apply(z,Y);return X}}Z.hooks=z}if(b.walkTokens){let z=this.defaults.walkTokens,A=b.walkTokens;Z.walkTokens=function(J){let U=[];if(U.push(A.call(this,J)),z)U=U.concat(z.call(this,J));return U}}this.defaults={...this.defaults,...Z}}),this}setOptions(_){return this.defaults={...this.defaults,..._},this}lexer(_,$){return $4.lex(_,$??this.defaults)}parser(_,$){return z4.parse(_,$??this.defaults)}parseMarkdown(_){return(b,Z)=>{let z={...Z},A={...this.defaults,...z},J=this.onError(!!A.silent,!!A.async);if(this.defaults.async===!0&&z.async===!1)return J(Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof b>"u"||b===null)return J(Error("marked(): input parameter is undefined or null"));if(typeof b!=="string")return J(Error("marked(): input parameter is of type "+Object.prototype.toString.call(b)+", string expected"));if(A.hooks)A.hooks.options=A,A.hooks.block=_;let U=A.hooks?A.hooks.provideLexer():_?$4.lex:$4.lexInline,G=A.hooks?A.hooks.provideParser():_?z4.parse:z4.parseInline;if(A.async)return Promise.resolve(A.hooks?A.hooks.preprocess(b):b).then((Y)=>U(Y,A)).then((Y)=>A.hooks?A.hooks.processAllTokens(Y):Y).then((Y)=>A.walkTokens?Promise.all(this.walkTokens(Y,A.walkTokens)).then(()=>Y):Y).then((Y)=>G(Y,A)).then((Y)=>A.hooks?A.hooks.postprocess(Y):Y).catch(J);try{if(A.hooks)b=A.hooks.preprocess(b);let Y=U(b,A);if(A.hooks)Y=A.hooks.processAllTokens(Y);if(A.walkTokens)this.walkTokens(Y,A.walkTokens);let X=G(Y,A);if(A.hooks)X=A.hooks.postprocess(X);return X}catch(Y){return J(Y)}}}onError(_,$){return(b)=>{if(b.message+=`
211
- Please report this to https://github.com/markedjs/marked.`,_){let Z="<p>An error occurred:</p><pre>"+m_(b.message+"",!0)+"</pre>";if($)return Promise.resolve(Z);return Z}if($)return Promise.reject(b);throw b}}},t4=new vx;function G0(_,$){return t4.parse(_,$)}G0.options=G0.setOptions=function(_){return t4.setOptions(_),G0.defaults=t4.defaults,LQ(G0.defaults),G0};G0.getDefaults=yJ;G0.defaults=s4;G0.use=function(..._){return t4.use(..._),G0.defaults=t4.defaults,LQ(G0.defaults),G0};G0.walkTokens=function(_,$){return t4.walkTokens(_,$)};G0.parseInline=t4.parseInline;G0.Parser=z4;G0.parser=z4.parse;G0.Renderer=f6;G0.TextRenderer=nJ;G0.Lexer=$4;G0.lexer=$4.lex;G0.Tokenizer=C6;G0.Hooks=T6;G0.parse=G0;var{options:af,setOptions:ef,use:tf,walkTokens:sf,parseInline:_m}=G0;var $m=z4.parse,zm=$4.lex;import{EventEmitter as Fx}from"events";var b4="\x1B",lQ="\x1B[200~",h6="\x1B[201~";function Hx(_){if(!_.startsWith(b4))return"not-escape";if(_.length===1)return"incomplete";let $=_.slice(1);if($.startsWith("[")){if($.startsWith("[M"))return _.length>=6?"complete":"incomplete";return qx(_)}if($.startsWith("]"))return Vx(_);if($.startsWith("P"))return Dx(_);if($.startsWith("_"))return kx(_);if($.startsWith("O"))return $.length>=2?"complete":"incomplete";if($.length===1)return"complete";return"complete"}function qx(_){if(!_.startsWith(`${b4}[`))return"complete";if(_.length<3)return"incomplete";let $=_.slice(2),b=$[$.length-1],Z=b.charCodeAt(0);if(Z>=64&&Z<=126){if($.startsWith("<")){if(/^<\d+;\d+;\d+[Mm]$/.test($))return"complete";if(b==="M"||b==="m"){let A=$.slice(1,-1).split(";");if(A.length===3&&A.every((J)=>/^\d+$/.test(J)))return"complete"}return"incomplete"}return"complete"}return"incomplete"}function Vx(_){if(!_.startsWith(`${b4}]`))return"complete";if(_.endsWith(`${b4}\\`)||_.endsWith("\x07"))return"complete";return"incomplete"}function Dx(_){if(!_.startsWith(`${b4}P`))return"complete";if(_.endsWith(`${b4}\\`))return"complete";return"incomplete"}function kx(_){if(!_.startsWith(`${b4}_`))return"complete";if(_.endsWith(`${b4}\\`))return"complete";return"incomplete"}function pQ(_){let $=[],b=0;while(b<_.length){let Z=_.slice(b);if(Z.startsWith(b4)){let z=1;while(z<=Z.length){let A=Z.slice(0,z),J=Hx(A);if(J==="complete"){$.push(A),b+=z;break}else if(J==="incomplete")z++;else{$.push(A),b+=z;break}}if(z>Z.length)return{sequences:$,remainder:Z}}else $.push(Z[0]),b++}return{sequences:$,remainder:""}}class c6 extends Fx{buffer="";timeout=null;timeoutMs;pasteMode=!1;pasteBuffer="";constructor(_={}){super();this.timeoutMs=_.timeout??10}process(_){if(this.timeout)clearTimeout(this.timeout),this.timeout=null;let $;if(Buffer.isBuffer(_))if(_.length===1&&_[0]>127){let z=_[0]-128;$=`\x1B${String.fromCharCode(z)}`}else $=_.toString();else $=_;if($.length===0&&this.buffer.length===0){this.emit("data","");return}if(this.buffer+=$,this.pasteMode){this.pasteBuffer+=this.buffer,this.buffer="";let z=this.pasteBuffer.indexOf(h6);if(z!==-1){let A=this.pasteBuffer.slice(0,z),J=this.pasteBuffer.slice(z+h6.length);if(this.pasteMode=!1,this.pasteBuffer="",this.emit("paste",A),J.length>0)this.process(J)}return}let b=this.buffer.indexOf(lQ);if(b!==-1){if(b>0){let A=this.buffer.slice(0,b),J=pQ(A);for(let U of J.sequences)this.emit("data",U)}this.buffer=this.buffer.slice(b+lQ.length),this.pasteMode=!0,this.pasteBuffer=this.buffer,this.buffer="";let z=this.pasteBuffer.indexOf(h6);if(z!==-1){let A=this.pasteBuffer.slice(0,z),J=this.pasteBuffer.slice(z+h6.length);if(this.pasteMode=!1,this.pasteBuffer="",this.emit("paste",A),J.length>0)this.process(J)}return}let Z=pQ(this.buffer);this.buffer=Z.remainder;for(let z of Z.sequences)this.emit("data",z);if(this.buffer.length>0)this.timeout=setTimeout(()=>{let z=this.flush();for(let A of z)this.emit("data",A)},this.timeoutMs)}flush(){if(this.timeout)clearTimeout(this.timeout),this.timeout=null;if(this.buffer.length===0)return[];let _=[this.buffer];return this.buffer="",_}clear(){if(this.timeout)clearTimeout(this.timeout),this.timeout=null;this.buffer="",this.pasteMode=!1,this.pasteBuffer=""}getBuffer(){return this.buffer}destroy(){this.clear()}}import*as dQ from"node:fs";import{createRequire as Wx}from"node:module";var gx=Wx(import.meta.url);class r6{wasRaw=!1;inputHandler;resizeHandler;_kittyProtocolActive=!1;_modifyOtherKeysActive=!1;stdinBuffer;stdinDataHandler;writeLogPath=process.env.PI_TUI_WRITE_LOG||"";get kittyProtocolActive(){return this._kittyProtocolActive}start(_,$){if(this.inputHandler=_,this.resizeHandler=$,this.wasRaw=process.stdin.isRaw||!1,process.stdin.setRawMode)process.stdin.setRawMode(!0);if(process.stdin.setEncoding("utf8"),process.stdin.resume(),process.stdout.write("\x1B[?2004h"),process.stdout.on("resize",this.resizeHandler),process.platform!=="win32")process.kill(process.pid,"SIGWINCH");this.enableWindowsVTInput(),this.queryAndEnableKittyProtocol()}setupStdinBuffer(){this.stdinBuffer=new c6({timeout:10});let _=/^\x1b\[\?(\d+)u$/;this.stdinBuffer.on("data",($)=>{if(!this._kittyProtocolActive){if($.match(_)){this._kittyProtocolActive=!0,s$(!0),process.stdout.write("\x1B[>7u");return}}if(this.inputHandler)this.inputHandler($)}),this.stdinBuffer.on("paste",($)=>{if(this.inputHandler)this.inputHandler(`\x1B[200~${$}\x1B[201~`)}),this.stdinDataHandler=($)=>{this.stdinBuffer.process($)}}queryAndEnableKittyProtocol(){this.setupStdinBuffer(),process.stdin.on("data",this.stdinDataHandler),process.stdout.write("\x1B[?u"),setTimeout(()=>{if(!this._kittyProtocolActive&&!this._modifyOtherKeysActive)process.stdout.write("\x1B[>4;2m"),this._modifyOtherKeysActive=!0},150)}enableWindowsVTInput(){if(process.platform!=="win32")return;try{let $=gx("koffi").load("kernel32.dll"),b=$.func("void* __stdcall GetStdHandle(int)"),Z=$.func("bool __stdcall GetConsoleMode(void*, _Out_ uint32_t*)"),z=$.func("bool __stdcall SetConsoleMode(void*, uint32_t)"),A=-10,J=512,U=b(-10),G=new Uint32Array(1);Z(U,G),z(U,G[0]|512)}catch{}}async drainInput(_=1000,$=50){if(this._kittyProtocolActive)process.stdout.write("\x1B[<u"),this._kittyProtocolActive=!1,s$(!1);if(this._modifyOtherKeysActive)process.stdout.write("\x1B[>4;0m"),this._modifyOtherKeysActive=!1;let b=this.inputHandler;this.inputHandler=void 0;let Z=Date.now(),z=()=>{Z=Date.now()};process.stdin.on("data",z);let A=Date.now()+_;try{while(!0){let J=Date.now(),U=A-J;if(U<=0)break;if(J-Z>=$)break;await new Promise((G)=>setTimeout(G,Math.min($,U)))}}finally{process.stdin.removeListener("data",z),this.inputHandler=b}}stop(){if(process.stdout.write("\x1B[?2004l"),this._kittyProtocolActive)process.stdout.write("\x1B[<u"),this._kittyProtocolActive=!1,s$(!1);if(this._modifyOtherKeysActive)process.stdout.write("\x1B[>4;0m"),this._modifyOtherKeysActive=!1;if(this.stdinBuffer)this.stdinBuffer.destroy(),this.stdinBuffer=void 0;if(this.stdinDataHandler)process.stdin.removeListener("data",this.stdinDataHandler),this.stdinDataHandler=void 0;if(this.inputHandler=void 0,this.resizeHandler)process.stdout.removeListener("resize",this.resizeHandler),this.resizeHandler=void 0;if(process.stdin.pause(),process.stdin.setRawMode)process.stdin.setRawMode(this.wasRaw)}write(_){if(process.stdout.write(_),this.writeLogPath)try{dQ.appendFileSync(this.writeLogPath,_,{encoding:"utf8"})}catch{}}get columns(){return process.stdout.columns||80}get rows(){return process.stdout.rows||24}moveBy(_){if(_>0)process.stdout.write(`\x1B[${_}B`);else if(_<0)process.stdout.write(`\x1B[${-_}A`)}hideCursor(){process.stdout.write("\x1B[?25l")}showCursor(){process.stdout.write("\x1B[?25h")}clearLine(){process.stdout.write("\x1B[K")}clearFromCursor(){process.stdout.write("\x1B[J")}clearScreen(){process.stdout.write("\x1B[2J\x1B[H")}setTitle(_){process.stdout.write(`\x1B]0;${_}\x07`)}}var iQ=(_=0)=>($)=>`\x1B[${$+_}m`,oQ=(_=0)=>($)=>`\x1B[${38+_};5;${$}m`,aQ=(_=0)=>($,b,Z)=>`\x1B[${38+_};2;${$};${b};${Z}m`,v0={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Wu=Object.keys(v0.modifier),Bx=Object.keys(v0.color),wx=Object.keys(v0.bgColor),gu=[...Bx,...wx];function xx(){let _=new Map;for(let[$,b]of Object.entries(v0)){for(let[Z,z]of Object.entries(b))v0[Z]={open:`\x1B[${z[0]}m`,close:`\x1B[${z[1]}m`},b[Z]=v0[Z],_.set(z[0],z[1]);Object.defineProperty(v0,$,{value:b,enumerable:!1})}return Object.defineProperty(v0,"codes",{value:_,enumerable:!1}),v0.color.close="\x1B[39m",v0.bgColor.close="\x1B[49m",v0.color.ansi=iQ(),v0.color.ansi256=oQ(),v0.color.ansi16m=aQ(),v0.bgColor.ansi=iQ(10),v0.bgColor.ansi256=oQ(10),v0.bgColor.ansi16m=aQ(10),Object.defineProperties(v0,{rgbToAnsi256:{value($,b,Z){if($===b&&b===Z){if($<8)return 16;if($>248)return 231;return Math.round(($-8)/247*24)+232}return 16+36*Math.round($/255*5)+6*Math.round(b/255*5)+Math.round(Z/255*5)},enumerable:!1},hexToRgb:{value($){let b=/[a-f\d]{6}|[a-f\d]{3}/i.exec($.toString(16));if(!b)return[0,0,0];let[Z]=b;if(Z.length===3)Z=[...Z].map((A)=>A+A).join("");let z=Number.parseInt(Z,16);return[z>>16&255,z>>8&255,z&255]},enumerable:!1},hexToAnsi256:{value:($)=>v0.rgbToAnsi256(...v0.hexToRgb($)),enumerable:!1},ansi256ToAnsi:{value($){if($<8)return 30+$;if($<16)return 90+($-8);let b,Z,z;if($>=232)b=(($-232)*10+8)/255,Z=b,z=b;else{$-=16;let U=$%36;b=Math.floor($/36)/5,Z=Math.floor(U/6)/5,z=U%6/5}let A=Math.max(b,Z,z)*2;if(A===0)return 30;let J=30+(Math.round(z)<<2|Math.round(Z)<<1|Math.round(b));if(A===2)J+=60;return J},enumerable:!1},rgbToAnsi:{value:($,b,Z)=>v0.ansi256ToAnsi(v0.rgbToAnsi256($,b,Z)),enumerable:!1},hexToAnsi:{value:($)=>v0.ansi256ToAnsi(v0.hexToAnsi256($)),enumerable:!1}}),v0}var Nx=xx(),B_=Nx;import lJ from"node:process";import Ix from"node:os";import eQ from"node:tty";function F_(_,$=globalThis.Deno?globalThis.Deno.args:lJ.argv){let b=_.startsWith("-")?"":_.length===1?"-":"--",Z=$.indexOf(b+_),z=$.indexOf("--");return Z!==-1&&(z===-1||Z<z)}var{env:F0}=lJ,n6;if(F_("no-color")||F_("no-colors")||F_("color=false")||F_("color=never"))n6=0;else if(F_("color")||F_("colors")||F_("color=true")||F_("color=always"))n6=1;function Mx(){if("FORCE_COLOR"in F0){if(F0.FORCE_COLOR==="true")return 1;if(F0.FORCE_COLOR==="false")return 0;return F0.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(F0.FORCE_COLOR,10),3)}}function Ex(_){if(_===0)return!1;return{level:_,hasBasic:!0,has256:_>=2,has16m:_>=3}}function Ox(_,{streamIsTTY:$,sniffFlags:b=!0}={}){let Z=Mx();if(Z!==void 0)n6=Z;let z=b?n6:Z;if(z===0)return 0;if(b){if(F_("color=16m")||F_("color=full")||F_("color=truecolor"))return 3;if(F_("color=256"))return 2}if("TF_BUILD"in F0&&"AGENT_NAME"in F0)return 1;if(_&&!$&&z===void 0)return 0;let A=z||0;if(F0.TERM==="dumb")return A;if(lJ.platform==="win32"){let J=Ix.release().split(".");if(Number(J[0])>=10&&Number(J[2])>=10586)return Number(J[2])>=14931?3:2;return 1}if("CI"in F0){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((J)=>(J in F0)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((J)=>(J in F0))||F0.CI_NAME==="codeship")return 1;return A}if("TEAMCITY_VERSION"in F0)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(F0.TEAMCITY_VERSION)?1:0;if(F0.COLORTERM==="truecolor")return 3;if(F0.TERM==="xterm-kitty")return 3;if(F0.TERM==="xterm-ghostty")return 3;if(F0.TERM==="wezterm")return 3;if("TERM_PROGRAM"in F0){let J=Number.parseInt((F0.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(F0.TERM_PROGRAM){case"iTerm.app":return J>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(F0.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(F0.TERM))return 1;if("COLORTERM"in F0)return 1;return A}function tQ(_,$={}){let b=Ox(_,{streamIsTTY:_&&_.isTTY,...$});return Ex(b)}var Px={stdout:tQ({isTTY:eQ.isatty(1)}),stderr:tQ({isTTY:eQ.isatty(2)})},sQ=Px;function _K(_,$,b){let Z=_.indexOf($);if(Z===-1)return _;let z=$.length,A=0,J="";do J+=_.slice(A,Z)+$+b,A=Z+z,Z=_.indexOf($,A);while(Z!==-1);return J+=_.slice(A),J}function $K(_,$,b,Z){let z=0,A="";do{let J=_[Z-1]==="\r";A+=_.slice(z,J?Z-1:Z)+$+(J?`\r
209
+ `}strong({tokens:_}){return`<strong>${this.parser.parseInline(_)}</strong>`}em({tokens:_}){return`<em>${this.parser.parseInline(_)}</em>`}codespan({text:_}){return`<code>${u_(_,!0)}</code>`}br(_){return"<br>"}del({tokens:_}){return`<del>${this.parser.parseInline(_)}</del>`}link({href:_,title:$,tokens:b}){let Z=this.parser.parseInline(b),z=yQ(_);if(z===null)return Z;_=z;let A='<a href="'+_+'"';if($)A+=' title="'+u_($)+'"';return A+=">"+Z+"</a>",A}image({href:_,title:$,text:b,tokens:Z}){if(Z)b=this.parser.parseInline(Z,this.parser.textRenderer);let z=yQ(_);if(z===null)return u_(b);_=z;let A=`<img src="${_}" alt="${b}"`;if($)A+=` title="${u_($)}"`;return A+=">",A}text(_){return"tokens"in _&&_.tokens?this.parser.parseInline(_.tokens):("escaped"in _)&&_.escaped?_.text:u_(_.text)}},dJ=class{strong({text:_}){return _}em({text:_}){return _}codespan({text:_}){return _}del({text:_}){return _}html({text:_}){return _}text({text:_}){return _}link({text:_}){return""+_}image({text:_}){return""+_}br(){return""}},U4=class _{options;renderer;textRenderer;constructor($){this.options=$||s4,this.options.renderer=this.options.renderer||new C6,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new dJ}static parse($,b){return new _(b).parse($)}static parseInline($,b){return new _(b).parseInline($)}parse($,b=!0){let Z="";for(let z=0;z<$.length;z++){let A=$[z];if(this.options.extensions?.renderers?.[A.type]){let U=A,G=this.options.extensions.renderers[U.type].call({parser:this},U);if(G!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(U.type)){Z+=G||"";continue}}let J=A;switch(J.type){case"space":{Z+=this.renderer.space(J);continue}case"hr":{Z+=this.renderer.hr(J);continue}case"heading":{Z+=this.renderer.heading(J);continue}case"code":{Z+=this.renderer.code(J);continue}case"table":{Z+=this.renderer.table(J);continue}case"blockquote":{Z+=this.renderer.blockquote(J);continue}case"list":{Z+=this.renderer.list(J);continue}case"html":{Z+=this.renderer.html(J);continue}case"paragraph":{Z+=this.renderer.paragraph(J);continue}case"text":{let U=J,G=this.renderer.text(U);while(z+1<$.length&&$[z+1].type==="text")U=$[++z],G+=`
210
+ `+this.renderer.text(U);if(b)Z+=this.renderer.paragraph({type:"paragraph",raw:G,text:G,tokens:[{type:"text",raw:G,text:G,escaped:!0}]});else Z+=G;continue}default:{let U='Token with "'+J.type+'" type was not found.';if(this.options.silent)return console.error(U),"";else throw Error(U)}}}return Z}parseInline($,b=this.renderer){let Z="";for(let z=0;z<$.length;z++){let A=$[z];if(this.options.extensions?.renderers?.[A.type]){let U=this.options.extensions.renderers[A.type].call({parser:this},A);if(U!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(A.type)){Z+=U||"";continue}}let J=A;switch(J.type){case"escape":{Z+=b.text(J);break}case"html":{Z+=b.html(J);break}case"link":{Z+=b.link(J);break}case"image":{Z+=b.image(J);break}case"strong":{Z+=b.strong(J);break}case"em":{Z+=b.em(J);break}case"codespan":{Z+=b.codespan(J);break}case"br":{Z+=b.br(J);break}case"del":{Z+=b.del(J);break}case"text":{Z+=b.text(J);break}default:{let U='Token with "'+J.type+'" type was not found.';if(this.options.silent)return console.error(U),"";else throw Error(U)}}}return Z}},L6=class{options;block;constructor(_){this.options=_||s4}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(_){return _}postprocess(_){return _}processAllTokens(_){return _}provideLexer(){return this.block?J4.lex:J4.lexInline}provideParser(){return this.block?U4.parse:U4.parseInline}},kx=class{defaults=mJ();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=U4;Renderer=C6;TextRenderer=dJ;Lexer=J4;Tokenizer=y6;Hooks=L6;constructor(..._){this.use(..._)}walkTokens(_,$){let b=[];for(let Z of _)switch(b=b.concat($.call(this,Z)),Z.type){case"table":{let z=Z;for(let A of z.header)b=b.concat(this.walkTokens(A.tokens,$));for(let A of z.rows)for(let J of A)b=b.concat(this.walkTokens(J.tokens,$));break}case"list":{let z=Z;b=b.concat(this.walkTokens(z.items,$));break}default:{let z=Z;if(this.defaults.extensions?.childTokens?.[z.type])this.defaults.extensions.childTokens[z.type].forEach((A)=>{let J=z[A].flat(1/0);b=b.concat(this.walkTokens(J,$))});else if(z.tokens)b=b.concat(this.walkTokens(z.tokens,$))}}return b}use(..._){let $=this.defaults.extensions||{renderers:{},childTokens:{}};return _.forEach((b)=>{let Z={...b};if(Z.async=this.defaults.async||Z.async||!1,b.extensions)b.extensions.forEach((z)=>{if(!z.name)throw Error("extension name required");if("renderer"in z){let A=$.renderers[z.name];if(A)$.renderers[z.name]=function(...J){let U=z.renderer.apply(this,J);if(U===!1)U=A.apply(this,J);return U};else $.renderers[z.name]=z.renderer}if("tokenizer"in z){if(!z.level||z.level!=="block"&&z.level!=="inline")throw Error("extension level must be 'block' or 'inline'");let A=$[z.level];if(A)A.unshift(z.tokenizer);else $[z.level]=[z.tokenizer];if(z.start){if(z.level==="block")if($.startBlock)$.startBlock.push(z.start);else $.startBlock=[z.start];else if(z.level==="inline")if($.startInline)$.startInline.push(z.start);else $.startInline=[z.start]}}if("childTokens"in z&&z.childTokens)$.childTokens[z.name]=z.childTokens}),Z.extensions=$;if(b.renderer){let z=this.defaults.renderer||new C6(this.defaults);for(let A in b.renderer){if(!(A in z))throw Error(`renderer '${A}' does not exist`);if(["options","parser"].includes(A))continue;let J=A,U=b.renderer[J],G=z[J];z[J]=(...Y)=>{let X=U.apply(z,Y);if(X===!1)X=G.apply(z,Y);return X||""}}Z.renderer=z}if(b.tokenizer){let z=this.defaults.tokenizer||new y6(this.defaults);for(let A in b.tokenizer){if(!(A in z))throw Error(`tokenizer '${A}' does not exist`);if(["options","rules","lexer"].includes(A))continue;let J=A,U=b.tokenizer[J],G=z[J];z[J]=(...Y)=>{let X=U.apply(z,Y);if(X===!1)X=G.apply(z,Y);return X}}Z.tokenizer=z}if(b.hooks){let z=this.defaults.hooks||new L6;for(let A in b.hooks){if(!(A in z))throw Error(`hook '${A}' does not exist`);if(["options","block"].includes(A))continue;let J=A,U=b.hooks[J],G=z[J];if(L6.passThroughHooks.has(A))z[J]=(Y)=>{if(this.defaults.async)return Promise.resolve(U.call(z,Y)).then((Q)=>{return G.call(z,Q)});let X=U.call(z,Y);return G.call(z,X)};else z[J]=(...Y)=>{let X=U.apply(z,Y);if(X===!1)X=G.apply(z,Y);return X}}Z.hooks=z}if(b.walkTokens){let z=this.defaults.walkTokens,A=b.walkTokens;Z.walkTokens=function(J){let U=[];if(U.push(A.call(this,J)),z)U=U.concat(z.call(this,J));return U}}this.defaults={...this.defaults,...Z}}),this}setOptions(_){return this.defaults={...this.defaults,..._},this}lexer(_,$){return J4.lex(_,$??this.defaults)}parser(_,$){return U4.parse(_,$??this.defaults)}parseMarkdown(_){return(b,Z)=>{let z={...Z},A={...this.defaults,...z},J=this.onError(!!A.silent,!!A.async);if(this.defaults.async===!0&&z.async===!1)return J(Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof b>"u"||b===null)return J(Error("marked(): input parameter is undefined or null"));if(typeof b!=="string")return J(Error("marked(): input parameter is of type "+Object.prototype.toString.call(b)+", string expected"));if(A.hooks)A.hooks.options=A,A.hooks.block=_;let U=A.hooks?A.hooks.provideLexer():_?J4.lex:J4.lexInline,G=A.hooks?A.hooks.provideParser():_?U4.parse:U4.parseInline;if(A.async)return Promise.resolve(A.hooks?A.hooks.preprocess(b):b).then((Y)=>U(Y,A)).then((Y)=>A.hooks?A.hooks.processAllTokens(Y):Y).then((Y)=>A.walkTokens?Promise.all(this.walkTokens(Y,A.walkTokens)).then(()=>Y):Y).then((Y)=>G(Y,A)).then((Y)=>A.hooks?A.hooks.postprocess(Y):Y).catch(J);try{if(A.hooks)b=A.hooks.preprocess(b);let Y=U(b,A);if(A.hooks)Y=A.hooks.processAllTokens(Y);if(A.walkTokens)this.walkTokens(Y,A.walkTokens);let X=G(Y,A);if(A.hooks)X=A.hooks.postprocess(X);return X}catch(Y){return J(Y)}}}onError(_,$){return(b)=>{if(b.message+=`
211
+ Please report this to https://github.com/markedjs/marked.`,_){let Z="<p>An error occurred:</p><pre>"+u_(b.message+"",!0)+"</pre>";if($)return Promise.resolve(Z);return Z}if($)return Promise.reject(b);throw b}}},t4=new kx;function G0(_,$){return t4.parse(_,$)}G0.options=G0.setOptions=function(_){return t4.setOptions(_),G0.defaults=t4.defaults,mQ(G0.defaults),G0};G0.getDefaults=mJ;G0.defaults=s4;G0.use=function(..._){return t4.use(..._),G0.defaults=t4.defaults,mQ(G0.defaults),G0};G0.walkTokens=function(_,$){return t4.walkTokens(_,$)};G0.parseInline=t4.parseInline;G0.Parser=U4;G0.parser=U4.parse;G0.Renderer=C6;G0.TextRenderer=dJ;G0.Lexer=J4;G0.lexer=J4.lex;G0.Tokenizer=y6;G0.Hooks=L6;G0.parse=G0;var{options:vm,setOptions:Hm,use:qm,walkTokens:Dm,parseInline:Vm}=G0;var gm=U4.parse,km=J4.lex;import{EventEmitter as Wx}from"events";var G4="\x1B",aQ="\x1B[200~",u6="\x1B[201~";function wx(_){if(!_.startsWith(G4))return"not-escape";if(_.length===1)return"incomplete";let $=_.slice(1);if($.startsWith("[")){if($.startsWith("[M"))return _.length>=6?"complete":"incomplete";return Bx(_)}if($.startsWith("]"))return xx(_);if($.startsWith("P"))return Nx(_);if($.startsWith("_"))return Ix(_);if($.startsWith("O"))return $.length>=2?"complete":"incomplete";if($.length===1)return"complete";return"complete"}function Bx(_){if(!_.startsWith(`${G4}[`))return"complete";if(_.length<3)return"incomplete";let $=_.slice(2),b=$[$.length-1],Z=b.charCodeAt(0);if(Z>=64&&Z<=126){if($.startsWith("<")){if(/^<\d+;\d+;\d+[Mm]$/.test($))return"complete";if(b==="M"||b==="m"){let A=$.slice(1,-1).split(";");if(A.length===3&&A.every((J)=>/^\d+$/.test(J)))return"complete"}return"incomplete"}return"complete"}return"incomplete"}function xx(_){if(!_.startsWith(`${G4}]`))return"complete";if(_.endsWith(`${G4}\\`)||_.endsWith("\x07"))return"complete";return"incomplete"}function Nx(_){if(!_.startsWith(`${G4}P`))return"complete";if(_.endsWith(`${G4}\\`))return"complete";return"incomplete"}function Ix(_){if(!_.startsWith(`${G4}_`))return"complete";if(_.endsWith(`${G4}\\`))return"complete";return"incomplete"}function eQ(_){let $=[],b=0;while(b<_.length){let Z=_.slice(b);if(Z.startsWith(G4)){let z=1;while(z<=Z.length){let A=Z.slice(0,z),J=wx(A);if(J==="complete"){$.push(A),b+=z;break}else if(J==="incomplete")z++;else{$.push(A),b+=z;break}}if(z>Z.length)return{sequences:$,remainder:Z}}else $.push(Z[0]),b++}return{sequences:$,remainder:""}}class c6 extends Wx{buffer="";timeout=null;timeoutMs;pasteMode=!1;pasteBuffer="";constructor(_={}){super();this.timeoutMs=_.timeout??10}process(_){if(this.timeout)clearTimeout(this.timeout),this.timeout=null;let $;if(Buffer.isBuffer(_))if(_.length===1&&_[0]>127){let z=_[0]-128;$=`\x1B${String.fromCharCode(z)}`}else $=_.toString();else $=_;if($.length===0&&this.buffer.length===0){this.emit("data","");return}if(this.buffer+=$,this.pasteMode){this.pasteBuffer+=this.buffer,this.buffer="";let z=this.pasteBuffer.indexOf(u6);if(z!==-1){let A=this.pasteBuffer.slice(0,z),J=this.pasteBuffer.slice(z+u6.length);if(this.pasteMode=!1,this.pasteBuffer="",this.emit("paste",A),J.length>0)this.process(J)}return}let b=this.buffer.indexOf(aQ);if(b!==-1){if(b>0){let A=this.buffer.slice(0,b),J=eQ(A);for(let U of J.sequences)this.emit("data",U)}this.buffer=this.buffer.slice(b+aQ.length),this.pasteMode=!0,this.pasteBuffer=this.buffer,this.buffer="";let z=this.pasteBuffer.indexOf(u6);if(z!==-1){let A=this.pasteBuffer.slice(0,z),J=this.pasteBuffer.slice(z+u6.length);if(this.pasteMode=!1,this.pasteBuffer="",this.emit("paste",A),J.length>0)this.process(J)}return}let Z=eQ(this.buffer);this.buffer=Z.remainder;for(let z of Z.sequences)this.emit("data",z);if(this.buffer.length>0)this.timeout=setTimeout(()=>{let z=this.flush();for(let A of z)this.emit("data",A)},this.timeoutMs)}flush(){if(this.timeout)clearTimeout(this.timeout),this.timeout=null;if(this.buffer.length===0)return[];let _=[this.buffer];return this.buffer="",_}clear(){if(this.timeout)clearTimeout(this.timeout),this.timeout=null;this.buffer="",this.pasteMode=!1,this.pasteBuffer=""}getBuffer(){return this.buffer}destroy(){this.clear()}}import*as tQ from"node:fs";import{createRequire as Mx}from"node:module";var Ex=Mx(import.meta.url);class h6{wasRaw=!1;inputHandler;resizeHandler;_kittyProtocolActive=!1;_modifyOtherKeysActive=!1;stdinBuffer;stdinDataHandler;writeLogPath=process.env.PI_TUI_WRITE_LOG||"";get kittyProtocolActive(){return this._kittyProtocolActive}start(_,$){if(this.inputHandler=_,this.resizeHandler=$,this.wasRaw=process.stdin.isRaw||!1,process.stdin.setRawMode)process.stdin.setRawMode(!0);if(process.stdin.setEncoding("utf8"),process.stdin.resume(),process.stdout.write("\x1B[?2004h"),process.stdout.on("resize",this.resizeHandler),process.platform!=="win32")process.kill(process.pid,"SIGWINCH");this.enableWindowsVTInput(),this.queryAndEnableKittyProtocol()}setupStdinBuffer(){this.stdinBuffer=new c6({timeout:10});let _=/^\x1b\[\?(\d+)u$/;this.stdinBuffer.on("data",($)=>{if(!this._kittyProtocolActive){if($.match(_)){this._kittyProtocolActive=!0,t$(!0),process.stdout.write("\x1B[>7u");return}}if(this.inputHandler)this.inputHandler($)}),this.stdinBuffer.on("paste",($)=>{if(this.inputHandler)this.inputHandler(`\x1B[200~${$}\x1B[201~`)}),this.stdinDataHandler=($)=>{this.stdinBuffer.process($)}}queryAndEnableKittyProtocol(){this.setupStdinBuffer(),process.stdin.on("data",this.stdinDataHandler),process.stdout.write("\x1B[?u"),setTimeout(()=>{if(!this._kittyProtocolActive&&!this._modifyOtherKeysActive)process.stdout.write("\x1B[>4;2m"),this._modifyOtherKeysActive=!0},150)}enableWindowsVTInput(){if(process.platform!=="win32")return;try{let $=Ex("koffi").load("kernel32.dll"),b=$.func("void* __stdcall GetStdHandle(int)"),Z=$.func("bool __stdcall GetConsoleMode(void*, _Out_ uint32_t*)"),z=$.func("bool __stdcall SetConsoleMode(void*, uint32_t)"),A=-10,J=512,U=b(-10),G=new Uint32Array(1);Z(U,G),z(U,G[0]|512)}catch{}}async drainInput(_=1000,$=50){if(this._kittyProtocolActive)process.stdout.write("\x1B[<u"),this._kittyProtocolActive=!1,t$(!1);if(this._modifyOtherKeysActive)process.stdout.write("\x1B[>4;0m"),this._modifyOtherKeysActive=!1;let b=this.inputHandler;this.inputHandler=void 0;let Z=Date.now(),z=()=>{Z=Date.now()};process.stdin.on("data",z);let A=Date.now()+_;try{while(!0){let J=Date.now(),U=A-J;if(U<=0)break;if(J-Z>=$)break;await new Promise((G)=>setTimeout(G,Math.min($,U)))}}finally{process.stdin.removeListener("data",z),this.inputHandler=b}}stop(){if(process.stdout.write("\x1B[?2004l"),this._kittyProtocolActive)process.stdout.write("\x1B[<u"),this._kittyProtocolActive=!1,t$(!1);if(this._modifyOtherKeysActive)process.stdout.write("\x1B[>4;0m"),this._modifyOtherKeysActive=!1;if(this.stdinBuffer)this.stdinBuffer.destroy(),this.stdinBuffer=void 0;if(this.stdinDataHandler)process.stdin.removeListener("data",this.stdinDataHandler),this.stdinDataHandler=void 0;if(this.inputHandler=void 0,this.resizeHandler)process.stdout.removeListener("resize",this.resizeHandler),this.resizeHandler=void 0;if(process.stdin.pause(),process.stdin.setRawMode)process.stdin.setRawMode(this.wasRaw)}write(_){if(process.stdout.write(_),this.writeLogPath)try{tQ.appendFileSync(this.writeLogPath,_,{encoding:"utf8"})}catch{}}get columns(){return process.stdout.columns||80}get rows(){return process.stdout.rows||24}moveBy(_){if(_>0)process.stdout.write(`\x1B[${_}B`);else if(_<0)process.stdout.write(`\x1B[${-_}A`)}hideCursor(){process.stdout.write("\x1B[?25l")}showCursor(){process.stdout.write("\x1B[?25h")}clearLine(){process.stdout.write("\x1B[K")}clearFromCursor(){process.stdout.write("\x1B[J")}clearScreen(){process.stdout.write("\x1B[2J\x1B[H")}setTitle(_){process.stdout.write(`\x1B]0;${_}\x07`)}}var sQ=(_=0)=>($)=>`\x1B[${$+_}m`,_K=(_=0)=>($)=>`\x1B[${38+_};5;${$}m`,$K=(_=0)=>($,b,Z)=>`\x1B[${38+_};2;${$};${b};${Z}m`,F0={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},fu=Object.keys(F0.modifier),Ox=Object.keys(F0.color),Px=Object.keys(F0.bgColor),mu=[...Ox,...Px];function jx(){let _=new Map;for(let[$,b]of Object.entries(F0)){for(let[Z,z]of Object.entries(b))F0[Z]={open:`\x1B[${z[0]}m`,close:`\x1B[${z[1]}m`},b[Z]=F0[Z],_.set(z[0],z[1]);Object.defineProperty(F0,$,{value:b,enumerable:!1})}return Object.defineProperty(F0,"codes",{value:_,enumerable:!1}),F0.color.close="\x1B[39m",F0.bgColor.close="\x1B[49m",F0.color.ansi=sQ(),F0.color.ansi256=_K(),F0.color.ansi16m=$K(),F0.bgColor.ansi=sQ(10),F0.bgColor.ansi256=_K(10),F0.bgColor.ansi16m=$K(10),Object.defineProperties(F0,{rgbToAnsi256:{value($,b,Z){if($===b&&b===Z){if($<8)return 16;if($>248)return 231;return Math.round(($-8)/247*24)+232}return 16+36*Math.round($/255*5)+6*Math.round(b/255*5)+Math.round(Z/255*5)},enumerable:!1},hexToRgb:{value($){let b=/[a-f\d]{6}|[a-f\d]{3}/i.exec($.toString(16));if(!b)return[0,0,0];let[Z]=b;if(Z.length===3)Z=[...Z].map((A)=>A+A).join("");let z=Number.parseInt(Z,16);return[z>>16&255,z>>8&255,z&255]},enumerable:!1},hexToAnsi256:{value:($)=>F0.rgbToAnsi256(...F0.hexToRgb($)),enumerable:!1},ansi256ToAnsi:{value($){if($<8)return 30+$;if($<16)return 90+($-8);let b,Z,z;if($>=232)b=(($-232)*10+8)/255,Z=b,z=b;else{$-=16;let U=$%36;b=Math.floor($/36)/5,Z=Math.floor(U/6)/5,z=U%6/5}let A=Math.max(b,Z,z)*2;if(A===0)return 30;let J=30+(Math.round(z)<<2|Math.round(Z)<<1|Math.round(b));if(A===2)J+=60;return J},enumerable:!1},rgbToAnsi:{value:($,b,Z)=>F0.ansi256ToAnsi(F0.rgbToAnsi256($,b,Z)),enumerable:!1},hexToAnsi:{value:($)=>F0.ansi256ToAnsi(F0.hexToAnsi256($)),enumerable:!1}}),F0}var Sx=jx(),B_=Sx;import iJ from"node:process";import Rx from"node:os";import zK from"node:tty";function v_(_,$=globalThis.Deno?globalThis.Deno.args:iJ.argv){let b=_.startsWith("-")?"":_.length===1?"-":"--",Z=$.indexOf(b+_),z=$.indexOf("--");return Z!==-1&&(z===-1||Z<z)}var{env:v0}=iJ,r6;if(v_("no-color")||v_("no-colors")||v_("color=false")||v_("color=never"))r6=0;else if(v_("color")||v_("colors")||v_("color=true")||v_("color=always"))r6=1;function Lx(){if("FORCE_COLOR"in v0){if(v0.FORCE_COLOR==="true")return 1;if(v0.FORCE_COLOR==="false")return 0;return v0.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(v0.FORCE_COLOR,10),3)}}function Tx(_){if(_===0)return!1;return{level:_,hasBasic:!0,has256:_>=2,has16m:_>=3}}function yx(_,{streamIsTTY:$,sniffFlags:b=!0}={}){let Z=Lx();if(Z!==void 0)r6=Z;let z=b?r6:Z;if(z===0)return 0;if(b){if(v_("color=16m")||v_("color=full")||v_("color=truecolor"))return 3;if(v_("color=256"))return 2}if("TF_BUILD"in v0&&"AGENT_NAME"in v0)return 1;if(_&&!$&&z===void 0)return 0;let A=z||0;if(v0.TERM==="dumb")return A;if(iJ.platform==="win32"){let J=Rx.release().split(".");if(Number(J[0])>=10&&Number(J[2])>=10586)return Number(J[2])>=14931?3:2;return 1}if("CI"in v0){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((J)=>(J in v0)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((J)=>(J in v0))||v0.CI_NAME==="codeship")return 1;return A}if("TEAMCITY_VERSION"in v0)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(v0.TEAMCITY_VERSION)?1:0;if(v0.COLORTERM==="truecolor")return 3;if(v0.TERM==="xterm-kitty")return 3;if(v0.TERM==="xterm-ghostty")return 3;if(v0.TERM==="wezterm")return 3;if("TERM_PROGRAM"in v0){let J=Number.parseInt((v0.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(v0.TERM_PROGRAM){case"iTerm.app":return J>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(v0.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(v0.TERM))return 1;if("COLORTERM"in v0)return 1;return A}function bK(_,$={}){let b=yx(_,{streamIsTTY:_&&_.isTTY,...$});return Tx(b)}var Cx={stdout:bK({isTTY:zK.isatty(1)}),stderr:bK({isTTY:zK.isatty(2)})},ZK=Cx;function AK(_,$,b){let Z=_.indexOf($);if(Z===-1)return _;let z=$.length,A=0,J="";do J+=_.slice(A,Z)+$+b,A=Z+z,Z=_.indexOf($,A);while(Z!==-1);return J+=_.slice(A),J}function JK(_,$,b,Z){let z=0,A="";do{let J=_[Z-1]==="\r";A+=_.slice(z,J?Z-1:Z)+$+(J?`\r
212
212
  `:`
213
213
  `)+b,z=Z+1,Z=_.indexOf(`
214
- `,z)}while(Z!==-1);return A+=_.slice(z),A}var{stdout:zK,stderr:bK}=sQ,pJ=Symbol("GENERATOR"),r9=Symbol("STYLER"),G2=Symbol("IS_EMPTY"),ZK=["ansi","ansi","ansi256","ansi16m"],n9=Object.create(null),jx=(_,$={})=>{if($.level&&!(Number.isInteger($.level)&&$.level>=0&&$.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let b=zK?zK.level:0;_.level=$.level===void 0?b:$.level};var Sx=(_)=>{let $=(...b)=>b.join(" ");return jx($,_),Object.setPrototypeOf($,Y2.prototype),$};function Y2(_){return Sx(_)}Object.setPrototypeOf(Y2.prototype,Function.prototype);for(let[_,$]of Object.entries(B_))n9[_]={get(){let b=l6(this,iJ($.open,$.close,this[r9]),this[G2]);return Object.defineProperty(this,_,{value:b}),b}};n9.visible={get(){let _=l6(this,this[r9],!0);return Object.defineProperty(this,"visible",{value:_}),_}};var dJ=(_,$,b,...Z)=>{if(_==="rgb"){if($==="ansi16m")return B_[b].ansi16m(...Z);if($==="ansi256")return B_[b].ansi256(B_.rgbToAnsi256(...Z));return B_[b].ansi(B_.rgbToAnsi(...Z))}if(_==="hex")return dJ("rgb",$,b,...B_.hexToRgb(...Z));return B_[b][_](...Z)},Rx=["rgb","hex","ansi256"];for(let _ of Rx){n9[_]={get(){let{level:b}=this;return function(...Z){let z=iJ(dJ(_,ZK[b],"color",...Z),B_.color.close,this[r9]);return l6(this,z,this[G2])}}};let $="bg"+_[0].toUpperCase()+_.slice(1);n9[$]={get(){let{level:b}=this;return function(...Z){let z=iJ(dJ(_,ZK[b],"bgColor",...Z),B_.bgColor.close,this[r9]);return l6(this,z,this[G2])}}}}var Lx=Object.defineProperties(()=>{},{...n9,level:{enumerable:!0,get(){return this[pJ].level},set(_){this[pJ].level=_}}}),iJ=(_,$,b)=>{let Z,z;if(b===void 0)Z=_,z=$;else Z=b.openAll+_,z=$+b.closeAll;return{open:_,close:$,openAll:Z,closeAll:z,parent:b}},l6=(_,$,b)=>{let Z=(...z)=>Tx(Z,z.length===1?""+z[0]:z.join(" "));return Object.setPrototypeOf(Z,Lx),Z[pJ]=_,Z[r9]=$,Z[G2]=b,Z},Tx=(_,$)=>{if(_.level<=0||!$)return _[G2]?"":$;let b=_[r9];if(b===void 0)return $;let{openAll:Z,closeAll:z}=b;if($.includes("\x1B"))while(b!==void 0)$=_K($,b.close,b.open),b=b.parent;let A=$.indexOf(`
215
- `);if(A!==-1)$=$K($,z,Z,A);return Z+$+z};Object.defineProperties(Y2.prototype,n9);var yx=Y2(),ju=Y2({level:bK?bK.level:0});var u_=yx;var Cx=15,fx={selectedPrefix:(_)=>u_.cyan(_),selectedText:(_)=>u_.cyan(_),description:(_)=>u_.gray(_),scrollInfo:(_)=>u_.gray(_),noMatch:(_)=>u_.yellow(_)};function mx(_){let b=Date.now()-_.getTime(),Z=Math.floor(b/1000),z=Math.floor(Z/60),A=Math.floor(z/60),J=Math.floor(A/24),U=Math.floor(J/7);if(U>0)return`${U}w ago`;if(J>0)return`${J}d ago`;if(A>0)return`${A}h ago`;if(z>0)return`${z}m ago`;return"now"}function ux(_,$){if(!_)return"";let b=process.env.HOME??"",Z=_;if(b&&_.startsWith(b))Z="~"+_.slice(b.length);return R0(Z,$,"…",!1)}function hx(_){if(!_)return"";let $=[];if(_.linesAdded>0)$.push(u_.green(`+${_.linesAdded}`));if(_.linesModified>0)$.push(u_.yellow(`~${_.linesModified}`));if(_.linesRemoved>0)$.push(u_.red(`-${_.linesRemoved}`));return $.join(" ")}function cx(_,$){let b=mx(_.timestamp).padEnd(7),Z=_.source.padEnd(11),z=hx(_.stats),A=_.stats?15:0,J=24+A+(A>0?3:0),U=Math.max(40,$-J),G=Math.min(22,Math.floor(U*0.35)),Y=U-G-3,X=ux(_.cwd,G).padEnd(G),Q=R0(_.preview??"",Y,"…",!1);if(z)return`${b} │ ${Z} │ ${z.padEnd(15)} │ ${X} │ ${Q}`;return`${b} │ ${Z} │ ${X} │ ${Q}`}async function AK(_){if(_.length===0)return console.log("No transcripts found."),null;return new Promise(($)=>{let b=new r6,Z=new c9(b),z=process.stdout.columns??80,A=_.map((G)=>({value:G.id,label:cx(G,z),description:"",transcript:G})),J=new u9(u_.gray("Select a transcript to upload (↑↓ navigate, Enter select, Esc cancel)"),1),U=new g4(A,Cx,fx);U.onSelect=(G)=>{Z.stop(),$(G.transcript)},U.onCancel=()=>{Z.stop(),$(null)},Z.addChild(J),Z.addChild(U),Z.setFocus(U),Z.start()})}import{createHash as JK}from"crypto";import{existsSync as oJ,readFileSync as rx}from"fs";import{dirname as nx,isAbsolute as lx,resolve as px}from"path";async function UK(_,$={}){let b=aJ(_),Z=await M0(b.cwd);if(!J_(Z))return{success:!1,eventCount:b.records.length,invalidLines:b.invalidLines,sessionId:"",cwd:b.cwd,unifiedTranscript:{},sha256:"",source:_.source??"claude-code",skipped:!0};let z=await YK(_,b),A=kJ(z.unifiedTranscript),J=d4(A),U=JSON.stringify(J),G=JK("sha256").update(U).digest("hex"),Y=await X_(z.sessionId),X=_.visibility??Dz(Z),Q=w6(z.rawTranscript),K={id:Y,sha256:G,rawTranscript:Q,unifiedTranscript:J,blobs:z.blobs.length>0?z.blobs:void 0,visibility:X},v=await JJ(K,$);if(v.success&&v.id)await bb(z.sessionId,v.id);return{...v,eventCount:z.eventCount,invalidLines:z.invalidLines,sessionId:z.sessionId,unifiedTranscript:J,sha256:G,source:_.source??"claude-code",cwd:z.cwd,skipped:!1}}function GK(_){if(!_)return null;if(lx(_))return oJ(_)?_:null;let $=new Set,b=(A)=>{if(!A)return null;let J=px(A,_);if($.has(J))return null;return $.add(J),oJ(J)?J:null},Z=b(process.cwd())??b(process.env.INIT_CWD)??b(process.env.PWD);if(Z)return Z;let z=process.cwd();while(!0){let A=b(z);if(A)return A;let J=nx(z);if(J===z)break;z=J}return null}function dx(_){for(let $ of _){let b=typeof $.cwd==="string"?$.cwd.trim():"";if(b)return b}return null}function ix(_){for(let $ of _){let b=typeof $.gitBranch==="string"?$.gitBranch.trim():"";if(b)return b}return}function aJ(_){let{transcriptPath:$}=_;if(!$)throw Error("No transcript path provided.");if(!oJ($))throw Error(`Transcript file not found at path: ${$}`);let b=rx($,"utf8"),Z=b.split(/\r?\n/),z=[],A=0;for(let U of Z){let G=U.trim();if(!G)continue;try{let Y=JSON.parse(G);if(typeof Y==="object"&&Y!==null)z.push(Y);else A+=1}catch{A+=1}}if(z.length===0)throw Error("No transcript events found in the specified file.");let J=_.cwdOverride&&_.cwdOverride.trim().length>0?_.cwdOverride.trim():dx(z)??process.cwd();return{rawContent:b,records:z,cwd:J,invalidLines:A}}async function YK(_,$){let{sessionId:b,source:Z="claude-code"}=_,z=$??aJ(_),J=await new k0().fetchModelPricing(),U=Object.fromEntries(J),G=ix(z.records),Y=await g0(z.cwd,G),X={pricing:U,gitContext:Y},Q=Z==="codex"?qJ(z.records,{pricing:U}):g6(z.records,X);if(!Q)throw Error(`Unable to convert ${Z} transcript to unified format.`);let{transcript:K,blobs:v}=Q,V=b??K.id;if(!V)throw Error("Transcript did not include a session identifier.");if(b&&b!==K.id)throw Error(`Provided sessionId (${b}) does not match unified transcript id (${K.id}).`);let w=[];for(let[P,O]of v)w.push({sha256:P,data:new Uint8Array(O.data),mediaType:O.mediaType});return{unifiedTranscript:K,rawTranscript:z.rawContent,blobs:w,sessionId:V,cwd:z.cwd,eventCount:z.records.length,invalidLines:z.invalidLines}}async function w_(_){let $=aJ(_),b=await M0($.cwd);if(!J_(b))return{results:[],eventCount:$.records.length,id:"",sessionId:"",anySuccess:!1,allSuccess:!1};let Z=await YK(_,$),z=await O0({unifiedTranscript:Z.unifiedTranscript,sessionId:Z.sessionId,cwd:Z.cwd,rawTranscript:Z.rawTranscript,blobs:Z.blobs,visibility:_.visibility});if(z.skipped)return{results:[],eventCount:Z.eventCount,id:"",sessionId:Z.sessionId,anySuccess:!1,allSuccess:!1};return{results:z.results,eventCount:Z.eventCount,id:z.id,sessionId:z.sessionId,anySuccess:z.anySuccess,allSuccess:z.allSuccess}}async function O0(_){let{unifiedTranscript:$,sessionId:b,cwd:Z,rawTranscript:z,blobs:A,visibility:J}=_,U=await M0(Z);if(!J_(U))return{results:[],id:"",sessionId:b,anySuccess:!1,allSuccess:!1,skipped:!0};let G=await k_();if(G.length===0)throw Error("No authenticated environments found. Run `agentlogs login agentlogs.ai` first.");let Y=kJ($),X=d4(Y),Q=JSON.stringify(X),K=JK("sha256").update(Q).digest("hex"),v=await X_(b),V=J??Dz(U),w=w6(z??Q),P={id:v,sha256:K,rawTranscript:w,unifiedTranscript:X,blobs:A&&A.length>0?A:void 0,visibility:V},O=[],B="";for(let T of G)try{let y=await JJ(P,{serverUrl:T.baseURL,authToken:T.token});if(y.success&&y.id){if(await bb(b,y.id),!B)B=y.id}O.push({envName:T.name,baseURL:T.baseURL,success:y.success,id:y.id,transcriptId:y.transcriptId})}catch(y){O.push({envName:T.name,baseURL:T.baseURL,success:!1,error:y instanceof Error?y.message:String(y)})}return{results:O,id:B,sessionId:b,anySuccess:O.some((T)=>T.success),allSuccess:O.every((T)=>T.success),skipped:!1}}async function QK(_,$={}){if((await k_()).length===0)console.error("You must be logged in to upload transcripts."),console.error("Run `agentlogs login agentlogs.ai` to authenticate."),process.exit(1);let Z=_?XK(_):void 0,z=await QQ({sources:$.source?[$.source]:void 0,cwd:Z,limit:100});if(z.length===0){let U=[Z?`directory: ${Z}`:null,$.source?`source: ${$.source}`:null].filter(Boolean).join(", ");console.log(U?`No transcripts found matching filters (${U}).`:"No transcripts found.");return}let A=null;if($.latest)A=z[0],console.log(`Auto-selecting most recent transcript: ${A.id}`);else A=await AK(z);if(!A)process.exit(0);let J=await ax(A);process.exit(J?0:1)}async function ax(_){if(console.log(""),console.log(`Uploading ${_.source} transcript: ${_.id}`),_.cwd)console.log(`Directory: ${_.cwd}`);try{switch(_.source){case"claude-code":return await ex(_);case"codex":return await tx(_);case"opencode":return await sx(_);case"cline":return await _N(_);case"pi":return await $N(_)}}catch($){return console.error(""),console.error("Upload failed:",$ instanceof Error?$.message:String($)),!1}}async function ex(_){let $=await w_({transcriptPath:_.path,sessionId:_.id,cwdOverride:_.cwd??void 0,source:"claude-code"});return KK($)}async function tx(_){let $=await w_({transcriptPath:_.path,sessionId:_.id,cwdOverride:_.cwd??void 0,source:"codex"});return KK($)}async function sx(_){let $=bN(_.id);if(!$)throw Error(`Failed to read OpenCode session: ${_.id}`);let Z=await new k0().fetchModelPricing(),z=Object.fromEntries(Z),A=$.info.directory??process.cwd(),J=await g0(A,void 0);if(J?.repo)console.log(`Repository: ${J.repo}`);console.log("Converting transcript...");let U=l4($,{pricing:z,gitContext:J,cwd:A});if(!U)throw Error("Failed to convert OpenCode transcript");console.log("Uploading...");let G=await O0({unifiedTranscript:U,sessionId:_.id,cwd:A,rawTranscript:JSON.stringify($)});if(G.skipped)return console.log(""),console.log("Skipped: Repository not in allowlist"),!0;if(G.anySuccess&&G.id){console.log(""),console.log("Upload successful!"),console.log(`Transcript ID: ${G.id}`);for(let Y of G.results)if(Y.success){let X=`${Y.baseURL}/s/${G.id}`;console.log(`View: ${X}`)}return!0}else{console.error(""),console.error("Upload failed:");for(let Y of G.results)if(!Y.success&&Y.error)console.error(` ${Y.envName}: ${Y.error}`);return!1}}async function _N(_){if(!eJ(_.path))throw Error(`Failed to read Cline task: ${_.path}`);let $=tJ(_.path,"utf-8"),b;try{b=JSON.parse($)}catch{throw Error(`Failed to parse Cline task: ${_.path}`)}let Z,z=XK(_.path,"..","task_metadata.json");if(eJ(z))try{Z=JSON.parse(tJ(z,"utf-8"))}catch{}let J=await new k0().fetchModelPricing(),U=Object.fromEntries(J),G=process.cwd(),Y=await g0(G,void 0);if(Y?.repo)console.log(`Repository: ${Y.repo}`);console.log("Converting transcript...");let X=r4(b,{pricing:U,gitContext:Y,cwd:G,taskId:_.id,metadata:Z,clientVersion:Z?.environment_history?.[0]?.cline_version});if(!X)throw Error("Failed to convert Cline transcript");console.log("Uploading...");let Q=await O0({unifiedTranscript:X.transcript,sessionId:_.id,cwd:G,rawTranscript:$});if(Q.skipped)return console.log(""),console.log("Skipped: Repository not in allowlist"),!0;if(Q.anySuccess&&Q.id){console.log(""),console.log("Upload successful!"),console.log(`Transcript ID: ${Q.id}`);for(let K of Q.results)if(K.success){let v=`${K.baseURL}/s/${Q.id}`;console.log(`View: ${v}`)}return!0}else{console.error(""),console.error("Upload failed:");for(let K of Q.results)if(!K.success&&K.error)console.error(` ${K.envName}: ${K.error}`);return!1}}async function $N(_){let $=zN(_.path);if(!$)throw Error(`Failed to read Pi session: ${_.path}`);let Z=await new k0().fetchModelPricing(),z=Object.fromEntries(Z),A=$.header.cwd??process.cwd(),J=await g0(A,void 0);if(J?.repo)console.log(`Repository: ${J.repo}`);console.log("Converting transcript...");let U=p4($,{pricing:z,gitContext:J,cwd:A});if(!U)throw Error("Failed to convert Pi transcript");console.log("Uploading...");let G=await O0({unifiedTranscript:U.transcript,sessionId:_.id,cwd:A,rawTranscript:JSON.stringify($)});if(G.skipped)return console.log(""),console.log("Skipped: Repository not in allowlist"),!0;if(G.anySuccess&&G.id){console.log(""),console.log("Upload successful!"),console.log(`Transcript ID: ${G.id}`);for(let Y of G.results)if(Y.success){let X=`${Y.baseURL}/s/${G.id}`;console.log(`View: ${X}`)}return!0}else{console.error(""),console.error("Upload failed:");for(let Y of G.results)if(!Y.success&&Y.error)console.error(` ${Y.envName}: ${Y.error}`);return!1}}function zN(_){if(!eJ(_))return null;let b=tJ(_,"utf-8").split(`
216
- `).filter((A)=>A.trim());if(b.length===0)return null;let Z=JSON.parse(b[0]),z=[];for(let A=1;A<b.length;A++)try{z.push(JSON.parse(b[A]))}catch{}return{header:Z,entries:z}}function bN(_){try{let $=ox("opencode",["export",_],{encoding:"utf-8",timeout:30000,stdio:["pipe","pipe","pipe"]});if($.status!==0||$.error)return null;let b=$.stdout.trim();if(!b)return null;return JSON.parse(b)}catch{return null}}function KK(_){if(_.anySuccess&&_.id){console.log(""),console.log("Upload successful!"),console.log(`Transcript ID: ${_.id}`);for(let $ of _.results)if($.success){let b=`${$.baseURL}/s/${_.id}`;console.log(`View: ${b}`)}return!0}else if(_.results.length===0)return console.log(""),console.log("Skipped: Repository not in allowlist"),!0;else{console.error(""),console.error("Upload failed:");for(let $ of _.results)if(!$.success&&$.error)console.error(` ${$.envName}: ${$.error}`);return!1}}var ZN="/tmp/agentlogs.log";function AN(){return!1}var L=jX("cli",{logFilePath:ZN,logToFile:AN(),disableConsole:!0}),vK="https://agentlogs.ai",JN=/https?:\/\/[^\s"'`]+\/s\/([a-zA-Z0-9_-]+)/;function UN(_){let $=_.toLowerCase();return $==="localhost"||$==="127.0.0.1"||$==="::1"}function GN(_){try{let $=new URL(_);return UN($.hostname)}catch{return!1}}function FK(_){try{let $=new URL(_);return`${$.protocol}//${$.host.toLowerCase()}`}catch{return _.replace(/\/+$/,"")}}function YN(_){let $=_.find((b)=>!GN(b.baseURL))??_[0];return FK($?.baseURL??vK)}async function l9(){let _=await k_();return YN(_)}function Z4(_){return/\bgit\s+commit\b/.test(_)}function p9(_,$,b){let z=`\uD83D\uDD2E View transcript: ${FK(b??vK)}/s/${$}`;if(_.includes(z)||_9(_)===$)return _;let A=`
214
+ `,z)}while(Z!==-1);return A+=_.slice(z),A}var{stdout:UK,stderr:GK}=ZK,oJ=Symbol("GENERATOR"),r9=Symbol("STYLER"),U2=Symbol("IS_EMPTY"),YK=["ansi","ansi","ansi256","ansi16m"],n9=Object.create(null),fx=(_,$={})=>{if($.level&&!(Number.isInteger($.level)&&$.level>=0&&$.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let b=UK?UK.level:0;_.level=$.level===void 0?b:$.level};var mx=(_)=>{let $=(...b)=>b.join(" ");return fx($,_),Object.setPrototypeOf($,G2.prototype),$};function G2(_){return mx(_)}Object.setPrototypeOf(G2.prototype,Function.prototype);for(let[_,$]of Object.entries(B_))n9[_]={get(){let b=n6(this,eJ($.open,$.close,this[r9]),this[U2]);return Object.defineProperty(this,_,{value:b}),b}};n9.visible={get(){let _=n6(this,this[r9],!0);return Object.defineProperty(this,"visible",{value:_}),_}};var aJ=(_,$,b,...Z)=>{if(_==="rgb"){if($==="ansi16m")return B_[b].ansi16m(...Z);if($==="ansi256")return B_[b].ansi256(B_.rgbToAnsi256(...Z));return B_[b].ansi(B_.rgbToAnsi(...Z))}if(_==="hex")return aJ("rgb",$,b,...B_.hexToRgb(...Z));return B_[b][_](...Z)},ux=["rgb","hex","ansi256"];for(let _ of ux){n9[_]={get(){let{level:b}=this;return function(...Z){let z=eJ(aJ(_,YK[b],"color",...Z),B_.color.close,this[r9]);return n6(this,z,this[U2])}}};let $="bg"+_[0].toUpperCase()+_.slice(1);n9[$]={get(){let{level:b}=this;return function(...Z){let z=eJ(aJ(_,YK[b],"bgColor",...Z),B_.bgColor.close,this[r9]);return n6(this,z,this[U2])}}}}var cx=Object.defineProperties(()=>{},{...n9,level:{enumerable:!0,get(){return this[oJ].level},set(_){this[oJ].level=_}}}),eJ=(_,$,b)=>{let Z,z;if(b===void 0)Z=_,z=$;else Z=b.openAll+_,z=$+b.closeAll;return{open:_,close:$,openAll:Z,closeAll:z,parent:b}},n6=(_,$,b)=>{let Z=(...z)=>hx(Z,z.length===1?""+z[0]:z.join(" "));return Object.setPrototypeOf(Z,cx),Z[oJ]=_,Z[r9]=$,Z[U2]=b,Z},hx=(_,$)=>{if(_.level<=0||!$)return _[U2]?"":$;let b=_[r9];if(b===void 0)return $;let{openAll:Z,closeAll:z}=b;if($.includes("\x1B"))while(b!==void 0)$=AK($,b.close,b.open),b=b.parent;let A=$.indexOf(`
215
+ `);if(A!==-1)$=JK($,z,Z,A);return Z+$+z};Object.defineProperties(G2.prototype,n9);var rx=G2(),ou=G2({level:GK?GK.level:0});var c_=rx;var nx=15,lx={selectedPrefix:(_)=>c_.cyan(_),selectedText:(_)=>c_.cyan(_),description:(_)=>c_.gray(_),scrollInfo:(_)=>c_.gray(_),noMatch:(_)=>c_.yellow(_)};function px(_){let b=Date.now()-_.getTime(),Z=Math.floor(b/1000),z=Math.floor(Z/60),A=Math.floor(z/60),J=Math.floor(A/24),U=Math.floor(J/7);if(U>0)return`${U}w ago`;if(J>0)return`${J}d ago`;if(A>0)return`${A}h ago`;if(z>0)return`${z}m ago`;return"now"}function dx(_,$){if(!_)return"";let b=process.env.HOME??"",Z=_;if(b&&_.startsWith(b))Z="~"+_.slice(b.length);return R0(Z,$,"…",!1)}function ix(_){if(!_)return"";let $=[];if(_.linesAdded>0)$.push(c_.green(`+${_.linesAdded}`));if(_.linesModified>0)$.push(c_.yellow(`~${_.linesModified}`));if(_.linesRemoved>0)$.push(c_.red(`-${_.linesRemoved}`));return $.join(" ")}function ox(_,$){let b=px(_.timestamp).padEnd(7),Z=_.source.padEnd(11),z=ix(_.stats),A=_.stats?15:0,J=24+A+(A>0?3:0),U=Math.max(40,$-J),G=Math.min(22,Math.floor(U*0.35)),Y=U-G-3,X=dx(_.cwd,G).padEnd(G),Q=R0(_.preview??"",Y,"…",!1);if(z)return`${b} │ ${Z} │ ${z.padEnd(15)} │ ${X} │ ${Q}`;return`${b} │ ${Z} │ ${X} │ ${Q}`}async function XK(_){if(_.length===0)return console.log("No transcripts found."),null;return new Promise(($)=>{let b=new h6,Z=new h9(b),z=process.stdout.columns??80,A=_.map((G)=>({value:G.id,label:ox(G,z),description:"",transcript:G})),J=new u9(c_.gray("Select a transcript to upload (↑↓ navigate, Enter select, Esc cancel)"),1),U=new I4(A,nx,lx);U.onSelect=(G)=>{Z.stop(),$(G.transcript)},U.onCancel=()=>{Z.stop(),$(null)},Z.addChild(J),Z.addChild(U),Z.setFocus(U),Z.start()})}import{createHash as QK}from"crypto";import{existsSync as tJ,readFileSync as JN}from"fs";import{dirname as UN,isAbsolute as GN,resolve as YN}from"path";var ax=["github.com","gitlab.com","bitbucket.org"];function ex(_){if(!_)return null;let $=_.trim();if(!$)return null;let[b,...Z]=$.split("/");if(!b||Z.length<2)return $;return`${_N(b)}/${Z.join("/")}`}function tx(_,$={}){if(!_)return _;if(_.startsWith("http://")||_.startsWith("https://")||_.startsWith("mailto:")||_.startsWith("#"))return _;let{pathPart:b,fragment:Z}=$N(_);if(!zN(b))return _;let z=ex($.repoId),A=z?.startsWith("github.com/")?z.slice(11):null;if(!z||!A)return null;let J=bN(b,z);if(!J)return null;let U=ZN($.branch?.trim()||"HEAD");return`https://github.com/${A}/blob/${U}/${AN(J)}${Z}`}function sx(_,$={}){if(!_)return _;return _.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,(b,Z,z)=>{let A=tx(z,$);if(A===null)return Z;if(A===z)return b;return`[${Z}](${A})`})}function l6(_,$={}){if(typeof _==="string")return sx(_,$);if(Array.isArray(_))return _.map((b)=>l6(b,$));if(_ instanceof Date)return _;if(_!==null&&typeof _==="object"){let b={};for(let[Z,z]of Object.entries(_))b[Z]=l6(z,$);return b}return _}function _N(_){let $=_.toLowerCase();for(let b of ax)if($===b||$.startsWith(`${b}-`))return b;return _}function $N(_){let $=_.indexOf("#");if($===-1)return{pathPart:_,fragment:""};return{pathPart:_.slice(0,$),fragment:_.slice($)}}function zN(_){return _.startsWith("~/")||/^(?:\/(?:Users|home|private|tmp|var|opt|srv|etc|usr)\/)/.test(_)||/^[A-Za-z]:[\\/]/.test(_)}function bN(_,$){let b=$.split("/").pop();if(!b)return null;let Z=_.replace(/\\/g,"/"),z=`/${b}/`,A=Z.lastIndexOf(z);if(A===-1)return null;let J=Z.slice(A+z.length);return J.length>0?J:null}function ZN(_){return _.split("/").map(($)=>encodeURIComponent($)).join("/")}function AN(_){return _.split("/").map(($)=>encodeURIComponent($)).join("/")}function p6(_){let $=l6(_,{repoId:_.git?.repo??null,branch:_.git?.branch??null}),b=KQ($);return w6(b)}async function KK(_,$={}){let b=sJ(_),Z=await M0(b.cwd);if(!U_(Z))return{success:!1,eventCount:b.records.length,invalidLines:b.invalidLines,sessionId:"",cwd:b.cwd,unifiedTranscript:{},sha256:"",source:_.source??"claude-code",skipped:!0};let z=await vK(_,b),A=p6(z.unifiedTranscript),J=JSON.stringify(A),U=QK("sha256").update(J).digest("hex"),G=await r0(z.sessionId),Y=_.visibility??wz(Z),X={id:G,sha256:U,unifiedTranscript:A,blobs:z.blobs.length>0?z.blobs:void 0,visibility:Y},Q=await XJ(X,$);if(Q.success&&Q.id)await Ub(z.sessionId,Q.id);return{...Q,eventCount:z.eventCount,invalidLines:z.invalidLines,sessionId:z.sessionId,unifiedTranscript:A,sha256:U,source:_.source??"claude-code",cwd:z.cwd,skipped:!1}}function FK(_){if(!_)return null;if(GN(_))return tJ(_)?_:null;let $=new Set,b=(A)=>{if(!A)return null;let J=YN(A,_);if($.has(J))return null;return $.add(J),tJ(J)?J:null},Z=b(process.cwd())??b(process.env.INIT_CWD)??b(process.env.PWD);if(Z)return Z;let z=process.cwd();while(!0){let A=b(z);if(A)return A;let J=UN(z);if(J===z)break;z=J}return null}function XN(_){for(let $ of _){let b=typeof $.cwd==="string"?$.cwd.trim():"";if(b)return b}return null}function QN(_){for(let $ of _){let b=typeof $.gitBranch==="string"?$.gitBranch.trim():"";if(b)return b}return}function sJ(_){let{transcriptPath:$}=_;if(!$)throw Error("No transcript path provided.");if(!tJ($))throw Error(`Transcript file not found at path: ${$}`);let Z=JN($,"utf8").split(/\r?\n/),z=[],A=0;for(let U of Z){let G=U.trim();if(!G)continue;try{let Y=JSON.parse(G);if(typeof Y==="object"&&Y!==null)z.push(Y);else A+=1}catch{A+=1}}if(z.length===0)throw Error("No transcript events found in the specified file.");let J=_.cwdOverride&&_.cwdOverride.trim().length>0?_.cwdOverride.trim():XN(z)??process.cwd();return{records:z,cwd:J,invalidLines:A}}async function vK(_,$){let{sessionId:b,source:Z="claude-code"}=_,z=$??sJ(_),J=await new g0().fetchModelPricing(),U=Object.fromEntries(J),G=QN(z.records),Y=await W0(z.cwd,G),X={pricing:U,gitContext:Y},Q=Z==="codex"?kJ(z.records,{pricing:U}):k6(z.records,X);if(!Q)throw Error(`Unable to convert ${Z} transcript to unified format.`);let{transcript:K,blobs:v}=Q,D=b??K.id;if(!D)throw Error("Transcript did not include a session identifier.");if(b&&b!==K.id)throw Error(`Provided sessionId (${b}) does not match unified transcript id (${K.id}).`);let w=[];for(let[P,E]of v)w.push({sha256:P,data:new Uint8Array(E.data),mediaType:E.mediaType});return{unifiedTranscript:K,blobs:w,sessionId:D,cwd:z.cwd,eventCount:z.records.length,invalidLines:z.invalidLines}}async function x_(_){let $=sJ(_),b=await M0($.cwd);if(!U_(b))return{results:[],eventCount:$.records.length,id:"",sessionId:"",anySuccess:!1,allSuccess:!1};let Z=await vK(_,$),z=await O0({unifiedTranscript:Z.unifiedTranscript,sessionId:Z.sessionId,cwd:Z.cwd,blobs:Z.blobs,visibility:_.visibility});if(z.skipped)return{results:[],eventCount:Z.eventCount,id:"",sessionId:Z.sessionId,anySuccess:!1,allSuccess:!1};return{results:z.results,eventCount:Z.eventCount,id:z.id,sessionId:z.sessionId,anySuccess:z.anySuccess,allSuccess:z.allSuccess}}async function O0(_){let{unifiedTranscript:$,sessionId:b,cwd:Z,blobs:z,visibility:A}=_,J=await M0(Z);if(!U_(J))return{results:[],id:"",sessionId:b,anySuccess:!1,allSuccess:!1,skipped:!0};let U=await k_();if(U.length===0)throw Error("No authenticated environments found. Run `agentlogs login agentlogs.ai` first.");let G=p6($),Y=JSON.stringify(G),X=QK("sha256").update(Y).digest("hex"),Q=await r0(b),K=A??wz(J),v={id:Q,sha256:X,unifiedTranscript:G,blobs:z&&z.length>0?z:void 0,visibility:K},D=[],w="";for(let P of U)try{let E=await XJ(v,{serverUrl:P.baseURL,authToken:P.token});if(E.success&&E.id){if(await Ub(b,E.id),!w)w=E.id}D.push({envName:P.name,baseURL:P.baseURL,success:E.success,id:E.id,transcriptId:E.transcriptId})}catch(E){D.push({envName:P.name,baseURL:P.baseURL,success:!1,error:E instanceof Error?E.message:String(E)})}return{results:D,id:w,sessionId:b,anySuccess:D.some((P)=>P.success),allSuccess:D.every((P)=>P.success),skipped:!1}}async function qK(_,$={}){if((await k_()).length===0)console.error("You must be logged in to upload transcripts."),console.error("Run `agentlogs login agentlogs.ai` to authenticate."),process.exit(1);let Z=_?HK(_):void 0,z=await qQ({sources:$.source?[$.source]:void 0,cwd:Z,limit:100});if(z.length===0){let U=[Z?`directory: ${Z}`:null,$.source?`source: ${$.source}`:null].filter(Boolean).join(", ");console.log(U?`No transcripts found matching filters (${U}).`:"No transcripts found.");return}let A=null;if($.latest)A=z[0],console.log(`Auto-selecting most recent transcript: ${A.id}`);else A=await XK(z);if(!A)process.exit(0);let J=await FN(A);process.exit(J?0:1)}async function FN(_){if(console.log(""),console.log(`Uploading ${_.source} transcript: ${_.id}`),_.cwd)console.log(`Directory: ${_.cwd}`);try{switch(_.source){case"claude-code":return await vN(_);case"codex":return await HN(_);case"opencode":return await qN(_);case"cline":return await DN(_);case"pi":return await VN(_)}}catch($){return console.error(""),console.error("Upload failed:",$ instanceof Error?$.message:String($)),!1}}async function vN(_){let $=await x_({transcriptPath:_.path,sessionId:_.id,cwdOverride:_.cwd??void 0,source:"claude-code"});return DK($)}async function HN(_){let $=await x_({transcriptPath:_.path,sessionId:_.id,cwdOverride:_.cwd??void 0,source:"codex"});return DK($)}async function qN(_){let $=kN(_.id);if(!$)throw Error(`Failed to read OpenCode session: ${_.id}`);let Z=await new g0().fetchModelPricing(),z=Object.fromEntries(Z),A=$.info.directory??process.cwd(),J=await W0(A,void 0);if(J?.repo)console.log(`Repository: ${J.repo}`);console.log("Converting transcript...");let U=p4($,{pricing:z,gitContext:J,cwd:A});if(!U)throw Error("Failed to convert OpenCode transcript");console.log("Uploading...");let G=await O0({unifiedTranscript:U,sessionId:_.id,cwd:A});if(G.skipped)return console.log(""),console.log("Skipped: Repository not in allowlist"),!0;if(G.anySuccess&&G.id){console.log(""),console.log("Upload successful!"),console.log(`Transcript ID: ${G.id}`);for(let Y of G.results)if(Y.success){let X=`${Y.baseURL}/s/${G.id}`;console.log(`View: ${X}`)}return!0}else{console.error(""),console.error("Upload failed:");for(let Y of G.results)if(!Y.success&&Y.error)console.error(` ${Y.envName}: ${Y.error}`);return!1}}async function DN(_){if(!_U(_.path))throw Error(`Failed to read Cline task: ${_.path}`);let $=$U(_.path,"utf-8"),b;try{b=JSON.parse($)}catch{throw Error(`Failed to parse Cline task: ${_.path}`)}let Z,z=HK(_.path,"..","task_metadata.json");if(_U(z))try{Z=JSON.parse($U(z,"utf-8"))}catch{}let J=await new g0().fetchModelPricing(),U=Object.fromEntries(J),G=process.cwd(),Y=await W0(G,void 0);if(Y?.repo)console.log(`Repository: ${Y.repo}`);console.log("Converting transcript...");let X=n4(b,{pricing:U,gitContext:Y,cwd:G,taskId:_.id,metadata:Z,clientVersion:Z?.environment_history?.[0]?.cline_version});if(!X)throw Error("Failed to convert Cline transcript");console.log("Uploading...");let Q=await O0({unifiedTranscript:X.transcript,sessionId:_.id,cwd:G});if(Q.skipped)return console.log(""),console.log("Skipped: Repository not in allowlist"),!0;if(Q.anySuccess&&Q.id){console.log(""),console.log("Upload successful!"),console.log(`Transcript ID: ${Q.id}`);for(let K of Q.results)if(K.success){let v=`${K.baseURL}/s/${Q.id}`;console.log(`View: ${v}`)}return!0}else{console.error(""),console.error("Upload failed:");for(let K of Q.results)if(!K.success&&K.error)console.error(` ${K.envName}: ${K.error}`);return!1}}async function VN(_){let $=gN(_.path);if(!$)throw Error(`Failed to read Pi session: ${_.path}`);let Z=await new g0().fetchModelPricing(),z=Object.fromEntries(Z),A=$.header.cwd??process.cwd(),J=await W0(A,void 0);if(J?.repo)console.log(`Repository: ${J.repo}`);console.log("Converting transcript...");let U=d4($,{pricing:z,gitContext:J,cwd:A});if(!U)throw Error("Failed to convert Pi transcript");console.log("Uploading...");let G=await O0({unifiedTranscript:U.transcript,sessionId:_.id,cwd:A});if(G.skipped)return console.log(""),console.log("Skipped: Repository not in allowlist"),!0;if(G.anySuccess&&G.id){console.log(""),console.log("Upload successful!"),console.log(`Transcript ID: ${G.id}`);for(let Y of G.results)if(Y.success){let X=`${Y.baseURL}/s/${G.id}`;console.log(`View: ${X}`)}return!0}else{console.error(""),console.error("Upload failed:");for(let Y of G.results)if(!Y.success&&Y.error)console.error(` ${Y.envName}: ${Y.error}`);return!1}}function gN(_){if(!_U(_))return null;let b=$U(_,"utf-8").split(`
216
+ `).filter((A)=>A.trim());if(b.length===0)return null;let Z=JSON.parse(b[0]),z=[];for(let A=1;A<b.length;A++)try{z.push(JSON.parse(b[A]))}catch{}return{header:Z,entries:z}}function kN(_){try{let $=KN("opencode",["export",_],{encoding:"utf-8",timeout:30000,stdio:["pipe","pipe","pipe"]});if($.status!==0||$.error)return null;let b=$.stdout.trim();if(!b)return null;return JSON.parse(b)}catch{return null}}function DK(_){if(_.anySuccess&&_.id){console.log(""),console.log("Upload successful!"),console.log(`Transcript ID: ${_.id}`);for(let $ of _.results)if($.success){let b=`${$.baseURL}/s/${_.id}`;console.log(`View: ${b}`)}return!0}else if(_.results.length===0)return console.log(""),console.log("Skipped: Repository not in allowlist"),!0;else{console.error(""),console.error("Upload failed:");for(let $ of _.results)if(!$.success&&$.error)console.error(` ${$.envName}: ${$.error}`);return!1}}var WN="/tmp/agentlogs.log";function wN(){return!1}var L=TX("cli",{logFilePath:WN,logToFile:wN(),disableConsole:!0}),VK="https://agentlogs.ai",BN=/https?:\/\/[^\s"'`]+\/s\/([a-zA-Z0-9_-]+)/;function xN(_){let $=_.toLowerCase();return $==="localhost"||$==="127.0.0.1"||$==="::1"}function NN(_){try{let $=new URL(_);return xN($.hostname)}catch{return!1}}function gK(_){try{let $=new URL(_);return`${$.protocol}//${$.host.toLowerCase()}`}catch{return _.replace(/\/+$/,"")}}function IN(_){let $=_.find((b)=>!NN(b.baseURL))??_[0];return gK($?.baseURL??VK)}async function l9(){let _=await k_();return IN(_)}function H_(_){return/\bgit\s+commit\b/.test(_)}function p9(_,$,b){let z=`\uD83D\uDD2E View transcript: ${gK(b??VK)}/s/${$}`;if(_.includes(z)||_9(_)===$)return _;let A=`
217
217
 
218
- ${z}`,J=[{regex:/(\s--message=)"([^"]*)"/,quote:'"',equalsForm:!0},{regex:/(\s--message=)'([^']*)'/,quote:"'",equalsForm:!0},{regex:/(\s(?:-m|--message|-am))\s+"([^"]*)"/,quote:'"',equalsForm:!1},{regex:/(\s(?:-m|--message|-am))\s+'([^']*)'/,quote:"'",equalsForm:!1},{regex:/(\s--message=)([^\s"'][^\s]*)(\s|$)/,quote:'"',equalsForm:!0,unquoted:!0},{regex:/(\s(?:-m|--message|-am))\s+([^\s"'-][^\s]*)(\s|$)/,quote:'"',equalsForm:!1,unquoted:!0}];for(let{regex:U,quote:G,equalsForm:Y,unquoted:X}of J){let Q=_.match(U);if(Q){let K=Q[1],v=Q[2],V=Q[3]||"";if(X&&Y)return _.replace(U,`${K}${G}${v}${A}${G}${V}`);if(X)return _.replace(U,`${K} ${G}${v}${A}${G}${V}`);if(Y)return _.replace(U,`${K}${G}${v}${A}${G}`);return _.replace(U,`${K} ${G}${v}${A}${G}`)}}return _}function _9(_){let $=new RegExp(JN.source,"g"),b=[..._.matchAll($)];if(b.length===0)return;return b[b.length-1][1]}function w4(_){let $=_.match(/\[[\w/-]+(?:\s+\([^)]+\))?\s+([a-f0-9]{7,40})\]/);return $?$[1]:void 0}function x4(_){let $=_.match(/\[[\w/-]+(?:\s+\([^)]+\))?\s+[a-f0-9]{7,40}\]\s+(.+)/);return $?$[1].trim():void 0}function N4(_){let $=_.match(/\[([\w/-]+)(?:\s+\([^)]+\))?\s+[a-f0-9]{7,40}\]/);return $?$[1]:void 0}async function I4(_){let $=await k_();if($.length===0){L.warn("Commit tracking skipped: no authenticated environments",{transcriptId:_.transcriptId.substring(0,8)});return}for(let b of $)try{let Z=new AbortController,z=setTimeout(()=>Z.abort(),5000),A=await fetch(new URL("/api/commit-track",b.baseURL),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b.token}`},body:JSON.stringify({transcript_id:_.transcriptId,repo_path:_.repoPath,timestamp:_.timestamp,commit_sha:_.commitSha,commit_title:_.commitTitle,branch:_.branch}),signal:Z.signal});if(clearTimeout(z),!A.ok){L.warn(`Commit tracking to ${b.name} failed`,{transcriptId:_.transcriptId.substring(0,8),status:A.status});continue}L.info(`Commit tracked (${b.name})`,{transcriptId:_.transcriptId.substring(0,8)})}catch(Z){if(Z instanceof Error&&Z.name==="AbortError"){L.warn(`Commit tracking to ${b.name} timed out`,{transcriptId:_.transcriptId.substring(0,8)});continue}L.error(`Commit tracking to ${b.name} error`,{transcriptId:_.transcriptId.substring(0,8),error:Z instanceof Error?Z.message:String(Z)})}}var XN=2048;function h_(){return new Promise((_,$)=>{let b="";process.stdin.setEncoding("utf8"),process.stdin.on("data",(Z)=>{b+=Z}),process.stdin.on("end",()=>{_({preview:b.slice(0,XN),full:b})}),process.stdin.on("error",(Z)=>$(Z))})}async function HK(){let _=Date.now(),$,b;try{let{preview:Z,full:z}=await h_();if(L.info(`Hook invoked (stdin: ${z.length} bytes)`),!z.trim())L.warn("Hook received empty stdin - ignoring"),process.exit(0);let A=Z.includes('"PreToolUse"'),J=Z.includes("git")&&Z.includes("commit");if(A&&!J){let Y={hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}};process.stdout.write(JSON.stringify(Y));let X=Date.now()-_;L.info(`Hook completed: PreToolUse (fast path, ${X}ms)`),process.exit(0)}let U;try{U=JSON.parse(z)}catch(Y){L.error("Hook failed to parse stdin JSON",{error:Y instanceof Error?Y.message:Y}),process.exit(1)}if($=U.hook_event_name,b=U.session_id||"unknown",!$)L.error("Hook missing event name",{sessionId:b}),process.exit(1);if(L.info(`Hook: ${$} (session: ${b.substring(0,8)}...)`),$==="PreToolUse")await vN(U);else if($==="PostToolUse")await FN(U);else if($==="SessionEnd")await HN(U);else if($==="Stop")await qN(U);else L.debug(`Hook: skipping unsupported event ${$}`);let G=Date.now()-_;L.info(`Hook completed: ${$} (${G}ms)`,{sessionId:b.substring(0,8)}),process.exit(0)}catch(Z){let z=Date.now()-_;L.error(`Hook failed: ${$||"unknown"} (${z}ms)`,{sessionId:b?.substring(0,8),error:Z instanceof Error?Z.message:String(Z)}),process.exit(1)}}function qK(_){if(_.tool_input&&typeof _.tool_input==="object"&&typeof _.tool_input.command==="string")return{command:_.tool_input.command,updateCommand:($)=>{if(_.tool_input)_.tool_input.command=$}};if(typeof _.command==="string")return{command:_.command,updateCommand:($)=>{_.command=$}};return{command:void 0,updateCommand:()=>{}}}function QN(_){if(_.tool_response?.stdout)return _.tool_response.stdout;if(_.tool_response)return JSON.stringify(_.tool_response);return}function KN(_){if(typeof _.repo_path==="string")return _.repo_path;if(typeof _.cwd==="string")return _.cwd;return""}async function vN(_){let $=_.session_id||"unknown",b=!1,Z=!1,{command:z,updateCommand:A}=qK(_),J=typeof _.tool_name==="string"?_.tool_name:_.tool,U=J?J.toLowerCase()==="bash":Boolean(z),G=typeof _.cwd==="string"?_.cwd:void 0,Y=await M0(G),X=J_(Y);if(U&&z&&Z4(z)&&X){b=!0;let K=await X_($),v=await l9(),V=p9(z,K,v);if(V!==z)A(V),Z=!0}let Q=Z?{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow",updatedInput:_.tool_input}}:{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}};if(process.stdout.write(JSON.stringify(Q)),b)await VN({sessionId:$,transcriptPath:_.transcript_path,cwd:typeof _.cwd==="string"?_.cwd:void 0});L.info("PreToolUse handled",{sessionId:$.substring(0,8),shouldTrack:b,modified:Z})}async function FN(_){let $=_.session_id||"unknown",b=KN(_),{command:Z}=qK(_);if(!Z||!Z4(Z))return;let z=_9(Z);if(!z){L.debug("PostToolUse: git commit without agentlogs link",{sessionId:$.substring(0,8)});return}let A=QN(_),J=A?w4(A):void 0,U=A?x4(A):void 0,G=A?N4(A):void 0;await I4({transcriptId:z,repoPath:b,timestamp:new Date().toISOString(),commitSha:J,commitTitle:U,branch:G}),L.info("PostToolUse: tracked commit",{sessionId:$.substring(0,8),transcriptId:z,commitSha:J?.substring(0,8)})}async function HN(_){let $=_.transcript_path,b=_.session_id||"unknown";if(!$){L.error("SessionEnd: missing transcript_path",{sessionId:b});return}try{let Z=await w_({transcriptPath:$,sessionId:_.session_id,cwdOverride:_.cwd});if(Z.results.length===0){if(!Z.anySuccess)L.info("SessionEnd: upload skipped (repo not allowed or no auth)",{sessionId:b});return}for(let z of Z.results)if(z.success)L.info(`SessionEnd: uploaded to ${z.envName} (${Z.eventCount} events)`,{transcriptId:z.transcriptId,sessionId:b.substring(0,8)});else L.error(`SessionEnd: upload to ${z.envName} failed`,{sessionId:b,error:z.error})}catch(Z){L.error("SessionEnd: upload error",{sessionId:b,error:Z instanceof Error?Z.message:String(Z)})}}async function qN(_){let $=_.transcript_path,b=_.session_id||"unknown";if(!$){L.error("Stop: missing transcript_path",{sessionId:b});return}if(_.stop_hook_active){L.debug("Stop: skipped (stop_hook_active=true)",{sessionId:b});return}try{let Z=await w_({transcriptPath:$,sessionId:_.session_id,cwdOverride:_.cwd});if(Z.results.length===0){if(!Z.anySuccess)L.info("Stop: upload skipped (repo not allowed or no auth)",{sessionId:b});return}for(let z of Z.results)if(z.success)L.info(`Stop: uploaded to ${z.envName} (${Z.eventCount} events)`,{transcriptId:z.transcriptId,sessionId:b.substring(0,8)});else L.error(`Stop: upload to ${z.envName} failed`,{sessionId:b,error:z.error})}catch(Z){L.error("Stop: upload error",{sessionId:b,error:Z instanceof Error?Z.message:String(Z)})}}async function VN(_){if(!_.transcriptPath){L.warn("Partial upload skipped: missing transcript_path",{sessionId:_.sessionId.substring(0,8)});return}try{let $=await w_({transcriptPath:_.transcriptPath,sessionId:_.sessionId,cwdOverride:_.cwd});if($.results.length===0){if(!$.anySuccess)L.info("Partial upload: skipped (repo not allowed or no auth)",{sessionId:_.sessionId.substring(0,8)});return}for(let b of $.results)if(b.success)L.info(`Partial upload: uploaded to ${b.envName}`,{transcriptId:b.transcriptId,sessionId:_.sessionId.substring(0,8),eventCount:$.eventCount});else L.error(`Partial upload: to ${b.envName} failed`,{sessionId:_.sessionId.substring(0,8),error:b.error})}catch($){L.error("Partial upload: error",{sessionId:_.sessionId.substring(0,8),error:$ instanceof Error?$.message:String($)})}}import{createHash as DN}from"crypto";import{promises as p6}from"fs";import{homedir as kN}from"os";import{basename as WN,extname as gN,join as d6,relative as BN,resolve as wN}from"path";var xN=d6(kN(),".claude");async function VK(_={}){let{repoFilter:$,claudeDir:b}=_,Z=await k_();if(Z.length===0)console.error("You must be logged in to sync transcripts."),console.error("Run `agentlogs login agentlogs.ai` to authenticate"),process.exit(1);let z=b?wN(b):process.env.CLAUDE_HOME??xN,A=d6(z,"projects"),J=await IN(A);if(J.length===0){console.log(`No local Claude Code transcripts were found under ${A}. Nothing to sync.`);return}let U=$?J.filter((Y)=>Y.repoId===$):J;if($&&U.length===0){let Y=J.filter((X)=>X.repoId===null).length;if(console.log(`No local Claude Code transcripts matched repo ${$}.`),Y>0)console.log(`${Y} transcript(s) were skipped because their repo could not be determined.`);return}let G=Z.map((Y)=>Y.name).join(", ");console.log(`Syncing to environments: ${G}`),console.log(`Found ${U.length} local transcript(s)
219
- `);for(let Y of Z)await NN(Y,U,$)}async function NN(_,$,b){let Z=_.name;console.log(`
220
- --- ${Z} (${_.baseURL}) ---`);try{let z=await ZQ({serverUrl:_.baseURL,authToken:_.token}),A=b?z.filter((v)=>v.repoId===b):z,J=new Map;for(let v of A)J.set(v.transcriptId,v.sha256);let U=$.filter((v)=>{let V=J.get(v.transcriptId);return!V||V!==v.sha256});if(U.length===0){console.log("All local transcripts are up to date.");return}console.log(`Uploading ${U.length} transcript(s)...`);let G=0,Y=0,X=0,Q=[];for(let[v,V]of U.entries()){let w=`${v+1}/${U.length}`,P=V.repoId?` • ${V.repoId}`:"",O=`${V.transcriptId} – ${V.displayPath}${P}`;try{let B=await UK({transcriptPath:V.path,sessionId:V.transcriptId,cwdOverride:V.cwd??void 0},{serverUrl:_.baseURL,authToken:_.token});if(B.skipped)Y+=1,console.log(`[${w}] - ${O} • skipped (repo not allowed)`);else if(B.success)G+=1,console.log(`[${w}] ✓ ${O} • ${B.eventCount} events${B.transcriptId?` → ${B.transcriptId}`:""}`);else{X+=1;let T="Upload returned unsuccessful response.";console.error(`[${w}] ✗ ${O} • ${T}`),Q.push({transcriptId:V.transcriptId,displayPath:V.displayPath,reason:T})}}catch(B){X+=1;let T=B instanceof Error?B.message:String(B);console.error(`[${w}] ✗ ${O} • ${T}`),Q.push({transcriptId:V.transcriptId,displayPath:V.displayPath,reason:T})}}let K=Y>0?`, ${Y} skipped`:"";if(console.log(`Sync complete: ${G} uploaded, ${X} failed${K}.`),Q.length>0){console.error("Failed transcript details:");for(let v of Q.slice(0,10))console.error(` - ${v.transcriptId} (${v.displayPath}): ${v.reason}`);if(Q.length>10)console.error(` …and ${Q.length-10} more failures.`)}}catch(z){console.error(`Error syncing to ${Z}: ${z instanceof Error?z.message:String(z)}`)}}async function IN(_){if(!await DK(_))return[];let $=await p6.readdir(_,{withFileTypes:!0}),b=[],z=await new k0().fetchModelPricing(),A=Object.fromEntries(z);for(let J of $){if(!J.isDirectory())continue;let U=d6(_,J.name),G=await p6.readdir(U,{withFileTypes:!0});for(let Y of G){if(!Y.isFile()||gN(Y.name)!==".jsonl")continue;let X=d6(U,Y.name),Q=WN(Y.name,".jsonl");try{let K=await p6.readFile(X,"utf8"),v=EN(K),V=await PN(v),w=MN(K),P=ON(w),O=v?await g0(v,P):null,B=g6(w,{pricing:A,gitContext:O});if(!B){console.warn(`Skipped transcript at ${X}: Could not convert to unified format`);continue}let T=d4(B.transcript),y=JSON.stringify(T),u=DN("sha256").update(y).digest("hex");b.push({transcriptId:Q,path:X,sha256:u,cwd:v,repoId:V,displayPath:BN(_,X)||Y.name})}catch(K){console.warn(`Skipped transcript at ${X}: ${K.message}`)}}}return b}async function DK(_){try{return(await p6.stat(_)).isDirectory()}catch{return!1}}function MN(_){let $=_.split(/\r?\n/),b=[];for(let Z of $){let z=Z.trim();if(!z)continue;try{let A=JSON.parse(z);if(typeof A==="object"&&A!==null)b.push(A)}catch{continue}}return b}function EN(_){let $=_.split(/\r?\n/);for(let b of $){let Z=b.trim();if(!Z)continue;try{let A=JSON.parse(Z)?.cwd;if(typeof A==="string"&&A.length>0)return A}catch{continue}}return null}function ON(_){for(let $ of _){let b=typeof $.gitBranch==="string"?$.gitBranch.trim():"";if(b)return b}return}async function PN(_){if(!_)return null;if(!await DK(_))return null;try{return SX(_).repoId}catch{return null}}async function i6(_,$="claude-code"){if(!_)console.error("The upload command expects a <transcript> argument."),process.exit(1);let b=GK(_);if(!b)console.error(`Transcript file not found for path: ${_}`),process.exit(1);let Z=await k_();if(Z.length===0)console.error("You must be logged in to upload transcripts."),console.error("Run `agentlogs login agentlogs.ai` to authenticate"),process.exit(1);let z=$==="codex"?"Codex":"Claude Code",A=Z.map((J)=>J.name).join(", ");console.log(`Uploading ${z} transcript from ${b}`),console.log(`Target environments: ${A}`);try{let J=await w_({transcriptPath:b,source:$});if(J.results.length===0){console.log(""),console.log("- Upload skipped (repo not allowed by allowlist)"),console.log(" Use `agentlogs allow` to enable uploads for this repo.");return}console.log("");for(let U of J.results){let G=U.envName;if(U.success){if(console.log(`✓ ${G}: uploaded successfully`),U.id)console.log(` ID: ${U.id}`);if(U.transcriptId)console.log(` Transcript ID: ${U.transcriptId}`)}else if(console.log(`✗ ${G}: upload failed`),U.error)console.log(` Error: ${U.error}`)}if(console.log(""),J.allSuccess)console.log(`✓ Upload complete (${J.eventCount} events)`);else if(J.anySuccess)console.log(`⚠ Partial upload (${J.eventCount} events) - some environments failed`),process.exit(1);else console.error("✗ Upload failed for all environments"),process.exit(1)}catch(J){console.error(J instanceof Error?J.message:"Unexpected error occurred while uploading transcript."),process.exit(1)}}async function kK(_){await i6(_,"claude-code")}import{existsSync as WK,readFileSync as gK}from"fs";import{join as o6}from"path";import{homedir as jN}from"os";var SN=o6(jN(),".cline","data","tasks");async function BK(){let _=Date.now(),$,b;try{let{preview:Z,full:z}=await h_();if(L.info(`Cline hook invoked (stdin: ${z.length} bytes)`),!z.trim())L.warn("Cline hook received empty stdin - ignoring"),d9(),process.exit(0);let A=Z.includes('"PostToolUse"'),J=Z.includes("git")&&Z.includes("commit");if(A&&!J){d9();let Y=Date.now()-_;L.info(`Cline hook completed: PostToolUse (fast path, ${Y}ms)`),process.exit(0)}let U;try{U=JSON.parse(z)}catch(Y){L.error("Cline hook failed to parse stdin JSON",{error:Y instanceof Error?Y.message:Y}),d9(),process.exit(1)}if($=U.hookName,b=U.taskId,!$)L.error("Cline hook missing hookName",{taskId:b}),d9(),process.exit(1);if(L.info(`Cline hook: ${$} (task: ${b})`),$==="PostToolUse")await RN(U);else if($==="TaskComplete"||$==="TaskCancel")await LN(U);else L.debug(`Cline hook: skipping unsupported event ${$}`);d9();let G=Date.now()-_;L.info(`Cline hook completed: ${$} (${G}ms)`,{taskId:b}),process.exit(0)}catch(Z){let z=Date.now()-_;L.error(`Cline hook failed: ${$||"unknown"} (${z}ms)`,{taskId:b,error:Z instanceof Error?Z.message:String(Z)}),d9(),process.exit(1)}}async function RN(_){let{taskId:$,postToolUse:b,workspaceRoots:Z}=_;if(!b)return;let{toolName:z,parameters:A,result:J}=b;if(z!=="execute_command")return;let U=typeof A.command==="string"?A.command:void 0;if(!U||!Z4(U))return;if(!J)return;let G=Z?.[0],Y=await M0(G);if(!J_(Y)){L.debug("PostToolUse: repo not allowed",{taskId:$});return}let X=await X_($),Q=w4(J),K=x4(J),v=N4(J);if(!Q){L.debug("PostToolUse: no commit SHA found in output",{taskId:$});return}await I4({transcriptId:X,repoPath:G||"",timestamp:new Date().toISOString(),commitSha:Q,commitTitle:K,branch:v}),L.info("PostToolUse: tracked commit",{taskId:$,transcriptId:X.substring(0,8),commitSha:Q.substring(0,8)})}async function LN(_){let{taskId:$,workspaceRoots:b}=_,Z=o6(SN,$),z=o6(Z,"api_conversation_history.json");if(!WK(z)){L.error("TaskEnd: conversation file not found",{taskId:$,path:z});return}let A;try{A=JSON.parse(gK(z,"utf-8"))}catch(O){L.error("TaskEnd: failed to parse conversation file",{taskId:$,error:O instanceof Error?O.message:String(O)});return}let J,U=o6(Z,"task_metadata.json");if(WK(U))try{J=JSON.parse(gK(U,"utf-8"))}catch{}let G=b?.[0]||process.cwd(),X=await new k0().fetchModelPricing(),Q=Object.fromEntries(X),K=await g0(G,void 0),v=J?.environment_history?.[0]?.cline_version,V=r4(A,{pricing:Q,gitContext:K,cwd:G,taskId:$,metadata:J,clientVersion:v});if(!V){L.error("TaskEnd: failed to convert transcript",{taskId:$});return}let w=[];for(let[O,B]of V.blobs)w.push({sha256:O,data:new Uint8Array(B.data),mediaType:B.mediaType});let P=await O0({unifiedTranscript:V.transcript,sessionId:$,cwd:G,rawTranscript:JSON.stringify(A),blobs:w.length>0?w:void 0});if(P.skipped){L.info("TaskEnd: skipped (repo not allowed)",{taskId:$});return}if(P.anySuccess&&P.id){for(let O of P.results)if(O.success)L.info(`TaskEnd: uploaded to ${O.envName}`,{taskId:$,transcriptId:P.id.substring(0,8)});else if(O.error)L.error(`TaskEnd: upload to ${O.envName} failed`,{taskId:$,error:O.error})}else for(let O of P.results)if(!O.success&&O.error)L.error("TaskEnd: upload failed",{taskId:$,env:O.envName,error:O.error})}function d9(){process.stdout.write(JSON.stringify({cancel:!1}))}import{existsSync as TN,mkdirSync as yN,writeFileSync as wK,chmodSync as CN,readFileSync as fN}from"fs";import{join as NK}from"node:path";import{homedir as mN}from"node:os";var sJ=NK(mN(),"Documents","Cline","Hooks"),_7="# agentlogs-managed";function xK(_){if(_==="PostToolUse")return`#!/usr/bin/env bash
221
- ${_7}
218
+ ${z}`,J=[{regex:/(\s--message=)"([^"]*)"/,quote:'"',equalsForm:!0},{regex:/(\s--message=)'([^']*)'/,quote:"'",equalsForm:!0},{regex:/(\s(?:-m|--message|-am))\s+"([^"]*)"/,quote:'"',equalsForm:!1},{regex:/(\s(?:-m|--message|-am))\s+'([^']*)'/,quote:"'",equalsForm:!1},{regex:/(\s--message=)([^\s"'][^\s]*)(\s|$)/,quote:'"',equalsForm:!0,unquoted:!0},{regex:/(\s(?:-m|--message|-am))\s+([^\s"'-][^\s]*)(\s|$)/,quote:'"',equalsForm:!1,unquoted:!0}];for(let{regex:U,quote:G,equalsForm:Y,unquoted:X}of J){let Q=_.match(U);if(Q){let K=Q[1],v=Q[2],D=Q[3]||"";if(X&&Y)return _.replace(U,`${K}${G}${v}${A}${G}${D}`);if(X)return _.replace(U,`${K} ${G}${v}${A}${G}${D}`);if(Y)return _.replace(U,`${K}${G}${v}${A}${G}`);return _.replace(U,`${K} ${G}${v}${A}${G}`)}}return _}function _9(_){let $=new RegExp(BN.source,"g"),b=[..._.matchAll($)];if(b.length===0)return;return b[b.length-1][1]}function h_(_){let $=_.match(/\[[\w/-]+(?:\s+\([^)]+\))?\s+([a-f0-9]{7,40})\]/);return $?$[1]:void 0}function r_(_){let $=_.match(/\[[\w/-]+(?:\s+\([^)]+\))?\s+[a-f0-9]{7,40}\]\s+(.+)/);return $?$[1].trim():void 0}function n_(_){let $=_.match(/\[([\w/-]+)(?:\s+\([^)]+\))?\s+[a-f0-9]{7,40}\]/);return $?$[1]:void 0}async function l_(_){let $=await k_();if($.length===0){L.warn("Commit tracking skipped: no authenticated environments",{transcriptId:_.transcriptId.substring(0,8)});return}for(let b of $)try{let Z=new AbortController,z=setTimeout(()=>Z.abort(),5000),A=await fetch(new URL("/api/commit-track",b.baseURL),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b.token}`},body:JSON.stringify({transcript_id:_.transcriptId,repo_path:_.repoPath,timestamp:_.timestamp,commit_sha:_.commitSha,commit_title:_.commitTitle,branch:_.branch}),signal:Z.signal});if(clearTimeout(z),!A.ok){L.warn(`Commit tracking to ${b.name} failed`,{transcriptId:_.transcriptId.substring(0,8),status:A.status});continue}L.info(`Commit tracked (${b.name})`,{transcriptId:_.transcriptId.substring(0,8)})}catch(Z){if(Z instanceof Error&&Z.name==="AbortError"){L.warn(`Commit tracking to ${b.name} timed out`,{transcriptId:_.transcriptId.substring(0,8)});continue}L.error(`Commit tracking to ${b.name} error`,{transcriptId:_.transcriptId.substring(0,8),error:Z instanceof Error?Z.message:String(Z)})}}var MN=2048;function p_(){return new Promise((_,$)=>{let b="";process.stdin.setEncoding("utf8"),process.stdin.on("data",(Z)=>{b+=Z}),process.stdin.on("end",()=>{_({preview:b.slice(0,MN),full:b})}),process.stdin.on("error",(Z)=>$(Z))})}async function kK(){let _=Date.now(),$,b;try{let{preview:Z,full:z}=await p_();if(L.info(`Hook invoked (stdin: ${z.length} bytes)`),!z.trim())L.warn("Hook received empty stdin - ignoring"),process.exit(0);let A=Z.includes('"PreToolUse"'),J=Z.includes("git")&&Z.includes("commit");if(A&&!J){let Y={hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}};process.stdout.write(JSON.stringify(Y));let X=Date.now()-_;L.info(`Hook completed: PreToolUse (fast path, ${X}ms)`),process.exit(0)}let U;try{U=JSON.parse(z)}catch(Y){L.error("Hook failed to parse stdin JSON",{error:Y instanceof Error?Y.message:Y}),process.exit(1)}if($=U.hook_event_name,b=U.session_id||"unknown",!$)L.error("Hook missing event name",{sessionId:b}),process.exit(1);if(L.info(`Hook: ${$} (session: ${b.substring(0,8)}...)`),$==="PreToolUse")await PN(U);else if($==="PostToolUse")await jN(U);else if($==="SessionEnd")await SN(U);else if($==="Stop")await RN(U);else L.debug(`Hook: skipping unsupported event ${$}`);let G=Date.now()-_;L.info(`Hook completed: ${$} (${G}ms)`,{sessionId:b.substring(0,8)}),process.exit(0)}catch(Z){let z=Date.now()-_;L.error(`Hook failed: ${$||"unknown"} (${z}ms)`,{sessionId:b?.substring(0,8),error:Z instanceof Error?Z.message:String(Z)}),process.exit(1)}}function WK(_){if(_.tool_input&&typeof _.tool_input==="object"&&typeof _.tool_input.command==="string")return{command:_.tool_input.command,updateCommand:($)=>{if(_.tool_input)_.tool_input.command=$}};if(typeof _.command==="string")return{command:_.command,updateCommand:($)=>{_.command=$}};return{command:void 0,updateCommand:()=>{}}}function EN(_){if(_.tool_response?.stdout)return _.tool_response.stdout;if(_.tool_response)return JSON.stringify(_.tool_response);return}function ON(_){if(typeof _.repo_path==="string")return _.repo_path;if(typeof _.cwd==="string")return _.cwd;return""}async function PN(_){let $=_.session_id||"unknown",b=!1,Z=!1,{command:z,updateCommand:A}=WK(_),J=typeof _.tool_name==="string"?_.tool_name:_.tool,U=J?J.toLowerCase()==="bash":Boolean(z),G=typeof _.cwd==="string"?_.cwd:void 0,Y=await M0(G),X=U_(Y);if(U&&z&&H_(z)&&X){b=!0;let K=await r0($),v=await l9(),D=p9(z,K,v);if(D!==z)A(D),Z=!0}let Q=Z?{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow",updatedInput:_.tool_input}}:{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}};if(process.stdout.write(JSON.stringify(Q)),b)await LN({sessionId:$,transcriptPath:_.transcript_path,cwd:typeof _.cwd==="string"?_.cwd:void 0});L.info("PreToolUse handled",{sessionId:$.substring(0,8),shouldTrack:b,modified:Z})}async function jN(_){let $=_.session_id||"unknown",b=ON(_),{command:Z}=WK(_);if(!Z||!H_(Z))return;let z=_9(Z);if(!z){L.debug("PostToolUse: git commit without agentlogs link",{sessionId:$.substring(0,8)});return}let A=EN(_),J=A?h_(A):void 0,U=A?r_(A):void 0,G=A?n_(A):void 0;await l_({transcriptId:z,repoPath:b,timestamp:new Date().toISOString(),commitSha:J,commitTitle:U,branch:G}),L.info("PostToolUse: tracked commit",{sessionId:$.substring(0,8),transcriptId:z,commitSha:J?.substring(0,8)})}async function SN(_){let $=_.transcript_path,b=_.session_id||"unknown";if(!$){L.error("SessionEnd: missing transcript_path",{sessionId:b});return}try{let Z=await x_({transcriptPath:$,sessionId:_.session_id,cwdOverride:_.cwd});if(Z.results.length===0){if(!Z.anySuccess)L.info("SessionEnd: upload skipped (repo not allowed or no auth)",{sessionId:b});return}for(let z of Z.results)if(z.success)L.info(`SessionEnd: uploaded to ${z.envName} (${Z.eventCount} events)`,{transcriptId:z.transcriptId,sessionId:b.substring(0,8)});else L.error(`SessionEnd: upload to ${z.envName} failed`,{sessionId:b,error:z.error})}catch(Z){L.error("SessionEnd: upload error",{sessionId:b,error:Z instanceof Error?Z.message:String(Z)})}}async function RN(_){let $=_.transcript_path,b=_.session_id||"unknown";if(!$){L.error("Stop: missing transcript_path",{sessionId:b});return}if(_.stop_hook_active){L.debug("Stop: skipped (stop_hook_active=true)",{sessionId:b});return}try{let Z=await x_({transcriptPath:$,sessionId:_.session_id,cwdOverride:_.cwd});if(Z.results.length===0){if(!Z.anySuccess)L.info("Stop: upload skipped (repo not allowed or no auth)",{sessionId:b});return}for(let z of Z.results)if(z.success)L.info(`Stop: uploaded to ${z.envName} (${Z.eventCount} events)`,{transcriptId:z.transcriptId,sessionId:b.substring(0,8)});else L.error(`Stop: upload to ${z.envName} failed`,{sessionId:b,error:z.error})}catch(Z){L.error("Stop: upload error",{sessionId:b,error:Z instanceof Error?Z.message:String(Z)})}}async function LN(_){if(!_.transcriptPath){L.warn("Partial upload skipped: missing transcript_path",{sessionId:_.sessionId.substring(0,8)});return}try{let $=await x_({transcriptPath:_.transcriptPath,sessionId:_.sessionId,cwdOverride:_.cwd});if($.results.length===0){if(!$.anySuccess)L.info("Partial upload: skipped (repo not allowed or no auth)",{sessionId:_.sessionId.substring(0,8)});return}for(let b of $.results)if(b.success)L.info(`Partial upload: uploaded to ${b.envName}`,{transcriptId:b.transcriptId,sessionId:_.sessionId.substring(0,8),eventCount:$.eventCount});else L.error(`Partial upload: to ${b.envName} failed`,{sessionId:_.sessionId.substring(0,8),error:b.error})}catch($){L.error("Partial upload: error",{sessionId:_.sessionId.substring(0,8),error:$ instanceof Error?$.message:String($)})}}import{createHash as TN}from"crypto";import{promises as d6}from"fs";import{homedir as yN}from"os";import{basename as CN,extname as fN,join as i6,relative as mN,resolve as uN}from"path";var cN=i6(yN(),".claude");async function wK(_={}){let{repoFilter:$,claudeDir:b}=_,Z=await k_();if(Z.length===0)console.error("You must be logged in to sync transcripts."),console.error("Run `agentlogs login agentlogs.ai` to authenticate"),process.exit(1);let z=b?uN(b):process.env.CLAUDE_HOME??cN,A=i6(z,"projects"),J=await rN(A);if(J.length===0){console.log(`No local Claude Code transcripts were found under ${A}. Nothing to sync.`);return}let U=$?J.filter((Y)=>Y.repoId===$):J;if($&&U.length===0){let Y=J.filter((X)=>X.repoId===null).length;if(console.log(`No local Claude Code transcripts matched repo ${$}.`),Y>0)console.log(`${Y} transcript(s) were skipped because their repo could not be determined.`);return}let G=Z.map((Y)=>Y.name).join(", ");console.log(`Syncing to environments: ${G}`),console.log(`Found ${U.length} local transcript(s)
219
+ `);for(let Y of Z)await hN(Y,U,$)}async function hN(_,$,b){let Z=_.name;console.log(`
220
+ --- ${Z} (${_.baseURL}) ---`);try{let z=await GQ({serverUrl:_.baseURL,authToken:_.token}),A=b?z.filter((v)=>v.repoId===b):z,J=new Map;for(let v of A)J.set(v.transcriptId,v.sha256);let U=$.filter((v)=>{let D=J.get(v.transcriptId);return!D||D!==v.sha256});if(U.length===0){console.log("All local transcripts are up to date.");return}console.log(`Uploading ${U.length} transcript(s)...`);let G=0,Y=0,X=0,Q=[];for(let[v,D]of U.entries()){let w=`${v+1}/${U.length}`,P=D.repoId?` • ${D.repoId}`:"",E=`${D.transcriptId} – ${D.displayPath}${P}`;try{let B=await KK({transcriptPath:D.path,sessionId:D.transcriptId,cwdOverride:D.cwd??void 0},{serverUrl:_.baseURL,authToken:_.token});if(B.skipped)Y+=1,console.log(`[${w}] - ${E} • skipped (repo not allowed)`);else if(B.success)G+=1,console.log(`[${w}] ✓ ${E} • ${B.eventCount} events${B.transcriptId?` → ${B.transcriptId}`:""}`);else{X+=1;let C="Upload returned unsuccessful response.";console.error(`[${w}] ✗ ${E} • ${C}`),Q.push({transcriptId:D.transcriptId,displayPath:D.displayPath,reason:C})}}catch(B){X+=1;let C=B instanceof Error?B.message:String(B);console.error(`[${w}] ✗ ${E} • ${C}`),Q.push({transcriptId:D.transcriptId,displayPath:D.displayPath,reason:C})}}let K=Y>0?`, ${Y} skipped`:"";if(console.log(`Sync complete: ${G} uploaded, ${X} failed${K}.`),Q.length>0){console.error("Failed transcript details:");for(let v of Q.slice(0,10))console.error(` - ${v.transcriptId} (${v.displayPath}): ${v.reason}`);if(Q.length>10)console.error(` …and ${Q.length-10} more failures.`)}}catch(z){console.error(`Error syncing to ${Z}: ${z instanceof Error?z.message:String(z)}`)}}async function rN(_){if(!await BK(_))return[];let $=await d6.readdir(_,{withFileTypes:!0}),b=[],z=await new g0().fetchModelPricing(),A=Object.fromEntries(z);for(let J of $){if(!J.isDirectory())continue;let U=i6(_,J.name),G=await d6.readdir(U,{withFileTypes:!0});for(let Y of G){if(!Y.isFile()||fN(Y.name)!==".jsonl")continue;let X=i6(U,Y.name),Q=CN(Y.name,".jsonl");try{let K=await d6.readFile(X,"utf8"),v=lN(K),D=await dN(v),w=nN(K),P=pN(w),E=v?await W0(v,P):null,B=k6(w,{pricing:A,gitContext:E});if(!B){console.warn(`Skipped transcript at ${X}: Could not convert to unified format`);continue}let C=p6(B.transcript),f=JSON.stringify(C),u=TN("sha256").update(f).digest("hex");b.push({transcriptId:Q,path:X,sha256:u,cwd:v,repoId:D,displayPath:mN(_,X)||Y.name})}catch(K){console.warn(`Skipped transcript at ${X}: ${K.message}`)}}}return b}async function BK(_){try{return(await d6.stat(_)).isDirectory()}catch{return!1}}function nN(_){let $=_.split(/\r?\n/),b=[];for(let Z of $){let z=Z.trim();if(!z)continue;try{let A=JSON.parse(z);if(typeof A==="object"&&A!==null)b.push(A)}catch{continue}}return b}function lN(_){let $=_.split(/\r?\n/);for(let b of $){let Z=b.trim();if(!Z)continue;try{let A=JSON.parse(Z)?.cwd;if(typeof A==="string"&&A.length>0)return A}catch{continue}}return null}function pN(_){for(let $ of _){let b=typeof $.gitBranch==="string"?$.gitBranch.trim():"";if(b)return b}return}async function dN(_){if(!_)return null;if(!await BK(_))return null;try{return yX(_).repoId}catch{return null}}async function o6(_,$="claude-code"){if(!_)console.error("The upload command expects a <transcript> argument."),process.exit(1);let b=FK(_);if(!b)console.error(`Transcript file not found for path: ${_}`),process.exit(1);let Z=await k_();if(Z.length===0)console.error("You must be logged in to upload transcripts."),console.error("Run `agentlogs login agentlogs.ai` to authenticate"),process.exit(1);let z=$==="codex"?"Codex":"Claude Code",A=Z.map((J)=>J.name).join(", ");console.log(`Uploading ${z} transcript from ${b}`),console.log(`Target environments: ${A}`);try{let J=await x_({transcriptPath:b,source:$});if(J.results.length===0){console.log(""),console.log("- Upload skipped (repo not allowed by allowlist)"),console.log(" Use `agentlogs allow` to enable uploads for this repo.");return}console.log("");for(let U of J.results){let G=U.envName;if(U.success){if(console.log(`✓ ${G}: uploaded successfully`),U.id)console.log(` ID: ${U.id}`);if(U.transcriptId)console.log(` Transcript ID: ${U.transcriptId}`)}else if(console.log(`✗ ${G}: upload failed`),U.error)console.log(` Error: ${U.error}`)}if(console.log(""),J.allSuccess)console.log(`✓ Upload complete (${J.eventCount} events)`);else if(J.anySuccess)console.log(`⚠ Partial upload (${J.eventCount} events) - some environments failed`),process.exit(1);else console.error("✗ Upload failed for all environments"),process.exit(1)}catch(J){console.error(J instanceof Error?J.message:"Unexpected error occurred while uploading transcript."),process.exit(1)}}async function xK(_){await o6(_,"claude-code")}import{existsSync as NK,readFileSync as IK}from"fs";import{join as a6}from"path";import{homedir as iN}from"os";var oN=a6(iN(),".cline","data","tasks");async function MK(){let _=Date.now(),$,b;try{let{preview:Z,full:z}=await p_();if(L.info(`Cline hook invoked (stdin: ${z.length} bytes)`),!z.trim())L.warn("Cline hook received empty stdin - ignoring"),d9(),process.exit(0);let A=Z.includes('"PostToolUse"'),J=Z.includes("git")&&Z.includes("commit");if(A&&!J){d9();let Y=Date.now()-_;L.info(`Cline hook completed: PostToolUse (fast path, ${Y}ms)`),process.exit(0)}let U;try{U=JSON.parse(z)}catch(Y){L.error("Cline hook failed to parse stdin JSON",{error:Y instanceof Error?Y.message:Y}),d9(),process.exit(1)}if($=U.hookName,b=U.taskId,!$)L.error("Cline hook missing hookName",{taskId:b}),d9(),process.exit(1);if(L.info(`Cline hook: ${$} (task: ${b})`),$==="PostToolUse")await aN(U);else if($==="TaskComplete"||$==="TaskCancel")await eN(U);else L.debug(`Cline hook: skipping unsupported event ${$}`);d9();let G=Date.now()-_;L.info(`Cline hook completed: ${$} (${G}ms)`,{taskId:b}),process.exit(0)}catch(Z){let z=Date.now()-_;L.error(`Cline hook failed: ${$||"unknown"} (${z}ms)`,{taskId:b,error:Z instanceof Error?Z.message:String(Z)}),d9(),process.exit(1)}}async function aN(_){let{taskId:$,postToolUse:b,workspaceRoots:Z}=_;if(!b)return;let{toolName:z,parameters:A,result:J}=b;if(z!=="execute_command")return;let U=typeof A.command==="string"?A.command:void 0;if(!U||!H_(U))return;if(!J)return;let G=Z?.[0],Y=await M0(G);if(!U_(Y)){L.debug("PostToolUse: repo not allowed",{taskId:$});return}let X=await r0($),Q=h_(J),K=r_(J),v=n_(J);if(!Q){L.debug("PostToolUse: no commit SHA found in output",{taskId:$});return}await l_({transcriptId:X,repoPath:G||"",timestamp:new Date().toISOString(),commitSha:Q,commitTitle:K,branch:v}),L.info("PostToolUse: tracked commit",{taskId:$,transcriptId:X.substring(0,8),commitSha:Q.substring(0,8)})}async function eN(_){let{taskId:$,workspaceRoots:b}=_,Z=a6(oN,$),z=a6(Z,"api_conversation_history.json");if(!NK(z)){L.error("TaskEnd: conversation file not found",{taskId:$,path:z});return}let A;try{A=JSON.parse(IK(z,"utf-8"))}catch(E){L.error("TaskEnd: failed to parse conversation file",{taskId:$,error:E instanceof Error?E.message:String(E)});return}let J,U=a6(Z,"task_metadata.json");if(NK(U))try{J=JSON.parse(IK(U,"utf-8"))}catch{}let G=b?.[0]||process.cwd(),X=await new g0().fetchModelPricing(),Q=Object.fromEntries(X),K=await W0(G,void 0),v=J?.environment_history?.[0]?.cline_version,D=n4(A,{pricing:Q,gitContext:K,cwd:G,taskId:$,metadata:J,clientVersion:v});if(!D){L.error("TaskEnd: failed to convert transcript",{taskId:$});return}let w=[];for(let[E,B]of D.blobs)w.push({sha256:E,data:new Uint8Array(B.data),mediaType:B.mediaType});let P=await O0({unifiedTranscript:D.transcript,sessionId:$,cwd:G,blobs:w.length>0?w:void 0});if(P.skipped){L.info("TaskEnd: skipped (repo not allowed)",{taskId:$});return}if(P.anySuccess&&P.id){for(let E of P.results)if(E.success)L.info(`TaskEnd: uploaded to ${E.envName}`,{taskId:$,transcriptId:P.id.substring(0,8)});else if(E.error)L.error(`TaskEnd: upload to ${E.envName} failed`,{taskId:$,error:E.error})}else for(let E of P.results)if(!E.success&&E.error)L.error("TaskEnd: upload failed",{taskId:$,env:E.envName,error:E.error})}function d9(){process.stdout.write(JSON.stringify({cancel:!1}))}import{existsSync as tN,mkdirSync as sN,writeFileSync as EK,chmodSync as _I,readFileSync as $I}from"fs";import{join as PK}from"node:path";import{homedir as zI}from"node:os";var zU=PK(zI(),"Documents","Cline","Hooks"),bU="# agentlogs-managed";function OK(_){if(_==="PostToolUse")return`#!/usr/bin/env bash
221
+ ${bU}
222
222
  input=$(cat)
223
223
  echo "$input" | npx agentlogs cline hook 2>/dev/null
224
224
  echo '{"cancel": false}'
225
225
  `;return`#!/usr/bin/env bash
226
- ${_7}
226
+ ${bU}
227
227
  input=$(cat)
228
228
  echo "$input" | npx agentlogs cline hook &>/dev/null &
229
229
  echo '{"cancel": false}'
230
- `}var uN=[{name:"PostToolUse",description:"Track git commits in agentlogs"},{name:"TaskComplete",description:"Upload transcript when a Cline task completes"},{name:"TaskCancel",description:"Upload transcript when a Cline task is cancelled"}];async function IK(){console.log("Setting up agentlogs hooks for Cline..."),console.log(`Hooks directory: ${sJ}`),console.log(""),yN(sJ,{recursive:!0});let _=0,$=0;for(let b of uN){let Z=NK(sJ,b.name);if(TN(Z))if(fN(Z,"utf-8").includes(_7))wK(Z,xK(b.name),{mode:493}),console.log(` Updated: ${b.name}`),_++;else console.log(` Skipped: ${b.name} (existing hook not managed by agentlogs)`),$++;else wK(Z,xK(b.name),{mode:493}),CN(Z,493),console.log(` Created: ${b.name}`),_++}if(console.log(""),_>0)console.log(`Installed ${_} hook(s).`);if($>0)console.log(`Skipped ${$} hook(s) with existing non-agentlogs content.`);console.log(""),console.log("Cline will now auto-upload transcripts and track commits."),console.log("Run `agentlogs status` to verify you are logged in.")}import{existsSync as J4,readFileSync as $7,readdirSync as MK,statSync as EK}from"fs";import{join as M4,basename as hN}from"path";import{homedir as OK}from"os";var A4=M4(OK(),".cline","data","tasks");function cN(_){if(!J4(_))return null;try{let $=$7(_,"utf-8"),b=JSON.parse($),Z,z=M4(_,"..","task_metadata.json");if(J4(z))try{Z=JSON.parse($7(z,"utf-8"))}catch{}return{messages:b,metadata:Z}}catch{return null}}function rN(_){let $=M4(A4,_),b=M4($,"api_conversation_history.json");if(J4(b))return b;if(!J4(A4))return null;for(let Z of MK(A4))if(Z.includes(_)){let z=M4(A4,Z,"api_conversation_history.json");if(J4(z))return z}return null}function nN(_=10){let $=[];if(!J4(A4))return $;for(let b of MK(A4)){let Z=M4(A4,b,"api_conversation_history.json");if(!J4(Z))continue;try{let z=EK(Z),A="",U=$7(Z,"utf-8").match(/<task>\n?([\s\S]*?)\n?<\/task>/);if(U&&U[1])A=U[1].trim().slice(0,60);$.push({path:Z,id:b,mtime:z.mtime,preview:A})}catch{}}return $.sort((b,Z)=>Z.mtime.getTime()-b.mtime.getTime()),$.slice(0,_)}async function PK(_){if(!_){console.log("Recent Cline tasks:"),console.log("");let w=nN(10);if(w.length===0)console.log("No tasks found in",A4),process.exit(1);for(let P of w){let O=P.mtime.toLocaleString();if(console.log(` ${P.id.substring(0,13)}... ${O}`),P.preview)console.log(` ${P.preview}`);console.log("")}console.log("Usage: agentlogs cline upload <task-id-or-path>"),process.exit(0)}let $,b=_.startsWith("~")?_.replace(/^~/,OK()):_;if(J4(b))if(EK(b).isDirectory()){let P=M4(b,"api_conversation_history.json");if(J4(P))$=P;else console.error(`Error: No api_conversation_history.json found in: ${b}`),process.exit(1)}else $=b;else{let w=rN(_);if(!w)console.error(`Error: Task not found: ${_}`),console.error(`Searched in: ${A4}`),process.exit(1);$=w}let Z=hN(M4($,".."));console.log(`Uploading Cline task: ${Z}`);let z=cN($);if(!z)console.error(`Error: Failed to read task file: ${$}`),process.exit(1);let A=z.messages.length;console.log(`Task: ${Z} (${A} messages)`);let U=await new k0().fetchModelPricing(),G=Object.fromEntries(U),Y=process.cwd(),X=await g0(Y,void 0);if(X?.repo)console.log(`Repository: ${X.repo}`);let Q=z.metadata?.environment_history?.[0]?.cline_version;console.log("Converting transcript...");let K=r4(z.messages,{pricing:G,gitContext:X,cwd:Y,taskId:Z,metadata:z.metadata,clientVersion:Q});if(!K)console.error("Error: Failed to convert transcript"),process.exit(1);let v=[];for(let[w,P]of K.blobs)v.push({sha256:w,data:new Uint8Array(P.data),mediaType:P.mediaType});console.log("Uploading...");let V=await O0({unifiedTranscript:K.transcript,sessionId:Z,cwd:Y,rawTranscript:JSON.stringify(z.messages),blobs:v.length>0?v:void 0});if(V.skipped)console.log("Skipped: Repository not in allowlist"),process.exit(0);if(V.anySuccess&&V.id){console.log(""),console.log("Upload successful!"),console.log(`Transcript ID: ${V.id}`);for(let w of V.results)if(w.success){let P=`${w.baseURL}/s/${V.id}`;console.log(`View: ${P}`)}}else{console.error(""),console.error("Upload failed:");for(let w of V.results)if(!w.success&&w.error)console.error(` ${w.envName}: ${w.error}`);process.exit(1)}}var i9={};async function lN(_,$=w_){let b=_.hook_event_name,Z=typeof _.session_id==="string"?_.session_id:"unknown";if(b!=="Stop")return L.debug("Codex hook: skipping non-stop event",{eventName:b,sessionId:Z.substring(0,8)}),i9;let z=typeof _.transcript_path==="string"?_.transcript_path:void 0;if(!z)return L.warn("Codex Stop: missing transcript_path",{sessionId:Z.substring(0,8)}),i9;try{let A=await $({transcriptPath:z,sessionId:_.session_id,cwdOverride:typeof _.cwd==="string"?_.cwd:void 0,source:"codex"});pN("Stop",Z,A)}catch(A){L.error("Codex Stop: upload error",{sessionId:Z.substring(0,8),error:A instanceof Error?A.message:String(A)})}return i9}async function jK(){let _=Date.now(),$,b;try{let{full:Z}=await h_();if(L.info(`Codex hook invoked (stdin: ${Z.length} bytes)`),!Z.trim())L.warn("Codex hook received empty stdin - ignoring"),a6(i9),process.exit(0);let z;try{z=JSON.parse(Z)}catch(U){L.error("Codex hook failed to parse stdin JSON",{error:U instanceof Error?U.message:String(U)}),a6(i9),process.exit(1)}$=typeof z.hook_event_name==="string"?z.hook_event_name:void 0,b=typeof z.session_id==="string"?z.session_id:void 0,L.info(`Codex hook: ${$??"unknown"} (session: ${(b??"unknown").substring(0,8)}...)`);let A=await lN(z);a6(A);let J=Date.now()-_;L.info(`Codex hook completed: ${$??"unknown"} (${J}ms)`,{sessionId:b?.substring(0,8)}),process.exit(0)}catch(Z){let z=Date.now()-_;L.error(`Codex hook failed: ${$??"unknown"} (${z}ms)`,{sessionId:b?.substring(0,8),error:Z instanceof Error?Z.message:String(Z)}),a6(i9),process.exit(1)}}function a6(_){process.stdout.write(JSON.stringify(_))}function pN(_,$,b){if(b.results.length===0){if(!b.anySuccess)L.info(`Codex ${_}: upload skipped (repo not allowed or no auth)`,{sessionId:$.substring(0,8)});return}for(let Z of b.results)if(Z.success)L.info(`Codex ${_}: uploaded to ${Z.envName} (${b.eventCount} events)`,{transcriptId:Z.transcriptId,sessionId:$.substring(0,8)});else L.error(`Codex ${_}: upload to ${Z.envName} failed`,{sessionId:$.substring(0,8),error:Z.error})}import{existsSync as z7,mkdirSync as dN,readFileSync as SK,writeFileSync as RK}from"fs";import{homedir as iN}from"os";import{join as b7}from"path";var oN=30,aN=b7(iN(),".codex");function eN(){let _=process.env.CODEX_HOME??aN;return{codexHome:_,configPath:b7(_,"config.toml"),hooksPath:b7(_,"hooks.json")}}function yK(_){let $=eN();zI($.codexHome);let b=z7($.configPath)?SK($.configPath,"utf-8"):"",Z=tN(b);if(Z!==b)RK($.configPath,Z);let z=z7($.hooksPath)?SK($.hooksPath,"utf-8"):"",A=sN(z,_);if(A!==z)RK($.hooksPath,A);return{paths:$,configUpdated:Z!==b,hooksUpdated:A!==z}}function tN(_){return bI(_,"features","codex_hooks = true",/^\s*codex_hooks\s*=/)}function sN(_,$){let b=_I(_),Z=b.hooks??{};return Z.SessionStart=LK(Z.SessionStart??[],TK($)),Z.Stop=LK(Z.Stop??[],TK($)),b.hooks=Z,`${JSON.stringify(b,null,2)}
231
- `}function _I(_){if(!_.trim())return{hooks:{}};let $=JSON.parse(_);if(!$.hooks||typeof $.hooks!=="object")$.hooks={};return $}function LK(_,$){return[..._.filter((Z)=>!$I(Z)),$]}function $I(_){return(_.hooks??[]).some(($)=>$.type==="command"&&$.command.includes("agentlogs")&&$.command.includes("codex hook"))}function TK(_){return{hooks:[{type:"command",command:_,timeoutSec:oN}]}}function zI(_){if(!z7(_))dN(_,{recursive:!0})}function bI(_,$,b,Z){let z=AI(_),A=JI(z,$);if(!A){let J=ZI(z);if(J.length>0)J.push("");return J.push(`[${$}]`),J.push(b),`${J.join(`
230
+ `}var bI=[{name:"PostToolUse",description:"Track git commits in agentlogs"},{name:"TaskComplete",description:"Upload transcript when a Cline task completes"},{name:"TaskCancel",description:"Upload transcript when a Cline task is cancelled"}];async function jK(){console.log("Setting up agentlogs hooks for Cline..."),console.log(`Hooks directory: ${zU}`),console.log(""),sN(zU,{recursive:!0});let _=0,$=0;for(let b of bI){let Z=PK(zU,b.name);if(tN(Z))if($I(Z,"utf-8").includes(bU))EK(Z,OK(b.name),{mode:493}),console.log(` Updated: ${b.name}`),_++;else console.log(` Skipped: ${b.name} (existing hook not managed by agentlogs)`),$++;else EK(Z,OK(b.name),{mode:493}),_I(Z,493),console.log(` Created: ${b.name}`),_++}if(console.log(""),_>0)console.log(`Installed ${_} hook(s).`);if($>0)console.log(`Skipped ${$} hook(s) with existing non-agentlogs content.`);console.log(""),console.log("Cline will now auto-upload transcripts and track commits."),console.log("Run `agentlogs status` to verify you are logged in.")}import{existsSync as X4,readFileSync as ZU,readdirSync as SK,statSync as RK}from"fs";import{join as E4,basename as ZI}from"path";import{homedir as LK}from"os";var Y4=E4(LK(),".cline","data","tasks");function AI(_){if(!X4(_))return null;try{let $=ZU(_,"utf-8"),b=JSON.parse($),Z,z=E4(_,"..","task_metadata.json");if(X4(z))try{Z=JSON.parse(ZU(z,"utf-8"))}catch{}return{messages:b,metadata:Z}}catch{return null}}function JI(_){let $=E4(Y4,_),b=E4($,"api_conversation_history.json");if(X4(b))return b;if(!X4(Y4))return null;for(let Z of SK(Y4))if(Z.includes(_)){let z=E4(Y4,Z,"api_conversation_history.json");if(X4(z))return z}return null}function UI(_=10){let $=[];if(!X4(Y4))return $;for(let b of SK(Y4)){let Z=E4(Y4,b,"api_conversation_history.json");if(!X4(Z))continue;try{let z=RK(Z),A="",U=ZU(Z,"utf-8").match(/<task>\n?([\s\S]*?)\n?<\/task>/);if(U&&U[1])A=U[1].trim().slice(0,60);$.push({path:Z,id:b,mtime:z.mtime,preview:A})}catch{}}return $.sort((b,Z)=>Z.mtime.getTime()-b.mtime.getTime()),$.slice(0,_)}async function TK(_){if(!_){console.log("Recent Cline tasks:"),console.log("");let w=UI(10);if(w.length===0)console.log("No tasks found in",Y4),process.exit(1);for(let P of w){let E=P.mtime.toLocaleString();if(console.log(` ${P.id.substring(0,13)}... ${E}`),P.preview)console.log(` ${P.preview}`);console.log("")}console.log("Usage: agentlogs cline upload <task-id-or-path>"),process.exit(0)}let $,b=_.startsWith("~")?_.replace(/^~/,LK()):_;if(X4(b))if(RK(b).isDirectory()){let P=E4(b,"api_conversation_history.json");if(X4(P))$=P;else console.error(`Error: No api_conversation_history.json found in: ${b}`),process.exit(1)}else $=b;else{let w=JI(_);if(!w)console.error(`Error: Task not found: ${_}`),console.error(`Searched in: ${Y4}`),process.exit(1);$=w}let Z=ZI(E4($,".."));console.log(`Uploading Cline task: ${Z}`);let z=AI($);if(!z)console.error(`Error: Failed to read task file: ${$}`),process.exit(1);let A=z.messages.length;console.log(`Task: ${Z} (${A} messages)`);let U=await new g0().fetchModelPricing(),G=Object.fromEntries(U),Y=process.cwd(),X=await W0(Y,void 0);if(X?.repo)console.log(`Repository: ${X.repo}`);let Q=z.metadata?.environment_history?.[0]?.cline_version;console.log("Converting transcript...");let K=n4(z.messages,{pricing:G,gitContext:X,cwd:Y,taskId:Z,metadata:z.metadata,clientVersion:Q});if(!K)console.error("Error: Failed to convert transcript"),process.exit(1);let v=[];for(let[w,P]of K.blobs)v.push({sha256:w,data:new Uint8Array(P.data),mediaType:P.mediaType});console.log("Uploading...");let D=await O0({unifiedTranscript:K.transcript,sessionId:Z,cwd:Y,blobs:v.length>0?v:void 0});if(D.skipped)console.log("Skipped: Repository not in allowlist"),process.exit(0);if(D.anySuccess&&D.id){console.log(""),console.log("Upload successful!"),console.log(`Transcript ID: ${D.id}`);for(let w of D.results)if(w.success){let P=`${w.baseURL}/s/${D.id}`;console.log(`View: ${P}`)}}else{console.error(""),console.error("Upload failed:");for(let w of D.results)if(!w.success&&w.error)console.error(` ${w.envName}: ${w.error}`);process.exit(1)}}var Q4={};async function GI(_,$={}){let b=_.hook_event_name,Z=AU(_),z=$.uploadFn??x_,A=$.trackCommitFn??l_,J=$.getTranscriptIdFn??r0;if(b==="PreToolUse")return await YI(_,z),Q4;if(b==="PostToolUse")return await XI(_,A,J),Q4;if(b==="Stop"){let U=typeof _.transcript_path==="string"?_.transcript_path:void 0;if(!U)return L.warn("Codex Stop: missing transcript_path",{sessionId:Z.substring(0,8)}),Q4;try{let G=await z({transcriptPath:U,sessionId:_.session_id,cwdOverride:typeof _.cwd==="string"?_.cwd:void 0,source:"codex"});mK("Stop",Z,G)}catch(G){L.error("Codex Stop: upload error",{sessionId:Z.substring(0,8),error:G instanceof Error?G.message:String(G)})}return Q4}if(b==="SessionStart")return Q4;return L.debug("Codex hook: skipping unsupported event",{eventName:b,sessionId:Z.substring(0,8)}),Q4}function AU(_){return typeof _.session_id==="string"?_.session_id:"unknown"}function yK(_){return typeof _.tool_input?.command==="string"?_.tool_input.command:void 0}function CK(_){if(typeof _.tool_name==="string")return _.tool_name.toLowerCase()==="bash";return typeof _.tool_input?.command==="string"}function t6(_,$=0){if(_==null||$>3)return;if(typeof _==="string"){let Z=_.trim();if(!Z)return;if(Z.startsWith("{")||Z.startsWith("["))try{let z=JSON.parse(_);return t6(z,$+1)??_}catch{return _}return _}if(Array.isArray(_)){for(let Z of _){let z=t6(Z,$+1);if(z)return z}return}if(typeof _!=="object")return;let b=_;for(let Z of["aggregated_output","formatted_output","output","stdout","content","message","stderr"]){let z=t6(b[Z],$+1);if(z)return z}return}async function YI(_,$){let b=AU(_),Z=yK(_);if(!CK(_)||!Z||!H_(Z))return;let z=typeof _.transcript_path==="string"?_.transcript_path:void 0;if(!z){L.warn("Codex PreToolUse: missing transcript_path",{sessionId:b.substring(0,8)});return}try{let A=await $({transcriptPath:z,sessionId:_.session_id,cwdOverride:typeof _.cwd==="string"?_.cwd:void 0,source:"codex"});mK("PreToolUse",b,A)}catch(A){L.error("Codex PreToolUse: upload error",{sessionId:b.substring(0,8),error:A instanceof Error?A.message:String(A)})}}async function XI(_,$,b){let Z=AU(_),z=yK(_);if(!CK(_)||!z||!H_(z))return;if(typeof _.session_id!=="string"){L.warn("Codex PostToolUse: missing session_id");return}let A=typeof _.cwd==="string"?_.cwd:void 0;if(!A){L.warn("Codex PostToolUse: missing cwd",{sessionId:Z.substring(0,8)});return}let J=t6(_.tool_response);if(!J){L.debug("Codex PostToolUse: missing tool output",{sessionId:Z.substring(0,8)});return}let U=h_(J);if(!U){L.debug("Codex PostToolUse: no commit SHA found",{sessionId:Z.substring(0,8)});return}let G=await b(_.session_id),Y=r_(J),X=n_(J);await $({transcriptId:G,repoPath:A,timestamp:new Date().toISOString(),commitSha:U,commitTitle:Y,branch:X}),L.info("Codex PostToolUse: tracked commit",{sessionId:Z.substring(0,8),transcriptId:G,commitSha:U.substring(0,8)})}async function fK(){let _=Date.now(),$,b;try{let{full:Z}=await p_();if(L.info(`Codex hook invoked (stdin: ${Z.length} bytes)`),!Z.trim())L.warn("Codex hook received empty stdin - ignoring"),e6(Q4),process.exit(0);let z;try{z=JSON.parse(Z)}catch(U){L.error("Codex hook failed to parse stdin JSON",{error:U instanceof Error?U.message:String(U)}),e6(Q4),process.exit(1)}$=typeof z.hook_event_name==="string"?z.hook_event_name:void 0,b=typeof z.session_id==="string"?z.session_id:void 0,L.info(`Codex hook: ${$??"unknown"} (session: ${(b??"unknown").substring(0,8)}...)`);let A=await GI(z);e6(A);let J=Date.now()-_;L.info(`Codex hook completed: ${$??"unknown"} (${J}ms)`,{sessionId:b?.substring(0,8)}),process.exit(0)}catch(Z){let z=Date.now()-_;L.error(`Codex hook failed: ${$??"unknown"} (${z}ms)`,{sessionId:b?.substring(0,8),error:Z instanceof Error?Z.message:String(Z)}),e6(Q4),process.exit(1)}}function e6(_){process.stdout.write(JSON.stringify(_))}function mK(_,$,b){if(b.results.length===0){if(!b.anySuccess)L.info(`Codex ${_}: upload skipped (repo not allowed or no auth)`,{sessionId:$.substring(0,8)});return}for(let Z of b.results)if(Z.success)L.info(`Codex ${_}: uploaded to ${Z.envName} (${b.eventCount} events)`,{transcriptId:Z.transcriptId,sessionId:$.substring(0,8)});else L.error(`Codex ${_}: upload to ${Z.envName} failed`,{sessionId:$.substring(0,8),error:Z.error})}import{existsSync as JU,mkdirSync as QI,readFileSync as uK,writeFileSync as cK}from"fs";import{homedir as KI}from"os";import{join as UU}from"path";var FI=30,vI=UU(KI(),".codex");function HI(){let _=process.env.CODEX_HOME??vI;return{codexHome:_,configPath:UU(_,"config.toml"),hooksPath:UU(_,"hooks.json")}}function hK(_){let $=HI();kI($.codexHome);let b=JU($.configPath)?uK($.configPath,"utf-8"):"",Z=qI(b);if(Z!==b)cK($.configPath,Z);let z=JU($.hooksPath)?uK($.hooksPath,"utf-8"):"",A=DI(z,_);if(A!==z)cK($.hooksPath,A);return{paths:$,configUpdated:Z!==b,hooksUpdated:A!==z}}function qI(_){return WI(_,"features","codex_hooks = true",/^\s*codex_hooks\s*=/)}function DI(_,$){let b=VI(_),Z=b.hooks??{};return Z.SessionStart=s6(Z.SessionStart??[],_z($)),Z.PreToolUse=s6(Z.PreToolUse??[],_z($,"Bash")),Z.PostToolUse=s6(Z.PostToolUse??[],_z($,"Bash")),Z.Stop=s6(Z.Stop??[],_z($)),b.hooks=Z,`${JSON.stringify(b,null,2)}
231
+ `}function VI(_){if(!_.trim())return{hooks:{}};let $=JSON.parse(_);if(!$.hooks||typeof $.hooks!=="object")$.hooks={};return $}function s6(_,$){return[..._.filter((Z)=>!gI(Z)),$]}function gI(_){return(_.hooks??[]).some(($)=>$.type==="command"&&$.command.includes("agentlogs")&&$.command.includes("codex hook"))}function _z(_,$){return{...$?{matcher:$}:{},hooks:[{type:"command",command:_,timeoutSec:FI}]}}function kI(_){if(!JU(_))QI(_,{recursive:!0})}function WI(_,$,b,Z){let z=BI(_),A=xI(z,$);if(!A){let J=wI(z);if(J.length>0)J.push("");return J.push(`[${$}]`),J.push(b),`${J.join(`
232
232
  `)}
233
233
  `}for(let J=A.start+1;J<A.end;J++)if(Z.test(z[J]))return z[J]=b,`${z.join(`
234
234
  `)}
235
235
  `;return z.splice(A.start+1,0,b),`${z.join(`
236
236
  `)}
237
- `}function ZI(_){let $=[..._];while($.length>0&&$[$.length-1]==="")$.pop();return $}function AI(_){if(!_)return[];return _.replace(/\r\n/g,`
237
+ `}function wI(_){let $=[..._];while($.length>0&&$[$.length-1]==="")$.pop();return $}function BI(_){if(!_)return[];return _.replace(/\r\n/g,`
238
238
  `).split(`
239
- `)}function JI(_,$){let b=`[${$}]`;for(let Z=0;Z<_.length;Z++){if(_[Z].trim()!==b)continue;let z=_.length;for(let A=Z+1;A<_.length;A++)if(/^\s*\[[^\]]+\]\s*$/.test(_[A])){z=A;break}return{start:Z,end:z}}return null}var UI=`bash -c 'if [ -n "$AGENTLOGS_CLI_PATH" ]; then exec $AGENTLOGS_CLI_PATH codex hook; else exec npx -y agentlogs@latest codex hook; fi'`;async function CK(){let _=yK(UI);if(console.log("Installed AgentLogs Codex hooks."),console.log(`Config: ${_.paths.configPath}`),console.log(`Hooks: ${_.paths.hooksPath}`),!_.configUpdated&&!_.hooksUpdated)console.log("No changes were needed.");else{if(_.configUpdated)console.log("Enabled Codex hooks via [features].codex_hooks = true.");if(_.hooksUpdated)console.log("Wrote AgentLogs SessionStart and Stop hook entries."),console.log("Hooks prefer AGENTLOGS_CLI_PATH when set and otherwise fall back to agentlogs@latest.")}}async function fK(_){await i6(_,"codex")}import{spawnSync as GI}from"child_process";function YI(_){try{let $=GI("opencode",["export",_],{encoding:"utf-8",timeout:30000,stdio:["pipe","pipe","pipe"]});if($.status!==0||$.error)return null;let b=$.stdout.trim();if(!b)return null;return JSON.parse(b)}catch{return null}}async function mK(_){if(!_)console.error("Error: Session ID is required"),process.exit(1);console.log(`Uploading OpenCode session: ${_}`);let $=YI(_);if(!$)console.error(`Error: Session not found: ${_}`),console.error("Run 'opencode session list' to see available sessions"),process.exit(1);if($.info.parentID)console.log("Skipping subagent session"),process.exit(0);let b=$.info.title||"Untitled",Z=$.messages?.length??0;console.log(`Session: "${b}" (${Z} messages)`);let A=await new k0().fetchModelPricing(),J=Object.fromEntries(A),U=$.info.directory??process.cwd(),G=await g0(U,void 0);if(G?.repo)console.log(`Repository: ${G.repo}`);console.log("Converting transcript...");let Y=l4($,{pricing:J,gitContext:G,cwd:U});if(!Y)console.error("Error: Failed to convert transcript"),process.exit(1);console.log("Uploading...");let X=await O0({unifiedTranscript:Y,sessionId:_,cwd:U,rawTranscript:JSON.stringify($)});if(X.skipped)console.log("Skipped: Repository not in allowlist"),process.exit(0);if(X.anySuccess&&X.id){console.log(""),console.log("Upload successful!"),console.log(`Transcript ID: ${X.id}`);for(let Q of X.results)if(Q.success){let K=`${Q.baseURL}/app/logs/${X.id}`;console.log(`View: ${K}`)}}else{console.error(""),console.error("Upload failed:");for(let Q of X.results)if(!Q.success&&Q.error)console.error(` ${Q.envName}: ${Q.error}`);process.exit(1)}}import{spawnSync as XI}from"child_process";async function uK(){let _=Date.now(),$,b;try{let{preview:Z,full:z}=await h_();if(L.info(`OpenCode hook invoked (stdin: ${z.length} bytes)`),!z.trim())L.warn("OpenCode hook received empty stdin - ignoring"),c_({modified:!1}),process.exit(0);let A=Z.includes("tool.execute.before"),J=Z.includes("git")&&Z.includes("commit");if(A&&!J){c_({modified:!1});let Y=Date.now()-_;L.info(`OpenCode hook completed: tool.execute.before (fast path, ${Y}ms)`),process.exit(0)}let U;try{U=JSON.parse(z)}catch(Y){L.error("OpenCode hook failed to parse stdin JSON",{error:Y instanceof Error?Y.message:Y}),c_({modified:!1}),process.exit(1)}if($=U.hook_event_name,b=U.session_id||"unknown",!$)L.error("OpenCode hook missing event name",{sessionId:b}),c_({modified:!1}),process.exit(1);if(L.info(`OpenCode hook: ${$} (session: ${b.substring(0,8)}...)`),$==="tool.execute.before")await QI(U);else if($==="tool.execute.after")await KI(U),c_({modified:!1});else if($==="session.idle")await vI(U),c_({modified:!1});else L.debug(`OpenCode hook: skipping unsupported event ${$}`),c_({modified:!1});let G=Date.now()-_;L.info(`OpenCode hook completed: ${$} (${G}ms)`,{sessionId:b.substring(0,8)}),process.exit(0)}catch(Z){let z=Date.now()-_;L.error(`OpenCode hook failed: ${$||"unknown"} (${z}ms)`,{sessionId:b?.substring(0,8),error:Z instanceof Error?Z.message:String(Z)}),c_({modified:!1}),process.exit(1)}}function c_(_){process.stdout.write(JSON.stringify(_))}async function QI(_){let{session_id:$,call_id:b}=_,Z=_.tool||"",z=_.tool_input||{},A=typeof z.command==="string"?z.command:"",J=_.cwd,U=Z==="bash",G=await M0(J),Y=J_(G);if(U&&Z4(A)&&Y){let X=await X_($),Q=await l9(),K=p9(A,X,Q);if(K!==A){if(L.info("OpenCode hook: intercepting git commit",{sessionId:$.substring(0,8),transcriptId:X,callId:b}),b)await X$(b,X);await FI($,J),c_({modified:!0,args:{...z,command:K}});return}}c_({modified:!1})}async function KI(_){let{session_id:$,call_id:b}=_,Z=_.tool||"",z=_.tool_output||{},A=_.cwd||"";if(Z!=="bash")return;let U=z.output||"",G=_9(U),Y=!1;if(!G&&b)G=await Q$(b),Y=!0;if(!G)return;if(b)await K$(b);let X=w4(U),Q=x4(U),K=N4(U);if(!X){L.debug("OpenCode PostToolUse: found link but no commit SHA",{sessionId:$.substring(0,8),transcriptId:G,fromCache:Y});return}await I4({transcriptId:G,repoPath:A,timestamp:new Date().toISOString(),commitSha:X,commitTitle:Q,branch:K}),L.info("OpenCode PostToolUse: tracked commit",{sessionId:$.substring(0,8),transcriptId:G,commitSha:X.substring(0,8),fromCache:Y})}async function vI(_){let{session_id:$,cwd:b}=_;L.info("OpenCode session.idle: uploading transcript",{sessionId:$.substring(0,8)}),await HI($,b)}function hK(_){try{let $=XI("opencode",["export",_],{encoding:"utf-8",timeout:30000,stdio:["pipe","pipe","pipe"]});if($.status!==0||$.error)return L.warn("OpenCode export failed",{sessionId:_.substring(0,8),error:$.error?.message||$.stderr}),null;let b=$.stdout.trim();if(!b)return null;return JSON.parse(b)}catch($){return L.error("OpenCode export error",{sessionId:_.substring(0,8),error:$ instanceof Error?$.message:String($)}),null}}async function FI(_,$){let b=hK(_);if(!b){L.warn("OpenCode partial upload: session not found",{sessionId:_.substring(0,8)});return}await cK(b,_,$,"partial")}async function HI(_,$){let b=hK(_);if(!b){L.warn("OpenCode full upload: session not found",{sessionId:_.substring(0,8)});return}if(b.info.parentID){L.debug("OpenCode full upload: skipping subagent session",{sessionId:_.substring(0,8)});return}await cK(b,_,$,"full")}async function cK(_,$,b,Z="full"){try{let A=await new k0().fetchModelPricing(),J=Object.fromEntries(A),U=b||_.info.directory||process.cwd(),G=await g0(U,void 0),Y=l4(_,{pricing:J,gitContext:G,cwd:U});if(!Y){L.error(`OpenCode ${Z} upload: failed to convert transcript`,{sessionId:$.substring(0,8)});return}let X=await O0({unifiedTranscript:Y,sessionId:$,cwd:U,rawTranscript:JSON.stringify(_)});if(X.skipped){L.info(`OpenCode ${Z} upload: skipped (repo not allowed)`,{sessionId:$.substring(0,8)});return}for(let Q of X.results)if(Q.success)L.info(`OpenCode ${Z} upload: success (${Q.envName})`,{sessionId:$.substring(0,8),transcriptId:X.id});else L.error(`OpenCode ${Z} upload: failed (${Q.envName})`,{sessionId:$.substring(0,8),error:Q.error})}catch(z){L.error(`OpenCode ${Z} upload: error`,{sessionId:$.substring(0,8),error:z instanceof Error?z.message:String(z)})}}import{existsSync as a9,readFileSync as Z7,readdirSync as e6}from"fs";import{join as o9,basename as qI}from"path";import{homedir as rK}from"os";var E4=o9(rK(),".pi","agent","sessions");function VI(_){if(!a9(_))return null;let b=Z7(_,"utf-8").split(`
240
- `).filter((A)=>A.trim());if(b.length===0)return null;let Z=JSON.parse(b[0]),z=[];for(let A=1;A<b.length;A++)try{z.push(JSON.parse(b[A]))}catch{}return{header:Z,entries:z}}function DI(_){if(!a9(E4))return null;for(let $ of e6(E4)){let b=o9(E4,$);if(!a9(b))continue;for(let Z of e6(b)){if(!Z.endsWith(".jsonl"))continue;if(Z.includes(_))return o9(b,Z);let z=o9(b,Z);try{let A=Z7(z,"utf-8").split(`
241
- `)[0];if(JSON.parse(A).id===_)return z}catch{}}}return null}function kI(_=10){let $=[];if(!a9(E4))return $;for(let b of e6(E4)){let Z=o9(E4,b);if(!a9(Z))continue;for(let z of e6(Z)){if(!z.endsWith(".jsonl"))continue;let A=o9(Z,z);try{let J=Z7(A,"utf-8").split(`
242
- `)[0],U=JSON.parse(J);$.push({path:A,id:U.id,timestamp:U.timestamp,cwd:U.cwd})}catch{}}}return $.sort((b,Z)=>Z.timestamp.localeCompare(b.timestamp)),$.slice(0,_)}async function nK(_){if(!_){console.log("Recent Pi sessions:"),console.log("");let v=kI(10);if(v.length===0)console.log("No sessions found in",E4),process.exit(1);for(let V of v){let P=new Date(V.timestamp).toLocaleString();console.log(` ${V.id.substring(0,8)}... ${P}`),console.log(` ${V.cwd}`),console.log("")}console.log("Usage: agentlogs pi upload <session-id-or-path>"),process.exit(0)}let $,b=_.startsWith("~")?_.replace(/^~/,rK()):_;if(a9(b))$=b;else{let v=DI(_);if(!v)console.error(`Error: Session not found: ${_}`),console.error(`Searched in: ${E4}`),process.exit(1);$=v}console.log(`Uploading Pi session: ${qI($)}`);let Z=VI($);if(!Z)console.error(`Error: Failed to read session file: ${$}`),process.exit(1);let z=Z.entries.filter((v)=>v.type==="message").length;console.log(`Session: ${Z.header.id.substring(0,8)}... (${z} messages)`);let J=await new k0().fetchModelPricing(),U=Object.fromEntries(J),G=Z.header.cwd??process.cwd(),Y=await g0(G,void 0);if(Y?.repo)console.log(`Repository: ${Y.repo}`);console.log("Converting transcript...");let X=p4(Z,{pricing:U,gitContext:Y,cwd:G});if(!X)console.error("Error: Failed to convert transcript"),process.exit(1);let Q=[];for(let[v,V]of X.blobs)Q.push({sha256:v,data:new Uint8Array(V.data),mediaType:V.mediaType});console.log("Uploading...");let K=await O0({unifiedTranscript:X.transcript,sessionId:Z.header.id,cwd:G,rawTranscript:JSON.stringify(Z),blobs:Q.length>0?Q:void 0});if(K.skipped)console.log("Skipped: Repository not in allowlist"),process.exit(0);if(K.anySuccess&&K.id){console.log(""),console.log("Upload successful!"),console.log(`Transcript ID: ${K.id}`);for(let v of K.results)if(v.success){let V=`${v.baseURL}/app/logs/${K.id}`;console.log(`View: ${V}`)}}else{console.error(""),console.error("Upload failed:");for(let v of K.results)if(!v.success&&v.error)console.error(` ${v.envName}: ${v.error}`);process.exit(1)}}import{existsSync as WI,readFileSync as gI}from"fs";async function lK(){let _=Date.now(),$,b;try{let{preview:Z,full:z}=await h_();if(L.info(`Pi hook invoked (stdin: ${z.length} bytes)`),!z.trim())L.warn("Pi hook received empty stdin - ignoring"),x_({modified:!1}),process.exit(0);let A=Z.includes("tool_call")&&!Z.includes("tool_call_id"),J=Z.includes("git")&&Z.includes("commit");if(A&&!J){x_({modified:!1});let Y=Date.now()-_;L.info(`Pi hook completed: tool_call (fast path, ${Y}ms)`),process.exit(0)}let U;try{U=JSON.parse(z)}catch(Y){L.error("Pi hook failed to parse stdin JSON",{error:Y instanceof Error?Y.message:Y}),x_({modified:!1}),process.exit(1)}if($=U.hook_event_name,b=U.session_id||"unknown",!$)L.error("Pi hook missing event name",{sessionId:b}),x_({modified:!1}),process.exit(1);if(L.info(`Pi hook: ${$} (session: ${b.substring(0,8)}...)`),$==="tool_call")await BI(U);else if($==="tool_result")await wI(U),x_({modified:!1});else if($==="session_shutdown")await xI(U),x_({modified:!1});else if($==="agent_end")await NI(U),x_({modified:!1});else L.debug(`Pi hook: skipping unsupported event ${$}`),x_({modified:!1});let G=Date.now()-_;L.info(`Pi hook completed: ${$} (${G}ms)`,{sessionId:b.substring(0,8)}),process.exit(0)}catch(Z){let z=Date.now()-_;L.error(`Pi hook failed: ${$||"unknown"} (${z}ms)`,{sessionId:b?.substring(0,8),error:Z instanceof Error?Z.message:String(Z)}),x_({modified:!1}),process.exit(1)}}function x_(_){process.stdout.write(JSON.stringify(_))}async function BI(_){let{session_id:$,tool_call_id:b}=_,Z=_.tool||"",z=_.tool_input||{},A=typeof z.command==="string"?z.command:"",J=_.cwd,U=Z.toLowerCase()==="bash",G=await M0(J),Y=J_(G);if(U&&Z4(A)&&Y){let X=await X_($),Q=await l9(),K=p9(A,X,Q);if(K!==A){if(L.info("Pi hook: intercepting git commit",{sessionId:$.substring(0,8),transcriptId:X,toolCallId:b}),b)await X$(b,X);await II(_),x_({modified:!0,updatedInput:{...z,command:K}});return}}x_({modified:!1})}async function wI(_){let{session_id:$,tool_call_id:b}=_,Z=_.tool||"",z=_.tool_output||{},A=_.cwd||"";if(Z.toLowerCase()!=="bash")return;let U=z.stdout||z.content||"",G=typeof U==="string"?U:JSON.stringify(U),Y=_9(G),X=!1;if(!Y&&b)Y=await Q$(b),X=!0;if(!Y)return;if(b)await K$(b);let Q=w4(G),K=x4(G),v=N4(G);if(!Q){L.debug("Pi tool_result: found link but no commit SHA",{sessionId:$.substring(0,8),transcriptId:Y,fromCache:X});return}await I4({transcriptId:Y,repoPath:A,timestamp:new Date().toISOString(),commitSha:Q,commitTitle:K,branch:v}),L.info("Pi tool_result: tracked commit",{sessionId:$.substring(0,8),transcriptId:Y,commitSha:Q.substring(0,8),fromCache:X})}async function xI(_){let $=_.session_id;L.info("Pi session_shutdown: uploading transcript",{sessionId:$.substring(0,8)}),await dK(_)}async function NI(_){let $=_.session_id;L.info("Pi agent_end: uploading transcript",{sessionId:$.substring(0,8)}),await dK(_)}function pK(_){if(!WI(_))return null;try{let b=gI(_,"utf-8").split(`
243
- `).filter((A)=>A.trim());if(b.length===0)return null;let Z=JSON.parse(b[0]),z=[];for(let A=1;A<b.length;A++)try{z.push(JSON.parse(b[A]))}catch{}return{header:Z,entries:z}}catch($){return L.error("Pi: failed to read session file",{sessionFile:_,error:$ instanceof Error?$.message:String($)}),null}}async function II(_){let{session_id:$,cwd:b,session_data:Z}=_;if(!Z&&_.session_file)Z=pK(_.session_file)??void 0;if(!Z){L.warn("Pi partial upload: no session data available",{sessionId:$.substring(0,8)});return}await iK(Z,$,b,_.leaf_id,"partial")}async function dK(_){let{session_id:$,cwd:b,session_data:Z}=_;if(!Z&&_.session_file)Z=pK(_.session_file)??void 0;if(!Z){L.warn("Pi full upload: no session data available",{sessionId:$.substring(0,8)});return}await iK(Z,$,b,_.leaf_id,"full")}async function iK(_,$,b,Z,z="full"){try{let J=await new k0().fetchModelPricing(),U=Object.fromEntries(J),G=b||_.header.cwd||process.cwd(),Y=await g0(G,void 0),X=p4(_,{pricing:U,gitContext:Y,cwd:G,leafId:Z});if(!X){L.error(`Pi ${z} upload: failed to convert transcript`,{sessionId:$.substring(0,8)});return}let Q=await O0({unifiedTranscript:X.transcript,sessionId:$,cwd:G,rawTranscript:JSON.stringify(_)});if(Q.skipped){L.info(`Pi ${z} upload: skipped (repo not allowed)`,{sessionId:$.substring(0,8)});return}for(let K of Q.results)if(K.success)L.info(`Pi ${z} upload: success (${K.envName})`,{sessionId:$.substring(0,8),transcriptId:Q.id});else L.error(`Pi ${z} upload: failed (${K.envName})`,{sessionId:$.substring(0,8),error:K.error})}catch(A){L.error(`Pi ${z} upload: error`,{sessionId:$.substring(0,8),error:A instanceof Error?A.message:String(A)})}}var h0=new N7;h0.name("agentlogs").description("CLI tools for working with AgentLogs accounts and transcripts from AI coding agents");h0.command("login").description("Authenticate with AgentLogs using device authorization").argument("<hostname>","AgentLogs server hostname, e.g. agentlogs.ai").option("--token <token>","OAuth access token for direct authentication (skips browser)").action(async(_,$)=>{await BG({hostname:_,token:$.token})});h0.command("status").description("Check your current login status").action(async()=>{await NG()});h0.command("logout").description("Log out and clear stored credentials").argument("[hostname]","Optional hostname to log out from (logs out all when omitted)").action(async(_)=>{await wG({hostname:_})});h0.command("upload").argument("[directory]","Filter transcripts to this directory").option("-s, --source <source>","Filter by source: claude-code, cline, codex, opencode, or pi").option("-l, --latest","Upload the most recent transcript without picker").description("Interactively select and upload a transcript").action(async(_,$)=>{let b=$.source;await QK(_,{source:b,latest:$.latest})});var A7=h0.command("claudecode").description("Claude Code transcript utilities for AgentLogs");A7.command("upload").argument("<transcript>","Path or alias for a transcript JSONL file").description("Upload a transcript JSONL file to AgentLogs").action(async(_)=>{await kK(_)});A7.command("hook").description("Process Claude Code hook input from stdin").action(async()=>{await HK()});var J7=h0.command("codex").description("Codex transcript utilities for AgentLogs");J7.command("upload").argument("<transcript>","Path or alias for a Codex transcript JSONL file").description("Upload a Codex transcript JSONL file to AgentLogs").action(async(_)=>{await fK(_)});J7.command("hook").description("Process Codex hook input from stdin").action(async()=>{await jK()});J7.command("install").description("Install AgentLogs Codex hooks into ~/.codex").action(async()=>{await CK()});var oK=h0.command("opencode").description("OpenCode transcript utilities for AgentLogs");oK.command("upload").argument("<sessionId>","OpenCode session ID to upload").description("Upload an OpenCode session transcript to AgentLogs").action(async(_)=>{await mK(_)});oK.command("hook").description("Process OpenCode hook input from stdin").action(async()=>{await uK()});var U7=h0.command("cline").description("Cline transcript utilities for AgentLogs");U7.command("upload").argument("[taskIdOrPath]","Cline task ID or path to task directory/file").description("Upload a Cline task transcript to AgentLogs").action(async(_)=>{await PK(_)});U7.command("hook").description("Process Cline hook input from stdin").action(async()=>{await BK()});U7.command("install").description("Install agentlogs hooks into Cline's global hooks directory").action(async()=>{await IK()});var aK=h0.command("pi").description("Pi transcript utilities for AgentLogs");aK.command("upload").argument("[sessionIdOrPath]","Pi session ID or path to session file").description("Upload a Pi session transcript to AgentLogs").action(async(_)=>{await nK(_)});aK.command("hook").description("Process Pi hook input from stdin").action(async()=>{await lK()});A7.command("sync").argument("[claudeDir]","Optional Claude data directory (defaults to ~/.claude)").option("-r, --repo <repoId>","Only sync transcripts for the provided repo identifier").description("Upload all local Claude Code transcripts that are missing or outdated on the server").action(async(_,$)=>{await VK({claudeDir:_,repoFilter:$.repo})});h0.command("settings").description("View and modify AgentLogs settings").option("--allowMode <mode>","Set allow mode: 'allowlist' or 'denylist'").action(async(_)=>{await xG({allowMode:_.allowMode})});h0.command("allow").description("Allow capture for the current repository").option("--visibility <visibility>","Set visibility: 'public', 'team', or 'private'").option("--public","Set visibility to public").option("--team","Set visibility to team").option("--private","Set visibility to private").action(async(_)=>{await h7(_)});h0.command("deny").description("Deny capture for the current repository").action(async()=>{await c7()});h0.showHelpAfterError("(add --help for additional information)");h0.parseAsync().catch((_)=>{console.error("CLI encountered an unexpected error."),console.error(_),process.exit(1)});
239
+ `)}function xI(_,$){let b=`[${$}]`;for(let Z=0;Z<_.length;Z++){if(_[Z].trim()!==b)continue;let z=_.length;for(let A=Z+1;A<_.length;A++)if(/^\s*\[[^\]]+\]\s*$/.test(_[A])){z=A;break}return{start:Z,end:z}}return null}var NI=`bash -c 'if [ -n "$AGENTLOGS_CLI_PATH" ]; then exec $AGENTLOGS_CLI_PATH codex hook; else exec npx -y agentlogs@latest codex hook; fi'`;async function rK(){let _=hK(NI);if(console.log("Installed AgentLogs Codex hooks."),console.log(`Config: ${_.paths.configPath}`),console.log(`Hooks: ${_.paths.hooksPath}`),!_.configUpdated&&!_.hooksUpdated)console.log("No changes were needed.");else{if(_.configUpdated)console.log("Enabled Codex hooks via [features].codex_hooks = true.");if(_.hooksUpdated)console.log("Wrote AgentLogs SessionStart, PreToolUse, PostToolUse, and Stop hook entries."),console.log("Hooks prefer AGENTLOGS_CLI_PATH when set and otherwise fall back to agentlogs@latest.")}}async function nK(_){await o6(_,"codex")}import{spawnSync as II}from"child_process";function MI(_){try{let $=II("opencode",["export",_],{encoding:"utf-8",timeout:30000,stdio:["pipe","pipe","pipe"]});if($.status!==0||$.error)return null;let b=$.stdout.trim();if(!b)return null;return JSON.parse(b)}catch{return null}}async function lK(_){if(!_)console.error("Error: Session ID is required"),process.exit(1);console.log(`Uploading OpenCode session: ${_}`);let $=MI(_);if(!$)console.error(`Error: Session not found: ${_}`),console.error("Run 'opencode session list' to see available sessions"),process.exit(1);if($.info.parentID)console.log("Skipping subagent session"),process.exit(0);let b=$.info.title||"Untitled",Z=$.messages?.length??0;console.log(`Session: "${b}" (${Z} messages)`);let A=await new g0().fetchModelPricing(),J=Object.fromEntries(A),U=$.info.directory??process.cwd(),G=await W0(U,void 0);if(G?.repo)console.log(`Repository: ${G.repo}`);console.log("Converting transcript...");let Y=p4($,{pricing:J,gitContext:G,cwd:U});if(!Y)console.error("Error: Failed to convert transcript"),process.exit(1);console.log("Uploading...");let X=await O0({unifiedTranscript:Y,sessionId:_,cwd:U});if(X.skipped)console.log("Skipped: Repository not in allowlist"),process.exit(0);if(X.anySuccess&&X.id){console.log(""),console.log("Upload successful!"),console.log(`Transcript ID: ${X.id}`);for(let Q of X.results)if(Q.success){let K=`${Q.baseURL}/app/logs/${X.id}`;console.log(`View: ${K}`)}}else{console.error(""),console.error("Upload failed:");for(let Q of X.results)if(!Q.success&&Q.error)console.error(` ${Q.envName}: ${Q.error}`);process.exit(1)}}import{spawnSync as EI}from"child_process";async function pK(){let _=Date.now(),$,b;try{let{preview:Z,full:z}=await p_();if(L.info(`OpenCode hook invoked (stdin: ${z.length} bytes)`),!z.trim())L.warn("OpenCode hook received empty stdin - ignoring"),d_({modified:!1}),process.exit(0);let A=Z.includes("tool.execute.before"),J=Z.includes("git")&&Z.includes("commit");if(A&&!J){d_({modified:!1});let Y=Date.now()-_;L.info(`OpenCode hook completed: tool.execute.before (fast path, ${Y}ms)`),process.exit(0)}let U;try{U=JSON.parse(z)}catch(Y){L.error("OpenCode hook failed to parse stdin JSON",{error:Y instanceof Error?Y.message:Y}),d_({modified:!1}),process.exit(1)}if($=U.hook_event_name,b=U.session_id||"unknown",!$)L.error("OpenCode hook missing event name",{sessionId:b}),d_({modified:!1}),process.exit(1);if(L.info(`OpenCode hook: ${$} (session: ${b.substring(0,8)}...)`),$==="tool.execute.before")await OI(U);else if($==="tool.execute.after")await PI(U),d_({modified:!1});else if($==="session.idle")await jI(U),d_({modified:!1});else L.debug(`OpenCode hook: skipping unsupported event ${$}`),d_({modified:!1});let G=Date.now()-_;L.info(`OpenCode hook completed: ${$} (${G}ms)`,{sessionId:b.substring(0,8)}),process.exit(0)}catch(Z){let z=Date.now()-_;L.error(`OpenCode hook failed: ${$||"unknown"} (${z}ms)`,{sessionId:b?.substring(0,8),error:Z instanceof Error?Z.message:String(Z)}),d_({modified:!1}),process.exit(1)}}function d_(_){process.stdout.write(JSON.stringify(_))}async function OI(_){let{session_id:$,call_id:b}=_,Z=_.tool||"",z=_.tool_input||{},A=typeof z.command==="string"?z.command:"",J=_.cwd,U=Z==="bash",G=await M0(J),Y=U_(G);if(U&&H_(A)&&Y){let X=await r0($),Q=await l9(),K=p9(A,X,Q);if(K!==A){if(L.info("OpenCode hook: intercepting git commit",{sessionId:$.substring(0,8),transcriptId:X,callId:b}),b)await Y$(b,X);await SI($,J),d_({modified:!0,args:{...z,command:K}});return}}d_({modified:!1})}async function PI(_){let{session_id:$,call_id:b}=_,Z=_.tool||"",z=_.tool_output||{},A=_.cwd||"";if(Z!=="bash")return;let U=z.output||"",G=_9(U),Y=!1;if(!G&&b)G=await X$(b),Y=!0;if(!G)return;if(b)await Q$(b);let X=h_(U),Q=r_(U),K=n_(U);if(!X){L.debug("OpenCode PostToolUse: found link but no commit SHA",{sessionId:$.substring(0,8),transcriptId:G,fromCache:Y});return}await l_({transcriptId:G,repoPath:A,timestamp:new Date().toISOString(),commitSha:X,commitTitle:Q,branch:K}),L.info("OpenCode PostToolUse: tracked commit",{sessionId:$.substring(0,8),transcriptId:G,commitSha:X.substring(0,8),fromCache:Y})}async function jI(_){let{session_id:$,cwd:b}=_;L.info("OpenCode session.idle: uploading transcript",{sessionId:$.substring(0,8)}),await RI($,b)}function dK(_){try{let $=EI("opencode",["export",_],{encoding:"utf-8",timeout:30000,stdio:["pipe","pipe","pipe"]});if($.status!==0||$.error)return L.warn("OpenCode export failed",{sessionId:_.substring(0,8),error:$.error?.message||$.stderr}),null;let b=$.stdout.trim();if(!b)return null;return JSON.parse(b)}catch($){return L.error("OpenCode export error",{sessionId:_.substring(0,8),error:$ instanceof Error?$.message:String($)}),null}}async function SI(_,$){let b=dK(_);if(!b){L.warn("OpenCode partial upload: session not found",{sessionId:_.substring(0,8)});return}await iK(b,_,$,"partial")}async function RI(_,$){let b=dK(_);if(!b){L.warn("OpenCode full upload: session not found",{sessionId:_.substring(0,8)});return}if(b.info.parentID){L.debug("OpenCode full upload: skipping subagent session",{sessionId:_.substring(0,8)});return}await iK(b,_,$,"full")}async function iK(_,$,b,Z="full"){try{let A=await new g0().fetchModelPricing(),J=Object.fromEntries(A),U=b||_.info.directory||process.cwd(),G=await W0(U,void 0),Y=p4(_,{pricing:J,gitContext:G,cwd:U});if(!Y){L.error(`OpenCode ${Z} upload: failed to convert transcript`,{sessionId:$.substring(0,8)});return}let X=await O0({unifiedTranscript:Y,sessionId:$,cwd:U});if(X.skipped){L.info(`OpenCode ${Z} upload: skipped (repo not allowed)`,{sessionId:$.substring(0,8)});return}for(let Q of X.results)if(Q.success)L.info(`OpenCode ${Z} upload: success (${Q.envName})`,{sessionId:$.substring(0,8),transcriptId:X.id});else L.error(`OpenCode ${Z} upload: failed (${Q.envName})`,{sessionId:$.substring(0,8),error:Q.error})}catch(z){L.error(`OpenCode ${Z} upload: error`,{sessionId:$.substring(0,8),error:z instanceof Error?z.message:String(z)})}}import{existsSync as o9,readFileSync as GU,readdirSync as $z}from"fs";import{join as i9,basename as LI}from"path";import{homedir as oK}from"os";var O4=i9(oK(),".pi","agent","sessions");function TI(_){if(!o9(_))return null;let b=GU(_,"utf-8").split(`
240
+ `).filter((A)=>A.trim());if(b.length===0)return null;let Z=JSON.parse(b[0]),z=[];for(let A=1;A<b.length;A++)try{z.push(JSON.parse(b[A]))}catch{}return{header:Z,entries:z}}function yI(_){if(!o9(O4))return null;for(let $ of $z(O4)){let b=i9(O4,$);if(!o9(b))continue;for(let Z of $z(b)){if(!Z.endsWith(".jsonl"))continue;if(Z.includes(_))return i9(b,Z);let z=i9(b,Z);try{let A=GU(z,"utf-8").split(`
241
+ `)[0];if(JSON.parse(A).id===_)return z}catch{}}}return null}function CI(_=10){let $=[];if(!o9(O4))return $;for(let b of $z(O4)){let Z=i9(O4,b);if(!o9(Z))continue;for(let z of $z(Z)){if(!z.endsWith(".jsonl"))continue;let A=i9(Z,z);try{let J=GU(A,"utf-8").split(`
242
+ `)[0],U=JSON.parse(J);$.push({path:A,id:U.id,timestamp:U.timestamp,cwd:U.cwd})}catch{}}}return $.sort((b,Z)=>Z.timestamp.localeCompare(b.timestamp)),$.slice(0,_)}async function aK(_){if(!_){console.log("Recent Pi sessions:"),console.log("");let v=CI(10);if(v.length===0)console.log("No sessions found in",O4),process.exit(1);for(let D of v){let P=new Date(D.timestamp).toLocaleString();console.log(` ${D.id.substring(0,8)}... ${P}`),console.log(` ${D.cwd}`),console.log("")}console.log("Usage: agentlogs pi upload <session-id-or-path>"),process.exit(0)}let $,b=_.startsWith("~")?_.replace(/^~/,oK()):_;if(o9(b))$=b;else{let v=yI(_);if(!v)console.error(`Error: Session not found: ${_}`),console.error(`Searched in: ${O4}`),process.exit(1);$=v}console.log(`Uploading Pi session: ${LI($)}`);let Z=TI($);if(!Z)console.error(`Error: Failed to read session file: ${$}`),process.exit(1);let z=Z.entries.filter((v)=>v.type==="message").length;console.log(`Session: ${Z.header.id.substring(0,8)}... (${z} messages)`);let J=await new g0().fetchModelPricing(),U=Object.fromEntries(J),G=Z.header.cwd??process.cwd(),Y=await W0(G,void 0);if(Y?.repo)console.log(`Repository: ${Y.repo}`);console.log("Converting transcript...");let X=d4(Z,{pricing:U,gitContext:Y,cwd:G});if(!X)console.error("Error: Failed to convert transcript"),process.exit(1);let Q=[];for(let[v,D]of X.blobs)Q.push({sha256:v,data:new Uint8Array(D.data),mediaType:D.mediaType});console.log("Uploading...");let K=await O0({unifiedTranscript:X.transcript,sessionId:Z.header.id,cwd:G,blobs:Q.length>0?Q:void 0});if(K.skipped)console.log("Skipped: Repository not in allowlist"),process.exit(0);if(K.anySuccess&&K.id){console.log(""),console.log("Upload successful!"),console.log(`Transcript ID: ${K.id}`);for(let v of K.results)if(v.success){let D=`${v.baseURL}/app/logs/${K.id}`;console.log(`View: ${D}`)}}else{console.error(""),console.error("Upload failed:");for(let v of K.results)if(!v.success&&v.error)console.error(` ${v.envName}: ${v.error}`);process.exit(1)}}import{existsSync as fI,readFileSync as mI}from"fs";async function eK(){let _=Date.now(),$,b;try{let{preview:Z,full:z}=await p_();if(L.info(`Pi hook invoked (stdin: ${z.length} bytes)`),!z.trim())L.warn("Pi hook received empty stdin - ignoring"),N_({modified:!1}),process.exit(0);let A=Z.includes("tool_call")&&!Z.includes("tool_call_id"),J=Z.includes("git")&&Z.includes("commit");if(A&&!J){N_({modified:!1});let Y=Date.now()-_;L.info(`Pi hook completed: tool_call (fast path, ${Y}ms)`),process.exit(0)}let U;try{U=JSON.parse(z)}catch(Y){L.error("Pi hook failed to parse stdin JSON",{error:Y instanceof Error?Y.message:Y}),N_({modified:!1}),process.exit(1)}if($=U.hook_event_name,b=U.session_id||"unknown",!$)L.error("Pi hook missing event name",{sessionId:b}),N_({modified:!1}),process.exit(1);if(L.info(`Pi hook: ${$} (session: ${b.substring(0,8)}...)`),$==="tool_call")await uI(U);else if($==="tool_result")await cI(U),N_({modified:!1});else if($==="session_shutdown")await hI(U),N_({modified:!1});else if($==="agent_end")await rI(U),N_({modified:!1});else L.debug(`Pi hook: skipping unsupported event ${$}`),N_({modified:!1});let G=Date.now()-_;L.info(`Pi hook completed: ${$} (${G}ms)`,{sessionId:b.substring(0,8)}),process.exit(0)}catch(Z){let z=Date.now()-_;L.error(`Pi hook failed: ${$||"unknown"} (${z}ms)`,{sessionId:b?.substring(0,8),error:Z instanceof Error?Z.message:String(Z)}),N_({modified:!1}),process.exit(1)}}function N_(_){process.stdout.write(JSON.stringify(_))}async function uI(_){let{session_id:$,tool_call_id:b}=_,Z=_.tool||"",z=_.tool_input||{},A=typeof z.command==="string"?z.command:"",J=_.cwd,U=Z.toLowerCase()==="bash",G=await M0(J),Y=U_(G);if(U&&H_(A)&&Y){let X=await r0($),Q=await l9(),K=p9(A,X,Q);if(K!==A){if(L.info("Pi hook: intercepting git commit",{sessionId:$.substring(0,8),transcriptId:X,toolCallId:b}),b)await Y$(b,X);await nI(_),N_({modified:!0,updatedInput:{...z,command:K}});return}}N_({modified:!1})}async function cI(_){let{session_id:$,tool_call_id:b}=_,Z=_.tool||"",z=_.tool_output||{},A=_.cwd||"";if(Z.toLowerCase()!=="bash")return;let U=z.stdout||z.content||"",G=typeof U==="string"?U:JSON.stringify(U),Y=_9(G),X=!1;if(!Y&&b)Y=await X$(b),X=!0;if(!Y)return;if(b)await Q$(b);let Q=h_(G),K=r_(G),v=n_(G);if(!Q){L.debug("Pi tool_result: found link but no commit SHA",{sessionId:$.substring(0,8),transcriptId:Y,fromCache:X});return}await l_({transcriptId:Y,repoPath:A,timestamp:new Date().toISOString(),commitSha:Q,commitTitle:K,branch:v}),L.info("Pi tool_result: tracked commit",{sessionId:$.substring(0,8),transcriptId:Y,commitSha:Q.substring(0,8),fromCache:X})}async function hI(_){let $=_.session_id;L.info("Pi session_shutdown: uploading transcript",{sessionId:$.substring(0,8)}),await sK(_)}async function rI(_){let $=_.session_id;L.info("Pi agent_end: uploading transcript",{sessionId:$.substring(0,8)}),await sK(_)}function tK(_){if(!fI(_))return null;try{let b=mI(_,"utf-8").split(`
243
+ `).filter((A)=>A.trim());if(b.length===0)return null;let Z=JSON.parse(b[0]),z=[];for(let A=1;A<b.length;A++)try{z.push(JSON.parse(b[A]))}catch{}return{header:Z,entries:z}}catch($){return L.error("Pi: failed to read session file",{sessionFile:_,error:$ instanceof Error?$.message:String($)}),null}}async function nI(_){let{session_id:$,cwd:b,session_data:Z}=_;if(!Z&&_.session_file)Z=tK(_.session_file)??void 0;if(!Z){L.warn("Pi partial upload: no session data available",{sessionId:$.substring(0,8)});return}await _F(Z,$,b,_.leaf_id,"partial")}async function sK(_){let{session_id:$,cwd:b,session_data:Z}=_;if(!Z&&_.session_file)Z=tK(_.session_file)??void 0;if(!Z){L.warn("Pi full upload: no session data available",{sessionId:$.substring(0,8)});return}await _F(Z,$,b,_.leaf_id,"full")}async function _F(_,$,b,Z,z="full"){try{let J=await new g0().fetchModelPricing(),U=Object.fromEntries(J),G=b||_.header.cwd||process.cwd(),Y=await W0(G,void 0),X=d4(_,{pricing:U,gitContext:Y,cwd:G,leafId:Z});if(!X){L.error(`Pi ${z} upload: failed to convert transcript`,{sessionId:$.substring(0,8)});return}let Q=await O0({unifiedTranscript:X.transcript,sessionId:$,cwd:G});if(Q.skipped){L.info(`Pi ${z} upload: skipped (repo not allowed)`,{sessionId:$.substring(0,8)});return}for(let K of Q.results)if(K.success)L.info(`Pi ${z} upload: success (${K.envName})`,{sessionId:$.substring(0,8),transcriptId:Q.id});else L.error(`Pi ${z} upload: failed (${K.envName})`,{sessionId:$.substring(0,8),error:K.error})}catch(A){L.error(`Pi ${z} upload: error`,{sessionId:$.substring(0,8),error:A instanceof Error?A.message:String(A)})}}var c0=new OU;c0.name("agentlogs").description("CLI tools for working with AgentLogs accounts and transcripts from AI coding agents");c0.command("login").description("Authenticate with AgentLogs using device authorization").argument("<hostname>","AgentLogs server hostname, e.g. agentlogs.ai").option("--token <token>","OAuth access token for direct authentication (skips browser)").action(async(_,$)=>{await IG({hostname:_,token:$.token})});c0.command("status").description("Check your current login status").action(async()=>{await OG()});c0.command("logout").description("Log out and clear stored credentials").argument("[hostname]","Optional hostname to log out from (logs out all when omitted)").action(async(_)=>{await MG({hostname:_})});c0.command("upload").argument("[directory]","Filter transcripts to this directory").option("-s, --source <source>","Filter by source: claude-code, cline, codex, opencode, or pi").option("-l, --latest","Upload the most recent transcript without picker").description("Interactively select and upload a transcript").action(async(_,$)=>{let b=$.source;await qK(_,{source:b,latest:$.latest})});var YU=c0.command("claudecode").description("Claude Code transcript utilities for AgentLogs");YU.command("upload").argument("<transcript>","Path or alias for a transcript JSONL file").description("Upload a transcript JSONL file to AgentLogs").action(async(_)=>{await xK(_)});YU.command("hook").description("Process Claude Code hook input from stdin").action(async()=>{await kK()});var XU=c0.command("codex").description("Codex transcript utilities for AgentLogs");XU.command("upload").argument("<transcript>","Path or alias for a Codex transcript JSONL file").description("Upload a Codex transcript JSONL file to AgentLogs").action(async(_)=>{await nK(_)});XU.command("hook").description("Process Codex hook input from stdin").action(async()=>{await fK()});XU.command("install").description("Install AgentLogs Codex hooks into ~/.codex").action(async()=>{await rK()});var $F=c0.command("opencode").description("OpenCode transcript utilities for AgentLogs");$F.command("upload").argument("<sessionId>","OpenCode session ID to upload").description("Upload an OpenCode session transcript to AgentLogs").action(async(_)=>{await lK(_)});$F.command("hook").description("Process OpenCode hook input from stdin").action(async()=>{await pK()});var QU=c0.command("cline").description("Cline transcript utilities for AgentLogs");QU.command("upload").argument("[taskIdOrPath]","Cline task ID or path to task directory/file").description("Upload a Cline task transcript to AgentLogs").action(async(_)=>{await TK(_)});QU.command("hook").description("Process Cline hook input from stdin").action(async()=>{await MK()});QU.command("install").description("Install agentlogs hooks into Cline's global hooks directory").action(async()=>{await jK()});var zF=c0.command("pi").description("Pi transcript utilities for AgentLogs");zF.command("upload").argument("[sessionIdOrPath]","Pi session ID or path to session file").description("Upload a Pi session transcript to AgentLogs").action(async(_)=>{await aK(_)});zF.command("hook").description("Process Pi hook input from stdin").action(async()=>{await eK()});YU.command("sync").argument("[claudeDir]","Optional Claude data directory (defaults to ~/.claude)").option("-r, --repo <repoId>","Only sync transcripts for the provided repo identifier").description("Upload all local Claude Code transcripts that are missing or outdated on the server").action(async(_,$)=>{await wK({claudeDir:_,repoFilter:$.repo})});c0.command("settings").description("View and modify AgentLogs settings").option("--allowMode <mode>","Set allow mode: 'allowlist' or 'denylist'").action(async(_)=>{await EG({allowMode:_.allowMode})});c0.command("allow").description("Allow capture for the current repository").option("--visibility <visibility>","Set visibility: 'public', 'team', or 'private'").option("--public","Set visibility to public").option("--team","Set visibility to team").option("--private","Set visibility to private").action(async(_)=>{await lU(_)});c0.command("deny").description("Deny capture for the current repository").action(async()=>{await pU()});c0.showHelpAfterError("(add --help for additional information)");c0.parseAsync().catch((_)=>{console.error("CLI encountered an unexpected error."),console.error(_),process.exit(1)});